:root {
  --blood: #c62828;
  --gold: #fbc02d;
  --ink: #e8e6e3;
  --faint: #8a8784;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
  background: #050507;
  color: var(--ink);
  font-family: "Courier New", ui-monospace, Menlo, monospace;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

#stage { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }

/* o palco mantém 16:9 e o HUD fica dentro dele */
#frame {
  position: relative;
  width: min(100vw, calc(100vh * 16 / 9));
  width: min(100vw, calc(100dvh * 16 / 9));
  aspect-ratio: 16 / 9;
  box-shadow: 0 0 90px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  container-type: size;   /* permite compactar as telas conforme a altura do quadro, não da janela */
}
canvas { width: 100%; height: 100%; display: block; background: #08202c; }

/* ---------- HUD ---------- */
#hud {
  position: absolute; top: 0; left: 0; right: 0;
  pointer-events: none;
  padding: 2.2% 2.4%;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  font-size: clamp(10px, 1.4vw, 13px);
  letter-spacing: 0.12em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  transition: opacity .4s;
}
#hud.off { opacity: 0; }
#hearts { display: flex; gap: 4px; min-width: 80px; }
#hearts svg { width: clamp(15px, 2.2vw, 22px); height: auto; filter: drop-shadow(0 0 6px rgba(198, 40, 40, .7)); transition: transform .2s; }
#hearts svg.off { filter: none; opacity: .22; transform: scale(.82); }

#progress-wrap { flex: 1; max-width: 360px; margin-top: 4px; }
#progress-label { font-size: .75em; color: var(--faint); letter-spacing: 0.3em; margin-bottom: 7px; text-align: center; text-transform: uppercase; }
#progress { position: relative; height: 6px; background: rgba(255, 255, 255, 0.12); border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
#progress-fill { height: 100%; width: 0%; border-radius: 4px; background: linear-gradient(to right, var(--gold), #ff7043 70%, var(--blood)); }
#prog-dot { position: absolute; top: 50%; left: 0%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--gold); border: 2px solid #1b1b1b; box-shadow: 0 0 10px rgba(251, 192, 45, .9); }
.tick { position: absolute; top: -3px; width: 2px; height: 12px; background: rgba(255, 255, 255, .5); }
#ticklabels { position: relative; height: 14px; margin-top: 6px; font-size: .68em; color: var(--faint); letter-spacing: .15em; }
#ticklabels span { position: absolute; transform: translateX(-50%); }

#gate-hint {
  font-size: .8em; letter-spacing: 0.22em; padding: 5px 9px;
  border: 1px solid currentColor; background: rgba(0, 0, 0, .4);
  opacity: 0; transition: opacity .3s; white-space: nowrap;
}
#gate-hint.on { opacity: 1; }
#gate-hint.closed { color: #ff5252; }
#gate-hint.open { color: #69f0ae; }

#toast {
  position: absolute; left: 50%; top: 17%; transform: translateX(-50%); z-index: 3;
  padding: 6px 14px; font-size: clamp(10px, 1.5vw, 14px); letter-spacing: .16em; white-space: nowrap;
  color: #ff8a80; border: 1px solid #ff5252; background: rgba(0, 0, 0, .6);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .9); pointer-events: none; opacity: 0; transition: opacity .3s;
}
#toast.on { opacity: 1; }

#flash {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(198, 40, 40, 0.65) 100%);
  opacity: 0; transition: opacity .45s;
}

