/* Rizz AI — seaside dusk. Sea-glass, deep tide, dusk coral, sand, lamp gold, night ink. */
:root {
  --glass: #7FC8B8;
  --glass-2: #A9DDD1;
  --tide: #12343B;
  --tide-2: #1A4650;
  --coral: #F08A7E;
  --coral-2: #F6A79D;
  --sand: #F3E3C3;
  --gold: #F6C26B;
  --ink: #0E1A24;
  --ink-2: #132433;
  --ink-3: #1A2F40;

  --bg: var(--ink);
  --surface: rgba(18, 52, 59, .55);
  --surface-solid: #142C37;
  --line: rgba(127, 200, 184, .18);
  --line-2: rgba(127, 200, 184, .34);
  --text: #EDE4D3;
  --text-dim: #A4B7B5;
  --text-faint: #6F8789;
  --good: var(--glass);
  --bad: var(--coral);

  --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Space Mono', ui-monospace, Menlo, monospace;

  --r: 18px;
  --r-sm: 11px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, .6);
  --gut: clamp(16px, 4vw, 40px);
  --maxw: 1240px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font-family: var(--body); font-size: 16px; line-height: 1.55; color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(240, 138, 126, .16), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(127, 200, 184, .12), transparent 60%),
    linear-gradient(180deg, #102330 0%, var(--ink) 40%, #0B151D 100%);
  background-color: var(--ink);
  overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--sand); color: var(--ink); padding: 8px 12px; border-radius: 8px; z-index: 99; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.dim { color: var(--text-dim); }
.lbl { display: block; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); }
.link { color: var(--glass); text-decoration: none; border-bottom: 1px solid rgba(127, 200, 184, .35); }
.link:hover { color: var(--glass-2); }
code { font-family: var(--mono); font-size: .9em; background: rgba(127, 200, 184, .1); padding: 1px 5px; border-radius: 5px; }

/* ---------------------------------------------------------------- header */
.top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px;
  padding: 12px var(--gut); background: rgba(14, 26, 36, .78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.lamp { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(246, 194, 107, .15), 0 0 18px 4px rgba(246, 194, 107, .55); animation: lamp 3.2s ease-in-out infinite; }
@keyframes lamp { 50% { box-shadow: 0 0 0 5px rgba(246, 194, 107, .1), 0 0 26px 8px rgba(246, 194, 107, .35); } }
.wordmark { font-family: var(--display); font-weight: 800; font-size: 25px; letter-spacing: -.03em; color: var(--sand); }
.wordmark em { font-style: italic; font-weight: 400; color: var(--coral); margin-left: 1px; }
.nav { display: flex; gap: 2px; margin-left: 8px; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 999px; color: var(--text-dim); font-weight: 600; font-size: 14.5px; }
.nav a:hover { color: var(--text); background: rgba(127, 200, 184, .08); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--glass); }
.who { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.mode-chip { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; padding: 5px 9px; border-radius: 999px; color: var(--ink); background: var(--gold); }
.pass-chip { text-decoration: none; font-family: var(--mono); font-size: 13px; font-weight: 700; padding: 7px 11px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--glass); }
.pass-chip:hover { background: rgba(127, 200, 184, .1); }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; text-decoration: none; font-weight: 700; padding: 10px 18px; border-radius: 999px; font-size: 15px; transition: transform .12s, background .2s, box-shadow .2s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, var(--coral-2), var(--coral)); color: #2A0F0C; box-shadow: 0 8px 24px -10px rgba(240, 138, 126, .8), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn-primary:hover { box-shadow: 0 10px 30px -8px rgba(240, 138, 126, .9), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn-ghost { background: rgba(127, 200, 184, .08); color: var(--sand); border: 1px solid var(--line-2); }
.btn-ghost:hover { background: rgba(127, 200, 184, .16); }
.btn-lg { padding: 14px 24px; font-size: 16px; }
.btn-connect { background: var(--sand); color: var(--ink); }
.btn-connect.on { background: rgba(127, 200, 184, .14); color: var(--glass); border: 1px solid var(--line-2); font-family: var(--mono); font-size: 13px; }

