:root {
  --paper: #f7f6f1;
  --paper-2: #f1efe8;
  --panel: #fffefa;
  --ink: #24231f;
  --muted: #77736a;
  --line: #e4e0d7;
  --line-strong: #d7d1c4;
  --accent: #d97757;
  --accent-deep: #b95f42;
  --danger: #a33a2c;
  --success: #416b52;
  --shadow: 0 10px 35px rgba(61, 52, 39, 0.08);
  --radius: 14px;
  --sidebar: 232px;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 72%, white);
  outline-offset: 2px;
}

::selection { background: rgba(217, 119, 87, 0.2); }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  background:
    radial-gradient(circle at 72% 18%, rgba(255,255,255,.78), transparent 28%),
    var(--paper);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  background: rgba(247, 246, 241, 0.92);
  backdrop-filter: blur(14px);
  z-index: 8;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 7px;
  margin-bottom: 8px;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 20px;
  letter-spacing: -0.025em;
}

.brand img { width: 18px; height: 18px; }

.nav-group { margin-top: 6px; }
.nav-label {
  margin: 14px 9px 7px;
  color: #99948b;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 10px;
  font-weight: 650;
}

.nav-item {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border-radius: 8px;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
}

.nav-item:hover { background: #efede6; }
.nav-item.active { background: #ebe8df; }
.nav-dot { width: 7px; height: 7px; border: 1px solid currentColor; border-radius: 50%; }
.nav-dot.fill { background: var(--accent); border-color: var(--accent); }

.sidebar-spacer { flex: 1; }
.user-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 8px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: #33312d; color: white;
  font-size: 10px; font-weight: 700;
}
.user-meta { min-width: 0; flex: 1; }
.user-name { font-weight: 600; }
.user-plan { color: var(--muted); margin-top: 1px; font-size: 10px; }

.main {
  min-width: 0;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.topbar {
  height: 58px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.58);
  color: var(--muted);
  font-size: 11px;
}

.pill.bad { color: var(--danger); border-color: rgba(163,58,44,.25); background: rgba(163,58,44,.04); }
.pill.good { color: var(--success); border-color: rgba(65,107,82,.24); }

.page {
  min-height: calc(100vh - 58px);
  padding: 30px 28px 70px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.center-stack { width: min(740px, 100%); margin: 5vh auto 0; }
.center-stack.narrow { width: min(560px, 100%); }
.center-stack.wide { width: min(920px, 100%); }

.eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 13px;
}
.eyebrow img { width: 16px; height: 16px; }

.hero-title {
  margin: 0;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1.04;
  font-size: clamp(38px, 5vw, 62px);
  text-align: center;
}
.hero-title.small { font-size: clamp(32px, 4.2vw, 48px); }
.hero-sub {
  max-width: 600px;
  margin: 15px auto 0;
  text-align: center;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.offer-card, .card, .composer {
  background: rgba(255,255,252,.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.offer-card {
  width: min(620px, 100%);
  margin: 32px auto 0;
  padding: 24px;
}
.offer-top { display:flex; align-items:flex-start; justify-content:space-between; gap: 18px; }
.offer-kicker { font-size: 12px; color: var(--accent-deep); font-weight: 700; }
.offer-title { margin-top: 5px; font-size: 22px; font-weight: 650; letter-spacing: -.03em; }
.price { text-align:right; }
.price strong { font-family: ui-serif, Georgia, serif; font-size: 38px; font-weight: 400; }
.price span { display:block; color: var(--muted); font-size: 11px; }
.feature-list { margin: 20px 0 22px; padding: 0; list-style: none; display:grid; gap: 10px; color:#59564f; font-size: 13px; }
.feature-list li::before { content: "✓"; color: var(--success); margin-right: 9px; }

.primary, .secondary, .ghost, .danger-btn {
  border-radius: 9px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
  font-weight: 620;
  font-size: 13px;
}
.primary { background: #282622; color: white; }
.primary:hover { background: #171613; transform: translateY(-1px); }
.primary.accent { background: var(--accent); }
.primary.accent:hover { background: var(--accent-deep); }
.secondary { background: var(--panel); border-color: var(--line-strong); }
.secondary:hover { background: #f4f2ec; }
.ghost { background: transparent; color: var(--muted); }
.ghost:hover { background: #efede7; color: var(--ink); }
.danger-btn { background: #fff8f6; border-color: rgba(163,58,44,.25); color: var(--danger); }
.full { width: 100%; }

.mini-note { margin-top: 13px; color: #928d83; font-size: 10.5px; line-height: 1.55; text-align: center; }

.stage-head { text-align:center; margin-bottom: 26px; }
.stage-step { color: var(--muted); font-size: 11px; margin-bottom: 9px; }
.stage-title { margin: 0; font-family: ui-serif, Georgia, serif; font-weight: 400; font-size: 34px; letter-spacing: -.035em; }
.stage-desc { color: var(--muted); line-height: 1.6; font-size: 13px; margin: 9px auto 0; max-width: 560px; }

.risk-card {
  margin: 0 auto 18px;
  padding: 14px 15px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.56);
}
.risk-top { display:flex; align-items:center; justify-content:space-between; font-size: 12px; }
.risk-num { font-weight: 700; font-variant-numeric: tabular-nums; }
.risk-track { height: 7px; margin-top: 10px; background: #ebe8e1; border-radius:999px; overflow:hidden; }
.risk-fill { height:100%; width: var(--risk, 50%); background: linear-gradient(90deg, #68856f, #d39a63 60%, #a84939); border-radius:inherit; transition: width .5s ease; }
.risk-caption { margin-top: 8px; color: var(--muted); font-size: 10.5px; }

.card { padding: 20px; }
.card + .card { margin-top: 13px; }
.card-title { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.card-sub { font-size: 11.5px; color: var(--muted); margin-bottom: 16px; line-height: 1.5; }

.form-grid { display:grid; gap: 13px; }
.field label { display:block; margin-bottom: 6px; font-size: 11px; color:#5f5c55; font-weight:600; }
.select-wrap { position:relative; }
select, .fake-input {
  width:100%;
  height: 42px;
  border:1px solid var(--line-strong);
  border-radius: 8px;
  background:#fff;
  padding:0 11px;
  color:var(--ink);
}

.scan-row {
  display:flex;
  align-items:center;
  gap: 13px;
  padding: 12px 0;
  border-bottom: 1px solid #ece9e2;
}
.scan-row:last-child { border-bottom:0; }
.scan-icon { width: 24px; height: 24px; border-radius: 50%; display:grid; place-items:center; border:1px solid var(--line-strong); font-size:10px; }
.scan-copy { flex:1; min-width:0; }
.scan-name { font-size:12px; font-weight:650; }
.scan-value { color:var(--muted); font-size:10.5px; margin-top:3px; }
.status { font-size:10px; font-weight:750; letter-spacing:.04em; }
.status.pass { color:var(--success); }
.status.fail { color:var(--danger); }
.status.warn { color:#9b6e2f; }

.toggle {
  width: 38px; height: 22px; border-radius:999px; border:0; background:#d9d5cc; padding:2px; cursor:pointer;
}
.toggle::after { content:""; display:block; width:18px; height:18px; border-radius:50%; background:white; box-shadow:0 1px 4px rgba(0,0,0,.12); transition:transform .18s ease; }
.toggle.on { background:#34322e; }
.toggle.on::after { transform: translateX(16px); }

.actions { display:flex; gap:9px; margin-top:18px; }
.actions > * { flex:1; }

.question {
  padding: 18px;
  border:1px solid var(--line);
  border-radius: 12px;
  background:rgba(255,255,255,.6);
}
.question + .question { margin-top: 12px; }
.question-title { font-family: ui-serif, Georgia, serif; font-size: 21px; line-height:1.35; }
.question-meta { color:var(--muted); font-size:10.5px; margin-top:6px; }
.option-grid { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin-top:15px; }
.option {
  min-height: 42px;
  border:1px solid var(--line-strong);
  background:var(--panel);
  border-radius:9px;
  padding:10px 12px;
  text-align:left;
  cursor:pointer;
}
.option:hover { background:#f1efe9; }

.logbox {
  margin-top: 14px;
  border:1px solid #d5d1c8;
  border-radius: 10px;
  background:#292824;
  color:#e9e5db;
  padding:14px;
  font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  min-height: 104px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.log-dim { color:#8f8a81; }
.log-warn { color:#e6ad75; }
.log-bad { color:#ef8f7b; }
.log-good { color:#8dc19c; }

.manual-shell { display:grid; grid-template-columns: minmax(0, 1fr) 270px; gap:15px; }
.chat-card { min-height: 440px; display:flex; flex-direction:column; }
.chat-head { padding-bottom:13px; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; align-items:center; }
.chat-title { font-weight:700; font-size:13px; }
.chat-status { font-size:10px; color:var(--success); }
.chat-thread { flex:1; padding:18px 0; display:flex; flex-direction:column; gap:12px; }
.bubble { max-width:78%; padding:10px 12px; border-radius:11px; font-size:12px; line-height:1.55; }
.bubble.reviewer { background:#eeece6; align-self:flex-start; }
.bubble.user { background:#2e2c28; color:white; align-self:flex-end; }
.reply-grid { display:grid; gap:8px; }
.metadata { font-size:11px; }
.meta-row { display:flex; justify-content:space-between; gap:10px; padding:9px 0; border-bottom:1px solid var(--line); }
.meta-row:last-child{ border-bottom:0; }
.meta-key { color:var(--muted); }
.meta-val { text-align:right; font-family:ui-monospace, monospace; }

.system-button {
  position: fixed;
  right: 18px;
  bottom: 16px;
  z-index: 30;
  border:1px solid #d8d3ca;
  background:rgba(255,255,252,.9);
  backdrop-filter: blur(12px);
  border-radius:999px;
  padding:8px 11px;
  font: 10px ui-monospace, monospace;
  letter-spacing:.08em;
  cursor:pointer;
  box-shadow: 0 7px 22px rgba(55,45,30,.08);
}
.system-button:hover { background:#fff; }
.system-button::before { content:"●"; color:#7c7a73; margin-right:7px; }
.system-button.hot::before { color:var(--danger); animation:blink .8s infinite; }

.console-backdrop {
  position:fixed; inset:0; z-index:50;
  background:rgba(30,28,24,.22);
  backdrop-filter:blur(3px);
  display:grid; place-items:center;
  padding:22px;
}
.console {
  width:min(780px, 100%);
  max-height:min(660px, 88vh);
  border:1px solid #46443e;
  border-radius:13px;
  overflow:hidden;
  background:#1f1f1c;
  color:#e9e5dc;
  box-shadow: 0 30px 80px rgba(0,0,0,.28);
}
.console-bar { height:38px; display:flex; align-items:center; gap:7px; padding:0 12px; border-bottom:1px solid #35342f; background:#272621; }
.console-dot { width:9px; height:9px; border-radius:50%; background:#5b5850; }
.console-title { margin-left:6px; font:11px ui-monospace, monospace; color:#a8a39a; }
.console-close { margin-left:auto; border:0; background:transparent; color:#aaa69d; cursor:pointer; }
.console-body { padding:16px; height:430px; overflow:auto; font:12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.console-line { white-space:pre-wrap; }
.console-input-row { display:flex; align-items:center; gap:7px; border-top:1px solid #35342f; padding:10px 14px; }
.console-prompt { color:#d08a68; font:12px ui-monospace, monospace; }
.console-input { flex:1; background:transparent; border:0; outline:0; color:#f1eee7; font:12px ui-monospace, monospace; }

.ending { min-height: calc(100vh - 58px); display:grid; place-items:center; padding:30px; }
.ending-card { width:min(660px,100%); text-align:center; }
.ending-code { font:11px ui-monospace, monospace; color:var(--muted); letter-spacing:.08em; margin-bottom:12px; }
.ending h1 { font-family:ui-serif, Georgia, serif; font-weight:400; font-size:clamp(44px,7vw,82px); letter-spacing:-.055em; margin:0; }
.ending p { color:var(--muted); line-height:1.75; max-width:540px; margin:18px auto 0; }
.ending .actions { max-width:420px; margin:28px auto 0; }

.toast {
  position:fixed; left:50%; bottom:24px; transform:translateX(-50%);
  z-index:80; padding:10px 14px; border-radius:9px;
  background:#2d2b27; color:white; font-size:11px;
  box-shadow:0 12px 32px rgba(0,0,0,.18);
  animation:toastIn .2s ease-out;
}

.screen-flash { position:fixed; inset:0; z-index:70; pointer-events:none; background:white; animation:flash .2s ease-out forwards; }

.glitch-1 .main::after,
.glitch-2 .main::after {
  content:"";
  position:absolute; inset:0; pointer-events:none;
  background:repeating-linear-gradient(to bottom, transparent 0 3px, rgba(40,30,20,.018) 4px);
  opacity:.6;
}
.glitch-2 { filter:saturate(.92); }
.glitch-2 .stage-title, .glitch-2 .hero-title { text-shadow: .5px 0 rgba(150,0,0,.18), -.5px 0 rgba(0,70,90,.13); }
.glitch-3 .sidebar { transform: translateX(-1px); }
.glitch-3 .main { animation: microJitter 8s steps(1) infinite; }

.glyph-drop *:not(input):not(select):not(button) { font-family: ui-monospace, monospace !important; }
.glyph-drop .stage-title::after { content:"  □□□□"; }

.redacted {
  display:inline-block;
  background:#262521;
  color:#262521;
  border-radius:2px;
  min-width:66px;
  user-select:none;
}

@keyframes toastIn { from { opacity:0; transform:translate(-50%, 6px); } to { opacity:1; transform:translate(-50%,0); } }
@keyframes flash { from { opacity:.75; } to { opacity:0; } }
@keyframes blink { 50% { opacity:.25; } }
@keyframes microJitter { 0%,94%,100%{transform:none} 95%{transform:translateX(.5px)} 96%{transform:translateX(-.5px)} 97%{transform:none} }

@media (max-width: 820px) {
  :root { --sidebar: 72px; }
  .brand span, .nav-item span, .nav-label, .user-meta { display:none; }
  .brand, .nav-item { justify-content:center; }
  .sidebar { padding-inline:8px; }
  .manual-shell { grid-template-columns:1fr; }
  .metadata-card { order:-1; }
}

@media (max-width: 560px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display:none; }
  .page { padding:20px 14px 64px; }
  .topbar { padding:0 14px; }
  .option-grid { grid-template-columns:1fr; }
  .offer-top { flex-direction:column; }
  .price { text-align:left; }
  .center-stack { margin-top:2vh; }
  .hero-title { font-size:42px; }
}

/* v1.1 — login, live browser signals, custom selects, leaderboard */
body { min-height: 100vh; }
button:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background:
    radial-gradient(circle at 68% 20%, rgba(255,255,255,.95), transparent 32%),
    linear-gradient(120deg, #f5f2e8 0%, #faf9f5 58%, #f3eee2 100%);
}
.login-header {
  height: 72px;
  padding: 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand.large { margin: 0; padding: 0; font-size: 23px; }
.brand.large img { width: 20px; height: 20px; }
.game-tag { font-size: 10px; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.login-grid {
  width: min(1120px, calc(100% - 48px));
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(330px, .7fr);
  gap: 40px;
  align-items: center;
  padding: 28px 0 60px;
}
.login-hero {
  min-height: 590px;
  border-radius: 26px;
  padding: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(circle at 85% 25%, rgba(220,113,72,.17), transparent 28%),
    radial-gradient(circle at 20% 80%, rgba(70,88,68,.09), transparent 24%),
    rgba(255,254,250,.72);
  border: 1px solid rgba(215,209,196,.8);
  box-shadow: 0 30px 80px rgba(59,49,36,.08);
}
.login-copy { max-width: 580px; }
.hero-title.left, .hero-sub.left { text-align: left; margin-left: 0; }
.hero-sub.left { max-width: 520px; }
.login-copy .eyebrow { justify-content: flex-start; }
.login-card {
  margin-top: 42px;
  width: min(430px, 100%);
  padding: 18px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.86);
  box-shadow: var(--shadow);
}
.login-card-title { font-family: ui-serif, Georgia, serif; font-size: 22px; margin-bottom: 18px; }
.field-label { display: block; font-size: 11px; color: var(--muted); font-weight: 650; margin-bottom: 7px; }
.login-card input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 0 13px;
  background: white;
  color: var(--ink);
  margin-bottom: 10px;
}
.login-card input:focus { outline: 2px solid rgba(217,119,87,.28); border-color: #bf9d8f; }
.privacy-note { color: #928d83; font-size: 10px; line-height: 1.6; margin-top: 12px; }
.leaderboard-preview {
  min-height: 520px;
  padding: 24px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255,255,252,.75);
  box-shadow: var(--shadow);
}
.leaderboard-head, .modal-head { display:flex; align-items:flex-start; justify-content:space-between; gap: 16px; }
.leaderboard-head h2, .modal-head h2 { margin: 3px 0 0; font-family: ui-serif, Georgia, serif; font-weight: 400; font-size: 29px; letter-spacing: -.03em; }
.tiny-label { font-size: 9px; letter-spacing: .13em; color: var(--accent-deep); font-weight: 800; }
.board-list { margin-top: 20px; }
.board-row {
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 57px;
  border-bottom: 1px solid #ebe7de;
}
.board-row:last-child { border-bottom: 0; }
.rank { font-family: ui-serif, Georgia, serif; font-size: 19px; color: #8e887d; }
.board-name { min-width: 0; font-size: 12px; font-weight: 680; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-name span { display: block; color: #99938a; font-size: 9px; margin-top: 4px; font-weight: 600; letter-spacing: .04em; }
.board-score { font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 750; }
.board-foot { color: #9a958c; font-size: 9.5px; line-height: 1.5; margin-top: 18px; }
.empty-board { padding: 44px 10px; text-align: center; color: var(--muted); font-size: 12px; }
.login-footer { text-align: center; padding: 22px; color: #a19b90; font-size: 9.5px; }

.button-pill { cursor: pointer; }
.button-pill:hover { background: white; color: var(--ink); }
.two-col { display: grid; grid-template-columns: minmax(0,.92fr) minmax(0,1.08fr); gap: 14px; align-items: start; }
.signal-grid { display: grid; gap: 9px; }
.signal {
  border: 1px solid #e9e5dc;
  background: rgba(248,247,242,.8);
  border-radius: 10px;
  padding: 12px;
}
.signal > span { display: block; color: var(--muted); font-size: 9.5px; text-transform: uppercase; letter-spacing: .07em; }
.signal > strong { display: block; font-size: 12px; margin-top: 4px; overflow-wrap:anywhere; }
.signal > small { display:block; color:#9a958b; font-size:9px; margin-top:4px; }

.custom-field { position: relative; }
.custom-select { position: relative; }
.select-trigger {
  width: 100%; height: 43px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: white;
  cursor: pointer;
  text-align: left;
  font-size: 12px;
}
.select-trigger:hover, .custom-select.open .select-trigger { border-color: #aca597; background: #fffefb; }
.chev { font-size: 17px; color: var(--muted); transform: translateY(-2px); }
.select-menu {
  position: absolute;
  z-index: 40;
  left: 0; right: 0;
  top: calc(100% + 6px);
  max-height: 252px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fffefa;
  box-shadow: 0 18px 50px rgba(45,38,29,.17);
}
.select-option {
  width: 100%; min-height: 36px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  border: 0; background: transparent; border-radius: 7px;
  padding: 7px 9px;
  cursor: pointer; text-align: left; font-size: 11.5px;
}
.select-option:hover { background: #f1eee7; }
.select-option.selected { background: #ebe8df; font-weight: 680; }
.subsection { margin-top: 17px; padding-top: 14px; border-top: 1px solid #ece9e2; }
.subsection-title { font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #6f6a61; margin-bottom: 4px; }
.subsection-title span { color: #aaa49a; font-weight: 600; margin-left: 6px; }
.relay-row {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0;
  border: 0; border-bottom: 1px solid #f0ede6; background: transparent;
  cursor: pointer; text-align: left;
}
.relay-row:last-child { border-bottom: 0; }
.relay-row strong { display:block; font-size: 11px; }
.relay-row small { display:block; font-size: 9px; color:#99938a; margin-top:3px; }
i.toggle { display:block; flex: 0 0 auto; }

.manual-banner {
  display:flex; align-items:center; gap:12px;
  padding: 14px 15px; margin-bottom: 13px;
  border:1px solid rgba(163,58,44,.20); border-radius: 11px;
  background: rgba(163,58,44,.035);
}
.manual-banner > span { width:9px; height:9px; border-radius:50%; background:var(--danger); box-shadow:0 0 0 6px rgba(163,58,44,.08); }
.manual-banner strong { display:block; font-size:12px; }
.manual-banner small { display:block; margin-top:3px; color:var(--danger); font-size:9.5px; }
.chat-card { padding: 18px; border:1px solid var(--line); border-radius:13px; background:rgba(255,255,252,.7); box-shadow:var(--shadow); }
.chat-log { max-height: 330px; overflow:auto; padding-right:4px; }
.reviewer, .you { margin-bottom: 13px; max-width: 86%; }
.you { margin-left:auto; }
.reviewer b, .you b { font-size:9px; color:#99938a; text-transform:uppercase; letter-spacing:.06em; }
.reviewer p, .you p { margin:5px 0 0; padding:10px 12px; border-radius:10px; font-size:11.5px; line-height:1.5; }
.reviewer p { background:#efede7; }
.you p { background:#2c2a26; color:white; }
.reply-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; padding-top:13px; border-top:1px solid #ece8e0; }

.admin-grid { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(300px,.75fr); gap:14px; }
.admin-table, .policy-card { border:1px solid var(--line); border-radius:12px; background:rgba(255,255,252,.7); overflow:hidden; box-shadow:var(--shadow); }
.admin-head, .admin-row { display:grid; grid-template-columns:1.3fr 1fr 1fr .65fr; gap:8px; align-items:center; padding:11px 13px; }
.admin-head { background:#efede7; color:#8b857b; font-size:9px; text-transform:uppercase; letter-spacing:.06em; font-weight:800; }
.admin-row { border-top:1px solid #ece8e0; font-size:10.5px; }
.admin-row strong { color:var(--danger); }
.admin-row.you-row { background:rgba(163,58,44,.05); }
.policy-card { padding:16px; }
.file-name { font-size:10px; color:#8d877c; margin-bottom:11px; font-weight:700; }
.policy-card pre { margin:0; white-space:pre-wrap; font: 10.5px/1.65 ui-monospace,SFMono-Regular,Menlo,monospace; color:#49463f; }
.policy-note { margin-top:14px; color:#9a948a; font-size:9.5px; }
.actions.centered { max-width: 460px; margin-left:auto; margin-right:auto; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display:grid; place-items:center; padding:24px;
  background: rgba(29,27,24,.22); backdrop-filter: blur(8px);
}
.modal-card {
  width: min(570px,100%); max-height: min(760px,85vh); overflow:auto;
  border:1px solid var(--line); border-radius:18px; background:#fffefa;
  box-shadow:0 35px 90px rgba(34,30,25,.25); padding:22px;
}
.icon-btn { width:32px; height:32px; border:1px solid var(--line); border-radius:8px; background:transparent; cursor:pointer; font-size:19px; }
.modal-board { margin-top:16px; }

.result-strip { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-top:24px; }
.result-strip > div { padding:11px; border:1px solid var(--line); border-radius:9px; background:rgba(255,255,255,.5); text-align:left; }
.result-strip span { display:block; color:#9b958b; font-size:8.5px; letter-spacing:.08em; }
.result-strip strong { display:block; margin-top:5px; font-size:12px; }

@media (max-width: 980px) {
  .login-grid { grid-template-columns:1fr; width:min(760px,calc(100% - 30px)); }
  .leaderboard-preview { min-height:0; }
  .login-hero { min-height:0; padding:42px; }
  .two-col, .admin-grid { grid-template-columns:1fr; }
}
@media (max-width: 700px) {
  .login-header { padding:0 18px; }
  .login-grid { width:calc(100% - 20px); padding-top:10px; gap:14px; }
  .login-hero { padding:28px 20px; border-radius:18px; }
  .game-tag { display:none; }
  .leaderboard-preview { border-radius:18px; }
  .result-strip { grid-template-columns:1fr 1fr; }
  .reply-grid, .option-grid { grid-template-columns:1fr; }
}

/* v1.2 — player-facing eligibility flow */
.center-stack.medium { width: min(760px, 100%); }
.verification-card {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0 auto 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,252,.72);
}
.verification-card .verification-icon {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  font-size: 12px;
}
.verification-card strong { display:block; font-size: 12.5px; }
.verification-card span { display:block; color: var(--muted); font-size: 11px; margin-top: 3px; line-height:1.45; }
.verification-card.accepted { border-color: rgba(80,118,88,.28); background: rgba(243,249,243,.78); }
.verification-card.accepted .verification-icon { color: var(--success); border-color: rgba(80,118,88,.32); }
.verification-card.needs-review { border-color: rgba(154,111,51,.28); background: rgba(251,247,237,.82); }

.account-card { padding: 24px; }
.form-grid.two-fields { grid-template-columns: repeat(2, minmax(0,1fr)); column-gap: 14px; row-gap: 15px; }
.quiet-status {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  margin-top:18px;
  padding:12px 2px 2px;
  border-top:1px solid var(--line);
  font-size:11px;
  color:var(--muted);
}
.quiet-status strong { color: var(--ink); font-weight: 620; }

.permission-line {
  display:flex;
  align-items:center;
  gap:8px;
  margin: 2px 0 18px;
  padding: 10px 11px;
  background: #f5f3ed;
  border-radius: 9px;
  color:#6c685f;
  font-size:11px;
}
.permission-dot { width:7px; height:7px; border-radius:50%; background:#c3b28f; box-shadow:0 0 0 3px rgba(195,178,143,.13); }
.permission-dot.ok { background:#6d8b72; box-shadow:0 0 0 3px rgba(109,139,114,.13); }
.permission-dot.muted { background:#aaa59b; box-shadow:none; }

.confirm-row {
  width:100%;
  display:flex;
  align-items:center;
  gap:13px;
  padding:14px 4px;
  border:0;
  border-bottom:1px solid #ece9e2;
  background:transparent;
  text-align:left;
  cursor:pointer;
  color:var(--ink);
}
.confirm-row:last-of-type { border-bottom:0; }
.confirm-row:hover { background:rgba(244,242,236,.65); }
.confirm-row > span:last-child { font-size:10.5px; color:var(--muted); }
.confirm-row.done > span:last-child { color:var(--success); }
.confirm-row.done .scan-icon { color:var(--success); border-color:rgba(80,118,88,.28); }
.inline-error { margin-top:10px; color:#8c6330; font-size:10.5px; text-align:center; }

@media (max-width: 680px) {
  .form-grid.two-fields { grid-template-columns: 1fr; }
}

/* v1.3 — branching endings, live locale switching, richer device choices */
.device-choice-card { padding: 8px 20px 20px; }
.device-choice-row {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(260px,1.25fr);
  gap:18px;
  align-items:center;
  padding:16px 2px;
  border-bottom:1px solid #ece9e2;
}
.device-choice-row:last-of-type { border-bottom:0; }
.mini-choice { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
.mini-choice button {
  min-height:36px;
  border:1px solid var(--line-strong);
  border-radius:8px;
  background:#fffefa;
  color:var(--ink);
  padding:7px 8px;
  font-size:10px;
  line-height:1.25;
  cursor:pointer;
}
.mini-choice button:hover { background:#f2f0ea; }
.mini-choice button.selected { background:#2c2a26; color:white; border-color:#2c2a26; }
.inline-hint { margin-top:10px; text-align:center; color:#8f877c; font-size:10.5px; }
.review-complete {
  margin-top:14px;
  padding:13px 14px;
  border:1px solid rgba(80,118,88,.22);
  border-radius:10px;
  background:rgba(243,249,243,.72);
}
.review-complete strong { display:block; font-size:12px; }
.review-complete span { display:block; margin-top:4px; color:var(--muted); font-size:10.5px; line-height:1.45; }
.internal-actions { max-width:760px !important; flex-wrap:wrap; }
.internal-actions > * { min-width:120px; }
.console-panel {
  width:min(780px,100%);
  max-height:min(660px,88vh);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid #46443e;
  border-radius:13px;
  background:#1f1f1c;
  color:#e9e5dc;
  box-shadow:0 30px 80px rgba(0,0,0,.28);
}
.console-panel header {
  min-height:40px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:0 13px;
  border-bottom:1px solid #35342f;
  background:#272621;
  font:11px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  color:#aaa69d;
}
.console-panel header button { border:0; background:transparent; color:#aaa69d; font-size:20px; cursor:pointer; }
.console-panel #console-form {
  display:flex;
  align-items:center;
  gap:8px;
  border-top:1px solid #35342f;
  padding:10px 14px;
  font:12px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}
.console-panel #console-form input {
  flex:1;
  border:0;
  outline:0;
  background:transparent;
  color:#f1eee7;
  font:12px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}
.ending-welcome .ending-code, .ending-appeal .ending-code, .ending-audit .ending-code { letter-spacing:.13em; }

@media (max-width: 760px) {
  .device-choice-row { grid-template-columns:1fr; gap:10px; }
  .mini-choice { grid-template-columns:1fr; }
  .internal-actions { display:grid; grid-template-columns:1fr 1fr; }
  .internal-actions > * { min-width:0; }
}
@media (max-width: 480px) {
  .internal-actions { grid-template-columns:1fr; }
}

/* v1.4 — bilingual game disclaimer shown before any permission prompt */
body.disclaimer-open { overflow: hidden; }
.disclaimer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(247,246,241,.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.disclaimer-card {
  width: min(760px, 100%);
  max-height: min(860px, calc(100vh - 44px));
  overflow: auto;
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #fffefa;
  box-shadow: 0 28px 80px rgba(38,34,29,.16);
}
.disclaimer-mark {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #8a847a;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .11em;
}
.disclaimer-mark img { width: 20px; height: 20px; }
.disclaimer-card h1 {
  margin: 16px 0 22px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -.025em;
}
.disclaimer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.disclaimer-copy {
  padding: 16px 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #faf9f5;
  color: #5f5b53;
  font-size: 12px;
  line-height: 1.72;
}
.disclaimer-copy p { margin: 0 0 11px; }
.disclaimer-copy p:last-child { margin-bottom: 0; }
.disclaimer-copy strong { color: var(--ink); font-weight: 650; }
.disclaimer-lang {
  margin-bottom: 10px;
  color: #8c867d;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.disclaimer-accept { min-height: 46px; }
@media (max-width: 680px) {
  .disclaimer-backdrop { padding: 12px; align-items: end; }
  .disclaimer-card { max-height: calc(100vh - 24px); padding: 22px 18px 18px; border-radius: 18px 18px 12px 12px; }
  .disclaimer-card h1 { margin-bottom: 16px; }
  .disclaimer-grid { grid-template-columns: 1fr; gap: 9px; }
  .disclaimer-copy { padding: 13px 14px; font-size: 11.5px; }
}
