/* ── Design Tokens ──────────────────────────────────────────── */
:root {
  --ink: #0a0a0a;
  --paper: #f4f1ea;
  --bw: 3px;
  --green: #27c93f;
  --amber: #ffb627;
  --blue: #3672ff;
  --red: #e63a2e;
  --font-display: 'Archivo Black', system-ui, sans-serif;
  --font-mono: 'DM Mono', 'Space Mono', monospace;
  --font-pixel: 'VT323', monospace;
  --nav-h: 64px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--paper); color: var(--ink); font-family: var(--font-mono); font-size: 13px; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font-mono); }
ul { list-style: none; }

/* ── Typography ─────────────────────────────────────────────── */
.vt323 { font-family: var(--font-pixel); }
.dm-mono-sm { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; opacity: 0.6; }
.dm-mono-xs { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; }

/* ── Utility ────────────────────────────────────────────────── */
.hidden { display: none !important; }
.opacity-60 { opacity: 0.6; }

/* ── Glitch / Hover-flood ───────────────────────────────────── */
.glitch {
  background-image: none;
  -webkit-text-fill-color: currentColor;
  transition: -webkit-text-fill-color .14s linear, color .14s linear, background-image .14s linear;
}

.frame { position: relative; }
.frame::after {
  content: '';
  position: fixed; inset: 0;
  background: rgba(6,5,4,0.82);
  z-index: 30; opacity: 0; pointer-events: none;
  transition: opacity .14s linear;
}
.frame:has(.flood:hover)::after { opacity: 1; }

.flood {
  position: relative;
  transition: color .14s linear, border-color .14s linear, background-color .14s linear;
}
.flood:hover {
  z-index: 40;
  color: var(--accent, #27c93f) !important;
  border-color: var(--accent, #27c93f) !important;
  outline: var(--bw) solid var(--accent, #27c93f);
  outline-offset: calc(var(--bw) * -1);
}

/* Make subdued text bold on hover for dark-overlay readability */
.flood:hover .card-pitch,
.flood:hover .card-code,
.flood:hover .card-type,
.flood:hover .tag,
.flood:hover .dm-mono-xs {
  font-weight: 700;
  opacity: 1;
}

/* Card buttons go white on hover */
.flood:hover .card-cta {
  color: #fff !important;
  border-color: #fff !important;
  background-color: transparent !important;
}
.flood:hover .card-cta:disabled { opacity: 0.4; }

/* ── Nav Chrome ─────────────────────────────────────────────── */
.os-chrome {
  position: sticky; top: 0; z-index: 100;
  width: 100%; height: var(--nav-h);
  background: var(--paper);
  border-bottom: var(--bw) solid var(--ink);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
}
.chrome-left { display: flex; align-items: center; gap: 8px; }
.chrome-dot { width: 10px; height: 10px; background: var(--green); flex-shrink: 0; }
.chrome-quote { font-family: var(--font-pixel); font-size: 28px; line-height: 1; opacity: 0.35; margin-right: -4px; }
.chrome-wordmark { font-family: var(--font-display); font-size: 22px; letter-spacing: -0.02em; }
.chrome-version { font-family: var(--font-pixel); font-size: 16px; opacity: 0.4; }
.chrome-right { display: flex; align-items: center; gap: 20px; }
.chrome-nav { display: flex; gap: 20px; }
.chrome-nav a { font-size: 11px; letter-spacing: 0.1em; font-weight: 500; opacity: 0.65; transition: opacity .1s; }
.chrome-nav a:hover { opacity: 1; }
.nav-dots { opacity: 0.25; letter-spacing: -2px; }
.chrome-lang { font-size: 11px; letter-spacing: 0.1em; opacity: 0.4; }
.chrome-signin {
  font-size: 11px; letter-spacing: 0.1em; font-weight: 600;
  border: 2px solid var(--ink); background: transparent; color: var(--ink);
  padding: 6px 14px;
  transition: background .1s, color .1s;
}
.chrome-signin:hover { background: var(--ink); color: var(--paper); }

/* ── Page Layout ────────────────────────────────────────────── */
.page-outer { padding: 20px 20px 0; }
.page-inner { border: var(--bw) solid var(--ink); }

/* ── Hero ───────────────────────────────────────────────────── */
.os-hero {
  padding: 40px 36px 28px;
  border-bottom: var(--bw) solid var(--ink);
}
.hero-meta-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(80px, 13vw, 200px);
  line-height: 0.87;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
}
.hero-sub-row {
  display: flex; gap: 32px; align-items: flex-start;
  flex-wrap: wrap;
}
.hero-body {
  flex: 1; min-width: 260px;
  font-size: 14px; line-height: 1.55; letter-spacing: 0.01em; opacity: 0.72;
  max-width: 560px;
}
.hero-ctas {
  display: flex; flex-direction: column; gap: 8px;
  flex-shrink: 0;
}
.btn-primary {
  font-size: 12px; font-weight: 600; letter-spacing: 0.1em;
  padding: 12px 24px;
  background: var(--ink); color: var(--paper);
  border: var(--bw) solid var(--ink);
  transition: opacity .1s;
}
.btn-primary:hover { opacity: 0.82; }
.btn-secondary {
  font-size: 12px; font-weight: 600; letter-spacing: 0.1em;
  padding: 12px 24px;
  background: transparent; color: var(--ink);
  border: var(--bw) solid var(--ink);
  transition: background .1s, color .1s;
}
.btn-secondary:hover { background: var(--ink); color: var(--paper); }

.create-room-wrap { position: relative; }

.game-picker {
  position: absolute;
  top: calc(100% + 6px); left: 0;
  background: var(--paper);
  border: var(--bw) solid var(--ink);
  min-width: 200px;
  z-index: 200;
  display: flex; flex-direction: column;
}
.picker-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em;
  background: transparent; color: var(--ink);
  border: none; border-bottom: 1px solid rgba(10,10,10,0.1);
  text-align: left; cursor: pointer;
  transition: background .1s;
}
.picker-item:last-child { border-bottom: none; }
.picker-item:not(:disabled):hover { background: var(--ink); color: var(--paper); }
.picker-item:not(:disabled):hover .picker-dot { outline: 2px solid var(--paper); }
.picker-item:disabled { opacity: 0.35; cursor: not-allowed; }
.picker-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.picker-soon { margin-left: auto; font-size: 9px; opacity: 0.6; }

/* ── Game Stack ─────────────────────────────────────────────── */
.stack-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 14px;
  border-bottom: var(--bw) solid var(--ink);
  font-size: 10px; letter-spacing: 0.08em; opacity: 0.5;
}
.stack-header-right { display: flex; gap: 16px; }