/* ---------------------------------------------------------------- tape + ticker */
.tape { background: repeating-linear-gradient(-45deg, var(--gold) 0 14px, #E9B157 14px 28px); color: var(--ink); font-weight: 700; font-size: 13px; text-align: center; padding: 6px var(--gut); }
.ticker { display: flex; gap: 12px; align-items: center; padding: 8px var(--gut); background: rgba(18, 52, 59, .7); border-bottom: 1px solid var(--line); font-size: 14px; }
.ticker-tag { font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--coral); white-space: nowrap; }
.ticker-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { max-width: var(--maxw); margin: 0 auto; padding: 22px var(--gut) 60px; outline: none; }

/* ---------------------------------------------------------------- shared */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; gap: 12px; }
.panel h2 { font-family: var(--display); font-weight: 600; font-size: 21px; margin: 0; color: var(--sand); }
.kicker { display: block; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--glass); margin: 0 0 10px; }
.live-dot { display: inline-block; vertical-align: middle; margin: -2px 8px 0 0; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 0 rgba(240, 138, 126, .7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(240, 138, 126, 0); } 100% { box-shadow: 0 0 0 0 rgba(240, 138, 126, 0); } }
.headline { font-family: var(--display); font-weight: 800; font-size: clamp(38px, 6vw, 68px); line-height: 1.02; letter-spacing: -.035em; margin: 0 0 14px; color: var(--sand); font-variation-settings: 'opsz' 144; }
.headline em { font-style: italic; font-weight: 400; color: var(--coral); }
.headline-sm { font-size: clamp(32px, 4.4vw, 48px); }
.lede { color: var(--text-dim); font-size: 17px; max-width: 60ch; margin: 0 0 18px; }
.fine { font-size: 13px; color: var(--text-faint); margin: 10px 0 0; }
.stage-pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(127, 200, 184, .15); color: var(--glass); border: 1px solid var(--line-2); }
.bar { display: block; height: 5px; border-radius: 5px; background: rgba(127, 200, 184, .12); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--glass), var(--coral)); border-radius: inherit; }

