/* ============================================================
   SKETCHFALL — styles
   Full-viewport stage, cream type, saffron / amber / teal.
   HUD lives in real CSS pixels (stage is sized, not scaled).
   ============================================================ */

@font-face {
  font-family: "Lilita One";
  src: url("../assets/fonts/LilitaOne.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("../assets/fonts/Nunito-500.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("../assets/fonts/Nunito-600.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("../assets/fonts/Nunito-700.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("../assets/fonts/Nunito-800.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0c0d18;
  --paper0: #15182d;
  --paper1: #241b36;
  --ink: #f6f0e4;
  --muted: #b7b0c4;
  --saffron: #ffb020;
  --saffron-d: #b56e00;
  --accent: #e0821e;
  --leaf: #2db36a;
  --indigo: #6d5cef;
  --indigo-d: #3228a0;
  --teal: #2ec4b6;
  --brass: #d7b56d;
  --brass-d: #8a6524;
  --walnut: #2c2116;
  --cream: #f3ead8;
  --panel: #1c2038;
  --panel-2: #14172b;
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.5);
  --font-ui: "Nunito", "Segoe UI", system-ui, sans-serif;
  --font-display: "Lilita One", "Arial Black", system-ui, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  height: 100dvh;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  overflow-x: hidden;
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #1a1f3c 0%, #241b38 50%, #3a2744 100%);
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 700;
  user-select: none;
  touch-action: none;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
}

button, input {
  font-family: inherit;
}

/* ---------- Stage ---------- */
#app {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

#stage {
  --cq: 900;
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  border: none;
  border-radius: 0;
  overflow: hidden;
  background: #1a1f3c;
  box-shadow: 0 0 70px 30px rgba(15, 14, 28, 0.45);
  container-type: size;
  container-name: stage;
}

canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

/* grain overlay */
#stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  font-weight: 800;
  opacity: 0;
  transition: opacity .25s ease;
}
#hud.live { opacity: 1; }

.hud-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding:
    max(10px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    18px
    max(14px, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(8, 10, 22, 0.78) 0%, rgba(8, 10, 22, 0.35) 70%, transparent 100%);
}

.chip {
  background: rgba(20, 18, 32, 0.72);
  border: 1.5px solid rgba(215, 181, 109, 0.35);
  border-radius: 12px;
  padding: 6px 12px;
  font-size: clamp(11px, 3.2cqi, 14px);
  letter-spacing: 0.3px;
  color: var(--cream);
  backdrop-filter: blur(8px);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#inkWrap {
  flex: 1 1 160px;
  min-width: 120px;
  max-width: 280px;
}
.ink-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 10px;
  letter-spacing: 1.6px;
  color: rgba(246, 240, 228, 0.72);
}
.star-pips { display: flex; gap: 3px; letter-spacing: 0; }
.star-pips span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.22);
  text-shadow: none;
  transition: color .2s, transform .2s;
}
.star-pips span.on {
  color: #ffd056;
  text-shadow: 0 0 8px rgba(255, 208, 86, 0.55);
  transform: scale(1.05);
}

#inkTrack {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
}
#inkFill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2ec4b6, #6d5cef);
  transition: width .12s linear, background .25s;
  position: relative;
}
#inkFill::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 45%;
  background: linear-gradient(180deg, rgba(255,255,255,.35), transparent);
  border-radius: 999px 999px 0 0;
}
#inkTrack.low #inkFill { background: linear-gradient(90deg, #ff7a7a, #e03a3a); }
#inkTrack.mid #inkFill { background: linear-gradient(90deg, #ffd25e, #ff9a2e); }

#targetPips {
  display: flex;
  gap: 5px;
  align-items: center;
}
.epip {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff9a9a, #d3231f);
  box-shadow: 0 0 0 2px rgba(0,0,0,.25);
  transition: transform .2s, opacity .2s, filter .2s;
}
.epip.off {
  opacity: .28;
  filter: grayscale(1);
  transform: scale(.85);
}

.hud-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  pointer-events: auto;
}

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  cursor: pointer;
  border: none;
  border-radius: 12px;
  color: var(--cream);
  background: linear-gradient(180deg, #4a5178, #32375a);
  box-shadow: 0 4px 0 #1a1d33, 0 6px 12px rgba(0, 0, 0, 0.22);
  padding: 0 13px;
  height: clamp(34px, 8cqh, 42px);
  min-width: clamp(34px, 8cqh, 42px);
  font-size: clamp(11px, 2.8cqi, 13.5px);
  font-weight: 800;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transform: translateY(0);
  transition: transform .08s, box-shadow .08s, filter .15s, opacity .15s;
  line-height: 1;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; flex: 0 0 auto; fill: currentColor; }
