:root {
  --bg: #07080d;
  --bg-2: #10121a;
  --card: rgba(22, 25, 35, 0.78);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f5f7;
  --muted: #9aa3b5;
  --gold: #f59e0b;
  --gold-2: #fbbf24;
  --gold-3: #d97706;
  --indigo: #6366f1;
  --ok: #34d399;
  --danger: #fb7185;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --radius: 22px;
  --font: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max: 1120px;
  --header: 76px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(99, 102, 241, 0.18), transparent 60%),
    radial-gradient(700px 420px at 10% 20%, rgba(245, 158, 11, 0.1), transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
}
body.is-playing { background: var(--bg); }
img, svg { display: block; max-width: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; }
.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--gold);
  color: #111;
  padding: 8px 12px;
  border-radius: 10px;
  z-index: 80;
}
.skip:focus { top: 12px; }
[hidden] { display: none !important; }

.sticky-stack { position: sticky; top: 0; z-index: 40; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.netbar {
  position: static;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(90deg, #d97706, #f59e0b);
  color: #1a1203;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
}
.netbar.is-offline { background: #14532d; color: #d1fae5; }

.site-header {
  position: static;
  z-index: 30;
  backdrop-filter: blur(16px);
  background: rgba(7, 8, 13, 0.8);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.bar, .subnav, .wrap { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; }
.bar {
  min-height: var(--header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f59e0b, #4f46e5);
  box-shadow: 0 0 28px rgba(245, 158, 11, 0.35);
}
.logo-mark svg { width: 24px; height: 24px; }
.brand-name { font-weight: 800; letter-spacing: -0.03em; font-size: 1.15rem; }
.brand-name span { color: var(--gold); }
.brand small {
  display: block;
  margin-top: -2px;
  color: var(--gold-2);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
}
.bar-actions, .hero-actions, .founder-actions { display: flex; gap: 10px; align-items: center; }
.subnav { display: flex; gap: 18px; padding: 0 0 12px; font-size: 0.92rem; }
.subnav a { color: var(--muted); text-decoration: none; }
.subnav a:hover { color: white; }

.btn-gold, .btn-glass, .text-btn, .gcard .play, .vote, .tool-row button, .dpad button, .pad button {
  border: 0;
  cursor: pointer;
  text-decoration: none;
  border-radius: 14px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-gold {
  background: linear-gradient(90deg, #f59e0b, #d97706);
  color: #1a1203;
  font-weight: 800;
  padding: 0 16px;
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.22);
}
.btn-gold:hover { filter: brightness(1.05); }
.btn-glass, .tool-row button, .vote {
  background: rgba(22, 25, 35, 0.8);
  color: var(--text);
  border: 1px solid var(--line-strong);
  padding: 0 14px;
  font-weight: 650;
}
.btn-glass:hover, .tool-row button:hover, .vote:hover { border-color: rgba(245, 158, 11, 0.45); }
.tool-row button.is-on, .vote[aria-pressed="true"] {
  background: var(--gold);
  color: #1a1203;
  border-color: transparent;
}
.tool-row button:disabled { opacity: 0.4; cursor: not-allowed; }

.hero { position: relative; padding: 72px 0 36px; text-align: center; overflow: hidden; }
.hero h1 {
  font-size: clamp(2.5rem, 7vw, 4.7rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  margin: 14px auto 16px;
  max-width: 16ch;
}
.gold-text {
  background: linear-gradient(135deg, #fde68a, #f59e0b 45%, #d97706);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede, .section-intro { color: var(--muted); font-size: 1.05rem; }
.lede { max-width: 42rem; margin: 0 auto 28px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.1);
  color: var(--gold-2);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero-actions, .founder-actions { justify-content: center; flex-wrap: wrap; }
.hero-actions .btn-gold, .hero-actions .btn-glass, .founder-actions .btn-gold { padding: 0 22px; min-height: 52px; }

.section { padding: 28px 0 10px; }
.section h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 10px 0;
}
.center { text-align: center; }
.center .section-intro { max-width: 40rem; margin: 0 auto 8px; }

.founder-panel {
  margin-top: 18px;
  padding: 28px 22px;
  border-radius: 28px;
  background:
    linear-gradient(160deg, rgba(245, 158, 11, 0.14), rgba(16, 18, 26, 0.9) 42%),
    var(--card);
  border: 1px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 0 40px -12px rgba(245, 158, 11, 0.55), var(--shadow);
  backdrop-filter: blur(16px);
}
.founder-head, .founder-actions { display: flex; justify-content: space-between; gap: 18px; align-items: center; }
.founder-head { align-items: flex-end; margin-bottom: 12px; }
.counter {
  min-width: 180px;
  text-align: right;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(7, 8, 13, 0.55);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.counter span, .stat-row span, .gcard-foot span { display: block; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.counter strong { font-size: 2rem; color: var(--gold-2); letter-spacing: -0.04em; }
.counter strong em { font-style: normal; color: #667085; font-size: 1rem; }
.meter {
  margin-top: 8px;
  height: 8px;
  border-radius: 99px;
  background: #1f2430;
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #f59e0b, #fde68a);
}
.honest { color: var(--muted); font-size: 0.82rem; margin-top: 6px; }
.perks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; padding: 0; list-style: none; }
.perks li {
  background: rgba(7, 8, 13, 0.45);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  font-size: 0.92rem;
}
.refund {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0;
  max-width: 46rem;
}
.founder-actions { border-top: 1px solid var(--line); padding-top: 16px; align-items: center; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 22px;
}
.gcard, .point, .modal-card, .game-shell {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}
.gcard { padding: 18px; display: flex; flex-direction: column; gap: 8px; min-height: 100%; }
.gcard:hover { border-color: rgba(245, 158, 11, 0.4); }
.gcard.is-soon { opacity: 0.92; }
.gcard-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.icon-bubble {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--gold-2);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.28);
}
.icon-bubble svg, .icon { width: 24px; height: 24px; }
.badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 5px 8px;
}
.badge-live { background: rgba(52, 211, 153, 0.15); color: var(--ok); }
.badge-soon { background: rgba(148, 163, 184, 0.12); color: #cbd5e1; }
.kicker { margin: 0; color: var(--gold); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.gcard h3, .point h3 { margin: 0; letter-spacing: -0.03em; }
.gcard p { margin: 0; color: var(--muted); font-size: 0.94rem; }
.seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: #0c0e15;
  border: 1px solid var(--line);
}
.seg button {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}
.seg button.is-on { background: var(--gold); color: #1a1203; }
.gcard-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px; }
.gcard .play {
  background: #1c2230;
  color: white;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0 14px;
}
.gcard .play:hover { background: var(--gold); color: #1a1203; }
.vote { width: 100%; }

.points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 18px 0 28px; }
.point { padding: 18px; }
.point p { color: var(--muted); margin: 8px 0 0; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--muted);
}
.footer-row { display: flex; justify-content: space-between; gap: 18px; align-items: center; flex-wrap: wrap; }
.site-footer a { color: var(--text); }
.site-footer nav { display: flex; gap: 16px; }
.legal { padding-bottom: 64px; }
.legal h1 { letter-spacing: -0.04em; }
.legal h2 { margin-top: 1.6rem; font-size: 1.25rem; }
.legal p, .legal li { color: #c6ccda; }
.placeholder { color: var(--gold-2); font-weight: 700; }

.play-view { padding: 18px 0 48px; }
.game-shell { padding: 16px; position: relative; }
.game-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.game-bar h1 { margin: 0; font-size: 1.35rem; letter-spacing: -0.03em; }
.eyebrow { margin: 0; color: var(--gold); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.text-btn {
  background: #151923;
  color: var(--text);
  border: 1px solid var(--line-strong);
  padding: 0 12px;
  font-weight: 700;
}
.stat-row, .diff-row, .tool-row { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); }
.stat-row > div {
  background: rgba(7, 8, 13, 0.45);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 10px;
}
.stat-row strong { font-size: 1.15rem; }
.diff-row { display: grid; grid-template-columns: repeat(3, 1fr); }
.diff-row .seg, .diff-row button.seg {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0c0e15;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}
.diff-row button.seg.is-on { background: var(--gold); color: #1a1203; border-color: transparent; }
.tool-note { color: var(--muted); font-size: 0.82rem; }
.help { color: var(--muted); font-size: 0.88rem; }
.stage { position: relative; margin-top: 14px; }

.sudo-grid {
  width: min(100%, 460px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  background: #0c0e16;
  border: 2px solid rgba(251, 191, 36, 0.4);
  border-radius: 14px;
  overflow: hidden;
}
.sudo-cell {
  aspect-ratio: 1;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  color: var(--gold-2);
  font-weight: 750;
  font-size: clamp(0.95rem, 4.2vw, 1.35rem);
  position: relative;
  padding: 0;
}
.sudo-cell.is-given { color: #f8fafc; font-weight: 800; }
.sudo-cell.is-peer { background: rgba(255, 255, 255, 0.03); }
.sudo-cell.is-same { background: rgba(245, 158, 11, 0.12); }
.sudo-cell.is-selected { background: rgba(245, 158, 11, 0.28); color: white; }
.sudo-cell.is-bad { color: var(--danger); background: rgba(251, 113, 133, 0.12); }
.sudo-cell.box-r { border-right: 2px solid rgba(251, 191, 36, 0.38); }
.sudo-cell.box-b { border-bottom: 2px solid rgba(251, 191, 36, 0.38); }
.notes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  height: 100%;
  font-size: 0.58rem;
  color: var(--muted);
  font-weight: 700;
}
.notes i { font-style: normal; display: grid; place-items: center; }
.pad {
  width: min(100%, 460px);
  margin: 12px auto 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.pad button {
  background: #151923;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 48px;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
}
.pad button:hover { border-color: var(--gold); }
.pad button[data-action] { font-size: 0.82rem; grid-column: span 1; }

.board-2048 {
  width: min(100%, 420px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border-radius: 18px;
  background: #12141c;
  border: 1px solid var(--line);
  touch-action: none;
}
.tile {
  aspect-ratio: 1;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: clamp(1.05rem, 5vw, 1.7rem);
  background: #0c0e16;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.tile.pop { animation: pop 0.16s ease-out; }
@keyframes pop { from { transform: scale(0.82); } to { transform: scale(1); } }
.dpad {
  width: min(100%, 420px);
  margin: 12px auto 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.dpad button {
  background: #151923;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 1.2rem;
  cursor: pointer;
}

.mine-scroll { overflow-x: auto; }
.mine-grid { width: max(100%, calc(var(--n) * 36px)); margin: 0 auto; display: grid; gap: 4px; }
.mine-cell {
  aspect-ratio: 1;
  border: 0;
  border-radius: 7px;
  background: linear-gradient(180deg, #32384a, #1c2333);
  color: #dbe4ff;
  font-weight: 800;
  font-size: clamp(0.75rem, 2.6vw, 1rem);
  padding: 0;
  cursor: pointer;
}
.mine-cell.is-open { background: #12141c; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04); }
.mine-cell.is-mine { background: #9f1239; color: white; }
.mine-cell.is-flag { color: var(--gold-2); }
.mine-cell.n1 { color: #60a5fa; }
.mine-cell.n2 { color: #34d399; }
.mine-cell.n3 { color: #fb7185; }
.mine-cell.n4 { color: #a78bfa; }
.mine-cell.n5 { color: #f43f5e; }
.mine-cell.n6 { color: #22d3ee; }
.mine-cell.n7 { color: #e5e7eb; }
.mine-cell.n8 { color: #a8a29e; }

.sol-stage { touch-action: manipulation; }
.sol-top, .sol-tableau {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  align-items: start;
}
.sol-top { margin-bottom: 12px; }
.sol-waste { grid-column: 2 / span 2; }
.sol-foundations { grid-column: 4 / span 4; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.slot, .card {
  width: 100%;
  aspect-ratio: 5 / 7;
  border-radius: 8px;
  position: relative;
}
.slot {
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: var(--gold-2);
  font-size: 1.2rem;
}
.card {
  border: 0;
  padding: 0;
  background: #f7f3ea;
  color: #1c1917;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  text-align: left;
  cursor: pointer;
}
.card.red { color: #e11d48; }
.card.back {
  background: repeating-linear-gradient(135deg, #312e81 0 6px, #4338ca 6px 12px);
  border: 2px solid #fbbf24;
  box-shadow: none;
  cursor: pointer;
}
.card .corner {
  position: absolute;
  top: 3px;
  left: 4px;
  display: flex;
  flex-direction: column;
  line-height: 1;
  font-size: clamp(0.62rem, 2vw, 0.85rem);
}
.card .corner i { font-style: normal; }
.card .pip {
  display: none;
  position: absolute;
  inset: 0;
  place-items: center;
  font-size: 1.4rem;
}
.card.selected { outline: 2px solid var(--gold-2); outline-offset: 1px; transform: translateY(-4px); z-index: 3; }
.slot.hint, .card.hint { box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.9); }
.sol-pile { display: flex; flex-direction: column; min-height: 4.5rem; }
.sol-pile .card + .card, .sol-pile .slot { position: relative; }
.sol-pile .card + .card { margin-top: calc(-140% + 18px); }
.sol-pile .card.back + .card { margin-top: calc(-140% + 10px); }
.waste-fan { display: flex; align-items: flex-start; min-height: 100%; }
.waste-fan .card, .waste-fan .slot { width: 62%; flex: 0 0 auto; }
.waste-fan .card + .card { margin-left: -28%; }
.drag-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 90;
  pointer-events: none;
  margin: 0 !important;
  width: 72px;
}

.result {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
  background: rgba(7, 8, 13, 0.72);
  backdrop-filter: blur(8px);
  border-radius: 18px;
}
.result h2 { margin: 6px 0; font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -0.04em; }
.result p { color: var(--muted); }

.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.72);
  display: grid;
  place-items: center;
  padding: 18px;
}
.modal-card { width: min(440px, 100%); padding: 22px; position: relative; }
.modal-card h2 { margin-top: 0; letter-spacing: -0.03em; }
.modal-card ol { color: var(--muted); padding-left: 18px; }
.modal-card .close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #151923;
  cursor: pointer;
}
.noscript {
  margin: 12px auto;
  width: min(var(--max), calc(100% - 32px));
  color: var(--gold-2);
}

@media (min-width: 800px) {
  .card .pip { display: grid; }
  .hide-sm { display: inline; }
}
@media (max-width: 799px) {
  .hide-sm { display: none; }
  .grid, .points, .perks { grid-template-columns: 1fr; }
  .founder-head, .founder-actions, .footer-row { flex-direction: column; align-items: stretch; }
  .counter { text-align: left; }
  .hero { padding-top: 42px; }
  .subnav { overflow: auto; }
  .tool-row { flex-wrap: wrap; }
}
@media (min-width: 800px) and (max-width: 1040px) {
  .grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
