/* Palette and fonts: the Coblyn brand (art/brand/README.md). */
:root {
  --bg: #0f1114;
  --surface: #1c2025;
  --surface-2: #262b31;
  --line: #3a4148;
  --line-strong: #6b7580;
  --text: #ede7db;
  --text-2: #9c978c;
  --accent: #f2a23a;
  --blue: #86a9d6;
  --red: #ef5b57;
  --green: #6fbf8e;
  --font-head: 'Barlow Condensed', system-ui, sans-serif;
  --font-body: 'Barlow', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; background: var(--bg); color: var(--text); }
body { font-family: var(--font-body); font-size: 14px; overflow: hidden; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

#app {
  height: 100dvh; display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "hud hud" "stage side";
  gap: 10px; padding: max(10px, env(safe-area-inset-top)) 14px max(10px, env(safe-area-inset-bottom));
}

.hud { grid-area: hud; display: grid; grid-template-columns: auto auto minmax(220px, 1fr) auto auto; align-items: center; gap: 20px; }
.hud-net { display: none; font-family: var(--font-mono); font-size: 11px; line-height: 1.6; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hud-net b { color: var(--text); font-weight: 500; }
@media (min-width: 1760px) {
  .hud { grid-template-columns: auto auto minmax(320px, 600px) minmax(0, 1fr) auto auto; }
  .hud-net { display: block; text-align: right; } /* fills its column and clips; never spills over Collect */
}
.hud-stats { display: flex; gap: 22px; align-items: center; padding-left: 20px; border-left: 1px solid var(--line); }
.how-to { margin: 0; display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); }
.how-to:hover { color: var(--text); border-color: var(--accent); }
.how-q { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #16191d; font-weight: 700; font-size: 12px; }
.brand h1 { display: flex; align-items: center; gap: 6px; }
.brand-mark { width: 30px; height: 30px; flex: none; margin-left: -3px; }
.kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; color: var(--accent); text-transform: uppercase; }
h1 { font-family: var(--font-head); font-weight: 700; font-size: 28px; line-height: 1; }
.label { font-size: 11px; color: var(--text-2); display: block; }
.stat { min-width: 0; white-space: nowrap; }
.num { font-family: var(--font-mono); font-weight: 600; font-size: 24px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.num.sm { font-size: 18px; }
.unit { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); margin-left: 3px; }
.mono { font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-2); }
.claim { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 12px; row-gap: 5px; align-items: center; min-width: 0; }
@media (max-width: 1100px) and (min-width: 761px) { .hud { gap: 12px; } .hud-stats { gap: 14px; padding-left: 12px; } .num { font-size: 20px; } .num.sm { font-size: 16px; } .how-txt { display: none; } .how-to { width: 38px; padding: 0; justify-content: center; } }
.claim-top { display: flex; justify-content: space-between; gap: 8px; }
.bar { height: 7px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
#watchFill { height: 100%; width: 100%; background: var(--green); transition: width 300ms linear; }
#watchFill.low { background: var(--accent); }
#watchFill.out { background: var(--red); }
#claim { grid-column: 2; grid-row: 1 / span 2; }
.wallet-pill { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; min-height: 36px; padding: 0 10px 0 12px; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; justify-self: end; }
.wallet-pill:hover, .wallet-pill[aria-expanded="true"] { border-color: var(--accent); }
.wallet-pill .caret { color: var(--text-2); font-size: 10px; }
.wallet-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-2); flex: none; }
.wallet-pill.on { border-color: var(--green); }
.wallet-pill.on .dot { background: var(--green); box-shadow: 0 0 6px var(--green); }
.wallet-pill.connect .dot, .wallet-pill.get .dot { background: var(--accent); }

