/* DON'T DIE — play.dontdie.games host shell */
:root {
  --bg: #0A0716;
  --surface: #120D26;
  --line: #2A2050;
  --cyan: #00F0FF;
  --pink: #FF5FA2;
  --orange: #FFB65C;
  --violet: #9D5CFF;
  --text: #EFEAF8;
  --dim: #9C93B8;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --nav-h: 64px;
  --font-display: "Audiowide", "Space Grotesk", system-ui, sans-serif;
  --font-ui: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-mono: "VT323", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  touch-action: manipulation;
  background: #070510;
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
button, a { font-family: inherit; }
.hidden { display: none !important; }

.shell {
  width: min(430px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
}
@media (min-width: 440px) {
  .shell {
    border-color: var(--line);
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.55);
  }
}

/* Top chrome */
.top-chrome {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: calc(12px + var(--safe-t)) 14px 8px;
  flex-shrink: 0;
}
.avatar, .profile-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #7c5cff, #ff4d8d, #ffb020);
  border: 0; cursor: pointer; flex-shrink: 0;
}
.brand-block { min-width: 0; }
.brand {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.06em;
  line-height: 1.1;
}
.domain {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--cyan);
  letter-spacing: 0.08em;
  line-height: 1;
}
.cash {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 8px 6px 12px;
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.cash .plus {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--cyan); color: #041018;
  display: grid; place-items: center; font-weight: 800; font-size: 16px;
}

.main {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 14px calc(var(--nav-h) + 16px + var(--safe-b));
  outline: none;
}

.tab-panel[hidden] { display: none !important; }