/* ---------------------------------------------------------------- stage (her + scene) */
.stage { position: relative; overflow: hidden; border-radius: 26px; border: 1px solid var(--line); background: linear-gradient(180deg, #2B5763 0%, #F08A7E 55%, #12343B 100%); isolation: isolate; box-shadow: var(--shadow); }
.scene-slot { position: absolute; inset: 0; z-index: 0; }
.scene-slot > svg, .scene-slot > img, .scene-slot > canvas, .scene-slot > div { width: 100%; height: 100%; display: block; object-fit: cover; }
.scene-slot svg { width: 100%; height: 100%; }
.haze { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(14, 26, 36, 0) 45%, rgba(14, 26, 36, .78) 100%); }
.rig-slot { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; top: 4%; display: flex; justify-content: center; align-items: flex-end; }
.rig-slot > svg, .rig-slot > div, .rig-slot > canvas { height: 100%; width: auto; max-width: 100%; display: block; }
.rig-fallback { width: 62%; height: 92%; }
.burst-layer { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.burst-layer > div, .dlg-icon > .burst-box { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.burst-layer svg { width: min(55%, 300px); height: auto; overflow: visible; }
.dlg-icon > .burst-box svg { width: 130%; height: auto; overflow: visible; }
.fb-burst i { position: absolute; width: 14px; height: 14px; border-radius: 3px; transform: rotate(45deg); animation: fbb 1.4s ease-out forwards; }
@keyframes fbb { from { opacity: 1; transform: translate(0, 0) rotate(45deg) scale(1); } to { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(225deg) scale(.4); } }

/* ---------------------------------------------------------------- landing */
.home { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.home-stage { grid-row: span 2; aspect-ratio: 4 / 5; min-height: 520px; }
.vn { position: absolute; z-index: 3; left: 16px; right: 16px; bottom: 16px; padding: 14px 16px 16px; border-radius: 16px; background: rgba(14, 26, 36, .82); border: 1px solid var(--line-2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.vn-name { display: flex; align-items: baseline; gap: 6px; font-family: var(--display); font-weight: 800; color: var(--coral); font-size: 18px; }
.vn-name span { color: var(--sand); font-weight: 400; font-style: italic; }
.vn-name .vn-clock { margin-left: auto; font-family: var(--mono); font-style: normal; font-size: 12px; color: var(--glass); }
.vn-line { margin: 4px 0 0; min-height: 3.1em; color: var(--text); }
.home-copy { padding-top: 10px; }
.pot-card { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin: 6px 0 20px; }
.pot-cell { background: var(--ink-2); padding: 14px 16px; }
.pot-cell .big { display: block; font-size: clamp(20px, 2.4vw, 28px); color: var(--gold); margin-top: 2px; }
.pot-clock .clock { display: block; font-size: clamp(16px, 1.8vw, 21px); color: var(--glass); margin-top: 6px; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; }
.home-board { align-self: stretch; }
.board { list-style: none; margin: 0; padding: 0; }
.board li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.board li:first-child { border-top: 0; }
.board .rk { font-family: var(--mono); color: var(--text-faint); font-size: 13px; }
.board li:nth-child(1) .rk { color: var(--gold); }
.board .who-cell { min-width: 0; }
.board .tok { font-family: var(--mono); font-weight: 700; color: var(--sand); }
.board .own { font-family: var(--mono); font-size: 12px; color: var(--text-faint); margin-left: 6px; }
.board .stg { font-size: 12px; color: var(--text-dim); }
.board .bar { margin-top: 4px; }
.board .pct { font-family: var(--mono); font-size: 13px; color: var(--glass); }
.board li.me { background: rgba(240, 138, 126, .08); border-radius: 10px; }
.board .empty { grid-column: 1 / -1; color: var(--text-dim); }
.home-steps { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { padding: 20px; border-radius: var(--r); border: 1px solid var(--line); background: linear-gradient(160deg, rgba(127, 200, 184, .07), rgba(240, 138, 126, .04)); }
.step-n { font-family: var(--mono); color: var(--coral); font-size: 13px; }
.step h3 { font-family: var(--display); font-size: 22px; margin: 6px 0; color: var(--sand); }
.step p { margin: 0; color: var(--text-dim); font-size: 15px; }

/* ---------------------------------------------------------------- mint */
.mint-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 30px; align-items: start; }
.mint-card { display: grid; gap: 12px; }
.mint-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.mint-row .big { font-size: 28px; color: var(--gold); }
.mint-progress { height: 10px; border-radius: 10px; background: rgba(127, 200, 184, .12); overflow: hidden; }
.mint-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--glass), var(--gold)); transition: width .6s; }
.mint-off { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; background: rgba(246, 194, 107, .1); border: 1px dashed rgba(246, 194, 107, .5); color: var(--gold); }
.mint-off span { color: var(--text-dim); font-size: 14px; }
.mint-wall { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; transform: rotate(-2deg); }
.mint-wall .tile { aspect-ratio: 1; border-radius: 14px; overflow: hidden; position: relative; border: 1px solid var(--line-2); background: var(--tide); }
.mint-wall .tile:nth-child(odd) { transform: translateY(14px); }
.tile > img, .tile > svg, .tile .tile-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .tile-id { position: absolute; left: 6px; bottom: 6px; z-index: 2; font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 6px; background: rgba(14, 26, 36, .75); color: var(--sand); }

/* ---------------------------------------------------------------- pass picker */
.pass-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 16px; }
.pass-card { display: grid; text-align: left; padding: 0; overflow: hidden; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-solid); cursor: pointer; transition: transform .15s, border-color .15s; }
.pass-card:hover { transform: translateY(-2px); border-color: var(--glass); }
.pass-card.on { border-color: var(--coral); box-shadow: 0 0 0 2px rgba(240, 138, 126, .4); }
.pass-art { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--tide); }
.pass-art > img, .pass-art > .pa-scene, .pass-art > .pa-rig { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pa-scene svg, .pa-rig svg { width: 100%; height: 100%; }
.pa-rig { display: flex; justify-content: center; align-items: flex-end; }
.pa-rig > svg { height: 100%; width: auto; }
.pass-meta { padding: 12px 14px 14px; display: grid; gap: 6px; }
.pass-meta b { font-family: var(--mono); font-size: 18px; color: var(--sand); }
.pass-traits { display: flex; flex-wrap: wrap; gap: 4px; }
.pass-traits span { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: rgba(127, 200, 184, .1); color: var(--text-dim); }
.pass-empty { grid-column: 1 / -1; text-align: center; padding: 40px 20px; }

/* ---------------------------------------------------------------- chat */
.chat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 22px; align-items: start; }
.chat-stage { position: sticky; top: 84px; height: calc(100vh - 120px); min-height: 520px; max-height: 860px; }
.plate { position: absolute; z-index: 3; left: 14px; bottom: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 14px; background: rgba(14, 26, 36, .82); border: 1px solid var(--line-2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); max-width: calc(100% - 28px); }
.plate-name { font-family: var(--display); font-weight: 800; color: var(--coral); font-size: 18px; }
.plate-stage { font-size: 12px; font-weight: 700; color: var(--glass); }
.plate-clock { font-family: var(--mono); font-size: 12px; color: var(--gold); }
.plate-mood { font-size: 12px; color: var(--text-dim); }
.chat-panel { display: grid; gap: 12px; min-width: 0; }
.status { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; padding: 14px 16px; }
.aff-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.aff-num b { font-size: 22px; color: var(--sand); }
.meter { position: relative; height: 12px; border-radius: 12px; margin: 8px 0 6px; background: rgba(127, 200, 184, .12); overflow: hidden; }
.meter-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--glass), var(--gold) 60%, var(--coral)); border-radius: inherit; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.meter-ticks i { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(14, 26, 36, .7); }
.next { margin: 0; font-size: 13.5px; color: var(--text-dim); }
.next b { color: var(--sand); }
.energy { text-align: right; display: grid; gap: 2px; }
.energy b { font-size: 22px; color: var(--glass); }
.energy-next { font-size: 12px; }
.hint { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; }
.hint .lbl { color: var(--gold); }
.hint p { margin: 0; font-size: 14px; color: var(--text); }
.hint-next { background: none; border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 10px; cursor: pointer; font-size: 12px; color: var(--text-dim); }
.quest-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.quest-strip::-webkit-scrollbar { display: none; }
.qchip { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(18, 52, 59, .6); text-decoration: none; font-size: 13px; cursor: pointer; }
.qchip .ico { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; flex: none; background: rgba(127, 200, 184, .15); display: grid; place-items: center; }
.qchip .ico svg { width: 100%; height: 100%; }
.qchip.choice { border-color: var(--gold); color: var(--gold); }
.log { list-style: none; margin: 0; padding: 14px; display: flex; flex-direction: column; gap: 10px; height: min(52vh, 520px); overflow-y: auto; border-radius: var(--r); border: 1px solid var(--line); background: rgba(11, 21, 29, .65); scroll-behavior: smooth; }
.msg { max-width: 84%; padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.5; word-wrap: break-word; }
.msg.her { align-self: flex-start; background: var(--tide-2); border: 1px solid var(--line-2); border-bottom-left-radius: 5px; }
.msg.me { align-self: flex-end; background: linear-gradient(180deg, #F6A79D, #F08A7E); color: #2A0F0C; border-bottom-right-radius: 5px; }
.msg.sys { align-self: center; font-size: 13px; color: var(--text-dim); background: none; border: 1px dashed var(--line-2); }
.msg.recap { border-color: var(--gold); background: linear-gradient(160deg, rgba(246, 194, 107, .14), var(--tide-2)); }
.msg.quest { border-color: var(--glass); background: linear-gradient(160deg, rgba(127, 200, 184, .16), var(--tide-2)); }
.msg .meta { display: flex; gap: 8px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--text-dim); }
.delta { font-family: var(--mono); font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.delta.up { color: var(--ink); background: var(--glass); }
.delta.down { color: #2A0F0C; background: var(--coral); }
.delta.zero { color: var(--text-dim); background: rgba(127, 200, 184, .1); }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; border-radius: 16px; background: var(--tide-2); }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--glass); animation: dot 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 30% { transform: translateY(-4px); opacity: 1; } 0%, 60%, 100% { opacity: .4; transform: none; } }
.suggest { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.suggest .lbl { width: 100%; }
.chip { border: 1px dashed var(--glass); background: rgba(127, 200, 184, .08); color: var(--sand); border-radius: 12px; padding: 8px 12px; cursor: pointer; text-align: left; font-size: 14px; }
.gate { display: grid; gap: 10px; justify-items: start; }
.gate p { margin: 0; }
.composer { position: relative; display: flex; gap: 10px; align-items: flex-end; padding: 8px; border-radius: 22px; border: 1px solid var(--line-2); background: var(--ink-2); }
.composer textarea { flex: 1; min-width: 0; resize: none; border: 0; background: none; color: var(--text); font: inherit; padding: 8px 10px 18px; outline: none; max-height: 160px; }
.composer .count { position: absolute; left: 18px; bottom: 6px; font-size: 11px; font-family: var(--mono); }
.away-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r); border: 1px solid rgba(246, 194, 107, .45); background: rgba(246, 194, 107, .08); }
.away-banner b { color: var(--gold); }
.away-time { display: flex; gap: 10px; align-items: center; }

