/* frappe — the battle screen (view "battle", js/game/battle.js). Classes are prefixed bt-.
   Built on the theme tokens and the .g-* primitives of game-base.css. Works from 360 px wide.
   Reduced motion: battle.js adds .bt-rm on the screen root when FR.reducedMotion() is true. */

/* exercise views start at the top instead of being vertically centred (no jumps when feedback appears) */
#main > #view-battle.active {
  flex: 1 0 auto;
}

.bt-screen {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 760px;
  margin: 0 auto;
  padding-bottom: 2rem;
  font-family: "Lexend Deca", sans-serif;
  color: var(--text);
}
.bt-screen [hidden] {
  display: none !important;
}
.bt-noen .g-en {
  display: none;
}
.bt-screen kbd {
  font-family: "Roboto Mono", monospace;
}
.bt-screen button:focus-visible,
.bt-modal button:focus-visible {
  outline: 2px solid var(--main);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- top bar */

.bt-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.bt-title {
  flex: 1 1 8rem;
  min-width: 0;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text);
}
.bt-prog {
  font-variant-numeric: tabular-nums;
}
.bt-clock {
  font-variant-numeric: tabular-nums;
}
.bt-clock.warn {
  color: var(--error);
  animation: bt-pulse 1s ease-in-out infinite;
}
.bt-quit kbd {
  margin-left: 0.15rem;
}

/* ---------------------------------------------------------------- arena */

.bt-arena {
  position: relative;
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 0.25rem;
  min-height: 14rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--g-radius);
  overflow: hidden;
  background: var(--sub-alt);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--main) 14%, var(--sub-alt)) 0%,
    var(--sub-alt) 52%,
    color-mix(in srgb, var(--g-ok) 16%, var(--sub-alt)) 100%
  );
}
.bt-foe {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 0.75rem;
}
.bt-me {
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 0.75rem;
}
.bt-panel {
  position: relative;
  z-index: 2;
  min-width: 10rem;
  max-width: 16rem;
  padding: 0.45rem 0.7rem 0.5rem;
  border-radius: 0.6rem;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  box-shadow: var(--g-shadow);
  font-size: 0.85rem;
}
.bt-foe-panel {
  border-top-right-radius: 0.2rem;
}
.bt-me-panel {
  border-bottom-left-radius: 0.2rem;
}
.bt-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}
.bt-name b {
  font-weight: 500;
  overflow-wrap: anywhere;
}
.bt-sub {
  color: var(--g-gloss);
  font-size: 0.72rem;
}
.bt-hprow {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.3rem;
}
.bt-hplbl {
  color: var(--g-coin-ink);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.bt-hprow .g-bar {
  flex: 1;
  height: 0.45rem;
}
.bt-merow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.bt-hearts {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.1rem;
  color: var(--g-hp-low);
  font-size: 1rem;
  line-height: 1;
}
.bt-heart {
  display: inline-block;
  color: var(--g-hp-low);
  transition: opacity 0.2s, filter 0.2s;
}
.bt-heart.lost {
  opacity: 0.25;
  filter: grayscale(1);
}
.bt-heart.pop {
  animation: bt-heart 0.45s ease-out;
}
.bt-combo {
  color: var(--main);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}
.bt-combo.off {
  visibility: hidden;
}
.bt-examtag {
  color: var(--g-gloss);
  font-size: 0.75rem;
}
.bt-plv {
  white-space: nowrap;
}

/* sprites (svg from FR.fx, or an emoji placeholder) standing on a little platform */
.bt-sprite {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 7rem;
  height: 7rem;
}
.bt-sprite::before {
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 0;
  height: 20%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
  background: color-mix(in srgb, var(--text) 12%, transparent);
}
.bt-sprite > svg,
.bt-sprite > img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.bt-me-sprite {
  width: 5.5rem;
  height: 5.5rem;
}
.bt-emo {
  position: relative;
  z-index: 1;
  font-size: 4.2rem;
  line-height: 1;
  margin-bottom: 0.4rem;
}
.bt-emo.sil {
  filter: brightness(0);
  opacity: 0.7;
}
.bt-me-sprite .bt-emo {
  font-size: 3.4rem;
  transform: scaleX(-1);
}

/* fallback damage number (FR.fx.damage replaces it when present) */
.bt-dmg {
  position: absolute;
  z-index: 3;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  color: var(--error);
  font-size: 1.3rem;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  animation: bt-dmg 0.9s ease-out forwards;
}
.bt-dmg.crit {
  color: var(--g-coin-ink);
  font-size: 1.75rem;
}

/* animation states toggled by battle.js */
.bt-enter {
  animation: bt-enter 0.45s cubic-bezier(0.2, 0.8, 0.3, 1.15);
}
.bt-me-sprite.bt-enter {
  animation-name: bt-enter-left;
}
.bt-hit {
  animation: bt-hit 0.4s linear;
}
.bt-shake {
  animation: bt-shake 0.35s ease-in-out;
}
.bt-flee {
  animation: bt-flee 0.6s ease-in forwards;
}
.bt-ko {
  animation: bt-ko 0.7s ease-in forwards;
}
.bt-caught {
  animation: bt-pop 0.45s ease-out;
}

/* ---------------------------------------------------------------- message box and timers */

.bt-msg {
  display: flex;
  align-items: center;
  min-height: 2.6rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--g-radius);
  border-left: 3px solid var(--main);
  background: var(--sub-alt);
  font-size: 0.95rem;
}
.bt-msg:empty {
  visibility: hidden;
}
.bt-msg-in {
  animation: bt-rise 0.25s ease-out;
}
.bt-msg-in.ok,
.bt-msg-in.catch {
  color: var(--g-ok-ink);
}
.bt-msg-in.crit {
  color: var(--g-coin-ink);
}
.bt-msg-in.ko {
  color: var(--error);
}
.bt-msg-in .g-en {
  margin-left: 0.3rem;
}
.bt-timebar {
  height: 0.35rem;
  border-radius: 1rem;
  overflow: hidden;
  background: var(--sub-alt);
}
.bt-timebar > i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--main);
  transition: width 0.2s linear;
}
.bt-timebar.warn > i {
  background: var(--error);
}