.game-card { border-bottom: var(--bw) solid var(--ink); }
.game-card:last-child { border-bottom: none; }

.card-inner { display: flex; min-height: 340px; }
.card-left {
  flex: 0 0 56%; min-width: 0;
  padding: 22px 28px 20px;
  border-right: var(--bw) solid var(--ink);
  display: flex; flex-direction: column;
}
.card-meta-top {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 8px;
}
.card-code { font-size: 13px; opacity: 0.35; }
.card-type { font-size: 10px; letter-spacing: 0.1em; opacity: 0.55; }
.card-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 64px);
  line-height: 0.88;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.card-pitch { font-size: 12px; line-height: 1.5; opacity: 0.65; margin-bottom: 8px; }
.card-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.card-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tag {
  font-size: 9px; letter-spacing: 0.1em; font-weight: 600;
  border: 1.5px solid currentColor; padding: 2px 7px; opacity: 0.45;
}
.card-actions { display: flex; gap: 8px; margin-top: 14px; }
.card-cta {
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em;
  padding: 8px 18px;
  border: 2px solid var(--ink); background: transparent; color: var(--ink);
  transition: background .1s, color .1s, opacity .1s;
}
.btn-host { background: var(--ink); color: var(--paper); }
.btn-host:hover:not(:disabled) { opacity: 0.82; }
.btn-host:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-edit:hover { background: var(--ink); color: var(--paper); }

.card-preview { flex: 0 0 44%; display: flex; flex-direction: column; overflow: hidden; }
.preview-header {
  display: flex; justify-content: space-between; padding: 6px 10px;
  border-bottom: var(--bw) solid var(--ink);
  font-size: 9px; letter-spacing: 0.1em; opacity: 0.45;
  flex-shrink: 0;
}
.preview-body { flex: 1; overflow: hidden; font-family: var(--font-mono); }