/* ---------------------------------------------------------------- shop */
.shop-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.balance { min-width: 230px; display: grid; gap: 4px; }
.balance .big { font-size: 26px; color: var(--gold); }
.tabs { display: flex; gap: 6px; margin: 4px 0 16px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs [role="tab"] { flex: none; border: 1px solid var(--line-2); background: transparent; border-radius: 999px; padding: 8px 16px; cursor: pointer; font-weight: 600; color: var(--text-dim); }
.tabs [role="tab"][aria-selected="true"] { background: var(--sand); color: var(--ink); border-color: var(--sand); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--surface-solid); transition: transform .15s, border-color .15s; }
.card:hover { transform: translateY(-2px); border-color: var(--line-2); }
.card.locked { opacity: .62; }
.card-art { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: radial-gradient(circle at 50% 40%, rgba(127, 200, 184, .22), transparent 70%), var(--tide); display: grid; place-items: center; }
.card-art.icon-art > * { width: 46%; height: auto; max-height: 82%; }
.card-art.scene-art > svg, .card-art.scene-art > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-art svg { display: block; }
.card-art.outfit-art { aspect-ratio: 4 / 5; place-items: end center; }
.card-art.outfit-art > svg { height: 100%; width: auto; }
.tagline { position: absolute; left: 10px; top: 10px; z-index: 2; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: rgba(14, 26, 36, .8); color: var(--sand); }
.tagline.key { left: auto; right: 10px; background: var(--gold); color: var(--ink); }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { margin: 0; font-family: var(--display); font-size: 19px; font-weight: 600; color: var(--sand); line-height: 1.2; }
.card-body p { margin: 0; color: var(--text-dim); font-size: 14px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 2px 0 0; }
.facts div { display: flex; gap: 5px; font-size: 12.5px; }
.facts dt { color: var(--text-faint); }
.facts dd { margin: 0; color: var(--sand); font-family: var(--mono); }
.card-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 8px; }
.price { font-family: var(--mono); font-weight: 700; font-size: 17px; color: var(--gold); }
.price small { font-size: 11px; color: var(--text-dim); }
.why { font-size: 12.5px; color: var(--coral-2); text-align: right; }