.btn:hover { filter: brightness(1.08); }
.btn:active, .btn.is-down {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #1a1d33, 0 2px 6px rgba(0, 0, 0, 0.2);
}
.btn:focus-visible {
  outline: 2px solid var(--saffron);
  outline-offset: 2px;
}
.btn:disabled {
  opacity: 0.38;
  pointer-events: none;
  filter: grayscale(.15);
}

.btn.primary {
  color: #3a2400;
  background: linear-gradient(180deg, #ffd056, #f0a010);
  box-shadow: 0 4px 0 #b56e00, 0 6px 12px rgba(0, 0, 0, 0.22);
}
.btn.primary:active, .btn.primary.is-down { box-shadow: 0 1px 0 #b56e00; }

.btn.ghost {
  background: linear-gradient(180deg, #3a4064, #2a2e4c);
}

.btn.danger {
  color: #fff5f3;
  background: linear-gradient(180deg, #f06a5e, #c4332c);
  box-shadow: 0 4px 0 #7a1c18, 0 6px 12px rgba(0, 0, 0, 0.22);
}
.btn.danger:active { box-shadow: 0 1px 0 #7a1c18; }

.btn.mode-drop {
  background: linear-gradient(180deg, #8b80ff, #5b4cdb);
  box-shadow: 0 4px 0 #3228a0, 0 6px 12px rgba(0, 0, 0, 0.22);
  color: #fff;
}
.btn.mode-drop:active { box-shadow: 0 1px 0 #3228a0; }

.btn.mode-pin {
  color: #3a2400;
  background: linear-gradient(180deg, #ffc44d, #e09000);
  box-shadow: 0 4px 0 #a86800, 0 6px 12px rgba(0, 0, 0, 0.22);
}
.btn.mode-pin:active { box-shadow: 0 1px 0 #a86800; }

.btn.icon {
  padding: 0;
  width: clamp(34px, 8cqh, 42px);
}

.btn.pulse {
  animation: goPulse 1.2s ease-in-out infinite;
}
@keyframes goPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.16); }
}

/* ---------- Hint ---------- */
#hint {
  position: absolute;
  top: clamp(58px, 14cqh, 78px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  font-size: clamp(11px, 2.8cqi, 13.5px);
  font-weight: 700;
  background: rgba(12, 14, 28, 0.62);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 7px 16px;
  letter-spacing: 0.2px;
  backdrop-filter: blur(8px);
  max-width: 78%;
  text-align: center;
  line-height: 1.4;
  opacity: 0;
  transition: opacity .8s ease;
  pointer-events: none;
}
#hud.live ~ #hint { opacity: 1; }
#hud.live ~ #hint.dim { opacity: 0.28; }
#hint:empty { display: none; }

#toast {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: 6;
  background: rgba(12, 14, 28, 0.82);
  border: 1.5px solid rgba(215, 181, 109, 0.35);
  color: var(--cream);
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Overlays ---------- */
.overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 10, 20, 0.72);
  backdrop-filter: blur(8px);
  pointer-events: auto;
  z-index: 10;
  padding:
    max(18px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
  touch-action: pan-y;
}
.panel { touch-action: pan-y; }
.overlay.show { display: flex; animation: fadeIn .22s ease; }

.panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), transparent 28%),
    linear-gradient(180deg, #262a46, #16192c);
  border: 2px solid rgba(215, 181, 109, 0.28);
  border-radius: 24px;
  padding: 28px 32px 26px;
  text-align: center;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.06);
  max-width: 640px;
  width: min(640px, 100%);
  max-height: 100%;
  overflow: auto;
  animation: popIn .28s cubic-bezier(.2, .9, .25, 1.15);
}
.panel-sm { max-width: 420px; padding: 26px 28px; }
.panel-wide { max-width: 680px; }

.panel h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 6cqi, 42px);
  letter-spacing: 0.6px;
  line-height: 0.95;
  margin-bottom: 6px;
  font-weight: 400;
}
.panel h1 .crush { color: var(--accent); }
.panel h2 {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.4px;
  font-weight: 400;
  margin-bottom: 8px;
}
.panel p {
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.55;
}
.panel .lede {
  color: var(--cream);
  font-size: 15px;
}