/* Villa preview */
.preview-villa { height: 100%; }
.villa-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 5px; padding: 10px; height: 100%;
}
.villa-player {
  border: 2px solid var(--ink); padding: 8px 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-weight: 700; font-size: 10px; letter-spacing: 0.04em; line-height: 1;
}
.villa-player.eliminated { opacity: 0.28; text-decoration: line-through; }
.villa-player.highlighted { background: var(--red); color: #fff; }
.villa-player.highlighted .player-icon { background: #fff; }
.player-icon { width: 12px; height: 12px; background: var(--ink); }

/* Generic preview */
.preview-generic { padding: 12px; display: flex; flex-direction: column; gap: 7px; height: 100%; }
.preview-round { font-size: 9px; letter-spacing: 0.08em; opacity: 0.45; }
.preview-prompt { font-weight: 700; font-size: 13px; line-height: 1.25; }
.preview-votes { display: flex; gap: 6px; margin-top: auto; }
.vote-bar {
  flex: 1; border: 2px solid var(--ink); padding: 5px 7px;
  font-weight: 700; font-size: 10px; text-align: center;
}
.vote-bar-accent { background: var(--accent, #ffb627); border-color: var(--accent, #ffb627); }
.preview-answers { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.answer-row {
  border: 2px solid var(--ink); padding: 4px 7px;
  display: flex; justify-content: space-between; gap: 6px;
  font-size: 10px; font-weight: 600;
}
.answer-top { background: var(--accent, #3672ff); color: #fff; border-color: var(--accent, #3672ff); }

/* Word chain */
.word-chain { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 12px; }
.word-chip {
  border: 2px solid var(--ink); padding: 3px 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
}
.word-chip-accent { background: var(--accent, #27c93f); border-color: var(--accent, #27c93f); }
.chain-footer {
  display: flex; justify-content: space-between;
  padding: 6px 12px 10px;
  font-size: 10px; font-weight: 700;
  border-top: 1px solid rgba(10,10,10,0.12);
  margin-top: auto;
}

/* Draw grid */
.preview-draw-grid {
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  height: 100%;
}
.draw-cell {
  border: 1.5px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; text-align: center; line-height: 1.1;
  padding: 4px;
}
.draw-sketch { padding: 0; }
.draw-cell-accent { background: var(--accent, #ffb627); }

/* ── Section shared ─────────────────────────────────────────── */
.section-box { max-width: 1100px; margin: 0 auto; }
.section-header {
  font-size: 10px; letter-spacing: 0.1em; opacity: 0.45;
  padding-bottom: 18px; margin-bottom: 24px;
  border-bottom: 1px solid rgba(10,10,10,0.12);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px;
}

/* ── How It Works ───────────────────────────────────────────── */
.os-hiw {
  padding: 48px 24px;
  border-top: var(--bw) solid var(--ink);
}
.hiw-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.hiw-step {
  padding-right: 28px; margin-right: 28px;
  border-right: 1px solid rgba(10,10,10,0.12);
}
.hiw-step-last { border-right: none; padding-right: 0; margin-right: 0; }
.step-num { font-family: var(--font-pixel); font-size: 48px; line-height: 1; opacity: 0.2; margin-bottom: 6px; }
.step-title { font-family: var(--font-display); font-size: clamp(18px, 2.5vw, 36px); line-height: 1; letter-spacing: -0.02em; margin-bottom: 10px; }
.step-body { font-size: 12px; line-height: 1.65; opacity: 0.62; }

/* ── Pricing ────────────────────────────────────────────────── */
.os-pricing {
  padding: 48px 24px;
  border-top: var(--bw) solid var(--ink);
  background: var(--ink); color: var(--paper);
}
.os-pricing .section-header { color: var(--paper); border-color: rgba(244,241,234,0.12); }
.pricing-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: var(--bw) solid var(--paper);
}
.pricing-tier {
  padding: 24px;
  border-right: var(--bw) solid var(--paper);
}
.pricing-tier:last-child { border-right: none; }
.tier-highlight {
  outline: var(--bw) solid var(--tier-accent, #ffb627);
  outline-offset: calc(var(--bw) * -1);
  background: rgba(255,255,255,0.03);
}
.tier-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.tier-header .dm-mono-xs { opacity: 0.4; color: var(--paper); }
.tier-recommended {
  font-size: 9px; letter-spacing: 0.1em;
  border: 1.5px solid var(--tier-accent, #ffb627);
  color: var(--tier-accent, #ffb627); padding: 2px 7px;
}
.tier-name { font-family: var(--font-display); font-size: 36px; line-height: 1; margin-bottom: 8px; }
.tier-price { font-family: var(--font-display); font-size: 52px; line-height: 1; margin-bottom: 20px; }
.tier-cap { font-size: 16px; opacity: 0.45; }
.tier-perks { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.tier-perks li {
  font-size: 11px; letter-spacing: 0.06em;
  display: flex; align-items: center; gap: 8px; opacity: 0.75;
}
.perk-dot { width: 5px; height: 5px; background: currentColor; flex-shrink: 0; }
.tier-btn {
  width: 100%; padding: 10px;
  background: transparent; color: var(--paper);
  border: 2px solid rgba(244,241,234,0.35);
  font-size: 11px; letter-spacing: 0.1em; font-weight: 600;
  transition: border-color .1s;
}
.tier-btn:hover { border-color: var(--paper); }
.tier-btn-primary {
  background: var(--tier-accent, #ffb627); color: var(--ink);
  border-color: var(--tier-accent, #ffb627);
}
.tier-btn-primary:hover { opacity: 0.9; }

/* ── FAQ ────────────────────────────────────────────────────── */
.os-faq {
  padding: 48px 24px;
  border-top: var(--bw) solid var(--ink);
}
.faq-row {
  display: grid; grid-template-columns: 48px 1fr 1fr;
  gap: 16px; align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid rgba(10,10,10,0.1);
}
.faq-row-last { border-bottom: none; }
.faq-num { font-family: var(--font-pixel); font-size: 22px; opacity: 0.22; }
.faq-q { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; }
.faq-a { font-size: 12px; line-height: 1.65; opacity: 0.62; }

/* ── Footer ─────────────────────────────────────────────────── */
.os-footer {
  border-top: var(--bw) solid var(--ink);
  padding: 48px 24px 32px;
}
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px; margin-bottom: 40px;
}
.footer-headline {
  font-family: var(--font-display);
  font-size: clamp(48px, 6vw, 80px);
  line-height: 0.88; letter-spacing: -0.02em; margin-bottom: 14px;
}
.footer-body { font-size: 12px; line-height: 1.65; opacity: 0.58; margin-bottom: 18px; }
.email-form { display: flex; border: var(--bw) solid var(--ink); }
.email-input {
  flex: 1; padding: 10px 12px;
  background: transparent; border: none; outline: none;
  font-family: var(--font-mono); font-size: 12px; color: var(--ink);
}
.email-input::placeholder { opacity: 0.38; }
.email-send {
  padding: 10px 14px; background: var(--ink); color: var(--paper);
  border: none; font-size: 12px; font-weight: 600; letter-spacing: 0.08em;
  transition: opacity .1s;
}
.email-send:hover { opacity: 0.82; }
.footer-col-header {
  font-size: 10px; letter-spacing: 0.12em; font-weight: 600; opacity: 0.32;
  margin-bottom: 10px;
}
.footer-link-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-link-col ul li {
  font-size: 11px; letter-spacing: 0.06em; opacity: 0.48;
  cursor: pointer; transition: opacity .1s;
}
.footer-link-col ul li:hover { opacity: 1; }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding-top: 20px; border-top: 1px solid rgba(10,10,10,0.1);
  font-size: 10px; letter-spacing: 0.06em; opacity: 0.32;
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(10,10,10,0.88);
}
.modal-content {
  position: relative; z-index: 1;
  background: var(--paper);
  border: var(--bw) solid var(--ink);
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px;
  border-bottom: var(--bw) solid var(--ink);
}
.modal-title { font-family: var(--font-pixel); font-size: 20px; letter-spacing: 0.04em; }
.modal-close {
  background: none; border: none; font-size: 15px;
  color: var(--ink); opacity: 0.45; padding: 0;
  transition: opacity .1s;
}
.modal-close:hover { opacity: 1; }
.modal-body { padding: 20px 18px; }

.progress-container { margin-bottom: 14px; }
.progress-track { height: 5px; background: rgba(10,10,10,0.1); overflow: hidden; }
.progress-fill { height: 100%; background: var(--ink); transition: width .3s ease; width: 0%; }
.progress-pct { font-family: var(--font-pixel); font-size: 20px; text-align: right; margin-top: 4px; opacity: 0.45; }
.deploy-msg { font-size: 12px; opacity: 0.58; margin-top: 8px; }

.deploy-ready-headline { font-family: var(--font-pixel); font-size: 26px; letter-spacing: 0.04em; color: var(--green); margin-bottom: 14px; }
.url-row { display: flex; border: var(--bw) solid var(--ink); }
.url-input {
  flex: 1; padding: 8px 10px;
  background: transparent; border: none; outline: none;
  font-family: var(--font-mono); font-size: 11px; color: var(--ink);
}
.btn-copy {
  padding: 8px 14px; background: var(--ink); color: var(--paper);
  border: none; font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  transition: opacity .1s;
}
.btn-copy:hover { opacity: 0.82; }

.deploy-error-headline { font-family: var(--font-pixel); font-size: 22px; letter-spacing: 0.04em; color: var(--red); margin-bottom: 10px; }
.deploy-error p { font-size: 12px; opacity: 0.65; margin-bottom: 12px; }

#admin-url-section { margin-top: 16px; }
.admin-warning {
  border: var(--bw) solid var(--amber); padding: 14px;
}
.admin-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  color: var(--amber); margin-bottom: 10px;
}
.admin-row { display: flex; border: 2px solid var(--ink); margin-bottom: 8px; }
.admin-input {
  flex: 1; padding: 6px 8px;
  background: transparent; border: none; outline: none;
  font-family: var(--font-mono); font-size: 11px; color: var(--ink);
}
.btn-copy-admin {
  padding: 6px 12px; background: var(--ink); color: var(--paper);
  border: none; font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  cursor: pointer;
}
.btn-copy-admin:hover { opacity: 0.82; }
.admin-note { font-size: 10px; opacity: 0.48; margin-bottom: 10px; }
.btn-edit-game {
  display: inline-block;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  padding: 8px 14px; background: var(--ink); color: var(--paper);
  border: none; cursor: pointer;
}
.btn-edit-game:hover { opacity: 0.82; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 960px) {
  .hiw-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .hiw-step { border-right: none; margin-right: 0; padding-right: 0; }
  .hiw-step:nth-child(odd) { border-right: 1px solid rgba(10,10,10,0.12); padding-right: 28px; margin-right: 28px; }
  .faq-row { grid-template-columns: 40px 1fr; }
  .faq-a { grid-column: 2; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-cta-col { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .pricing-grid { grid-template-columns: 1fr; }
  .pricing-tier { border-right: none; border-bottom: var(--bw) solid var(--paper); }
  .pricing-tier:last-child { border-bottom: none; }
}

@media (max-width: 640px) {
  .chrome-nav { display: none; }
  .chrome-lang { display: none; }
  .page-outer { padding: 12px 12px 0; }
  .os-hero { padding: 20px 16px 18px; }
  .hero-headline { font-size: clamp(52px, 16vw, 120px); }
  .card-inner { flex-direction: column; }
  .card-left { flex: none; border-right: none; border-bottom: var(--bw) solid var(--ink); }
  .card-preview { flex: none; min-height: 160px; }
  .stack-header { display: none; }
  .hiw-grid { grid-template-columns: 1fr; }
  .hiw-step:nth-child(odd) { border-right: none; padding-right: 0; margin-right: 0; }
  .hiw-step { border-bottom: 1px solid rgba(10,10,10,0.12); padding-bottom: 20px; margin-bottom: 20px; }
  .hiw-step-last { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
  .faq-row { grid-template-columns: 1fr; gap: 4px; }
  .faq-num { display: none; }
  .faq-a { grid-column: auto; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-cta-col { grid-column: auto; }
  .os-hiw, .os-pricing, .os-faq, .os-footer { padding: 32px 16px; }
}