/* ---------------------------------------------------------------- exercise card */

.bt-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  border-radius: var(--g-radius);
  background: var(--sub-alt);
  outline: none;
}
.bt-card:focus-visible {
  box-shadow: 0 0 0 2px var(--sub);
}
.bt-card:empty {
  display: none;
}
.bt-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  color: var(--g-gloss);
  font-size: 0.75rem;
}
.bt-again {
  color: var(--main);
}
/* a word met for the first time: guessing is expected */
.bt-new {
  padding: 0.05rem 0.55rem;
  border-radius: 0.6rem;
  background: color-mix(in srgb, var(--main) 16%, var(--bg));
  color: var(--text);
}
.bt-new .g-en {
  margin-left: 0.3rem;
  color: var(--text);
}
.bt-pfr {
  margin: 0;
  color: var(--text);
  font-size: 1.5rem;
  text-align: center;
  overflow-wrap: anywhere;
}
.bt-pen {
  margin: 0;
  color: var(--text);
  font-size: 1.25rem;
  text-align: center;
}
.bt-tag {
  display: inline-block;
  padding: 0.05rem 0.35rem;
  border-radius: 0.3rem;
  background: var(--bg);
  color: var(--g-gloss);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  vertical-align: middle;
}
.bt-q {
  margin: 0;
  color: var(--text);
  font-size: 1.1rem;
}
.bt-blank {
  display: inline-block;
  min-width: 2.2em;
  color: var(--main);
  font-weight: 500;
  text-align: center;
}
.bt-instr {
  margin: -0.35rem 0 0;
  font-size: 0.75rem;
}

/* reading document */
.bt-dockind {
  margin-bottom: 0.3rem;
  color: var(--g-gloss);
  font-size: 0.75rem;
}
.bt-doc {
  max-height: 42vh;
  overflow: auto;
  padding: 0.9rem 1rem;
  border-radius: 0.6rem;
  border-left: 3px solid var(--sub);
  background: var(--bg);
  color: var(--text);
  font-size: 0.98rem;
  overscroll-behavior: contain;
}
.bt-doc p {
  margin: 0 0 0.6rem;
}
.bt-doc p:last-child {
  margin-bottom: 0;
}
.bt-doc:focus-visible {
  outline: 2px solid var(--sub);
}