/* ---------------------------------------------------------------- away */
.away-card { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 26px; align-items: center; padding: 18px; }
.scene-wrap { position: relative; aspect-ratio: 4 / 3; border-radius: 20px; overflow: hidden; background: var(--tide); }
.scene-wrap > svg, .scene-wrap > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scene-wrap svg { width: 100%; height: 100%; }
.away-count { margin: 6px 0 8px; }
.away-count .clock { font-size: clamp(34px, 5vw, 52px); color: var(--gold); }
.away-bar { height: 6px; border-radius: 6px; background: rgba(127, 200, 184, .12); overflow: hidden; margin-bottom: 8px; }
.away-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--glass), var(--gold)); }

/* ---------------------------------------------------------------- quests */
.rank-summary { display: flex; gap: 22px; flex-wrap: wrap; }
.rank-summary b { font-size: 20px; color: var(--sand); }
.arcs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.arc { padding: 18px; min-width: 0; }
.arc-head { display: flex; gap: 14px; align-items: flex-start; }
.arc-ico { width: 46px; height: 46px; flex: none; border-radius: 14px; overflow: hidden; background: rgba(127, 200, 184, .14); display: grid; place-items: center; }
.arc-ico svg { width: 100%; height: 100%; }
.arc-head h3 { margin: 0; font-family: var(--display); font-size: 22px; color: var(--sand); }
.arc-head p { margin: 2px 0 0; color: var(--text-dim); font-size: 14.5px; }
.arc-state { margin-left: auto; flex: none; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; background: rgba(127, 200, 184, .14); color: var(--glass); }
.arc-state.locked { background: rgba(111, 135, 137, .16); color: var(--text-faint); }
.arc-state.completed { background: rgba(246, 194, 107, .16); color: var(--gold); }
.arc.locked { opacity: .72; }
.map { display: flex; gap: 0; align-items: stretch; margin-top: 16px; overflow-x: auto; padding: 6px 2px 8px; scrollbar-width: thin; }
.node { position: relative; flex: 1 0 150px; display: grid; gap: 6px; align-content: start; padding-right: 22px; }
.node::before { content: ''; position: absolute; left: 22px; right: 0; top: 13px; height: 2px; background: var(--line-2); }
.node:last-child::before { display: none; }
.node.done::before { background: var(--glass); }
.dot { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 12px; font-weight: 700; border: 2px solid var(--line-2); background: var(--ink-2); color: var(--text-faint); }
.node.done .dot { background: var(--glass); border-color: var(--glass); color: var(--ink); }
.node.current .dot { background: var(--coral); border-color: var(--coral); color: var(--ink); box-shadow: 0 0 0 6px rgba(240, 138, 126, .2); }
.node-title { font-weight: 700; font-size: 14px; color: var(--sand); }
.node.locked .node-title { color: var(--text-faint); letter-spacing: .2em; }
.node-step { font-size: 13px; color: var(--text-dim); }
.forks { display: grid; gap: 4px; }
.fork { font-size: 12px; padding: 3px 8px; border-radius: 8px; border: 1px dashed var(--line-2); color: var(--text-faint); }
.fork.chosen { border-style: solid; border-color: var(--glass); color: var(--glass); background: rgba(127, 200, 184, .08); }
.fork.closed { text-decoration: line-through; opacity: .6; }
.node .btn { justify-self: start; padding: 6px 12px; font-size: 13px; }
.countdown { font-family: var(--mono); font-size: 12px; color: var(--gold); }
.qlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 14px; }
.qcard { display: grid; grid-template-columns: 42px 1fr; gap: 12px; padding: 14px; align-items: start; }
.qcard h3 { margin: 0; font-size: 16px; color: var(--sand); }
.qcard p { margin: 2px 0 0; font-size: 13.5px; color: var(--text-dim); }
.qcard .arc-ico { width: 42px; height: 42px; }
.qcard.completed { opacity: .7; }
.qcard.completed h3::after { content: ' · done'; color: var(--gold); font-size: 12px; }
.qcard.unknown h3 { letter-spacing: .3em; color: var(--text-faint); }
.qprog { margin-top: 8px; }
.memories { margin-top: 18px; }
.memories li { color: var(--text-dim); font-style: italic; }

