:root {
  --night: #140a04;
  --text: #f6ecdc;
  --dim: #d4b593;
  --dim-2: #a8876a;
  --gold: #ffb84a;
  --gold-2: #ffe2a8;
  --cream: #fff3dc;
  --amber: #ffb24a;
  --orange: #ff8a1e;
  --cyan: #3fd8ff;
  --cyan-2: #b8f2ff;
  --wood: #2e180b;
  --wood-lo: #1a0d05;
  --wood-edge: #0d0602;
  --line: rgba(255, 180, 100, 0.17);
  --line-2: rgba(255, 196, 130, 0.36);
  --recess: rgba(12, 5, 1, 0.45);
  --green: #6fe08a;
  --red: #ff5a5a;
  --ink-dark: #2a1204;
  --glow: 0 0 18px rgba(255, 150, 50, 0.35);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.008 0.22' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.05 0 0 0 0 0.02 0 0 0 0 0 1.4 0 0 0 -0.62'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  --crystal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 26'%3E%3Cfilter id='b'%3E%3CfeGaussianBlur stdDeviation='2'/%3E%3C/filter%3E%3Cpolygon points='10,2 18,11 10,24 2,11' fill='%233fd8ff' filter='url(%23b)' opacity='.75'/%3E%3Cpolygon points='10,3 16,11 10,23 4,11' fill='%231a8cc4'/%3E%3Cpolygon points='10,3 16,11 10,11' fill='%23c8f6ff'/%3E%3Cpolygon points='10,3 4,11 10,11' fill='%2370e2ff'/%3E%3Cpolygon points='16,11 10,23 10,11' fill='%2330bff0'/%3E%3C/svg%3E");
  --lit: linear-gradient(180deg, #ffe9b8 0%, #ffbf5c 42%, #f78c22 100%);
  --sign: linear-gradient(180deg, #6a3c1c 0%, #4c2912 50%, #391d0b 100%);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --ui: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --display: "Luckiest Guy", "Fredoka", "Trebuchet MS", sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--night);
  color: var(--text);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.35;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}

[hidden] { display: none !important; }

button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.px, img { image-rendering: pixelated; image-rendering: crisp-edges; }

body *::-webkit-scrollbar { width: 10px; height: 10px; }
body *::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.28); border-radius: 999px; }
body *::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #8a5426, #5a3215); border: 2px solid #1a0d05; border-radius: 999px; }
body *::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #ffbf5c, #c46a1a); }
@supports (-moz-appearance: none) {
  .panel.narrow, .sheet, .run-card, .lobby-side, .lobby-body, .row-scroll { scrollbar-width: thin; scrollbar-color: #7a4a20 rgba(0, 0, 0, 0.28); }
}

#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  image-rendering: pixelated;
}