/* listening */
.bt-audio {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.7rem 0.9rem;
  border-radius: 0.6rem;
  background: var(--bg);
}
.bt-play {
  flex: none;
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  background: var(--main);
  color: var(--bg);
  font-size: 1.4rem;
  transition: transform 0.1s, filter 0.12s;
}
.bt-play:hover:not(:disabled) {
  filter: brightness(1.1);
}
.bt-play:active:not(:disabled) {
  transform: scale(0.95);
}
.bt-play:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.bt-audio.playing .bt-play {
  animation: bt-pulse 1s ease-in-out infinite;
}
.bt-audio-info {
  flex: 1;
  min-width: 0;
}
.bt-plays {
  color: var(--g-gloss);
  font-size: 0.8rem;
}
.bt-transcript {
  margin-top: 0.35rem;
  color: var(--text);
  font-size: 0.95rem;
}
.bt-transcript p {
  margin: 0.15rem 0;
}
.bt-hidden-tx {
  margin-top: 0.3rem;
  color: var(--g-gloss);
  font-size: 0.8rem;
  font-style: italic;
}
.bt-warn {
  color: var(--error);
  font-size: 0.8rem;
}
/* the spoken text is the prompt itself (vocab recognition): speaker button + word on one line */
.bt-audio-inline {
  flex-direction: column;
  gap: 0.2rem;
  padding: 0;
  background: transparent;
  text-align: center;
}
.bt-audio-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  max-width: 100%;
}
.bt-audio-line .bt-pfr {
  min-width: 0;
}
.bt-play.sm {
  width: 2.6rem;
  height: 2.6rem;
  font-size: 1.1rem;
}

/* multiple choice */
.bt-opts {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}
.bt-opts.n2,
.bt-opts.n4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.bt-opt {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 3rem;
  padding: 0.65rem 0.85rem;
  border: 2px solid transparent;
  border-radius: 0.6rem;
  background: var(--bg);
  color: var(--text);
  text-align: left;
  transition: border-color 0.12s, background 0.12s, opacity 0.12s, transform 0.08s;
}
.bt-opt:hover:not(:disabled) {
  border-color: var(--sub);
}
.bt-opt:active:not(:disabled) {
  transform: scale(0.98);
}
.bt-opt:disabled {
  cursor: default;
}
.bt-opt kbd {
  flex: none;
}
.bt-otext {
  flex: 1;
  font-size: 1rem;
  overflow-wrap: anywhere;
}
.bt-opts.n2 .bt-opt {
  justify-content: center;
  min-height: 4rem;
}
.bt-opts.n2 .bt-otext {
  flex: 0 1 auto;
  font-size: 1.3rem;
}
.bt-opt.ok {
  border-color: var(--g-ok);
  background: color-mix(in srgb, var(--g-ok) 16%, var(--bg));
}
.bt-opt.ko {
  border-color: var(--error);
  background: color-mix(in srgb, var(--error) 16%, var(--bg));
}
.bt-opt.picked {
  border-color: var(--main);
}
.bt-opt.dim {
  opacity: 0.45;
}
.bt-mark {
  flex: none;
  font-weight: 500;
}
.bt-opt.ok .bt-mark {
  color: var(--g-ok-ink);
}
.bt-opt.ko .bt-mark {
  color: var(--error);
}