.primary { background: var(--accent); color: #16191d; border: 0; border-radius: 4px; min-height: 44px; padding: 0 16px; font-weight: 700; }
.primary:disabled { opacity: 0.4; cursor: default; }
.ghost { background: transparent; border: 1px solid var(--line-strong); border-radius: 4px; min-height: 40px; padding: 0 12px; font-weight: 600; }
.ghost:disabled { opacity: 0.4; cursor: default; }
.small { min-height: 36px; padding: 0 10px; font-size: 13px; }

.stage { grid-area: stage; position: relative; min-height: 0; border-radius: 6px; overflow: hidden; background: #0b0d10; }
#scene { width: 100%; height: 100%; display: block; touch-action: none; }
.view-btns { position: absolute; right: 10px; bottom: 28px; display: flex; gap: 6px; }
.view-btns button { background: rgba(20, 23, 27, 0.85); }
.hint { position: absolute; right: 10px; bottom: 8px; font-size: 11px; color: var(--text-2); pointer-events: none; opacity: 0.8; }
.toast { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--accent); border-radius: 4px; padding: 8px 14px; font-family: var(--font-mono); font-size: 13px; pointer-events: none; max-width: 90%; text-align: center; }
.card-panel { position: absolute; left: 12px; bottom: 12px; width: min(320px, calc(100% - 24px)); background: rgba(20, 23, 27, 0.94); border: 1px solid var(--line-strong); border-radius: 6px; padding: 12px 14px; display: grid; gap: 8px; }
.card-panel h3 { font-family: var(--font-head); font-size: 22px; display: flex; align-items: center; gap: 8px; }
.card-panel .row { display: flex; gap: 8px; }
.card-panel .row button { flex: 1; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 13px; }
.kv span:nth-child(odd) { color: var(--text-2); }
.kv span:nth-child(even) { font-family: var(--font-mono); text-align: right; }
.swatch { width: 12px; height: 12px; border-radius: 2px; display: inline-block; flex: none; }
.good { color: var(--green); }
.bad { color: var(--red); }
.warn { color: var(--accent); }
.trend { font-size: 11px; margin-left: 4px; }
.trend.up { color: var(--red); }
.trend.down { color: var(--green); }
.market-strip { border-style: dashed; }
.market-strip b { color: var(--text); }

.side { grid-area: side; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.tabs button { min-height: 40px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; font-weight: 600; }
.tabs button[aria-selected="true"] { border-color: var(--accent); color: var(--accent); }
.tab-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 2px; }
.section-title { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; color: var(--text-2); text-transform: uppercase; margin-top: 4px; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.item.offer { border-color: rgba(242, 162, 58, 0.5); }
.item.locked { opacity: 0.55; }
.item .name { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.item .meta { grid-column: 1; font-family: var(--font-mono); font-size: 11px; color: var(--text-2); line-height: 1.5; }
.item .buy { grid-column: 2; grid-row: 1 / span 2; display: grid; justify-items: end; gap: 4px; }
.price { font-family: var(--font-mono); font-weight: 600; font-size: 14px; }
.price s { color: var(--text-2); font-weight: 400; font-size: 11px; margin-right: 4px; }
.tag { font-family: var(--font-mono); font-size: 10px; padding: 1px 5px; border-radius: 3px; background: var(--surface-2); color: var(--accent); }
.progress { height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden; grid-column: 1 / -1; }
.progress div { height: 100%; background: var(--blue); }
.credits { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.credit { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); text-decoration: none; }
.credit.built-on b { color: var(--text); font-weight: 600; }
.credit:hover { color: var(--text); }
.credit img { width: 22px; height: 22px; }
.debug { border-top: 1px solid var(--line); padding-top: 6px; font-size: 12px; color: var(--text-2); }
.debug summary { cursor: pointer; min-height: 28px; }
.debug .row { display: flex; align-items: center; gap: 4px; margin: 6px 0; }
.debug .label { display: inline; margin-right: auto; }
.speed { min-height: 32px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 4px; background: transparent; }
.speed[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

dialog { margin: auto; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 6px; padding: 22px; max-width: min(460px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(8, 10, 12, 0.7); }
dialog h2 { font-family: var(--font-head); font-size: 26px; margin-bottom: 8px; }
dialog p { line-height: 1.5; color: var(--text-2); margin-bottom: 12px; }
dialog p b { color: var(--text); font-family: var(--font-mono); }
dialog .primary { width: 100%; }
.dlg-credit { display: flex; align-items: center; gap: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }

@media (max-width: 1100px) and (min-width: 761px) {
  #app { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 760px) {
  #app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) minmax(0, 0.9fr); grid-template-areas: "hud" "stage" "side"; gap: 8px; padding-left: 10px; padding-right: 10px; }
  .hud { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; }
  .brand { display: flex; align-items: baseline; justify-content: space-between; min-width: 0; }
  .how-to { margin: 0; width: 38px; padding: 0; justify-content: center; }
  .hud-stats { grid-column: 1; grid-row: 2; padding-left: 0; border-left: 0; gap: 14px; }
  .wallet-pill { grid-column: 2; grid-row: 2; }
  .how-txt { display: none; }
  h1 { font-size: 22px; }
  .num { font-size: 18px; }
  .num.sm { font-size: 15px; }
  .stat { min-width: 0; }
  .claim { grid-column: 1 / -1; grid-row: 3; }
  .hint { display: none; }
  .view-btns { bottom: 8px; right: 8px; }
  .card-panel { left: 8px; bottom: 8px; padding: 10px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* RGB edition: animated rainbow tag and the extra buy row in the market */
.tag.rgb { color: #16191d; font-weight: 700; background: linear-gradient(90deg, #ef5b57, #f2a23a, #e8d44d, #6fbf8e, #86a9d6, #b48ce0, #ef5b57); background-size: 300% 100%; animation: rgbflow 3s linear infinite; }
@keyframes rgbflow { to { background-position: 300% 0; } }
.rgb-row { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px dashed var(--line); padding-top: 6px; margin-top: 2px; }
.rgb-row .meta { white-space: nowrap; }
.buy-inline { display: flex; align-items: center; gap: 8px; flex: none; }
@media (prefers-reduced-motion: reduce) { .tag.rgb { animation: none; } }

/* Rig swap: change every card of a rig to one model */
.rigswap { margin: -2px 0 6px; }
.rigswap summary { cursor: pointer; font-size: 12px; color: var(--accent); padding: 4px 2px; }
.swap-list { display: grid; gap: 6px; margin-top: 4px; }
.swap-row { background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 8px 10px; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; }
.swap-row .name { font-weight: 600; display: flex; align-items: center; gap: 6px; font-size: 13px; }
.swap-row .meta { grid-column: 1; font-family: var(--font-mono); font-size: 11px; color: var(--text-2); }
.swap-row button { grid-column: 2; grid-row: 1 / span 2; }

/* 404 page */
body.notfound { display: grid; place-items: center; min-height: 100dvh; }
.nf { text-align: center; padding: 24px; display: grid; gap: 10px; justify-items: center; }
.nf h1 { font-family: var(--font-head); font-size: 32px; }
.nf p { color: var(--text-2); }
.nf .nf-foot { font-size: 12px; margin-top: 18px; }
.nf a { color: var(--accent); }

/* Bulk overclock */
.item.ocall { border-color: rgba(242, 162, 58, 0.5); }
.rig-tools { display: flex; gap: 6px; margin: 0 0 4px; }
.rig-tools button { font-size: 12px; min-height: 32px; padding: 0 10px; }

/* Daily event banner (over the 3D view, top left) */
.event-bar { max-width: 100%; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center;
  background: rgba(22, 25, 29, 0.86); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; font-size: 12px; line-height: 1.4; color: var(--text-2); pointer-events: none; backdrop-filter: blur(4px); }
.event-bar b { color: var(--text); }
.event-bar.good { border-color: rgba(111, 191, 142, 0.6); }
.event-bar.bad { border-color: rgba(239, 91, 87, 0.6); }
.event-bar .ev-icon { font-size: 20px; width: 24px; text-align: center; }
.event-bar.good .ev-icon { color: var(--green); }
.event-bar.bad .ev-icon { color: var(--red); }
.event-bar .ev-next { grid-column: 1 / -1; font-family: var(--font-mono); font-size: 11px; border-top: 1px dashed var(--line); padding-top: 4px; margin-top: 2px; }

/* First-minute tips */
.coach { position: fixed; z-index: 50; width: min(290px, calc(100vw - 16px)); background: var(--surface); border: 1px solid var(--accent); border-radius: 6px;
  padding: 10px 12px; font-size: 13px; line-height: 1.45; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }
.coach p { margin: 0 0 8px; }
.coach-foot { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.coach-foot span { margin-right: auto; font-family: var(--font-mono); font-size: 11px; color: var(--text-2); }
.coach-foot button { min-height: 32px; padding: 0 10px; font-size: 12px; flex: none; }
.coach-target { outline: 2px solid var(--accent); outline-offset: 3px; animation: coachpulse 1.4s ease-in-out infinite; }
@keyframes coachpulse { 50% { outline-color: rgba(242, 162, 58, 0.25); } }
@media (prefers-reduced-motion: reduce) { .coach-target { animation: none; } }
@media (max-width: 900px) { .toast { top: auto; bottom: 12px; } }

/* Sound and music toggles */
.audio { display: grid; gap: 4px; margin-top: auto; }
.audio-row { display: grid; grid-template-columns: 40px 56px 1fr 48px; align-items: center; gap: 8px; }
.audio-row button { min-height: 34px; padding: 0; font-size: 15px; }
.audio-row button[aria-pressed="false"] { color: var(--text-2); }
.audio-row label { font-size: 12px; color: var(--text-2); }
.audio-row output { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }
.audio-row input[type=range] { width: 100%; min-width: 0; height: 28px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.audio-row input[type=range].off { accent-color: var(--line-strong); opacity: 0.6; }
.audio + .credits { margin-top: 0; }
.audio-row .gfx-ic { display: grid; place-items: center; min-height: 34px; color: var(--text-2); font-size: 15px; }
.audio-row select { min-height: 30px; min-width: 0; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 4px; font: inherit; font-size: 12px; padding: 0 6px; cursor: pointer; }

/* Gno.land link */
.btn-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 4px; border: 1px solid var(--line-strong); color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }

/* Season countdown (over the 3D view, top right): calm, then amber in the last 3 days, red in the last hour */
.season-clock { position: absolute; top: 10px; right: 10px; display: grid; justify-items: end; gap: 1px; background: rgba(22, 25, 29, 0.86); border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 10px; font-size: 12px; color: var(--text-2); pointer-events: none; backdrop-filter: blur(4px); text-align: right; }
.season-clock b { font-family: var(--font-mono); font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.season-clock .sub { font-size: 11px; }
.season-clock .clock-more { pointer-events: auto; margin-left: 6px; border: 1px solid var(--line-strong); background: transparent; color: var(--text-2); border-radius: 4px; font-size: 10px; line-height: 1; padding: 2px 5px; cursor: pointer; }
.season-clock .clock-more:hover { color: var(--text); border-color: var(--accent); }
.season-clock .clock-note { max-width: 230px; margin: 4px 0 0; font-size: 11px; line-height: 1.45; text-align: left; color: var(--text-2); }
.season-clock.upcoming { border-color: rgba(242, 162, 58, 0.55); }
.season-clock.upcoming b { color: var(--accent); }
.season-clock.soon { border-color: rgba(242, 162, 58, 0.7); }
.season-clock.soon b { color: var(--accent); }
.season-clock.last { border-color: rgba(239, 91, 87, 0.8); }
.season-clock.last b { color: var(--red); font-size: 15px; }
@media (max-width: 760px) { .stage-tl { width: calc(100% - 150px); } .season-clock { font-size: 11px; padding: 5px 8px; } }

/* Badges in Facility, and the share-card dialog */
.item.badge-row { grid-template-columns: auto 1fr auto; }
.item.badge-row .meta { grid-column: auto; }
.item.badge-row .buy { grid-column: 3; grid-row: 1; }
.badge-txt { display: grid; gap: 2px; min-width: 0; }
.badge-ico { display: block; }
dialog.wide { max-width: min(760px, calc(100vw - 32px)); }
.share-card { display: block; width: 100%; height: auto; border-radius: 6px; margin-bottom: 12px; aspect-ratio: 1200 / 630; }
.card-dl { display: flex; gap: 8px; margin-bottom: 12px; }
.card-dl button { flex: 1; }

/* share, leaderboard, reminders, achievements */
.share-row { display: flex; gap: 8px; }
.share-row button { flex: 1; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: inherit; }
#dlg .row { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
table.lb { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; }
table.lb th { text-align: left; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--text-2); font-weight: 500; padding: 4px 6px; border-bottom: 1px solid var(--line-strong); }
table.lb td { padding: 6px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
table.lb td:nth-child(3) { font-family: var(--font-mono); }
table.lb tr.me td { color: var(--accent); font-weight: 600; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-bottom: 8px; }
.ach { display: flex; gap: 8px; align-items: flex-start; padding: 7px 8px; border: 1px solid var(--line); border-radius: 4px; opacity: 0.45; }
.ach.got { opacity: 1; border-color: rgba(242, 162, 58, 0.45); background: rgba(242, 162, 58, 0.06); }
.ach-ic { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--line); font-size: 12px; }
.ach.got .ach-ic { background: var(--accent); color: #16191d; }
.ach-txt { display: grid; gap: 1px; font-size: 12px; line-height: 1.25; min-width: 0; }
.ach-txt span { color: var(--text-2); font-size: 11px; }

/* How to play: interactive tour */
.touring .coach { display: none !important; }
.tour { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.tour-dim { position: absolute; inset: 0; background: rgba(6, 8, 10, 0.62); pointer-events: auto; }
.tour-hole { position: absolute; border: 2px solid var(--accent); border-radius: 8px; box-shadow: 0 0 0 9999px rgba(6, 8, 10, 0.58); transition: left 0.25s, top 0.25s, width 0.25s, height 0.25s; animation: tourPulse 1.8s ease-in-out infinite; }
@keyframes tourPulse { 0%, 100% { outline: 0 solid rgba(242, 162, 58, 0.45); } 50% { outline: 6px solid rgba(242, 162, 58, 0); } }
.tour-card { position: absolute; pointer-events: auto; width: min(440px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 16px 18px 14px; box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5); transition: left 0.25s, top 0.25s; }
.tour-card h2 { font-family: var(--font-head); font-size: 24px; margin: 2px 0 10px; }
.tour-step { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; color: var(--accent); text-transform: uppercase; }
.tour-x { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border: 0; background: transparent; color: var(--text-2); font-size: 22px; line-height: 1; }
.tour-x:hover { color: var(--text); }
.tour-text p { line-height: 1.5; margin: 0 0 8px; color: var(--text-2); }
.tour-text b { color: var(--text); }
.tg-hint { font-size: 12px; }
.tour-visual { margin: 0 0 10px; }
.tour-try { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px dashed var(--accent); border-radius: 6px; font-size: 13px; color: var(--text-2); margin: 0 0 10px; }
.tour-try b { color: var(--accent); }
.tour-try.done { border-style: solid; border-color: #6fbf8e; color: #6fbf8e; }
.tour-try-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: tourBlink 1s ease-in-out infinite; }
@keyframes tourBlink { 50% { opacity: 0.25; } }
.tour-dots { display: flex; gap: 6px; justify-content: center; margin: 2px 0 10px; }
.tour-dots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; background: var(--line-strong); }
.tour-dots button.on { background: var(--accent); }
.tour-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tg-hero { margin: 0; position: relative; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.tg-hero img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #0d0f12; }
.tg-hero figcaption { position: absolute; left: 8px; bottom: 8px; padding: 3px 8px; border-radius: 4px; background: rgba(0, 0, 0, 0.62); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.tg-pop { margin-bottom: 8px; cursor: pointer; }
.tg-thumbs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 6px; }
.tg-thumb { padding: 0; border: 1px solid var(--line); border-radius: 4px; background: none; overflow: hidden; position: relative; }
.tg-thumb img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; opacity: 0.7; }
.tg-thumb span { display: block; font-size: 9px; padding: 2px 0; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-thumb.on { border-color: var(--accent); }
.tg-thumb.on img, .tg-thumb:hover img { opacity: 1; }
.tg-rooms { display: grid; gap: 5px; }
.tg-room { display: grid; grid-template-columns: 84px 1fr; gap: 10px; align-items: center; text-align: left; padding: 4px; border: 1px solid var(--line); border-radius: 6px; background: none; }
.tg-room:hover { border-color: var(--accent); }
.tg-room img { width: 84px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 3px; display: block; }
.tg-room-txt { display: grid; font-size: 12px; color: var(--text-2); line-height: 1.35; }
.tg-room-txt b { color: var(--text); font-size: 13px; }
.tg-svg { display: block; width: 100%; height: auto; }
.tg-svg text { font-family: var(--font-mono); fill: var(--text-2); }
.tg-t { font-size: 12px; font-weight: 700; fill: var(--text) !important; text-anchor: middle; letter-spacing: 0.08em; }
.tg-s { font-size: 10px; text-anchor: middle; }
.tg-s.l { text-anchor: start; }
.tg-s.r { text-anchor: end; }
.tg-s.b { fill: var(--text) !important; }
.tg-s.acc { fill: var(--accent) !important; font-weight: 700; }
.tg-s.warm { fill: #e0875a !important; }
.tg-box { fill: rgba(255, 255, 255, 0.03); stroke: var(--line-strong); stroke-width: 1.5; }
.tg-box.acc { stroke: var(--accent); fill: rgba(242, 162, 58, 0.08); }
.tg-arrow { stroke: var(--accent); stroke-width: 2; fill: none; stroke-dasharray: 4 4; }
.tg-coin { fill: var(--accent); }
.tg-track { fill: rgba(255, 255, 255, 0.08); }
.tg-bar { fill: var(--accent); }
.tg-bar.warm { fill: #e0875a; }
.tg-plot { fill: rgba(255, 255, 255, 0.02); stroke: var(--line); }
.tg-grid { stroke: var(--line-strong); stroke-dasharray: 3 3; }
.tg-line { fill: none; stroke-width: 2.4; }
.tg-line.a { stroke: #86a9d6; }
.tg-line.b { stroke: var(--accent); }
.tg-key.a { fill: #86a9d6; }
.tg-key.b { fill: var(--accent); }
.tg-anat { border: 1px solid var(--line-strong); border-radius: 6px; padding: 10px 12px; }
.tg-anat-row { display: flex; justify-content: space-between; font-weight: 600; }
.tg-anat-price { font-family: var(--font-mono); color: var(--accent); }
.tg-anat-stats { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); margin: 4px 0 8px; counter-reset: k; }
.tg-anat-stats span { border-bottom: 2px solid var(--accent); padding-bottom: 1px; position: relative; }
.tg-anat-stats span::after { content: attr(data-k); position: absolute; top: -9px; right: -7px; width: 13px; height: 13px; border-radius: 50%; background: var(--accent); color: #16191d; font-size: 9px; font-weight: 700; display: grid; place-items: center; }
.tg-anat-keys { margin: 0; padding-left: 18px; font-size: 12px; color: var(--text-2); line-height: 1.5; }
.tg-anat-keys b { color: var(--text); font-family: var(--font-mono); }
.tg-badges { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.tg-badge { display: grid; justify-items: center; gap: 1px; padding: 5px 2px; border: 1px solid var(--line); border-radius: 6px; font-size: 11px; }
.tg-badge b { font-size: 11px; }
.tg-badge span:last-child { font-family: var(--font-mono); font-size: 10px; color: var(--text-2); }
.tg-badge-ic svg { width: 40px; height: 40px; display: block; }
.tg-ctrls { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tg-ctrls div { display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.tg-ctrls .tg-ctrl-ic { grid-row: span 2; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgba(242, 162, 58, 0.14); color: var(--accent); font-size: 16px; }
.tg-ctrls span:last-child { color: var(--text-2); }
@media (max-width: 760px) {
  .tour-card { padding: 12px 14px; max-height: 62dvh; }
  .tour-card h2 { font-size: 20px; margin-bottom: 6px; }
  .tg-thumb span { display: none; }
  .tg-badges { grid-template-columns: repeat(5, 1fr); }
  .tg-badge-ic svg { width: 30px; height: 30px; }
}

/* next goal and daily tasks (top-left of the stage, under the day's event) */
.stage-tl { position: absolute; top: 10px; left: 10px; width: min(360px, calc(100% - 20px)); display: grid; gap: 6px; z-index: 2; pointer-events: none; }
.goal-card { position: absolute; left: 10px; bottom: 28px; width: min(330px, calc(100% - 140px)); z-index: 2; pointer-events: auto; background: rgba(22, 25, 29, 0.9); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; backdrop-filter: blur(4px); }
.goal-card.urgent { border-color: var(--accent); }
.goal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.goal-k { white-space: nowrap; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.goal-daily { white-space: nowrap; border: 1px solid var(--line-strong); background: transparent; border-radius: 999px; font-family: var(--font-mono); font-size: 11px; padding: 2px 9px; color: var(--text-2); }
.goal-daily:hover { color: var(--text); border-color: var(--accent); }
.goal-daily.done { border-color: #6fbf8e; color: #6fbf8e; }
.goal-main { display: grid; gap: 2px; width: 100%; text-align: left; background: none; border: 0; padding: 0; }
.goal-main b { font-size: 14px; }
.goal-main span { font-size: 12px; color: var(--text-2); }
.goal-main:hover b { color: var(--accent); }
.goal-bar { display: block; height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.goal-bar span { display: block; height: 100%; background: var(--accent); transition: width 0.4s; }
.goal-tasks { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 6px; display: grid; gap: 4px; }
.goal-task { display: grid; grid-template-columns: 16px 1fr auto; gap: 6px; align-items: center; font-size: 12px; color: var(--text-2); }
.goal-task.done { color: #6fbf8e; }
.goal-tick { width: 14px; height: 14px; border: 1px solid var(--line-strong); border-radius: 3px; display: grid; place-items: center; font-size: 10px; }
.goal-task.done .goal-tick { border-color: #6fbf8e; background: rgba(111, 191, 142, 0.15); }
.goal-n { font-family: var(--font-mono); font-size: 11px; }
.goal-foot { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.flash { animation: flashRing 0.8s ease-in-out 3; }
@keyframes flashRing { 0%, 100% { box-shadow: 0 0 0 0 rgba(242, 162, 58, 0); } 50% { box-shadow: 0 0 0 3px rgba(242, 162, 58, 0.85); } }
@media (max-width: 760px) {
  .goal-card { padding: 6px 8px; bottom: 8px; left: 8px; }
  .goal-main b { font-size: 13px; }
  .goal-main > span:not(.goal-bar) { display: none; }
}
.card-panel:not([hidden]) ~ .goal-card { display: none; }

/* network line under the market strip; halving under the season clock */
.market-strip { grid-template-columns: 1fr; }
.net-line { font-size: 11px; border-top: 1px dashed var(--line); padding-top: 5px; }
.net-line b { color: var(--text); font-weight: 500; }

/* profile popover (wallet button) */
.profile { position: fixed; z-index: 55; width: min(320px, calc(100vw - 16px)); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 14px; box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5); display: grid; gap: 12px; }
.pf-head { display: flex; gap: 10px; align-items: center; }
.pf-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-strong); display: grid; place-items: center; overflow: hidden; flex: none; }
.pf-avatar svg, .pf-avatar img { width: 36px; height: 36px; display: block; }
.pf-who { display: grid; gap: 2px; min-width: 0; }
.pf-line { display: flex; align-items: center; gap: 6px; }
.pf-name { font-family: var(--font-mono); font-size: 15px; }
.pf-copy { border: 0; background: none; color: var(--text-2); font-size: 14px; padding: 0 2px; }
.pf-copy:hover { color: var(--accent); }
.pf-where { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); }
.pf-score { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.pf-score b { font-family: var(--font-mono); font-size: 24px; line-height: 1.1; }
.pf-badge { font-size: 12px; color: var(--text-2); }
.pf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pf-grid div { padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; display: grid; gap: 1px; }
.pf-grid b { font-family: var(--font-mono); font-size: 14px; }
.pf-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pf-actions .btn-link, .pf-actions button { min-height: 36px; justify-content: center; font-size: 13px; padding: 0 8px; }
.pf-wide { grid-column: 1 / -1; }