.logo-faces {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 8px;
  height: 72px;
}
.blob {
  width: 58px; height: 58px;
  border-radius: 50%;
  position: relative;
  animation: bob 2.6s ease-in-out infinite;
  box-shadow: 0 8px 0 rgba(0,0,0,.18), inset 0 -6px 0 rgba(0,0,0,.12);
}
.blob.amber {
  background: radial-gradient(circle at 35% 30%, #ffd28a, #e0821e);
  animation-delay: 0s;
}
.blob.teal {
  background: radial-gradient(circle at 35% 30%, #9fe8ff, #1596b0);
  animation-delay: .4s;
  width: 50px; height: 50px;
}
.blob .eye {
  position: absolute;
  top: 34%;
  width: 13px; height: 15px;
  background: #fff;
  border-radius: 50%;
}
.blob .eye.l { left: 18%; }
.blob .eye.r { right: 18%; }
.blob .eye::after {
  content: "";
  position: absolute;
  width: 6px; height: 6px;
  background: #171a2e;
  border-radius: 50%;
  left: 4px; top: 5px;
}
.blob.amber .brow {
  position: absolute;
  top: 22%;
  width: 14px; height: 3px;
  background: #171a2e;
  border-radius: 2px;
}
.blob.amber .brow.l { left: 14%; transform: rotate(22deg); }
.blob.amber .brow.r { right: 14%; transform: rotate(-22deg); }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.tag {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.4px;
  color: var(--saffron);
  margin: 4px 0 14px !important;
  font-weight: 400 !important;
}

.row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.row .btn { height: 44px; min-width: 120px; font-size: 14px; padding: 0 18px; }
.row .btn.btn-play {
  height: 52px;
  min-width: 200px;
  font-size: 18px;
  letter-spacing: 0.6px;
  padding: 0 36px;
}
.row-sub { margin-top: 10px; }
.row-sub .btn { height: 40px; min-width: 108px; background: linear-gradient(180deg, #3a4064, #2a2e4c); }

.meta-line {
  margin-top: 16px;
  font-size: 13px;
  color: var(--brass);
  font-weight: 700;
  letter-spacing: 0.3px;
}
.meta-line span { color: var(--saffron); }

/* ---------- Loading screen ---------- */
#ovLoad { z-index: 20; }
.load-panel { max-width: 460px; }
.load-well { margin-top: 6px; }
.load-track {
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(215, 181, 109, 0.35);
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
  position: relative;
}
#loadFill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2ec4b6, #6d5cef 55%, #ffb020);
  box-shadow: 0 0 16px rgba(46, 196, 182, 0.35);
  position: relative;
}
#loadFill::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  animation: loadSheen 1.1s linear infinite;
}
.load-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 0.8px;
  color: var(--muted);
  font-weight: 700;
}
#loadPct { color: var(--saffron); font-variant-numeric: tabular-nums; }
@keyframes loadSheen {
  from { transform: translateX(-120%); }
  to { transform: translateX(280%); }
}

/* How-to cards */
.how-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  text-align: left;
  margin: 8px 0 18px;
}
.how-card {
  background: rgba(255,255,255,.04);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 12px 12px 12px 14px;
}
.how-card .k {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--saffron);
  font-size: 12px;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}
.how-card .k i {
  width: 22px; height: 22px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-size: 13px;
  color: #3a2400;
  background: var(--saffron);
}
.how-card p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: #d9d3e4;
}
.how-card b { color: var(--cream); }
.keys {
  margin: 0 0 16px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.6;
}
kbd {
  display: inline-block;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0 6px;
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--cream);
  font-weight: 800;
}

/* Level grid */
#levelGrid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 14px 0 18px;
  max-height: min(360px, 56cqh);
  overflow: auto;
  padding: 2px 4px 6px 0;
}
.lvBtn {
  height: auto;
  min-width: 0;
  aspect-ratio: 1.05 / 1;
  flex-direction: column;
  gap: 2px;
  padding: 8px 4px 6px;
  border-radius: 16px;
}
.lvBtn .n {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.5px;
  line-height: 1;
}
.lvBtn .nm {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: rgba(246, 240, 228, 0.7);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 4px;
}
.lvBtn .s {
  font-size: 11px;
  letter-spacing: 1px;
  color: #ffd25e;
  height: 14px;
  line-height: 14px;
}
.lvBtn.locked {
  opacity: 0.38;
  cursor: not-allowed;
  filter: grayscale(.3);
}
.lvBtn.locked .nm { color: transparent; }
.lvBtn.current {
  box-shadow: 0 4px 0 #b56e00, 0 0 0 2px #ffd056;
}