/* typed answers */
.bt-answer {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.bt-answer .g-input {
  flex: 1;
  min-width: 0;
}
.bt-input:disabled {
  opacity: 1;
  color: var(--text);
}
.bt-submit {
  flex: none;
}
.bt-acc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.bt-acc button {
  min-width: 2.15rem;
  height: 2.15rem;
  padding: 0 0.3rem;
  border-radius: 0.45rem;
  background: var(--bg);
  color: var(--text);
  font-family: "Lexend Deca", sans-serif;
  font-size: 1rem;
  transition: background 0.1s, color 0.1s;
}
.bt-acc button:hover {
  background: var(--text);
  color: var(--bg);
}
.bt-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.bt-hint {
  color: var(--main);
  font-size: 1rem;
  letter-spacing: 0.12em;
}

/* word order */
.bt-build {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-height: 3.3rem;
  padding: 0.45rem 0.55rem;
  border: 2px solid transparent;
  border-radius: 0.6rem;
  background: var(--bg);
  cursor: text;
}
.bt-build:focus-within {
  border-color: var(--sub);
}
.bt-build.ok {
  border-color: var(--g-ok);
}
.bt-build.ko {
  border-color: var(--error);
}
.bt-chips {
  display: contents;
}
.bt-chip,
.bt-tile {
  padding: 0.4rem 0.7rem;
  border-radius: 0.5rem;
  font-family: "Lexend Deca", sans-serif;
  font-size: 1rem;
  transition: opacity 0.12s, border-color 0.12s, transform 0.08s;
}
.bt-chip {
  background: var(--main);
  color: var(--bg);
}
.bt-chip:hover:not(:disabled) {
  text-decoration: line-through;
}
.bt-chip:disabled {
  cursor: default;
}
.bt-order-input {
  flex: 1 1 8rem;
  min-width: 6rem;
  padding: 0.3rem 0.2rem;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: "Lexend Deca", sans-serif;
  font-size: 1.05rem;
}
.bt-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.bt-tile {
  border: 2px solid var(--sub);
  border-bottom-width: 3px;
  background: var(--bg);
  color: var(--text);
}
.bt-tile:hover:not(:disabled) {
  border-color: var(--text);
}
.bt-tile:active:not(:disabled) {
  transform: translateY(1px);
}
.bt-tile.used,
.bt-tile:disabled {
  opacity: 0.25;
  cursor: default;
}
.bt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ---------------------------------------------------------------- feedback */

.bt-fb:empty {
  display: none;
}
.bt-fb-in {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--g-radius);
  border-left: 4px solid var(--sub);
  background: var(--sub-alt);
  animation: bt-rise 0.2s ease-out;
}
.bt-fb-in.ok {
  border-left-color: var(--g-ok);
  background: color-mix(in srgb, var(--g-ok) 9%, var(--sub-alt));
}
.bt-fb-in.ko {
  border-left-color: var(--error);
  background: color-mix(in srgb, var(--error) 8%, var(--sub-alt));
}
.bt-fb-in.almost {
  border-left-color: var(--g-hp-mid);
}
/* a new word introduced after a first guess: neutral, no verdict colour */
.bt-fb-in.new {
  border-left-color: var(--main);
  background: color-mix(in srgb, var(--main) 8%, var(--sub-alt));
}
.bt-newword {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  font-size: 1.35rem;
}
.bt-newword b {
  font-weight: 500;
  overflow-wrap: anywhere;
}
.bt-eq {
  color: var(--g-gloss);
}
.bt-newen {
  font-size: 1.1rem;
}
.bt-fb-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 1.05rem;
}
.bt-fb-head b {
  font-weight: 500;
}
.bt-fb-icon {
  flex: none;
  font-size: 1.2rem;
  font-weight: 500;
}
.bt-fb-in.ok .bt-fb-icon {
  color: var(--g-ok-ink);
}
.bt-fb-in.ko .bt-fb-icon {
  color: var(--error);
}
.bt-fb-in.almost .bt-fb-icon {
  color: var(--g-hp-mid);
}
.bt-fb-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.6rem;
}
.bt-fb-line .g-label {
  min-width: 9rem;
}
.bt-fb-val {
  min-width: 0;
  overflow-wrap: anywhere;
}
.bt-right {
  /* the ink, nudged towards --text: stays ≥ 4.5:1 on the red-tinted panel of a wrong answer too */
  color: var(--g-ok-ink);
  color: color-mix(in oklab, var(--g-ok-ink) 78%, var(--text));
  font-size: 1.1rem;
  font-weight: 500;
}
.bt-diff {
  font-size: 1.05rem;
}
.bt-d-bad,
.bt-d-extra {
  border-radius: 0.15rem;
  color: var(--error);
  background: color-mix(in srgb, var(--error) 20%, transparent);
}
.bt-d-extra {
  text-decoration: line-through;
}
.bt-d-fix {
  border-radius: 0.15rem;
  background: color-mix(in srgb, var(--g-ok) 25%, transparent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.bt-d-acc {
  border-radius: 0.15rem;
  background: color-mix(in srgb, var(--g-hp-mid) 40%, transparent);
  text-decoration: underline wavy;
  text-underline-offset: 3px;
}
.bt-fb-en {
  font-size: 0.95rem;
}
.bt-why {
  font-size: 0.9rem;
  line-height: 1.5;
}
.bt-errs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.bt-err {
  padding: 0.15rem 0.6rem;
  border-radius: 2rem;
  background: color-mix(in srgb, var(--error) 18%, var(--bg));
  font-size: 0.8rem;
}
.bt-fb-note:empty {
  display: none;
}
.bt-note {
  font-size: 0.95rem;
}
.bt-note.catch {
  color: var(--g-ok-ink);
  color: color-mix(in oklab, var(--g-ok-ink) 78%, var(--text));
}
.bt-fb-act {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.2rem;
}
.bt-fb-warn {
  color: var(--error);
  font-size: 0.85rem;
}

/* ---------------------------------------------------------------- result screen */

.bt-res-head {
  padding: 1.3rem 1rem 1.1rem;
  border-radius: var(--g-radius);
  background: var(--sub-alt);
  text-align: center;
}
.bt-res-head.win {
  background: color-mix(in srgb, var(--main) 14%, var(--sub-alt));
}
.bt-res-head.lose {
  background: color-mix(in srgb, var(--error) 10%, var(--sub-alt));
}
.bt-res-head .g-h {
  margin-top: 0.3rem;
}
.bt-res-head .g-sub {
  margin: 0.3rem 0 0;
}
.bt-res-icon {
  font-size: 3rem;
  line-height: 1;
  animation: bt-pop 0.5s ease-out;
}
.bt-res-tip {
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
}
.bt-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: 0.6rem;
}
.bt-stat {
  padding: 0.6rem 0.7rem;
  border-radius: 0.6rem;
  background: var(--sub-alt);
  text-align: center;
}
.bt-stat b {
  display: block;
  color: var(--main);
  font-size: 1.5rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.bt-stat.coin b {
  color: var(--g-coin-ink);
}
.bt-res-note {
  margin: 0;
  color: var(--g-gloss);
  font-size: 0.85rem;
  text-align: center;
}
.bt-sec {
  padding: 0.9rem 1rem;
  border-radius: var(--g-radius);
  background: var(--sub-alt);
}
.bt-sec h3 {
  margin: 0 0 0.7rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 400;
}
.bt-mons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.bt-mon {
  width: 5.5rem;
  margin: 0;
  font-size: 0.8rem;
  text-align: center;
}
.bt-mon .bt-sprite {
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 0.2rem;
}
.bt-mon .bt-emo,
.bt-evo .bt-emo {
  font-size: 2.6rem;
  margin-bottom: 0.2rem;
}
.bt-fled {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.bt-evo {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.bt-evo li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.bt-sprite.sm {
  width: 3rem;
  height: 3rem;
}
.bt-sprite.sm .bt-emo {
  font-size: 1.9rem;
}
.bt-review {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.bt-rv {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.6rem;
  background: var(--bg);
  font-size: 0.92rem;
}
.bt-rv-p,
.bt-rv-q {
  color: var(--text);
}
.bt-rv-q {
  font-size: 1rem;
}
.bt-rv s {
  color: var(--error);
}
.bt-accepted {
  padding: 0.05rem 0.5rem;
  border-radius: 2rem;
  background: color-mix(in srgb, var(--g-hp-mid) 22%, var(--bg));
  color: var(--text);
  font-size: 0.78rem;
  white-space: nowrap;
}
.bt-rv .bt-right {
  font-size: 1rem;
}
.bt-rv details summary {
  color: var(--g-gloss);
  font-size: 0.8rem;
  cursor: pointer;
}
.bt-rv details .bt-doc {
  max-height: 30vh;
  margin-top: 0.4rem;
}
.bt-rv-later {
  color: var(--g-ok-ink);
  font-size: 0.8rem;
}
.bt-res-btns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}
.bt-keys {
  color: var(--g-gloss);
  font-size: 0.75rem;
  text-align: center;
}
.bt-empty {
  align-items: center;
}

/* ---------------------------------------------------------------- quit dialog */

.bt-dialog {
  max-width: 26rem;
  font-family: "Lexend Deca", sans-serif;
}
.bt-dialog h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 400;
}
.bt-dialog .g-sub {
  margin: 0;
  line-height: 1.5;
}
.bt-dialog .bt-dialog-warn {
  margin-top: 0.5rem;
  color: var(--text);
}
.bt-dialog-btns {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.2rem;
}

/* ---------------------------------------------------------------- short screens (laptops: 1280×800, 1366×768…)
   a compact arena and card, so arena + question + verdict fit in one viewport and the hit / damage stay visible */

@media (max-height: 900px) and (min-width: 561px) {
  .bt-screen {
    gap: 0.55rem;
  }
  .bt-arena {
    min-height: 9.5rem;
    padding: 0.4rem 0.8rem;
    gap: 0;
  }
  .bt-sprite {
    width: 5.2rem;
    height: 5.2rem;
  }
  .bt-me-sprite {
    width: 4.2rem;
    height: 4.2rem;
  }
  .bt-emo {
    font-size: 3.2rem;
  }
  .bt-me-sprite .bt-emo {
    font-size: 2.7rem;
  }
  .bt-panel {
    padding: 0.35rem 0.6rem 0.4rem;
  }
  .bt-msg {
    min-height: 2.2rem;
    padding: 0.3rem 0.8rem;
  }
  .bt-card {
    gap: 0.55rem;
    padding: 0.75rem 1rem;
  }
  .bt-pfr {
    font-size: 1.35rem;
  }
  .bt-play {
    width: 2.9rem;
    height: 2.9rem;
    font-size: 1.2rem;
  }
  .bt-audio {
    padding: 0.5rem 0.8rem;
  }
  .bt-audio-inline {
    padding: 0;
  }
  .bt-opt {
    min-height: 2.6rem;
    padding: 0.45rem 0.8rem;
  }
  .bt-opts.n2 .bt-opt {
    min-height: 3.1rem;
  }
  .bt-doc {
    max-height: 34vh;
  }
  .bt-fb-in {
    gap: 0.4rem;
    padding: 0.7rem 0.95rem;
  }
}

/* ---------------------------------------------------------------- small screens (360 px+) */

@media (max-width: 560px) {
  .bt-screen {
    gap: 0.6rem;
  }
  .bt-arena {
    min-height: 11.5rem;
    padding: 0.5rem;
  }
  .bt-panel {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 62%;
    padding: 0.35rem 0.55rem 0.4rem;
    font-size: 0.8rem;
  }
  .bt-sprite {
    width: 5rem;
    height: 5rem;
  }
  .bt-me-sprite {
    width: 4rem;
    height: 4rem;
  }
  .bt-emo {
    font-size: 3rem;
  }
  .bt-me-sprite .bt-emo {
    font-size: 2.5rem;
  }
  .bt-card {
    padding: 0.85rem;
  }
  .bt-opts.n4 {
    grid-template-columns: 1fr;
  }
  .bt-pfr {
    font-size: 1.3rem;
  }
  .bt-pen {
    font-size: 1.1rem;
  }
  .bt-fb-in {
    padding: 0.8rem 0.85rem;
  }
  .bt-fb-line .g-label {
    min-width: 0;
    width: 100%;
  }
  .bt-quit .g-en,
  .bt-quit kbd,
  .bt-submit kbd {
    display: none;
  }
  .bt-acc button {
    min-width: 2rem;
    height: 2rem;
  }
}

/* ---------------------------------------------------------------- motion */

.bt-rm *,
.bt-rm *::before,
.bt-rm *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition: none !important;
}

@keyframes bt-enter {
  from {
    opacity: 0;
    transform: translateX(45%);
  }
}
@keyframes bt-enter-left {
  from {
    opacity: 0;
    transform: translateX(-45%);
  }
}
@keyframes bt-hit {
  0%,
  50%,
  100% {
    opacity: 1;
    filter: none;
  }
  25%,
  75% {
    opacity: 0.25;
    filter: brightness(2);
  }
}
@keyframes bt-shake {
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(4px);
  }
}
@keyframes bt-flee {
  to {
    opacity: 0;
    transform: translateX(70%);
  }
}
@keyframes bt-ko {
  to {
    opacity: 0;
    transform: translateY(35%);
  }
}
@keyframes bt-pop {
  50% {
    transform: scale(1.18);
  }
}
@keyframes bt-heart {
  40% {
    transform: scale(1.6);
  }
}
@keyframes bt-dmg {
  0% {
    opacity: 0;
    transform: translate(-50%, 0);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -2.6rem);
  }
}
@keyframes bt-pulse {
  50% {
    transform: scale(1.07);
  }
}
@keyframes bt-rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