/* ---------- telas ---------- */
.overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 16px; padding: 24px;
  background: radial-gradient(ellipse at center, rgba(8, 8, 14, .78), rgba(2, 2, 4, .94));
  backdrop-filter: blur(3px);
  z-index: 5;
  overflow-y: auto; touch-action: pan-y;
  justify-content: safe center;
}
.overlay.hidden { display: none; }
.overlay h2 { font-size: clamp(24px, 5vw, 46px); font-weight: 400; letter-spacing: 0.06em; text-shadow: 0 0 30px rgba(198, 40, 40, .35); }
.overlay p { max-width: 48ch; line-height: 1.6; color: #a7a4a0; font-size: clamp(12px, 1.7vw, 14px); }
.overlay .sub { color: var(--blood); letter-spacing: 0.34em; font-size: 11px; text-transform: uppercase; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; font-size: 11px; letter-spacing: .12em; color: var(--faint); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

button {
  font-family: inherit; font-size: 13px; letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--ink); background: rgba(198, 40, 40, 0.10);
  border: 1px solid rgba(198, 40, 40, 0.5);
  padding: 14px 38px; cursor: pointer; transition: all .3s ease;
}
button:hover { background: rgba(198, 40, 40, 0.22); box-shadow: 0 0 30px rgba(198, 40, 40, 0.35); }
.keys { font-size: 11px; letter-spacing: 0.2em; color: var(--faint); }
.btnrow { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
button.ghost { background: transparent; border-color: rgba(255, 255, 255, .22); color: var(--faint); }

/* ---------- diálogo da cabine ---------- */
#dialog {
  position: absolute; left: 50%; bottom: 4.5%; transform: translateX(-50%);
  width: min(90%, 780px);
  background: linear-gradient(to bottom, rgba(10, 12, 22, .94), rgba(5, 6, 12, .96));
  border: 1px solid rgba(251, 192, 45, .5);
  box-shadow: 0 10px 50px rgba(0, 0, 0, .7), inset 0 0 30px rgba(251, 192, 45, .05);
  padding: 16px 22px 12px; z-index: 6;
}
#dialog.hidden { display: none; }
#dlg-name { font-size: 11px; letter-spacing: .32em; color: var(--gold); text-transform: uppercase; margin-bottom: 8px; }
#dlg-text { font-size: clamp(14px, 2vw, 17px); line-height: 1.55; min-height: 3.1em; }
#dlg-choices { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
#dlg-choices button { padding: 11px 20px; letter-spacing: .12em; text-transform: none; font-size: 13px; border-color: rgba(251, 192, 45, .55); background: rgba(251, 192, 45, .08); }
#dlg-choices button:hover { background: rgba(251, 192, 45, .2); box-shadow: 0 0 24px rgba(251, 192, 45, .3); }
#dlg-hint { font-size: 10px; letter-spacing: .22em; color: var(--faint); text-align: right; margin-top: 6px; min-height: 14px; }

/* ---------- toque ---------- */
#touch { position: absolute; inset: 0; display: none; pointer-events: none; z-index: 4; }
#joy-zone { position: absolute; inset: 0; pointer-events: auto; touch-action: none; }
#joy-base {
  --joy: clamp(92px, min(24vw, 36vh), 168px);
  position: absolute; left: 0; top: 0; width: var(--joy); height: var(--joy);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02) 60%, transparent 73%);
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.35), 0 4px 14px rgba(0, 0, 0, 0.35);
  opacity: .42; transition: opacity .15s ease; pointer-events: none;
}
#joy-base.active { opacity: .96; }
#joy-knob {
  position: absolute; left: 50%; top: 50%; width: 46%; height: 46%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(251, 192, 45, 0.65);
  background: radial-gradient(circle at 38% 34%, rgba(251, 192, 45, 0.92), rgba(198, 40, 40, 0.78) 78%);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.5), inset 0 2px 6px rgba(255, 255, 255, 0.3);
  pointer-events: none;
}
#mute {
  position: absolute; right: 3%; bottom: 4%; width: 44px; height: 44px; padding: 0;
  pointer-events: auto; border-radius: 50%; font-size: 18px; letter-spacing: 0;
  border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.07);
}
@media (pointer: coarse) { #touch { display: block; } }

.touch-only { display: none; }
@media (pointer: coarse) { .touch-only { display: inline; } .kb-only { display: none; } }

/* celular em pé: pede para girar */
#rotate { position: fixed; z-index: 50; background: #050507; display: none; }
#rotate svg { width: 72px; height: 72px; animation: tilt 2.6s ease-in-out infinite; }
@keyframes tilt { 0%, 15% { transform: rotate(0deg); } 55%, 100% { transform: rotate(-90deg); } }
@media (orientation: portrait) and (pointer: coarse) and (max-width: 700px) { #rotate { display: flex; } }

/* ---------- escolha do disfarce ---------- */
#disguise-screen { gap: 10px; padding: 14px 22px; }
#disguise-screen h2 { font-size: clamp(18px, 3.2vw, 32px); }
#disguise-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(6px, 1.1vw, 14px); justify-content: center; }
.disguise {
  --pv: clamp(46px, min(9vw, 17vh), 150px);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 8px 7px; text-transform: none; letter-spacing: .04em; font-size: clamp(8px, 1.15vw, 11px);
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .14); border-radius: 4px;
}
.disguise canvas { width: calc(var(--pv) * 120 / 96); height: calc(var(--pv) * 130 / 96); background: transparent; }
.disguise:focus { outline: none; }
.disguise:hover { background: rgba(251, 192, 45, .08); border-color: rgba(251, 192, 45, .4); box-shadow: none; }
.disguise[aria-checked="true"] { background: rgba(251, 192, 45, .12); border-color: var(--gold); box-shadow: 0 0 26px rgba(251, 192, 45, .28); }
.disguise .dname { color: var(--faint); white-space: nowrap; }
.disguise[aria-checked="true"] .dname { color: var(--gold); }
#disguise-body { display: flex; flex-direction: column; align-items: stretch; gap: 10px; width: fit-content; min-width: min(100%, 520px); max-width: 100%; }
#disguise-bar { display: flex; align-items: center; gap: 18px; text-align: left; }
#disguise-info { flex: 1 1 0; width: 0; min-width: 0; min-height: 3em; }
#disguise-name { color: var(--gold); letter-spacing: .1em; font-size: clamp(11px, 1.5vw, 14px); margin-bottom: 4px; }
#disguise-desc { color: #a7a4a0; font-size: clamp(10px, 1.3vw, 13px); line-height: 1.4; max-width: 52ch; }

/* ---------- dificuldade ---------- */
.level { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.level-label { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--faint); margin-right: 6px; }
.level-btn { padding: 9px 18px; font-size: 12px; letter-spacing: .18em; color: var(--faint); background: transparent; border-color: rgba(255, 255, 255, .22); }
.level-btn:hover, .level-btn:focus-visible { color: var(--ink); border-color: rgba(255, 255, 255, .45); box-shadow: none; outline: none; }
.level-btn.on { color: var(--gold); border-color: var(--gold); background: rgba(251, 192, 45, .08); }

/* seletor de fase */
.stage-pick .level-btn { padding: 9px 14px; min-width: 40px; }
.stage-pick .level-btn.locked { opacity: .3; cursor: not-allowed; }
.stage-pick .level-btn.locked:hover { color: var(--faint); border-color: rgba(255, 255, 255, .22); }
.stage-name { font-size: 11px; letter-spacing: .18em; color: var(--gold); text-transform: uppercase; margin-left: 8px; min-width: 14ch; text-align: left; }

/* cartão de abertura da fase */
#stage-card {
  position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; pointer-events: none; opacity: 0; transition: opacity .5s;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, .55), rgba(0, 0, 0, .15) 70%);
}
#stage-card.on { opacity: 1; pointer-events: auto; cursor: pointer; }
#sc-num { color: var(--blood); letter-spacing: .42em; font-size: clamp(10px, 1.5vw, 13px); text-transform: uppercase; }
#sc-name { font-size: clamp(26px, 6vw, 58px); letter-spacing: .06em; text-shadow: 0 0 34px rgba(251, 192, 45, .45), 0 2px 8px #000; }
#sc-tag { max-width: 56ch; line-height: 1.6; color: #cfccc8; font-size: clamp(11px, 1.6vw, 15px); text-shadow: 0 1px 6px #000; padding: 0 20px; }