/* ---------------------------------------------------------------- ranking */
.rank-table { width: 100%; border-collapse: collapse; }
.rank-table th { text-align: left; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
.rank-table td { padding: 10px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.rank-table td:first-child { font-family: var(--mono); color: var(--text-faint); width: 44px; }
.rank-table tr:nth-child(-n+3) td:first-child { color: var(--gold); }
.rank-table tr.me { background: rgba(240, 138, 126, .08); }
.rank-table .tok { font-family: var(--mono); font-weight: 700; color: var(--sand); }
.rank-table .own { font-family: var(--mono); font-size: 12px; color: var(--text-faint); margin-left: 8px; }
.w-bar { width: 38%; }
.barcell { display: flex; gap: 10px; align-items: center; font-family: var(--mono); font-size: 13px; }
.barcell .bar { flex: 1; height: 7px; }
.rank-table tr.flash { animation: flash 1.2s; }
@keyframes flash { from { background: rgba(127, 200, 184, .25); } }

/* ---------------------------------------------------------------- how */
.how-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.how-grid ul { margin: 10px 0 0; padding-left: 18px; color: var(--text-dim); }
.how-grid li { margin: 6px 0; }
.how-grid li b { color: var(--sand); }
.split { display: flex; height: 40px; border-radius: 12px; overflow: hidden; margin: 12px 0 4px; font-size: 13px; font-weight: 700; }
.split span { display: grid; place-items: center; }
.split-pot { background: var(--glass); color: var(--ink); }
.split-burn { background: var(--coral); color: var(--ink); }
.warn { border-color: rgba(240, 138, 126, .45); }
.warn h2 { color: var(--coral); }

/* ---------------------------------------------------------------- dialogs + toasts */
.dlg { border: 0; padding: 0; background: transparent; color: var(--text); max-width: min(520px, calc(100vw - 24px)); width: 100%; }
.dlg::backdrop { background: rgba(6, 12, 18, .72); backdrop-filter: blur(4px); }
.dlg-inner { background: var(--surface-solid); border: 1px solid var(--line-2); border-radius: 22px; padding: 20px; display: grid; gap: 12px; box-shadow: var(--shadow); }
.dlg-head { display: flex; gap: 14px; align-items: center; }
.dlg-head h2 { margin: 0; font-family: var(--display); font-size: 24px; color: var(--sand); line-height: 1.15; }
.dlg-head .kicker { margin: 0 0 2px; }
.dlg-icon { width: 64px; height: 64px; flex: none; border-radius: 16px; overflow: hidden; background: var(--tide); display: grid; place-items: center; position: relative; }
.dlg-icon > svg, .dlg-icon > img { width: 100%; height: 100%; object-fit: cover; }
.dlg-x { margin-left: auto; align-self: flex-start; background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--text-dim); }
.dlg-desc { margin: 0; color: var(--text-dim); }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; color: var(--text-dim); }
.steps li.doing { color: var(--gold); }
.steps li.done { color: var(--glass); }
.steps li.done::marker { content: '✓  '; }
.steps li.fail { color: var(--coral); }
.steps a { color: inherit; }
.dlg-result { padding: 12px 14px; border-radius: 14px; background: rgba(127, 200, 184, .1); border: 1px solid var(--line-2); }
.dlg-result p { margin: 0 0 4px; }
.dlg-err { margin: 0; color: var(--coral); font-size: 14px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; }
.choice-prompt { font-family: var(--display); font-style: italic; font-size: 19px; color: var(--sand); }
.choice-opts { display: grid; gap: 8px; }
.choice-opts button { text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(127, 200, 184, .06); cursor: pointer; font-weight: 600; }
.choice-opts button:hover { border-color: var(--coral); background: rgba(240, 138, 126, .08); }
.toasts { position: fixed; z-index: 60; right: 16px; bottom: 16px; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 14px; animation: tin .3s ease-out; }
.toast.quest { border-color: var(--glass); }
.toast.quest::before { content: ''; flex: none; width: 10px; height: 10px; margin-top: 5px; border-radius: 3px; transform: rotate(45deg); background: var(--glass); }
.toast.bad { border-color: var(--coral); }
.toast b { color: var(--sand); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* ---------------------------------------------------------------- footer + tabbar */
.foot { max-width: var(--maxw); margin: 0 auto; padding: 26px var(--gut) 40px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-top: 1px solid var(--line); font-size: 13px; }
.foot-brand { display: grid; gap: 4px; max-width: 46ch; }
.foot-brand .wordmark { font-size: 20px; }
.foot-links { display: flex; gap: 16px; flex-wrap: wrap; }
.foot-links a { color: var(--text-dim); text-decoration: none; }
.foot-links a:hover { color: var(--glass); }
.tabbar { display: none; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1060px) {
  .nav a { padding: 8px 9px; font-size: 14px; }
}
@media (max-width: 960px) {
  .nav { display: none; }
  .home, .chat, .mint-grid, .away-card { grid-template-columns: minmax(0, 1fr); }
  .home-stage { grid-row: auto; aspect-ratio: auto; height: 62vh; min-height: 420px; max-height: 640px; }
  .home-steps { grid-template-columns: minmax(0, 1fr); }
  .how-grid { grid-template-columns: minmax(0, 1fr); }
  .chat-stage { position: relative; top: 0; height: 46vh; min-height: 300px; max-height: 460px; }
  .log { height: 46vh; }
  .mint-wall { grid-template-columns: repeat(4, 1fr); transform: none; }
  .mint-wall .tile:nth-child(odd) { transform: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: rgba(14, 26, 36, .94); border-top: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  .tabbar a { display: grid; justify-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; text-decoration: none; color: var(--text-dim); padding: 4px 0; }
  .tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a[aria-current="page"] { color: var(--coral); }
  body { padding-bottom: 72px; }
  .toasts { bottom: 84px; }
}
@media (max-width: 560px) {
  .top { gap: 8px; padding: 10px 16px; }
  .wordmark { font-size: 22px; }
  main { padding: 14px 16px 40px; }
  .pot-card { grid-template-columns: 1fr 1fr; }
  .pot-clock { grid-column: 1 / -1; }
  .headline { font-size: 40px; }
  .headline-sm { font-size: 32px; }
  .lede { font-size: 15.5px; }
  .status { grid-template-columns: 1fr; gap: 6px; }
  .energy { text-align: left; grid-template-columns: auto auto 1fr; align-items: baseline; gap: 8px; }
  .msg { max-width: 92%; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .balance { min-width: 0; width: 100%; }
  .rank-table th:nth-child(3), .rank-table td:nth-child(3) { display: none; }
  .rank-table .own { display: block; margin: 0; }
  .vn { left: 10px; right: 10px; bottom: 10px; }
  .btn-lg { flex: 1; }
  .node { flex-basis: 132px; }
  .mode-chip { display: none; }
  .btn-connect { padding: 8px 12px; font-size: 14px; }
  .hint { grid-template-columns: 1fr auto; }
  .hint .lbl { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

#main:focus, #main:focus-visible { outline: none; }