/* Stars on win */
.stars {
  font-size: 42px;
  letter-spacing: 8px;
  margin: 4px 0 12px;
  filter: drop-shadow(0 4px 10px rgba(255, 190, 60, 0.45));
  min-height: 52px;
}
.stars .star {
  display: inline-block;
  transform: scale(0);
  color: #ffd056;
}
.stars .star.off { color: rgba(255,255,255,.18); filter: none; }
.stars.pop .star { animation: starPop .45s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.stars.pop .star:nth-child(2) { animation-delay: .12s; }
.stars.pop .star:nth-child(3) { animation-delay: .24s; }

/* Settings rows */
.set-list { text-align: left; margin: 8px 0 18px; display: flex; flex-direction: column; gap: 8px; }
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255,255,255,.04);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
.set-row .lab { font-size: 14px; color: var(--cream); }
.set-row .sub { font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 2px; }

.switch {
  width: 52px; height: 30px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: #3a3f5c;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.35);
  position: relative;
  flex: 0 0 auto;
  padding: 0;
}
.switch .knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #e8e4f4;
  transition: transform .18s ease, background .18s;
  box-shadow: 0 2px 4px rgba(0,0,0,.3);
}
.switch.on { background: linear-gradient(180deg, #ffd056, #f0a010); }
.switch.on .knob { transform: translateX(22px); background: #fff; }
.switch:focus-visible { outline: 2px solid var(--saffron); outline-offset: 2px; }

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes popIn {
  from { transform: scale(0.92) translateY(8px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes starPop {
  0% { transform: scale(0) rotate(-24deg); }
  70% { transform: scale(1.18) rotate(8deg); }
  100% { transform: scale(1) rotate(0); }
}

/* Pause badge */
.pause-badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--saffron);
  margin-bottom: 6px;
}

/* Scrollbars inside panels */
.panel::-webkit-scrollbar { width: 8px; }
.panel::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.16);
  border-radius: 8px;
}

/* Tiny / short stages */
@container stage (max-width: 720px) {
  .panel { padding: 20px 16px 18px; border-radius: 18px; }
  .lvBtn .nm { display: none; }
  .row .btn { min-width: 100px; height: 40px; }
}

@container stage (max-width: 640px) {
  .how-grid { grid-template-columns: 1fr; }
  #levelGrid { gap: 7px; }
  .lvBtn .n { font-size: 18px; }
  .logo-faces { height: 56px; }
  .blob { width: 46px; height: 46px; }
  .blob.teal { width: 40px; height: 40px; }
  .panel h2 { font-size: 22px; }
  .keys { font-size: 11px; }
}

@container stage (max-width: 560px) {
  #levelGrid { grid-template-columns: repeat(4, 1fr); }
  .hud-top { padding: 8px 10px 12px; }
  .chip { padding: 5px 8px; max-width: 140px; }
}

@container stage (max-width: 420px) {
  #levelGrid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .btn-label { display: none; }
  #btnMode .btn-label { display: inline; font-size: 11px; }
  .row .btn { min-width: 88px; padding: 0 10px; font-size: 12px; }
  .panel { padding: 16px 12px 14px; }
}

@container stage (max-height: 420px) {
  .hud-top { padding: 6px 8px 10px; gap: 5px; }
  .btn { height: 30px; min-width: 30px; font-size: 11px; }
  .btn.icon { width: 30px; }
  #hint { top: 42px; font-size: 10px; padding: 4px 10px; }
  .logo-faces { height: 44px; margin-bottom: 2px; }
  .blob { width: 38px; height: 38px; }
  .blob.teal { width: 32px; height: 32px; }
  .panel { padding: 14px 14px 12px; }
  .panel h1 { font-size: 24px; }
  .panel h2 { font-size: 20px; }
  .panel p { font-size: 12px; margin-bottom: 10px; }
  .lede { display: none; }
  .how-grid { margin: 4px 0 10px; }
  .stars { font-size: 30px; min-height: 36px; }
}

@media (max-width: 700px) {
  #stage {
    box-shadow: none;
    border: none;
    border-radius: 0;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