/* ---------- botão de tela cheia ---------- */
#fs-btn {
  position: absolute; z-index: 20; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; letter-spacing: 0;
  top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right));
  border-radius: 12px; color: #e8e6e3; background: rgba(10, 12, 20, .55); border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(6px); box-shadow: 0 4px 14px rgba(0, 0, 0, .4); cursor: pointer;
}
#fs-btn:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .5); box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
#fs-btn:active { transform: scale(.94); }
#fs-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#fs-btn .ic-exit, #fs-btn.on .ic-enter { display: none; }
#fs-btn.on .ic-exit { display: block; }
#fs-btn.hidden { display: none; }
@media (pointer: coarse) { #fs-btn { width: 44px; height: 44px; } }
/* o botão fica por cima do canto do quadro: dá espaço ao aviso da cancela no HUD */
#hud { padding-right: calc(2.4% + 52px); }

/* ---------- tela inicial ---------- */
#start-screen {
  --sans: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  padding: 0; overflow: hidden; text-align: left; align-items: stretch; justify-content: center;
  background:
    linear-gradient(90deg, rgba(4, 5, 10, .86) 0%, rgba(4, 5, 10, .6) 46%, rgba(4, 5, 10, .22) 100%),
    radial-gradient(ellipse at 85% 10%, rgba(198, 40, 40, .22), transparent 55%);
  backdrop-filter: blur(2px);
  font-family: var(--sans);
}
.home {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 4cqw; align-items: center;
  width: 100%; height: 100%; padding: 5cqh 5cqw;
}
.home-main { display: flex; flex-direction: column; align-items: flex-start; gap: 2.4cqh; min-width: 0; }
.home-kicker {
  display: inline-flex; align-items: center; gap: .7em; padding: .5em 1em; border-radius: 99px;
  font-size: clamp(9px, 1.35cqw, 13px); letter-spacing: .16em; text-transform: uppercase; color: #cfccc8;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
}
.home-kicker .dot { width: .55em; height: .55em; border-radius: 50%; background: #ff5252; box-shadow: 0 0 12px #ff5252; animation: pulse 1.6s ease-in-out infinite; }
.home-kicker .sep, .home-keys .sep { opacity: .4; margin: 0 .6em; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }
.home-title {
  font-weight: 800; font-size: clamp(34px, 9.4cqw, 118px); line-height: .92; letter-spacing: -.035em;
  background: linear-gradient(180deg, #fff 10%, #b9b5ae 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 28px rgba(0, 0, 0, .55));
}
.home-title em {
  font-style: normal;
  background: linear-gradient(100deg, #ffe27a 0%, #fbc02d 38%, #ff7043 78%, #e53935 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.home-sub { max-width: 44ch; line-height: 1.55; color: #b4b0ab; font-size: clamp(11px, 1.75cqw, 17px); }

.home-cta { display: flex; align-items: center; gap: 1.6cqw; flex-wrap: wrap; }
button.primary {
  display: flex; flex-direction: column; align-items: flex-start; gap: .25em; text-transform: none; letter-spacing: 0;
  padding: 1.5cqh 2.4cqw 1.5cqh 2.2cqw; border: 0; border-radius: 16px; color: #170a04; font-family: var(--sans);
  background: linear-gradient(120deg, #ffd35a, #fbc02d 45%, #ff8a3d);
  box-shadow: 0 10px 34px rgba(251, 140, 40, .38), inset 0 1px 0 rgba(255, 255, 255, .55);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
button.primary:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 16px 44px rgba(251, 140, 40, .5), inset 0 1px 0 rgba(255, 255, 255, .55); background: linear-gradient(120deg, #ffd35a, #fbc02d 45%, #ff8a3d); }
button.primary:active { transform: translateY(0) scale(.98); }
.primary-label { font-size: clamp(15px, 2.6cqw, 26px); font-weight: 800; letter-spacing: -.01em; }
.primary-sub { font-size: clamp(9px, 1.25cqw, 12px); font-weight: 600; opacity: .72; }

.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); }
.seg-btn {
  padding: .75em 1.2em; border: 0; border-radius: 10px; background: transparent; color: #9c9893; text-transform: none; letter-spacing: 0;
  font-family: var(--sans); font-size: clamp(10px, 1.45cqw, 14px); font-weight: 600;
}
.seg-btn:hover { background: rgba(255, 255, 255, .07); color: #e8e6e3; box-shadow: none; }
.seg-btn.on { background: rgba(255, 255, 255, .92); color: #14110d; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }

.home-keys { font-size: clamp(9px, 1.3cqw, 12px); color: #8f8b86; display: flex; align-items: center; flex-wrap: wrap; gap: .3em; }
kbd {
  display: inline-block; min-width: 1.9em; padding: .18em .5em; margin: 0 .15em; text-align: center; border-radius: 6px; font: 600 .95em var(--sans); color: #d7d4cf;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); border-bottom-width: 2px;
}
.chips { display: flex; flex-wrap: wrap; gap: .5cqw 1.1cqw; font-size: clamp(9px, 1.2cqw, 11px); color: #8f8b86; }
.chips span { display: inline-flex; align-items: center; gap: .5em; padding: .35em .8em; border-radius: 99px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); }
.chips i { width: .75em; height: .75em; border-radius: 50%; display: inline-block; }

.home-stages {
  display: flex; flex-direction: column; gap: 1.4cqh; min-width: 0; padding: 2.2cqh 1.6cqw 2.2cqh; border-radius: 20px;
  background: rgba(14, 16, 24, .55); border: 1px solid rgba(255, 255, 255, .1); backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.home-stages-head { display: flex; justify-content: space-between; padding: 0 .4cqw .2cqh; font-size: clamp(9px, 1.25cqw, 12px); letter-spacing: .16em; text-transform: uppercase; color: #8f8b86; }
.home-stages-head span:last-child { color: var(--gold); }
#stage-list { display: flex; flex-direction: column; gap: 1.1cqh; }
.stage-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.2cqw; width: 100%; text-align: left;
  padding: 1.15cqh 1.2cqw; border-radius: 14px; text-transform: none; letter-spacing: 0; font-family: var(--sans); color: #e8e6e3;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08);
  transition: background .2s, border-color .2s, transform .2s, box-shadow .2s;
}
.stage-card:hover:not(:disabled) { background: rgba(255, 255, 255, .09); transform: translateX(3px); box-shadow: none; }
.stage-card.on { background: linear-gradient(100deg, rgba(251, 192, 45, .16), rgba(255, 112, 67, .08)); border-color: rgba(251, 192, 45, .65); box-shadow: 0 0 28px rgba(251, 192, 45, .16); }
.stage-card:disabled { cursor: not-allowed; opacity: .42; }
.stage-num {
  display: grid; place-items: center; width: clamp(24px, 3.9cqw, 38px); aspect-ratio: 1; border-radius: 11px; font-weight: 800; font-size: clamp(11px, 1.8cqw, 17px);
  background: rgba(255, 255, 255, .08); color: #d7d4cf;
}
.stage-card.on .stage-num { background: linear-gradient(135deg, #ffd35a, #ff8a3d); color: #170a04; }
.stage-info { min-width: 0; }
.stage-title { font-weight: 700; font-size: clamp(11px, 1.7cqw, 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-tag { font-size: clamp(8px, 1.1cqw, 11px); color: #8f8b86; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .15em; }
.stage-badge { font-size: clamp(8px, 1.1cqw, 11px); font-weight: 700; padding: .35em .7em; border-radius: 99px; white-space: nowrap; background: rgba(255, 255, 255, .08); color: #b4b0ab; }
.stage-badge.new { background: #ff5252; color: #fff; animation: pulse 1.6s ease-in-out infinite; }
.stage-badge.done { background: rgba(105, 240, 174, .16); color: #69f0ae; }
.stage-badge.lock { background: transparent; font-size: clamp(11px, 1.7cqw, 16px); }
.unlock-note { color: #69f0ae; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; min-height: 1.2em; }
.unlock-note:empty { display: none; }

/* celular deitado / telas baixas */
@container (max-height: 460px) {
  .overlay { gap: 8px; padding: 12px 20px; }
  .overlay h2 { font-size: clamp(20px, 4.6vw, 30px); }
  .overlay p { line-height: 1.4; font-size: 12px; }
  button { padding: 10px 28px; }
  #dialog { padding: 12px 16px 8px; }
  #dlg-choices button { padding: 8px 14px; }
  #disguise-screen .sub { display: none; }
  #disguise-screen { gap: 6px; padding: 8px 16px; }
  #disguise-body { gap: 6px; }
  #disguise-bar button { padding: 9px 20px; letter-spacing: .2em; }
}
@container (max-height: 400px) {
  .level-btn { padding: 6px 12px; font-size: 11px; letter-spacing: .12em; }
  .legend, .chips, .home-sub { display: none; }
  .stage-tag { display: none; }
}
@container (max-height: 365px) {
  .overlay { gap: 6px; padding: 8px 16px; }
  .overlay h2 { font-size: clamp(18px, 4vw, 24px); }
  .overlay p { font-size: 11px; line-height: 1.35; }
  .keys { font-size: 10px; letter-spacing: .12em; }
  button { padding: 8px 22px; font-size: 12px; letter-spacing: .24em; }
}