/* Featured */
.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 10px;
  margin-bottom: 16px;
  cursor: pointer;
}
.eyebrow {
  color: var(--orange);
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 800;
}
.feature h1 {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.1;
  margin: 6px 0 8px;
  font-weight: 400;
}
.prize {
  color: var(--orange);
  font-size: 28px;
  font-weight: 800;
  font-family: var(--font-ui);
}
.meta { color: var(--dim); font-size: 12px; margin: 6px 0 12px; }
.play-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(90deg, var(--pink), var(--orange));
  color: var(--bg); border: 0; border-radius: 999px;
  padding: 10px 18px; font-weight: 800; font-size: 15px; cursor: pointer;
}
.play-btn.wide { width: 100%; justify-content: center; }
.feature-art {
  border-radius: 14px;
  min-height: 120px;
  position: relative;
  overflow: hidden;
}
.vp-art {
  background:
    radial-gradient(circle at 50% 45%, #ffe08a 0 8%, transparent 9%),
    conic-gradient(from 0deg, #5b8cff, #b14dff, #ff4d8d, #ff9f1a, #5b8cff);
}
.vp-art::after {
  content: "";
  position: absolute; inset: 34% 34%;
  border-radius: 50%; background: #1a1208; border: 3px solid var(--orange);
}

.section-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; gap: 8px;
}
.section-row h2 { font-size: 18px; font-weight: 700; }
.chips { display: flex; gap: 8px; }
.chip {
  border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 700;
  color: var(--dim); background: var(--surface); border: 1px solid var(--line);
  cursor: pointer;
}
.chip.on { color: var(--text); border-color: var(--orange); }
.chip .dot { color: #22c55e; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tile {
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  padding: 0;
  text-align: left;
  color: inherit;
  font: inherit;
}
.tile .bg { position: absolute; inset: 0; }
.tile .label {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 10px 10px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  color: var(--text); font-weight: 800; font-size: 14px;
  z-index: 1;
}
.badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: var(--violet); color: var(--text); font-size: 10px; font-weight: 800;
  padding: 4px 8px; border-radius: 6px;
}
.badge.soon { background: #2a2050; color: var(--dim); }
.tile.vp .bg { background: conic-gradient(from 40deg, #5b8cff, #b14dff, #ff4d8d, #ff9f1a, #5b8cff); }
.tile.lc .bg {
  background:
    linear-gradient(180deg, #120D26 0%, #0d0d12 40%),
    linear-gradient(90deg, #c9a227 0 18%, #333 18% 82%, #1f9d55 82% 100%);
}
.tile.lc .bg::before {
  content: ""; position: absolute; left: 42%; top: 58%; width: 34px; height: 54px;
  background: #e11; border-radius: 6px; box-shadow: 0 0 12px #f33;
}
.tile.rr .bg {
  background: radial-gradient(circle at 50% 70%, #7c5cff55, transparent 55%),
    linear-gradient(180deg, #2a1048, #0A0716);
}
.tile.rr .bg::before {
  content: ""; position: absolute; left: 46%; bottom: 28%; width: 28px; height: 48px;
  background: #c4b5fd; border-radius: 40% 40% 20% 20%;
}
.tile.bb .bg { background: linear-gradient(160deg, #10203a, #0A0716); }
.tile.bb .bg::before {
  content: ""; position: absolute; inset: 22% 18% 28%;
  background:
    linear-gradient(#22d3ee 0 24%, transparent 24% 28%, #a78bfa 28% 52%, transparent 52% 56%, #f472b6 56% 80%, transparent 80% 84%, #fbbf24 84% 100%);
  border-radius: 8px; opacity: .9;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(430px, 100%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 10px 6px calc(12px + var(--safe-b));
  z-index: 20;
}
.nav-item {
  background: none; border: 0; color: var(--dim);
  font-size: 11px; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; padding: 4px;
}
.nav-item.active { color: var(--cyan); }
.nav-item .ico { font-size: 18px; line-height: 1; }

/* Sub-lobby */
.text-back {
  background: none; border: 0; color: var(--cyan);
  font-family: var(--font-mono); font-size: 18px;
  letter-spacing: 0.04em; cursor: pointer; margin-bottom: 8px; padding: 4px 0;
}
.lobby-hero {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  min-height: 120px;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 14px;
  margin-bottom: 12px;
}
.lobby-art {
  position: absolute; inset: 0;
  opacity: 0.9;
}
.lobby-hero h1 {
  position: relative;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  text-shadow: 0 2px 12px rgba(0,0,0,.6);
}
.lobby-sub {
  position: relative;
  color: var(--dim);
  font-size: 13px;
  margin-top: 4px;
}
.prize-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  text-align: center;
  margin-bottom: 14px;
}
.prize-banner {
  font-size: 11px; letter-spacing: 0.16em; font-weight: 800; color: var(--violet);
}
.prize-amount {
  font-size: 36px; font-weight: 800; color: var(--orange); margin: 6px 0;
}
.prize-meta {
  display: flex; justify-content: center; gap: 10px;
  color: var(--dim); font-size: 12px;
}
.sandbox-tag {
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 14px;
}
.lb-section { margin-bottom: 14px; }
.lb-heading {
  font-size: 12px; letter-spacing: 0.14em; color: var(--dim);
  margin-bottom: 8px;
}
.lb-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.lb-list li {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  gap: 8px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
}
.lb-list .rank { color: var(--orange); font-weight: 800; }
.lb-list .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-list .score { color: var(--dim); font-family: var(--font-mono); font-size: 16px; }
.lb-list .payout { color: #22c55e; font-weight: 700; }
.entry-fee {
  text-align: center; color: var(--dim); font-size: 13px; margin-top: 10px;
}
.lobby-cta-wrap {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px;
}
.play-cta {
  width: 100%;
  background: linear-gradient(90deg, var(--pink), var(--orange));
  color: var(--bg); border: 0; border-radius: 999px;
  padding: 14px; font-weight: 800; font-size: 17px; cursor: pointer;
}
.free-cta {
  width: 100%;
  background: transparent;
  color: var(--cyan); border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px; font-weight: 700; font-size: 15px; cursor: pointer;
}
.help-link {
  display: block; width: 100%;
  background: none; border: 0; color: var(--dim);
  font-size: 13px; text-decoration: underline; cursor: pointer;
  margin-bottom: 8px;
}
.coming-soon {
  text-align: center; color: var(--orange); font-size: 14px; margin-top: 8px;
}

/* Wallet / Results / Profile */
.page-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  margin: 8px 0 16px;
}
.wallet-card, .profile-card, .link-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
}
.wallet-label { color: var(--dim); font-size: 12px; letter-spacing: 0.08em; }
.wallet-balance { font-size: 36px; font-weight: 800; color: var(--cyan); margin: 6px 0; }
.wallet-network { font-family: var(--font-mono); color: var(--dim); font-size: 16px; }
.wallet-actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.ghost-btn {
  background: transparent; border: 1px solid var(--line); color: var(--dim);
  border-radius: 999px; padding: 10px; font-weight: 700; cursor: pointer;
}
.hint { color: var(--dim); font-size: 13px; line-height: 1.4; }
.empty-state {
  text-align: center; padding: 40px 16px; color: var(--dim);
}
.empty-ico { font-size: 40px; margin-bottom: 10px; }
.results-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.results-list li {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px;
  display: flex; justify-content: space-between; gap: 8px; font-size: 14px;
}
.results-list .when { color: var(--dim); font-size: 12px; }
.profile-card {
  display: flex; align-items: center; gap: 14px;
}
.profile-avatar { width: 56px; height: 56px; }
.profile-name { font-weight: 800; font-size: 18px; }
.profile-handle { color: var(--cyan); font-family: var(--font-mono); font-size: 18px; }
.link-card {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--text); text-decoration: none; font-weight: 700;
}
.link-card .chev { color: var(--cyan); }

/* Player — full-viewport cover (must escape phone-column shell) */
.player {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  z-index: 50;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  margin: 0;
  transform: none;
  /* Do not use left:50% / max-width phone column — that offsets the stage */
}
.player.hidden { display: none !important; }
body.is-playing .shell .top-chrome,
body.is-playing .shell .bottom-nav {
  visibility: hidden !important;
  pointer-events: none !important;
}
.player-bar {
  display: flex; align-items: center; gap: 8px;
  padding: calc(8px + var(--safe-t)) 10px 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.player-back {
  background: none; border: 1px solid var(--line);
  color: var(--cyan); font-family: var(--font-mono); font-size: 15px;
  letter-spacing: 0.04em; padding: 6px 10px; border-radius: 8px; cursor: pointer;
  white-space: nowrap;
}
.player-title {
  flex: 1; font-weight: 700; font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.player-brand {
  font-family: var(--font-display); font-size: 10px; letter-spacing: 0.06em; color: var(--dim);
}
.player iframe {
  flex: 1; width: 100%; border: 0; background: #000;
  min-height: 0;
}

/* Overlay — full viewport; card itself stays phone-width */
.overlay {
  position: fixed; inset: 0; z-index: 60;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: rgba(5, 3, 14, 0.82);
  display: grid; place-items: center;
  padding: 20px;
  margin: 0;
  transform: none;
}
.overlay.hidden { display: none !important; }
.overlay-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px 18px;
  max-width: 340px;
  text-align: center;
}
.laurel { font-size: 28px; margin-bottom: 6px; }
.overlay-card h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 8px;
}
.overlay-sub { color: var(--dim); font-size: 14px; margin-bottom: 14px; }
.overlay-rows {
  list-style: none; text-align: left;
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 16px;
}
.overlay-rows li {
  display: grid; grid-template-columns: 28px 1fr; gap: 8px;
  font-size: 13px; color: var(--text); line-height: 1.35;
}
.tap-hint {
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 0.06em;
}

/* Studio contest pool card + wizard */
.studio-card {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}
.studio-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.studio-card-head h2 {
  font-size: 16px;
  font-weight: 700;
}
.studio-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--dim);
}
.studio-badge.on {
  color: #041018;
  background: var(--cyan);
  border-color: var(--cyan);
}
.studio-card .play-btn {
  margin-top: 12px;
}

.wizard {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(4, 2, 12, 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}
.wizard-sheet {
  width: min(430px, 100%);
  max-height: min(92vh, 820px);
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 18px 18px 12px 12px;
  padding: 14px 14px calc(14px + var(--safe-b));
  box-shadow: 0 -20px 60px rgba(0,0,0,0.45);
}
.wizard-head .text-back {
  background: none;
  border: 0;
  color: var(--cyan);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  margin-bottom: 8px;
}
.wizard-head h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.04em;
}
.wizard-sub {
  color: var(--dim);
  font-size: 12px;
  margin-top: 4px;
}
.wizard-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin: 14px 0 12px;
}
.wizard-steps li {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--dim);
  padding: 6px 2px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--surface);
}
.wizard-steps li.on {
  color: var(--text);
  border-color: var(--cyan);
}
.wizard-steps li.done {
  color: var(--cyan);
}
.wizard-body h3 {
  font-size: 16px;
  margin-bottom: 8px;
}
.wizard-body p {
  color: var(--dim);
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 10px;
}
.wizard-body .mono {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--cyan);
  word-break: break-all;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  margin: 8px 0 12px;
}
.wizard-body .check-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 14px;
}
.wizard-body .check-list li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
}
.wizard-body a {
  color: var(--cyan);
}
.wizard-body .ok-line {
  color: var(--orange);
  font-weight: 700;
  font-size: 14px;
}
.wizard-error {
  margin-top: 10px;
  color: #ff8aa8;
  background: rgba(255, 95, 162, 0.08);
  border: 1px solid rgba(255, 95, 162, 0.35);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
}
.wizard-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.wizard-foot .ghost-btn,
.ghost-btn {
  width: 100%;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}
.wizard-foot .play-btn:disabled,
.play-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