.win {
  position: relative;
  border: 2px solid var(--wood-edge);
  border-radius: 16px;
  padding: 8px 10px;
  background: var(--grain), linear-gradient(180deg, #3a200f 0%, var(--wood) 45%, var(--wood-lo) 100%);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 2px 0 rgba(255, 214, 160, 0.1), inset 0 -18px 32px rgba(0, 0, 0, 0.3), 0 12px 36px rgba(0, 0, 0, 0.5);
}

.loading {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 16px;
  background: radial-gradient(ellipse at 50% 55%, #3a1d0b, var(--night) 70%);
  font: 400 28px var(--display);
  letter-spacing: 1px;
  color: var(--cream);
  text-shadow: 0 2px 0 #c8590a, 0 4px 0 var(--wood-edge), var(--glow);
  text-align: center;
  z-index: 50;
  transition: opacity 0.5s ease;
}
.loading.gone { opacity: 0; pointer-events: none; }
.load-bar { width: 240px; height: 14px; margin: 0 auto; padding: 2px; border-radius: 999px; background: var(--recess); border: 1px solid var(--line); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6); }
.load-fill { height: 100%; width: 0; border-radius: 999px; background: var(--lit); box-shadow: 0 0 10px rgba(255, 160, 60, 0.6); transition: width 0.2s ease; }

.hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  padding: calc(8px + var(--safe-t)) 10px 0;
  z-index: 5;
}
.hud button { pointer-events: auto; }
.hud .win { border-radius: 13px; box-shadow: inset 0 0 0 1px var(--line), inset 0 2px 0 rgba(255, 214, 160, 0.1), 0 6px 18px rgba(0, 0, 0, 0.45); }
.hud-top { display: flex; gap: 8px; align-items: flex-start; }
.hud-stats { flex: 0 1 270px; min-width: 150px; padding: 7px 10px; display: flex; flex-direction: column; gap: 5px; }
.bar-row { display: flex; align-items: center; gap: 7px; }
.ico { width: 16px; height: 16px; flex: none; }
.bar { flex: 1; height: 12px; padding: 2px; border-radius: 999px; background: rgba(8, 3, 0, 0.7); border: 1px solid var(--line); box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.6); position: relative; overflow: hidden; }
.bar-fill { position: absolute; inset: 2px; border-radius: 999px; transform-origin: left center; transform: scaleX(0); }
.hp .bar-fill { background: linear-gradient(180deg, #ffb09a 0%, #f04a4a 45%, #b81f2c 100%); box-shadow: 0 0 8px rgba(255, 80, 80, 0.45); }
.xp .bar-fill { background: linear-gradient(180deg, #d4f8ff 0%, #3fd8ff 45%, #1a8cc4 100%); box-shadow: 0 0 8px rgba(63, 216, 255, 0.5); }
.num, .lv { font: 700 14px var(--ui); min-width: 28px; color: var(--cream); text-shadow: 0 1px 0 #000; font-variant-numeric: tabular-nums; }
.lv { color: var(--amber); min-width: 40px; }

.hud-clock { flex: 1 1 auto; text-align: center; padding: 4px 12px 5px; min-width: 110px; max-width: 240px; margin: 0 auto; }
.clock { font: 400 34px var(--display); line-height: 1; letter-spacing: 1.5px; color: var(--cream); padding-top: 4px; text-shadow: 0 2px 0 #c8590a, 0 4px 0 var(--wood-edge); font-variant-numeric: tabular-nums; }
.clock.up { color: var(--gold-2); }
.mode-tag { margin-top: 1px; font: 500 12px var(--ui); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mode-tag.stay { display: inline-block; max-width: 100%; margin-top: 3px; padding: 1px 9px; border-radius: 999px; font-weight: 700; color: var(--ink-dark); background: var(--lit); box-shadow: 0 0 12px rgba(255, 160, 60, 0.55); animation: stayGlow 1.4s ease-in-out infinite; }
@keyframes stayGlow { 50% { box-shadow: 0 0 20px rgba(255, 170, 70, 0.85); } }

.hud-side { display: flex; gap: 6px; align-items: flex-start; }
.hud-count { display: flex; gap: 12px; padding: 8px 12px; font: 700 15px var(--ui); color: var(--cream); text-shadow: 0 1px 0 #000; font-variant-numeric: tabular-nums; }
.hud-count span { display: inline-flex; align-items: center; gap: 5px; }
.hud-score em { font: 600 11px var(--ui); font-style: normal; text-transform: uppercase; letter-spacing: 0.6px; color: var(--dim); }
.hud-score b { color: var(--gold-2); min-width: 3ch; }

.pbtn {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border: 2px solid var(--wood-edge);
  border-radius: 11px;
  background: var(--grain), var(--sign);
  color: var(--cream);
  box-shadow: inset 0 1px 0 rgba(255, 214, 160, 0.25), inset 0 -2px 0 rgba(0, 0, 0, 0.35), 0 3px 0 var(--wood-edge);
  transition: color 0.15s, box-shadow 0.15s;
}
.pbtn svg { width: 20px; height: 20px; }
.pbtn:hover { color: var(--gold-2); box-shadow: inset 0 0 0 1px rgba(255, 180, 90, 0.5), inset 0 1px 0 rgba(255, 214, 160, 0.25), 0 3px 0 var(--wood-edge), var(--glow); }
.pbtn:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 214, 160, 0.25), 0 1px 0 var(--wood-edge); }
.snd-off { display: none; }
.muted .snd-on { display: none; }
.muted .snd-off { display: block; }

.slots { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; align-items: center; }
.slot {
  position: relative;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: radial-gradient(circle at 50% 35%, #3a200f, #170a03 75%);
  border: 2px solid var(--wood-edge);
  box-shadow: inset 0 0 0 1px var(--line), 0 3px 8px rgba(0, 0, 0, 0.4);
}
.slot img { width: 24px; height: 24px; object-fit: contain; }
.slot i { position: absolute; right: -5px; bottom: -6px; min-width: 16px; padding: 0 3px; border-radius: 999px; background: #120702; border: 1px solid var(--line-2); font: 700 11px var(--ui); font-style: normal; line-height: 14px; text-align: center; color: var(--cream); }
.slot.evo { border-color: #6a3008; box-shadow: inset 0 0 0 1px var(--amber), 0 0 12px rgba(255, 160, 60, 0.5); }
.slot.evo i { color: var(--ink-dark); background: var(--lit); border-color: #6a3008; }
.slot.pas { box-shadow: inset 0 0 0 1px rgba(63, 216, 255, 0.45), 0 3px 8px rgba(0, 0, 0, 0.4); }
.slot-gap { width: 6px; }

.boss {
  position: absolute;
  left: 50%;
  bottom: calc(12px + var(--safe-b));
  transform: translateX(-50%);
  width: min(560px, 90vw);
  text-align: center;
  font: 400 18px var(--display);
  letter-spacing: 1px;
  color: var(--cream);
  text-shadow: 0 2px 0 #7a1010;
  padding: 7px 12px 9px;
}
.boss-track { height: 14px; margin-top: 4px; }
.boss-track .bar-fill { background: linear-gradient(180deg, #ffb08a 0%, #e8303c 45%, #8a1420 100%); box-shadow: 0 0 10px rgba(255, 60, 60, 0.5); }

.camp {
  position: absolute;
  left: 50%;
  bottom: calc(12px + var(--safe-b));
  transform: translateX(-50%);
  width: min(580px, 94vw);
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.camp-box { flex: 1; min-width: 0; padding: 8px 12px; font-size: 14px; }
.camp-top { display: flex; align-items: center; gap: 7px; font-size: 15px; }
.camp-top b { font: 400 21px var(--display); letter-spacing: 1px; color: var(--gold-2); text-shadow: 0 2px 0 #c8590a; padding-top: 3px; }
.camp-top span { color: var(--dim); }
.camp-tip { color: var(--text); min-height: 1.3em; }
.camp-buffs { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.camp-buffs span { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; background: var(--recess); border: 1px solid var(--line); color: var(--gold-2); font-size: 13px; }
.camp-buffs img { width: 14px; height: 14px; }
.camp .btn.big { pointer-events: auto; align-self: center; white-space: nowrap; }

.banner {
  position: fixed;
  left: 0;
  right: 0;
  top: 22%;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  z-index: 6;
  padding: 0 16px;
}
.banner.on { animation: banner 2.6s ease both; }
.banner-title {
  font: 400 clamp(32px, 6.5vw, 58px) var(--display);
  letter-spacing: 1.5px;
  color: var(--cream);
  text-shadow: 0 3px 0 #c8590a, 0 6px 0 var(--wood-edge), 0 0 30px rgba(255, 150, 50, 0.55);
}
.banner-sub { display: inline-block; margin-top: 6px; padding: 3px 14px; border-radius: 999px; background: rgba(20, 8, 2, 0.7); border: 1px solid var(--line-2); font: 600 17px var(--ui); color: var(--gold-2); }
@keyframes banner {
  0% { opacity: 0; transform: translateY(14px) scale(0.96); }
  12% { opacity: 1; transform: none; }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-8px); }
}

.flash { position: fixed; inset: 0; pointer-events: none; opacity: 0; z-index: 4; }
.flash.red { background: rgba(220, 30, 60, 0.32); animation: flash 0.3s steps(3) both; }
.flash.gold { background: rgba(255, 200, 120, 0.35); animation: flash 0.5s steps(4) both; }
.flash.pink { background: rgba(255, 110, 180, 0.4); animation: flash 0.6s steps(4) both; }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }
.lowhp { position: fixed; inset: 0; pointer-events: none; z-index: 4; opacity: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(200, 10, 40, 0.55) 100%); }
.lowhp.on { animation: lowhp 0.85s ease-in-out infinite; }
@keyframes lowhp { 0%, 100% { opacity: 0.25; } 30% { opacity: 1; } }
.doom { position: fixed; inset: 0; pointer-events: none; z-index: 4; opacity: 0; background: rgba(110, 0, 18, 0.5); transition: opacity 1.2s ease-out; }
.doom.on { opacity: 1; }

.toasts { position: fixed; right: 12px; bottom: calc(70px + var(--safe-b)); display: flex; flex-direction: column; gap: 7px; align-items: flex-end; pointer-events: none; z-index: 30; }
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 11px;
  border: 2px solid var(--wood-edge);
  border-radius: 12px;
  background: var(--grain), linear-gradient(180deg, #44250f, #24120a);
  box-shadow: inset 0 0 0 1px rgba(255, 184, 74, 0.4), 0 6px 18px rgba(0, 0, 0, 0.5), 0 0 16px rgba(255, 150, 50, 0.2);
  color: var(--gold-2);
  font: 600 15px var(--ui);
  animation: toast 3.2s var(--ease) both;
}
.toast::before { content: ""; flex: none; width: 11px; height: 15px; background: var(--crystal) center / contain no-repeat; }
@keyframes toast {
  0% { opacity: 0; transform: translateX(28px); }
  10%, 85% { opacity: 1; transform: none; }
  100% { opacity: 0; }
}

.story { position: fixed; inset: 0; pointer-events: none; z-index: 19; }
.story-top { position: absolute; left: 0; right: 0; top: calc(6px + var(--safe-t)); padding: 0 16px; text-align: center; }
.story-area { font: 400 clamp(18px, 3.2vw, 26px) var(--display); letter-spacing: 1px; color: var(--cream); text-shadow: 0 2px 0 #c8590a, 0 4px 0 var(--wood-edge); }
.story-skip { position: absolute; right: 12px; top: calc(8px + var(--safe-t)); z-index: 1; padding: 6px 18px; border-radius: 10px; font: 700 14px var(--ui); color: var(--cream); background: var(--grain), var(--sign); border: 2px solid var(--wood-edge); box-shadow: inset 0 1px 0 rgba(255, 214, 160, 0.25), 0 3px 0 var(--wood-edge); cursor: pointer; pointer-events: auto; }
.story-skip:hover, .story-skip:focus-visible { color: var(--gold-2); box-shadow: inset 0 0 0 1px rgba(255, 180, 90, 0.5), 0 3px 0 var(--wood-edge), var(--glow); }
.bubble {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 18;
  max-width: 220px;
  padding: 4px 11px 5px;
  transform: translate(-50%, -100%);
  background: #fff3dc;
  border: 2px solid #2a1204;
  border-radius: 12px;
  box-shadow: 0 3px 0 rgba(42, 18, 4, 0.45);
  color: #2a1204;
  font: 700 15px var(--ui);
  line-height: 1.2;
  text-align: center;
  pointer-events: none;
}
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -9px; margin-left: -6px; border: 6px solid transparent; border-top-color: #2a1204; border-bottom: 0; }
.end-story { display: flex; gap: 12px; align-items: center; margin: 4px 0 10px; padding: 8px 12px; border-radius: 12px; background: var(--recess); border: 1px solid var(--line); text-align: left; }
.end-story img { flex: none; width: 56px; height: 56px; border-radius: 10px; background: radial-gradient(circle at 50% 40%, #4a2a14, #170a03 75%); border: 1px solid var(--line-2); }
.end-story b { display: block; color: var(--gold-2); font-size: 15px; }
.end-story p { margin: 2px 0 0; font-size: 15px; color: var(--text); }
@media (max-width: 520px) {
  .bubble { font-size: 13px; max-width: 160px; }
}

.dialog {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(12px + var(--safe-b));
  display: flex;
  justify-content: center;
  padding: 0 12px;
  z-index: 20;
  cursor: pointer;
}
.dialog-box { width: min(740px, 100%); display: flex; gap: 14px; align-items: flex-start; padding: 12px 16px 14px 12px; animation: rise 0.22s var(--ease) both; }
.dlg-portrait { width: 96px; height: 96px; flex: none; border-radius: 12px; background: radial-gradient(circle at 50% 40%, #5a3418, #1a0b04 75%); border: 2px solid var(--wood-edge); box-shadow: inset 0 0 0 1px rgba(255, 184, 74, 0.45), 0 0 14px rgba(255, 150, 50, 0.2); }
.dlg-body { flex: 1; min-width: 0; }
.dlg-body b { display: block; font: 400 21px var(--display); letter-spacing: 1px; color: var(--orange); text-shadow: 0 2px 0 var(--wood-edge); padding-top: 3px; }
.dlg-body p { margin: 4px 0 0; font-size: 18px; color: var(--text); }
#dlgText { min-height: 2.5em; }
.dlg-sub { color: var(--dim); font-size: 15px !important; }
.dlg-next { position: absolute; right: 16px; bottom: 12px; width: 12px; height: 16px; background: var(--crystal) center / contain no-repeat; transform: rotate(180deg); animation: bob 0.9s ease-in-out infinite; }
.dialog.typing .dlg-next { visibility: hidden; }
@keyframes bob { 50% { transform: rotate(180deg) translateY(-4px); } }

.screen {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: calc(12px + var(--safe-t)) 12px calc(12px + var(--safe-b));
  z-index: 10;
}
.screen.on { display: flex; animation: fade 0.25s ease both; }
.screen.modal { background: radial-gradient(ellipse at center, rgba(20, 8, 2, 0.45), rgba(8, 3, 0, 0.78)); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.title-screen { flex-direction: column; justify-content: space-between; background: radial-gradient(ellipse 80% 70% at 50% 58%, transparent 42%, rgba(8, 3, 0, 0.62)), linear-gradient(180deg, rgba(8, 3, 0, 0.6), transparent 30%, transparent 68%, rgba(8, 3, 0, 0.66)); }
.title-wrap { margin-top: 4vh; display: flex; flex-direction: column; align-items: center; text-align: center; animation: rise 0.6s var(--ease) both; }
.logo-img { display: block; height: auto; image-rendering: auto; }
.logo { margin: 0; line-height: 0; }
.logo .logo-img { width: min(820px, 88vw); filter: drop-shadow(0 6px 0 rgba(13, 6, 2, 0.85)) drop-shadow(0 0 28px rgba(255, 150, 50, 0.4)); }
.title-foot { display: flex; flex-direction: column; align-items: center; gap: 18px; margin-bottom: clamp(36px, 7vh, 72px); animation: rise 0.6s 0.15s var(--ease) both; }
.tagline { margin: 4px 0 0; color: var(--cream); font-size: 18px; text-shadow: 0 2px 0 #000; }
.tagline.small { font-size: 14px; color: var(--dim); text-shadow: none; }
.btn.big.press { min-height: 68px; padding: 6px 56px 0; font-size: 33px; letter-spacing: 2.5px; border-radius: 18px; animation: press 1.6s ease-in-out infinite; }
@keyframes press { 50% { box-shadow: inset 0 1px 0 #fff6dc, inset 0 -3px 0 rgba(160, 64, 0, 0.4), 0 3px 0 var(--ink-dark), 0 0 40px rgba(255, 170, 70, 0.85); } }

.panel {
  width: min(940px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: rise 0.28s var(--ease) both;
}
.panel::before { content: ""; position: absolute; left: 10%; right: 10%; top: -1px; height: 2px; background: linear-gradient(90deg, transparent, rgba(255, 190, 110, 0.55), transparent); pointer-events: none; }
.panel.narrow { width: min(560px, 100%); padding: 16px 18px 18px; overflow-y: auto; border-radius: 20px; }

.menu-logo { margin: 0; line-height: 0; }
.menu-logo .logo-img { width: 210px; max-width: 100%; filter: drop-shadow(0 3px 0 rgba(13, 6, 2, 0.8)) drop-shadow(0 0 14px rgba(255, 150, 50, 0.28)); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 13px 0 11px; border-radius: 999px; background: var(--recess); border: 1px solid var(--line); box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 210, 150, 0.06); font-size: 17px; font-weight: 700; color: var(--cream); font-variant-numeric: tabular-nums; }
.chip small { font-size: 11px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; color: var(--dim-2); }
.gold-chip { border-color: rgba(255, 184, 74, 0.5); color: var(--gold-2); box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5), 0 0 14px rgba(255, 160, 60, 0.18); }
.wc-chip { border-color: rgba(63, 216, 255, 0.38); box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5), 0 0 14px rgba(63, 216, 255, 0.12); }
.star { color: var(--amber); text-shadow: 0 0 8px rgba(255, 170, 60, 0.7); }

.tabs { display: flex; flex-shrink: 0; gap: 4px; margin: 0 16px; padding: 5px; border-radius: 14px; background: var(--recess); border: 1px solid rgba(0, 0, 0, 0.4); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(255, 210, 150, 0.08); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 1 0 auto; padding: 7px 14px 6px; border-radius: 10px; font-size: 16px; font-weight: 600; color: var(--dim); white-space: nowrap; transition: color 0.15s, background 0.15s, box-shadow 0.15s; }
.tab:hover { color: var(--cream); background: rgba(255, 190, 110, 0.08); }
.tab.on { color: var(--ink-dark); background: var(--lit); text-shadow: 0 1px 0 rgba(255, 240, 200, 0.55); box-shadow: inset 0 1px 0 #fff6dc, inset 0 -2px 0 rgba(160, 64, 0, 0.35), 0 0 16px rgba(255, 160, 60, 0.45); }
.count { display: inline-block; min-width: 20px; margin-left: 3px; padding: 0 6px; border-radius: 999px; background: rgba(63, 216, 255, 0.15); color: var(--cyan-2); font-size: 12px; font-weight: 700; line-height: 18px; text-align: center; text-shadow: none; vertical-align: 1px; }
.count:empty { display: none; }
.tab.on .count, .btn .count { background: rgba(42, 18, 4, 0.18); color: var(--ink-dark); }
.btn.ghost .count { background: rgba(63, 216, 255, 0.15); color: var(--cyan-2); }

.tab-panel { display: none; }
.tab-panel.on { display: block; animation: fade 0.2s ease both; }

.sec { display: flex; align-items: center; gap: 9px; margin: 16px 0 8px; font-size: 13px; font-weight: 700; letter-spacing: 2.2px; text-transform: uppercase; color: var(--amber); }
.sec::before { content: ""; flex: none; width: 12px; height: 16px; background: var(--crystal) center / contain no-repeat; }
.sec::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
.sec .count { letter-spacing: 0; }

.row-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; overscroll-behavior-x: contain; }
.row-scroll > * { flex-shrink: 0; }
.row-scroll::-webkit-scrollbar { height: 9px; }

.tile, .opt, .item, .entry, .choice, .stat, .info, .night, .build-row, .ware, .nudge {
  position: relative;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 200, 140, 0.06), rgba(255, 200, 140, 0.015)), var(--recess);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 214, 160, 0.06), 0 2px 0 rgba(0, 0, 0, 0.22);
}
button.tile, button.opt, button.choice, .nudge { transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.08s; }
.tile { flex: none; width: 92px; padding: 8px 4px 7px; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.tile img { width: 54px; height: 66px; object-fit: contain; }
.tile b { font-size: 14px; line-height: 1.1; font-weight: 600; }
.tile i { font-size: 12px; font-style: normal; color: var(--green); text-transform: uppercase; }
.tile:hover, .opt:hover { border-color: var(--line-2); background: linear-gradient(180deg, rgba(255, 200, 140, 0.1), rgba(255, 200, 140, 0.03)), var(--recess); }
.tile.on, .opt.on { border-color: rgba(255, 191, 92, 0.9); background: radial-gradient(130% 140% at 0% 0%, rgba(255, 170, 70, 0.24), transparent 62%), rgba(44, 20, 6, 0.75); box-shadow: inset 0 0 0 1px rgba(255, 191, 92, 0.45), 0 0 20px rgba(255, 150, 50, 0.28); }
.tile.on b, .opt.on b { color: var(--gold-2); }
.opt.on::after, .tile.on::after { content: ""; position: absolute; top: 8px; right: 9px; width: 12px; height: 16px; background: var(--crystal) center / contain no-repeat; }
.tile.on::after { top: 5px; right: 6px; width: 9px; height: 12px; }
.tile.closed, .opt.closed { opacity: 0.5; cursor: default; }
.tile.closed:hover, .opt.closed:hover { border-color: var(--line); background: linear-gradient(180deg, rgba(255, 200, 140, 0.06), rgba(255, 200, 140, 0.015)), var(--recess); }
.item.feat.closed { opacity: 0.55; }
.tile.closed img, .entry.unseen img { filter: brightness(0) opacity(0.55); }
.tile.small { width: 84px; }
.tile.small img { width: 36px; height: 36px; margin-bottom: 2px; }
.tile.gift { border-color: rgba(111, 224, 138, 0.6); }

.info { margin-top: 8px; padding: 10px 12px; color: var(--dim); font-size: 15px; display: flex; align-items: center; gap: 14px; }
.info b { color: var(--cream); }
.portrait { flex: none; width: 96px; height: 118px; object-fit: contain; border-radius: 12px; background: radial-gradient(circle at 50% 38%, #6a3c1c, #2a1406 55%, #120702 85%); border: 2px solid var(--wood-edge); box-shadow: inset 0 0 0 1px rgba(255, 184, 74, 0.35); }
.portrait.end { display: block; width: 144px; height: 176px; margin: 0 auto 8px; box-shadow: inset 0 0 0 1px rgba(255, 184, 74, 0.6), 0 0 26px rgba(255, 150, 50, 0.35); }

.grid-2, .grid-3 { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.opt { text-align: left; padding: 10px 30px 10px 13px; display: flex; flex-direction: column; gap: 2px; }
.opt b { font-size: 17px; font-weight: 600; color: var(--cream); }
.opt span { font-size: 14px; color: var(--dim); line-height: 1.3; }

.night { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 9px 11px; }
.night > div { flex: 1; min-width: 0; }
.night b { font-size: 17px; font-weight: 600; color: var(--gold-2); }
.mods { display: flex; flex-direction: column; font-size: 14px; color: var(--dim); }
.step { width: 40px; height: 40px; flex: none; border-radius: 10px; border: 2px solid var(--wood-edge); background: var(--grain), var(--sign); color: var(--cream); font-size: 20px; font-weight: 700; box-shadow: inset 0 1px 0 rgba(255, 214, 160, 0.25), inset 0 -2px 0 rgba(0, 0, 0, 0.35), 0 3px 0 var(--wood-edge); }
.step:hover:not(:disabled) { color: var(--gold-2); box-shadow: inset 0 0 0 1px rgba(255, 180, 90, 0.5), 0 3px 0 var(--wood-edge), var(--glow); }
.step:active:not(:disabled) { transform: translateY(2px); }
.step:disabled { opacity: 0.3; }

.note { margin: 8px 0; font-size: 15px; color: var(--dim); }
.note.center { text-align: center; margin-top: 2px; }
.blurb { margin: 14px 0 0; font-size: 15px; color: var(--text); line-height: 1.5; }

.list { display: flex; flex-direction: column; gap: 7px; }
.item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; }
.item > img { flex: none; object-fit: contain; }
.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-body b { font-size: 16px; font-weight: 600; color: var(--cream); }
.item-body span { font-size: 14px; color: var(--dim); }
.pips { display: flex; gap: 3px; margin-top: 5px; }
.pip { width: 15px; height: 6px; border-radius: 3px; background: rgba(0, 0, 0, 0.55); box-shadow: inset 0 0 0 1px var(--line); }
.pip.on { background: var(--lit); box-shadow: 0 0 6px rgba(255, 160, 60, 0.55); }

.armory-note { margin-top: 12px; color: var(--text); font-size: 16px; }
.armory-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.armory-head .gold-chip { margin-top: 12px; }
.armory-next { margin: 6px 0 4px; font-size: 15px; font-weight: 700; color: var(--gold-2); }
.ware .buy-side { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.ware .buy-side .btn.buy { margin-left: 0; }
.ware .need { font-size: 12px; color: var(--dim); white-space: nowrap; }
.wares { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.ware { display: flex; align-items: center; gap: 12px; padding: 9px 11px; flex-wrap: wrap; }
.ware > img { flex: none; width: 40px; height: 40px; object-fit: contain; }
.ware .item-body { min-width: 150px; }
.ware .item-body b { font-size: 16px; }
.ware .item-body > span { font-size: 13px; color: var(--dim); line-height: 1.3; }
.ware .alt { display: block; margin-top: 2px; font-size: 12px; color: var(--cyan-2); }
.ware .pips { margin-top: 5px; }
.ware .btn.buy { margin-left: auto; min-height: 38px; font-size: 15px; padding: 0 12px; white-space: nowrap; }
.ware.owned { border-color: rgba(255, 184, 74, 0.32); background: linear-gradient(180deg, rgba(255, 184, 74, 0.08), rgba(255, 184, 74, 0.02)), var(--recess); }
.got { margin-left: auto; padding: 2px 10px; border-radius: 999px; background: rgba(255, 184, 74, 0.14); border: 1px solid rgba(255, 184, 74, 0.4); font-size: 12px; font-style: normal; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--gold-2); }
.gico { width: 16px; height: 16px; vertical-align: -3px; margin-right: 2px; }
.ware.fresh { animation: unlockPop 0.9s var(--ease) both; border-color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber), 0 0 22px rgba(255, 150, 50, 0.45); }
.ware.fresh .got { animation: unlockGlow 1.2s ease 2; }
@keyframes unlockPop { 0% { transform: scale(0.94); background-color: rgba(255, 210, 140, 0.6); } 30% { transform: scale(1.03); } 100% { transform: none; } }
@keyframes unlockGlow { 50% { background: var(--amber); color: var(--ink-dark); } }
.nudge { display: flex; align-items: center; gap: 12px; width: 100%; margin: 6px 0 10px; padding: 9px 12px; text-align: left; border-color: rgba(255, 184, 74, 0.45); }
.nudge:hover { border-color: var(--amber); box-shadow: var(--glow); }
.nudge img { flex: none; width: 40px; height: 40px; object-fit: contain; }
.nudge span { display: flex; flex-direction: column; }
.nudge b { font-size: 16px; color: var(--gold-2); }
.nudge em { font-style: normal; font-size: 14px; color: var(--dim); }
.nudge.ready { border-color: var(--amber); background: radial-gradient(130% 140% at 0% 0%, rgba(255, 170, 70, 0.24), transparent 62%), rgba(44, 20, 6, 0.75); animation: nudgeGlow 1.6s ease-in-out infinite; }
@keyframes nudgeGlow { 50% { box-shadow: 0 0 26px rgba(255, 160, 60, 0.6); } }
.stat.furthest { grid-column: 1 / -1; border-color: var(--line-2); }
.stat.furthest b { font-family: var(--display); font-weight: 400; letter-spacing: 1px; font-size: 26px; color: var(--cream); padding-top: 3px; }
.stat.furthest.new { border-color: var(--amber); background: radial-gradient(130% 140% at 0% 0%, rgba(255, 170, 70, 0.24), transparent 62%), rgba(44, 20, 6, 0.75); box-shadow: 0 0 22px rgba(255, 150, 50, 0.35); animation: unlockPop 0.9s var(--ease) both; }
.stat.furthest .nb { margin-left: 8px; padding: 1px 8px; border-radius: 999px; font: 700 13px var(--ui); font-style: normal; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-dark); background: var(--lit); vertical-align: 5px; animation: nbGlow 0.7s ease-in-out 5; }
@keyframes nbGlow { 50% { box-shadow: 0 0 14px rgba(255, 170, 70, 0.9); } }
.opt b .best { margin-left: 6px; font-size: 13px; font-style: normal; font-weight: 600; color: var(--amber); }
.stat.score { border-color: rgba(255, 184, 74, 0.55); background: radial-gradient(130% 140% at 0% 0%, rgba(255, 170, 70, 0.16), transparent 62%), rgba(44, 20, 6, 0.7); }
.stat.score b { font-family: var(--display); font-weight: 400; letter-spacing: 1px; font-size: 26px; color: var(--gold-2); padding-top: 3px; }
.stat.score .nb { margin-left: 8px; padding: 1px 8px; border-radius: 999px; font: 700 12px var(--ui); font-style: normal; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-dark); background: var(--lit); vertical-align: 5px; }
.stat.gold { border-color: rgba(255, 184, 74, 0.45); }
.stat.gold b { color: var(--gold-2); }
.reward { gap: 8px; }
.reward span { display: inline-flex; align-items: center; gap: 3px; }
.reward .wc { color: var(--dim); font-size: 13px; }

.item.confirm { margin-top: 8px; flex-wrap: wrap; border-color: rgba(255, 90, 90, 0.7); background: linear-gradient(180deg, rgba(255, 90, 90, 0.12), rgba(255, 90, 90, 0.04)), var(--recess); }
.item.confirm b { color: #ffc4b8; }
.confirm-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }

.feat { opacity: 0.7; }
.feat.done { opacity: 1; border-color: rgba(255, 184, 74, 0.4); }
.medal { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: rgba(0, 0, 0, 0.5); border: 1px solid var(--line); color: var(--ink-dark); font-size: 17px; }
.feat.done .medal { background: var(--lit); border-color: #6a3008; box-shadow: 0 0 10px rgba(255, 160, 60, 0.5); }
.reward { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 700; color: var(--gold-2); }

.entries { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.entry { padding: 10px 8px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; }
.entry img { width: 52px; height: 52px; object-fit: contain; }
.entry b { font-size: 15px; font-weight: 600; color: var(--cream); }
.entry span { font-size: 13px; color: var(--dim); }
.entry.unseen { opacity: 0.6; }

.stats { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin: 12px 0; }
.stat { padding: 8px 12px; display: flex; flex-direction: column; }
.stat span { font-size: 12px; font-weight: 600; color: var(--dim-2); text-transform: uppercase; letter-spacing: 1px; }
.stat b { font-size: 20px; font-weight: 600; color: var(--cream); font-variant-numeric: tabular-nums; }

.play-info { align-self: flex-end; max-width: 100%; padding: 4px 11px 3px; border-radius: 10px; font-size: 14px; color: var(--dim); text-align: right; background: rgba(12, 5, 1, 0.66); text-shadow: 0 1px 0 #000; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  min-height: 42px;
  border: 2px solid #4a1f04;
  border-radius: 12px;
  background: var(--lit);
  color: var(--ink-dark);
  font: 700 17px var(--ui);
  text-shadow: 0 1px 0 rgba(255, 240, 200, 0.55);
  box-shadow: inset 0 1px 0 #fff6dc, inset 0 -3px 0 rgba(160, 64, 0, 0.4), 0 3px 0 var(--ink-dark), 0 0 16px rgba(255, 150, 50, 0.28);
  transition: filter 0.15s, box-shadow 0.15s, color 0.15s, transform 0.08s;
}
.btn:hover { filter: brightness(1.06); box-shadow: inset 0 1px 0 #fff6dc, inset 0 -3px 0 rgba(160, 64, 0, 0.4), 0 3px 0 var(--ink-dark), 0 0 26px rgba(255, 160, 60, 0.6); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 1px 0 #fff6dc, inset 0 -2px 0 rgba(160, 64, 0, 0.4), 0 1px 0 var(--ink-dark), 0 0 16px rgba(255, 150, 50, 0.4); }
.btn:disabled { filter: grayscale(0.75) brightness(0.62); transform: none; box-shadow: inset 0 1px 0 #fff6dc, 0 3px 0 var(--ink-dark); }
.btn.big { min-height: 56px; padding: 4px 34px 0; font: 400 25px var(--display); letter-spacing: 1.5px; border-radius: 14px; }
.btn.ghost { border-color: var(--wood-edge); background: var(--grain), var(--sign); color: var(--cream); text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.6); box-shadow: inset 0 1px 0 rgba(255, 214, 160, 0.24), inset 0 -3px 0 rgba(0, 0, 0, 0.3), 0 3px 0 var(--wood-edge); }
.btn.ghost:hover { filter: none; color: var(--gold-2); box-shadow: inset 0 0 0 1px rgba(255, 180, 90, 0.5), inset 0 1px 0 rgba(255, 214, 160, 0.24), 0 3px 0 var(--wood-edge), var(--glow); }
.btn.ghost:active { box-shadow: inset 0 1px 0 rgba(255, 214, 160, 0.24), 0 1px 0 var(--wood-edge); }
.btn.buy { min-width: 84px; font-size: 16px; min-height: 38px; }
.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }

.title { margin: 0 0 6px; text-align: center; font-family: var(--display); font-weight: 400; letter-spacing: 1.5px; font-size: clamp(30px, 6vw, 42px); color: var(--cream); text-shadow: 0 2px 0 #c8590a, 0 5px 0 var(--wood-edge), 0 0 26px rgba(255, 150, 50, 0.35); }

.who { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.who-portrait { width: 64px; height: 64px; object-fit: contain; border-radius: 12px; background: radial-gradient(circle at 50% 40%, #5a3418, #1a0b04 75%); border: 2px solid var(--wood-edge); box-shadow: inset 0 0 0 1px rgba(255, 184, 74, 0.45); }
.who b { font: 400 20px var(--display); letter-spacing: 1px; color: var(--orange); }
.who p { margin: 2px 0 0; font-size: 16px; }

.choices { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.choice { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; text-align: left; animation: deal 0.3s var(--ease) both; }
.choice:nth-child(2) { animation-delay: 0.05s; }
.choice:nth-child(3) { animation-delay: 0.1s; }
.choice:nth-child(4) { animation-delay: 0.15s; }
button.choice:hover { border-color: rgba(255, 191, 92, 0.9); background: radial-gradient(130% 140% at 0% 0%, rgba(255, 170, 70, 0.2), transparent 62%), rgba(44, 20, 6, 0.75); box-shadow: 0 0 20px rgba(255, 150, 50, 0.3); }
.choice img { flex: none; width: 52px; height: 52px; padding: 2px; object-fit: contain; border-radius: 10px; background: radial-gradient(circle at 50% 40%, #4a2a14, #170a03 75%); border: 1px solid var(--line); }
.choice-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.choice-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.choice-top b { font-size: 18px; font-weight: 600; color: var(--cream); }
.choice-text { font-size: 15px; color: var(--dim); }
.choice.poor { opacity: 0.45; }
.tag { padding: 0 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.5); border: 1px solid var(--line); font-size: 12px; font-weight: 700; font-style: normal; text-transform: uppercase; letter-spacing: 1px; color: var(--dim); }
.tag.new { background: rgba(63, 216, 255, 0.16); border-color: rgba(63, 216, 255, 0.5); color: var(--cyan-2); }
.choice.evo { border-color: var(--amber); background: radial-gradient(130% 140% at 0% 0%, rgba(255, 170, 70, 0.26), transparent 62%), rgba(50, 22, 6, 0.8); box-shadow: inset 0 0 0 1px rgba(255, 191, 92, 0.45), 0 0 22px rgba(255, 150, 50, 0.35); }
.choice.evo .tag { background: var(--lit); border-color: #6a3008; color: var(--ink-dark); }
.choice kbd { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: rgba(0, 0, 0, 0.5); border: 1px solid var(--line); font: 700 14px var(--ui); color: var(--dim); }
.choice.shuffle img { animation: wobble 0.18s steps(2) infinite; }
.choice.landed { animation: land 0.3s var(--ease) both; border-color: var(--amber); box-shadow: 0 0 22px rgba(255, 150, 50, 0.4); }
.choice.landed kbd { display: none; }
.choice-row { display: flex; gap: 8px; align-items: stretch; }
.choice-row .choice { flex: 1; min-width: 0; }
.choice-row:nth-child(2) .choice { animation-delay: 0.05s; }
.choice-row:nth-child(3) .choice { animation-delay: 0.1s; }
.choice-row:nth-child(4) .choice { animation-delay: 0.15s; }
.banish, .banish-gap { flex: none; width: 66px; }
.banish { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px 4px; border-radius: 12px; border: 2px solid var(--wood-edge); background: var(--grain), var(--sign); color: var(--dim); font-size: 12px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; box-shadow: inset 0 1px 0 rgba(255, 214, 160, 0.22), inset 0 -3px 0 rgba(0, 0, 0, 0.3), 0 3px 0 var(--wood-edge); animation: deal 0.3s var(--ease) both; transition: color 0.15s, box-shadow 0.15s; }
.banish svg { width: 20px; height: 20px; }
.banish .count { position: absolute; top: -7px; right: -6px; margin: 0; }
.banish:hover { color: #ffb4a8; box-shadow: inset 0 0 0 1px rgba(255, 110, 90, 0.55), inset 0 1px 0 rgba(255, 214, 160, 0.22), 0 3px 0 var(--wood-edge), 0 0 16px rgba(255, 90, 70, 0.35); }
.banish:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 214, 160, 0.22), 0 1px 0 var(--wood-edge); }
@keyframes deal { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes wobble { 50% { transform: translateY(-3px); } }
@keyframes land { 0% { transform: scale(0.95); } 100% { transform: none; } }

.build { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 10px; }
.build-col h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--amber); }
.build-col h3::before { content: ""; flex: none; width: 10px; height: 14px; background: var(--crystal) center / contain no-repeat; }
.build-row { display: flex; align-items: center; gap: 9px; padding: 5px 10px; margin-bottom: 5px; border-radius: 10px; }
.build-row img { width: 28px; height: 28px; object-fit: contain; }
.build-row b { flex: 1; font-size: 15px; font-weight: 500; color: var(--cream); }
.build-row em { font-size: 13px; font-style: normal; color: var(--amber); }
.build-row span { color: var(--dim); font-size: 14px; }

.lobby { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 12px; padding: calc(12px + var(--safe-t)) 16px calc(14px + var(--safe-b)); background: linear-gradient(90deg, rgba(10, 4, 1, 0.8), rgba(10, 4, 1, 0.12) 32%, rgba(10, 4, 1, 0.12) 62%, rgba(10, 4, 1, 0.8)), linear-gradient(180deg, rgba(10, 4, 1, 0.62), transparent 16%, transparent 76%, rgba(10, 4, 1, 0.55)); transition: background-color 0.3s; }
.lobby.sheet-on { background-color: rgba(10, 4, 1, 0.45); }
.lb-exit { position: absolute; left: max(16px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 5; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 11px; border: 2px solid var(--wood-edge); border-radius: 11px; background: var(--grain), var(--sign); color: var(--cream); font: 700 13px var(--ui); letter-spacing: 0.06em; text-transform: uppercase; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.6); box-shadow: inset 0 1px 0 rgba(255, 214, 160, 0.25), inset 0 -2px 0 rgba(0, 0, 0, 0.35), 0 3px 0 var(--wood-edge); cursor: pointer; transition: color 0.15s, box-shadow 0.15s; }
.lb-exit:hover { color: var(--gold-2); box-shadow: inset 0 0 0 1px rgba(255, 180, 90, 0.5), inset 0 1px 0 rgba(255, 214, 160, 0.25), 0 3px 0 var(--wood-edge), var(--glow); }
.lb-exit:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 214, 160, 0.25), 0 1px 0 var(--wood-edge); }
.lb-exit svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lobby:not(.sheet-on) .lobby-side { padding-bottom: 58px; }
.lobby.sheet-on .lb-exit { display: none; }
@media (max-width: 640px), (max-height: 520px) { .lb-exit span { display: none; } .lb-exit { padding: 9px 10px; left: max(10px, env(safe-area-inset-left)); bottom: max(10px, env(safe-area-inset-bottom)); } }
.lobby-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; flex-shrink: 0; animation: rise 0.35s var(--ease) both; }
.lobby-top .tabs { justify-self: center; max-width: 100%; margin: 0; gap: 2px; }
.lobby-top .tab { flex: 0 0 auto; padding: 8px 11px 7px; font-size: 15px; }
.tab.soon { display: inline-flex; align-items: center; gap: 6px; color: var(--dim-2); cursor: default; }
.tab.soon:hover { color: var(--dim-2); background: none; }
.tab.soon em { padding: 2px 7px 1px; border-radius: 999px; font-size: 10px; font-style: normal; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--cyan-2); background: rgba(63, 216, 255, 0.12); border: 1px solid rgba(63, 216, 255, 0.3); }
.acct-slot { display: flex; justify-content: flex-end; min-width: 190px; }
.acct { display: flex; align-items: center; gap: 10px; max-width: 240px; padding: 5px 16px 5px 5px; border-radius: 14px; border: 2px solid var(--wood-edge); background: var(--grain), var(--sign); text-align: left; box-shadow: inset 0 1px 0 rgba(255, 214, 160, 0.22), inset 0 -3px 0 rgba(0, 0, 0, 0.3), 0 3px 0 var(--wood-edge); transition: box-shadow 0.15s, color 0.15s; }
.acct:hover { box-shadow: inset 0 0 0 1px rgba(255, 180, 90, 0.5), inset 0 1px 0 rgba(255, 214, 160, 0.22), 0 3px 0 var(--wood-edge), var(--glow); }
.acct-tier { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--recess); box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6); }
.acct-txt { display: grid; min-width: 0; line-height: 1.15; }
.acct-txt b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 600; color: var(--cream); }
.acct-txt small { font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--dim-2); }
.tier-gem { display: inline-block; flex: none; width: 13px; height: 18px; background: linear-gradient(135deg, rgba(255, 255, 255, 0.75) 0 28%, transparent 28%), var(--tc, #5a4130); clip-path: polygon(50% 0, 100% 42%, 50% 100%, 0 42%); filter: drop-shadow(0 0 6px var(--tc, transparent)); }
.lobby-body { position: relative; flex: 1; min-height: 0; }
.lobby-play.on { display: grid; grid-template-columns: minmax(270px, 320px) 1fr minmax(320px, 390px); gap: 16px; height: 100%; }
.lobby-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; padding: 2px 4px 4px 0; animation: slideL 0.4s var(--ease) both; }
.lobby-run { display: flex; flex-direction: column; gap: 12px; min-height: 0; animation: slideR 0.4s var(--ease) both; }
.lobby-stage { pointer-events: none; }
@keyframes slideL { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
@keyframes slideR { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
.card { flex-shrink: 0; padding: 14px 16px; border-radius: 18px; }
.kicker { display: block; font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--amber); }
.hero-top { display: flex; align-items: center; gap: 12px; }
.hero-card .portrait { width: 78px; height: 78px; object-fit: cover; object-position: 50% 20%; }
.hero-id { flex: 1; min-width: 0; }
#nameIn { display: block; width: 100%; margin-top: 5px; padding: 7px 12px; border-radius: 10px; font: 600 18px var(--ui); color: var(--cream); background: rgba(8, 3, 0, 0.7); border: 1px solid var(--line-2); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6); user-select: text; -webkit-user-select: text; }
#nameIn::placeholder { color: var(--dim-2); }
#nameIn:focus { outline: none; border-color: var(--gold); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6), 0 0 0 3px rgba(255, 184, 74, 0.2); }
.hero-id .tagline.small { margin-top: 6px; }
.hero-tier { display: flex; align-items: center; gap: 9px; margin-top: 12px; padding: 8px 12px; border-radius: 12px; background: var(--recess); box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5); }
.hero-tier b { font-size: 16px; font-weight: 600; color: var(--cream); }
.hero-tier.none b { color: var(--dim); font-weight: 500; }
.hero-card .note { margin: 8px 2px 0; font-size: 14px; line-height: 1.4; }
.hero-purse { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hero-purse .chip { height: 34px; font-size: 16px; }
.daily-name { display: block; margin-top: 4px; font: 400 21px var(--display); letter-spacing: 1px; color: var(--gold-2); text-shadow: 0 2px 0 var(--wood-edge); }
.daily-card .note { margin: 6px 0 0; font-size: 14px; line-height: 1.4; }
.daily-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.daily-streak { font-size: 14px; color: var(--dim); }
.daily-streak b { margin-left: 3px; font-size: 17px; color: var(--cream); }
.btn.daily-go { min-height: 36px; padding: 0 16px; font-size: 15px; }
.btn.daily-go.on { color: var(--gold-2); box-shadow: inset 0 0 0 1px rgba(255, 180, 90, 0.55), inset 0 1px 0 rgba(255, 214, 160, 0.24), 0 3px 0 var(--wood-edge), var(--glow); }
.best-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.best-box { padding: 10px 12px 8px; border-radius: 12px; background: var(--recess); box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5); }
.best-box b { display: block; margin-top: 4px; font: 400 30px var(--display); line-height: 1.1; color: var(--cream); font-variant-numeric: tabular-nums; }
.best-card .note { margin: 8px 2px 0; font-size: 13px; }
.run-card { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 14px 14px; }
.run-card .grid-2 { grid-template-columns: 1fr 1fr; }
.run-card .info { padding: 8px 4px 0; font-size: 14px; }
.run-card .info .portrait { width: 64px; height: 78px; }
.run-card .blurb { font-size: 14px; }
.lobby-go { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.go-row { display: flex; align-items: stretch; gap: 10px; }
.go-extras { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.go-extras .pbtn { width: 46px; height: 46px; }
.how-btn { padding-top: 3px; font: 400 24px var(--display); }
.btn.big.play-btn { flex: 1; min-height: 100px; padding: 8px 20px 0; font-size: 56px; letter-spacing: 4px; border-radius: 20px; }
.lobby-pane.on { position: absolute; inset: 0; display: flex; justify-content: center; }
.sheet { width: min(980px, 100%); height: 100%; overflow-y: auto; padding: 4px 22px 20px; border-radius: 20px; animation: rise 0.3s var(--ease) both; }
.sheet-title { margin: 14px 0 2px; font: 400 30px var(--display); letter-spacing: 1.5px; color: var(--gold-2); text-shadow: 0 3px 0 var(--wood-edge), 0 0 18px rgba(255, 150, 50, 0.3); }
.howto { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin-top: 12px; }
.how { padding: 12px 14px; border-radius: 14px; background: var(--recess); box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5); }
.how b { display: block; margin-bottom: 3px; font-size: 17px; color: var(--gold-2); }
.how span { font-size: 15px; line-height: 1.45; color: var(--dim); }

@media (max-width: 1180px) {
  .menu-logo .logo-img { width: 160px; }
  .lobby-top .tab { padding: 8px 9px 7px; font-size: 14px; }
  .lobby-play.on { grid-template-columns: minmax(250px, 290px) 1fr minmax(300px, 350px); }
  .acct-slot { min-width: 0; }
}
@media (max-width: 980px) {
  .lobby-top { grid-template-columns: auto 1fr; }
  .lobby-top .tabs { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; }
  .lobby-play.on { grid-template-columns: 1fr 1fr; }
  .lobby-stage { display: none; }
}
@media (max-width: 680px) {
  .lobby { gap: 10px; padding: calc(10px + var(--safe-t)) 10px calc(10px + var(--safe-b)); background: rgba(10, 4, 1, 0.55); }
  .menu-logo .logo-img { width: 150px; }
  .acct { padding: 4px 12px 4px 4px; }
  .acct-tier { width: 30px; height: 30px; }
  .lobby-body { overflow-y: auto; }
  .lobby-play.on { display: flex; flex-direction: column; height: auto; gap: 10px; }
  .lobby-side, .lobby-run { overflow: visible; }
  .run-card { flex: none; overflow: visible; }
  .lobby-go { position: sticky; bottom: 0; z-index: 2; margin: 0 -10px; padding: 10px 10px 2px; background: linear-gradient(180deg, rgba(14, 6, 2, 0), rgba(14, 6, 2, 0.94) 22px, #120702); border-top: 0; }
  .play-info { align-self: stretch; text-align: left; background: none; padding: 0 2px; }
  .btn.big.play-btn { min-height: 72px; font-size: 40px; }
  .go-extras { flex-direction: row; align-items: center; }
  .run-card .grid-2 { grid-template-columns: 1fr; }
  .sheet { padding: 2px 14px 16px; }
  .btn.big.press { min-height: 60px; padding: 5px 40px 0; font-size: 28px; }
}

@media (hover: none) {
  .choice kbd { display: none; }
}

@media (max-width: 560px) {
  body { font-size: 15px; }
  .hud { padding-left: 8px; padding-right: 8px; }
  .hud-stats { min-width: 120px; padding: 6px 8px; }
  .clock { font-size: 30px; }
  .hud-count { font-size: 13px; gap: 8px; padding: 7px 9px; }
  .pbtn { width: 36px; height: 36px; border-radius: 10px; }
  .pbtn svg { width: 18px; height: 18px; }
  .tile { width: 78px; }
  .tile img { width: 44px; height: 54px; }
  .tile.small { width: 76px; }
  .portrait { width: 78px; height: 96px; }
  .btn.big { flex: 1; font-size: 21px; padding: 4px 18px 0; }
  .slot { width: 32px; height: 32px; border-radius: 9px; }
  .slot img { width: 20px; height: 20px; }
  .dlg-portrait { width: 64px; height: 64px; }
  .dlg-body p { font-size: 16px; }
  .camp { flex-direction: column; }
  .banish, .banish-gap { width: 52px; }
  .banish span { font-size: 10px; letter-spacing: 0; }
  .chip { height: 34px; padding: 0 10px 0 9px; font-size: 15px; gap: 5px; }
  .panel.narrow { padding: 14px 12px 14px; }
}

@media (max-width: 420px) {
  .hud { padding-left: 6px; padding-right: 6px; }
  .hud-top { gap: 5px; }
  .hud-stats { min-width: 100px; }
  .hud-clock { min-width: 86px; padding: 3px 6px 4px; }
  .clock { font-size: 28px; letter-spacing: 1px; }
  .mode-tag { font-size: 11px; }
  .mode-tag.stay { white-space: normal; line-height: 1.15; padding: 2px 7px; }
  .hud-side { display: grid; grid-template-columns: auto auto; gap: 5px; justify-items: end; }
  .hud-count { grid-column: 1 / -1; grid-row: 2; }
  .chip small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .panel, .choice, .screen.on, .press, .dlg-next, .ware.fresh, .ware.fresh .got, .nudge.ready, .mode-tag.stay, .tab-panel.on { animation: none; }
}

.lb-row { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0 0; }
.lb-pick { padding: 6px 13px 5px; border-radius: 999px; font: 600 15px var(--ui); color: var(--dim); background: var(--recess); border: 1px solid var(--line); cursor: pointer; transition: color 0.15s, border-color 0.15s; }
.lb-pick:hover { color: var(--cream); border-color: var(--line-2); }
.lb-pick.on { color: var(--ink-dark); background: var(--lit); border-color: #6a3008; text-shadow: 0 1px 0 rgba(255, 240, 200, 0.55); box-shadow: 0 0 14px rgba(255, 160, 60, 0.4); }
.lb-list { list-style: none; margin: 12px 0 0; padding: 4px; border-radius: 14px; background: var(--recess); border: 1px solid var(--line); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45); }
.lb-line { display: flex; align-items: center; gap: 12px; padding: 7px 12px; border-radius: 9px; font-size: 16px; }
.lb-line:nth-child(odd) { background: rgba(255, 200, 140, 0.04); }
.lb-line.me { background: linear-gradient(90deg, rgba(255, 184, 74, 0.22), rgba(255, 184, 74, 0.06)); box-shadow: inset 3px 0 0 var(--amber); }
.lb-line.gap { margin-top: 4px; border-top: 1px dashed var(--line-2); border-radius: 0 0 9px 9px; }
.lb-rank { width: 36px; flex: none; text-align: right; font-family: var(--display); color: var(--amber); padding-top: 3px; }
.lb-line:nth-child(-n+3):not(.gap) .lb-rank { font-size: 20px; color: var(--gold-2); text-shadow: 0 0 10px rgba(255, 170, 60, 0.6); }
.lb-tier { flex: none; width: 11px; height: 15px; margin-right: -4px; background: linear-gradient(135deg, rgba(255, 255, 255, 0.75) 0 28%, transparent 28%), var(--tc); clip-path: polygon(50% 0, 100% 42%, 50% 100%, 0 42%); }
.lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--cream); }
.lb-score { font-weight: 600; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.lb-empty { padding: 16px 10px; color: var(--dim); text-align: center; font-size: 15px; }
.lb-acct { margin-top: 10px; }
.lb-acct b { color: var(--gold-2); }
.lb-wallets { display: flex; flex-wrap: wrap; gap: 8px; }
.lb-wallets .btn { font-size: 15px; min-height: 38px; gap: 6px; text-decoration: none; }
.lb-wallets img { display: block; }
.lb-via { display: inline-block; width: 13px; height: 13px; margin-left: 6px; vertical-align: -1px; }
.lb-via svg { display: block; width: 13px; height: 13px; fill: currentColor; }
.lb-via-telegram { color: #3fa9e8; }
.lb-via-discord { color: #8f98ff; }
.lb-name-row { display: flex; gap: 8px; flex-wrap: wrap; }
.lb-name-row input { flex: 1; min-width: 140px; padding: 7px 12px; border-radius: 10px; font: 500 16px var(--ui); color: var(--cream); background: rgba(8, 3, 0, 0.7); border: 1px solid var(--line-2); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6); }
.lb-msg { color: var(--gold-2); }
.end-rank { display: table; margin: 4px auto 8px; padding: 4px 16px 2px; border-radius: 999px; background: var(--recess); border: 1px solid var(--line-2); text-align: center; font: 400 20px var(--display); letter-spacing: 1px; color: var(--gold-2); }
.end-rank.top { color: var(--ink-dark); background: var(--lit); border-color: #6a3008; box-shadow: 0 0 20px rgba(255, 160, 60, 0.5); }
.ask-name { margin-top: 16px; }
.ask-name input { font-size: 18px; padding: 10px 14px; }
