/* 链上人生 — original visual system. Mint, ink, cream. Not a yellow brand clone. */
:root {
  --ink: #0b0d12;
  --ink-2: #10131a;
  --chrome: #14161c;
  --chrome-2: #1b1e27;
  --chrome-3: #232733;
  --mint: #3ee0b0;
  --mint-2: #1ec8a0;
  --mint-deep: #0e3d32;
  --mint-dim: rgba(62, 224, 176, 0.16);
  --mint-glow: rgba(62, 224, 176, 0.35);
  --amber: #e8b86d;
  --amber-dim: rgba(232, 184, 109, 0.18);
  --sheet: #f4f1ea;
  --sheet-2: #ebe6dc;
  --sheet-3: #e0dbd0;
  --paper: #fbf9f4;
  --text: #1a1c22;
  --text-dim: #5c616b;
  --text-faint: #8a8f99;
  --white: #f7f5f0;
  --white-dim: rgba(247, 245, 240, 0.62);
  --hairline: rgba(255, 255, 255, 0.10);
  --hairline-dark: rgba(20, 22, 28, 0.12);
  --health: #3ecf7a;
  --love: #f07cac;
  --growth: #4ad4e0;
  --safety: #8b7cf0;
  --kind: #f08a6c;
  --hot: #e07a4a;
  --cold: #6a8eae;
  --steady: #8a8f99;
  --success: #2fb56a;
  --fail: #e25b5b;
  --danger: #c94a4a;
  --display: "Noto Serif SC", "Noto Serif CJK SC", "Songti SC", serif;
  --sans: "Noto Sans SC", "Noto Sans CJK SC", "PingFang SC", system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --pixel: "Silkscreen", "DM Mono", ui-monospace, monospace;
  --radius-phone: 36px;
  --shadow-phone: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 30px 80px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  background: var(--ink);
  color: var(--white);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
img { display: block; }

.desktop {
  min-height: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, #16332c 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 80% 100%, #1a1730 0%, transparent 50%),
    var(--ink);
}
.phone-slot {
  display: grid;
  place-items: center;
}
.phone {
  width: 430px;
  height: 820px;
  border-radius: var(--radius-phone);
  background: var(--chrome);
  box-shadow: var(--shadow-phone);
  position: relative;
  overflow: hidden;
  transform-origin: center center;
}
.phone-hairline {
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid var(--hairline);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  z-index: 80;
}
.screen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--ink-2);
}

/* ---------- shared chrome ---------- */
.topbar {
  height: 44px;
  flex: 0 0 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 20;
}
.topbar .lang-toggle, .icon-btn {
  min-width: 36px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  color: var(--white-dim);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.icon-btn { width: 32px; padding: 0; font-size: 14px; }
.icon-btn.is-off { opacity: 0.4; }
.badge-block {
  font-family: var(--pixel);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--mint);
  border: 1px solid var(--mint);
  background: var(--mint-dim);
  border-radius: 4px;
  padding: 3px 7px 2px;
  line-height: 1;
}

/* ---------- landing ---------- */
.view { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.view-landing { background:
  radial-gradient(ellipse at 50% 20%, #14342c 0%, transparent 55%),
  var(--ink-2);
}
.landing-body {
  flex: 1;
  overflow: auto;
  padding: 4px 22px 20px;
  display: flex;
  flex-direction: column;
}
.kicker {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--white-dim);
  text-align: center;
  margin-top: 2px;
}
.title-block { text-align: center; margin: 8px 0 6px; }
.title-block h1 {
  font-family: var(--display);
  font-weight: 900;
  font-size: 52px;
  letter-spacing: 0.08em;
  line-height: 1;
  color: var(--white);
  text-shadow: 0 2px 0 #0a0c10, 0 0 28px var(--mint-glow);
}
.title-block .sub {
  margin-top: 8px;
  font-size: 13px;
  letter-spacing: 0.28em;
  color: var(--mint);
  font-weight: 500;
}
.title-block .badge-wrap { margin-top: 10px; }

.hero-frame {
  margin: 14px auto 0;
  width: 100%;
  height: 196px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: #0a0c10;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(62,224,176,0.05);
}
.hero-frame canvas { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.hero-fade {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 70%, rgba(11,13,18,0.35));
  pointer-events: none;
}

.lead {
  margin: 18px 2px 0;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--white-dim);
  text-align: justify;
}
.steps { margin: 16px 0 8px; display: flex; flex-direction: column; gap: 10px; }
.step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
}
.step-num {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--mint-dim);
  color: var(--mint);
  font-family: var(--mono);
  font-size: 13px;
  display: grid; place-items: center;
  border: 1px solid rgba(62,224,176,0.28);
}
.step p { font-size: 13px; line-height: 1.55; color: var(--white); padding-top: 4px; }

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(180deg, #4ee8bc 0%, var(--mint-2) 100%);
  color: #06241c;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.12em;
  box-shadow: 0 8px 24px rgba(30, 200, 160, 0.28), inset 0 1px 0 rgba(255,255,255,0.35);
  margin-top: 12px;
}
.btn-primary:active { transform: translateY(1px); filter: brightness(0.95); }
.btn-ghost {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 46px; border-radius: 12px;
  border: 1px solid var(--hairline);
  color: var(--white);
  font-size: 14px; font-weight: 500;
  background: rgba(255,255,255,0.03);
}
.btn-ghost:active { background: rgba(255,255,255,0.06); }
.btn-row { display: flex; gap: 10px; margin-top: 10px; }
.btn-row > * { flex: 1; }

.disclaimer {
  margin-top: 16px;
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--text-faint);
  text-align: center;
  padding: 0 8px 8px;
}

/* ---------- draw / sheet (dark) ---------- */
.view-draw, .view-sheet, .view-cine { background: var(--ink-2); }
.draw-body, .sheet-body { flex: 1; overflow: auto; padding: 6px 20px 24px; }
.scene-frame {
  width: 100%;
  height: 210px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: #090b10;
  position: relative;
}
.scene-frame canvas, .hud-scene canvas { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.mystery-date {
  text-align: center;
  margin: 14px 0 12px;
  font-family: var(--mono);
  font-size: 22px;
  letter-spacing: 0.18em;
  color: var(--white-dim);
}
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile {
  background: var(--chrome-2);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
}
.tile .k { font-size: 11px; color: var(--text-faint); letter-spacing: 0.08em; }
.tile .v { margin-top: 6px; font-size: 16px; color: var(--mint); font-weight: 700; letter-spacing: 0.16em; }
.hint { text-align: center; margin: 16px 8px 8px; font-size: 13px; color: var(--white-dim); line-height: 1.6; }

/* character sheet */
.sheet-card {
  background: var(--sheet);
  color: var(--text);
  border-radius: 20px;
  padding: 18px 18px 20px;
  margin-top: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.28);
}
.sheet-card h2 {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}
.meta-line { margin-top: 4px; font-size: 13px; color: var(--text-dim); }
.quote {
  margin: 12px 0 4px;
  font-size: 12.5px;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.6;
  padding-left: 10px;
  border-left: 2px solid var(--mint-2);
}
.section { margin-top: 16px; }
.section-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.money-box, .io-box {
  background: var(--paper);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.55;
  border: 1px solid var(--hairline-dark);
}
.io-box { display: flex; justify-content: space-between; gap: 8px; }
.io-box span { color: var(--text-dim); }
.io-box strong { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  background: var(--mint-dim);
  color: #0e3d32;
  border: 1px solid rgba(30,200,160,0.35);
  position: relative;
}
.chip[data-tip] { cursor: help; }
.wish { font-size: 15px; font-weight: 600; }
.sliders { display: flex; flex-direction: column; gap: 8px; }
.slider-row { display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 8px; font-size: 12.5px; }
.pips { display: flex; gap: 5px; }
.pip {
  width: 18px; height: 8px; border-radius: 2px;
  background: var(--sheet-3);
}
.pip.on { background: var(--mint-2); }
.pip.health.on { background: var(--health); }
.pip.love.on { background: var(--love); }
.pip.growth.on { background: var(--growth); }
.pip.safety.on { background: var(--safety); }
.pip.kind.on { background: var(--kind); }
.live-count { margin-top: 14px; font-size: 12px; color: var(--text-faint); text-align: center; }
.sheet-actions { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.sheet-actions .btn-ghost { color: var(--text); border-color: var(--hairline-dark); background: transparent; }
.sheet-actions .btn-primary { margin-top: 0; }

/* tooltip */
.tooltip {
  position: absolute;
  z-index: 60;
  max-width: 240px;
  background: #1a1c22;
  color: var(--white);
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 10px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  pointer-events: none;
  transform: translate(-50%, -100%);
  margin-top: -8px;
}

/* ---------- cinematic ---------- */
.cine-body { flex: 1; display: flex; flex-direction: column; }
.cine-scene { flex: 1; position: relative; min-height: 0; }
.cine-scene canvas { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.cine-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 28px 22px 32px;
  background: linear-gradient(to top, rgba(8,10,14,0.92), rgba(8,10,14,0.2) 70%, transparent);
}
.cine-caption .when { font-family: var(--mono); color: var(--mint); letter-spacing: 0.12em; font-size: 12px; }
.cine-caption p { margin-top: 8px; font-size: 15px; line-height: 1.7; }
.cine-skip { position: absolute; top: 12px; right: 16px; font-size: 12px; color: var(--white-dim); z-index: 5; padding: 6px 10px; }

/* ---------- HUD / play ---------- */
.view-play { background: var(--chrome); }
.hud-top {
  flex: 0 0 auto;
  padding: 8px 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hud-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
}
.hud-date { font-family: var(--mono); font-size: 16px; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.market-badge {
  font-size: 11px;
  border-radius: 999px;
  padding: 3px 9px;
  letter-spacing: 0.06em;
  border: 1px solid;
  white-space: nowrap;
  flex: 0 0 auto;
}
.market-badge.hot { color: var(--hot); border-color: rgba(224,122,74,0.45); background: rgba(224,122,74,0.12); }
.market-badge.steady { color: var(--steady); border-color: rgba(138,143,153,0.4); background: rgba(138,143,153,0.1); }
.market-badge.cold { color: #9bb8d0; border-color: rgba(106,142,174,0.5); background: rgba(80,120,160,0.16); }
.block-count { font-family: var(--pixel); font-size: 10px; color: var(--mint); white-space: nowrap; margin-left: auto; }
.speeds { display: flex; gap: 4px; }
.speeds button, .hud-tools .icon-btn {
  height: 26px; min-width: 30px; padding: 0 7px;
  border-radius: 6px; font-size: 11px; color: var(--white-dim);
  border: 1px solid transparent;
}
.speeds button.is-on { color: var(--mint); border-color: rgba(62,224,176,0.4); background: var(--mint-dim); }
.hud-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.hud-scene {
  height: 188px; flex: 0 0 188px;
  margin: 0 12px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: #090b10;
  position: relative;
}
.meters {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 8px 14px 4px;
}
.meter { text-align: center; cursor: pointer; }
.meter .ml { font-size: 10px; color: var(--white-dim); margin-bottom: 4px; letter-spacing: 0.04em; }
.meter .pips { justify-content: center; gap: 3px; }
.meter .pip { width: 11px; height: 6px; background: #2a2e38; }
.portfolio {
  margin: 6px 12px 0;
  background: var(--sheet);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px 11px;
}
.pf-head { display: flex; justify-content: space-between; align-items: baseline; }
.pf-head .k { font-size: 11px; color: var(--text-faint); letter-spacing: 0.08em; }
.pf-head .amt {
  font-family: var(--mono);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-weight: 500;
}
.pf-head .amt small { font-size: 11px; color: var(--text-faint); margin-left: 4px; font-weight: 400; }
.alloc {
  display: flex; height: 8px; border-radius: 99px; overflow: hidden;
  margin: 8px 0 6px; background: var(--sheet-3);
}
.alloc i { display: block; height: 100%; }
.alloc .usdt { background: #6b7280; }
.alloc .bnb { background: #f0b429; }
.alloc .alts { background: #5b8def; }
.alloc .farm { background: #3ecf7a; }
.alloc .prop { background: #c08457; }
.alloc .debt { background: #e25b5b; }
.alloc-legend { display: flex; flex-wrap: wrap; gap: 8px 10px; font-size: 10.5px; color: var(--text-dim); }
.alloc-legend b { font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.cashflow {
  margin-top: 6px;
  display: flex; flex-wrap: wrap; gap: 8px 12px;
  font-size: 11px; color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.cashflow .up { color: var(--success); }
.cashflow .down { color: var(--fail); }

.log {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 16px 16px;
}
.log-item { display: grid; grid-template-columns: 58px 1fr; gap: 8px; padding: 5px 0; }
.log-item .when { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
.log-item .txt { font-size: 12.5px; color: var(--white-dim); line-height: 1.5; }
.log-item.is-block .txt { color: var(--mint); }
.log-item.is-warn .txt { color: #f0c27a; }

/* overlays */
.overlay {
  position: absolute; inset: 0;
  z-index: 30;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: rgba(6, 8, 12, 0.45);
}
.overlay.center { justify-content: center; align-items: stretch; padding: 24px; background: rgba(6,8,12,0.62); }
.placard {
  margin: 0 28px 40%;
  background: var(--paper);
  color: var(--text);
  border-radius: 16px;
  padding: 22px 20px 20px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
  animation: pop 0.28s ease;
}
.placard h3 { font-family: var(--display); font-size: 26px; letter-spacing: 0.08em; }
.placard p { margin-top: 8px; font-size: 13px; color: var(--text-dim); }
.placard.mint h3 { color: #0e3d32; }
.placard.block-plus {
  background: linear-gradient(180deg, #16352d, #10241f);
  color: var(--white);
  border: 1px solid rgba(62,224,176,0.35);
}
.placard.block-plus h3 { color: var(--mint); font-family: var(--pixel); font-size: 22px; letter-spacing: 0.14em; }
.placard.block-plus p { color: var(--white-dim); }

.vn-card {
  margin: 12px; margin-bottom: 16px;
  background: var(--paper);
  color: var(--text);
  border-radius: 16px 16px 8px 16px;
  padding: 14px 16px 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
  animation: rise 0.28s ease;
}
.vn-tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  background: var(--sheet-2);
  border-radius: 4px;
  padding: 2px 6px;
}
.vn-tag.chat { color: #0e3d32; background: var(--mint-dim); }
.vn-card p { margin: 8px 0 10px; font-size: 14.5px; line-height: 1.7; }
.vn-next { text-align: right; font-size: 12px; color: var(--text-faint); }

.choice-sheet {
  background: var(--sheet);
  color: var(--text);
  border-radius: 20px 20px 0 0;
  padding: 18px 16px 20px;
  max-height: 78%;
  overflow: auto;
  animation: rise 0.3s ease;
  box-shadow: 0 -12px 40px rgba(0,0,0,0.4);
}
.choice-q {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 12px;
  padding: 0 4px;
}
.opt {
  border: 1px solid var(--hairline-dark);
  background: var(--paper);
  border-radius: 12px;
  margin-bottom: 8px;
  overflow: hidden;
}
.opt-head {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
}
.opt-head .plus { color: var(--text-faint); font-size: 18px; line-height: 1; }
.opt.is-open { border-color: var(--mint-2); background: #eef8f4; }
.opt.is-open .opt-head { font-weight: 600; }
.opt-body { display: none; padding: 0 14px 12px; }
.opt.is-open .opt-body { display: block; }
.fx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.fx {
  font-size: 11px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #e6f6ee;
  color: #1a6b42;
}
.fx.neg { background: #fde8e8; color: #9a2d2d; }
.fx.warn { background: #fde9c8; color: #8a5a12; }
.fx.odds { background: #e8e4f8; color: #433888; }
.fx.talent { background: var(--mint-dim); color: #0e3d32; }
.opt-hint { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.choice-sheet .btn-primary { margin-top: 8px; }

.result-sheet {
  background: var(--sheet);
  color: var(--text);
  border-radius: 20px 20px 0 0;
  padding: 18px 16px 20px;
  max-height: 82%;
  overflow: auto;
  animation: rise 0.3s ease;
  position: relative;
}
.stamp {
  position: absolute;
  top: 16px; right: 18px;
  font-family: var(--display);
  font-weight: 900;
  font-size: 28px;
  letter-spacing: 0.12em;
  border: 3px solid currentColor;
  border-radius: 6px;
  padding: 2px 8px 0;
  transform: rotate(12deg);
  opacity: 0.9;
  pointer-events: none;
  animation: stampIn 0.35s cubic-bezier(.2,1.4,.4,1);
}
.stamp.done { color: var(--amber); }
.stamp.success { color: var(--success); }
.stamp.fail { color: var(--fail); }
.result-copy { font-size: 14.5px; line-height: 1.7; padding-right: 72px; min-height: 48px; }
.result-delta { margin-top: 10px; font-size: 12.5px; color: var(--text-dim); }
.snap {
  margin-top: 12px;
  background: var(--paper);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  border: 1px solid var(--hairline-dark);
}
.community { margin-top: 14px; }
.community h4 { font-size: 12px; color: var(--text-dim); font-weight: 500; margin-bottom: 8px; }
.bar-row { display: grid; grid-template-columns: 1fr 42px; gap: 8px; align-items: center; margin-bottom: 6px; font-size: 12px; }
.bar-track { height: 8px; background: var(--sheet-3); border-radius: 99px; overflow: hidden; }
.bar-track span { display: block; height: 100%; background: var(--mint-2); border-radius: inherit; }
.bar-row em { font-style: normal; font-variant-numeric: tabular-nums; color: var(--text-dim); text-align: right; }
.first-block-note {
  margin-top: 10px;
  font-size: 12.5px;
  color: #0e3d32;
  background: var(--mint-dim);
  border-radius: 8px;
  padding: 8px 10px;
  line-height: 1.55;
}

.easter {
  background: var(--paper);
  color: var(--text);
  border-radius: 18px;
  padding: 22px 20px 18px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
  animation: pop 0.3s ease;
}
.easter .egg { font-size: 11px; letter-spacing: 0.2em; color: var(--amber); }
.easter h3 { font-family: var(--display); font-size: 22px; margin: 8px 0 10px; }
.easter p { font-size: 14px; line-height: 1.7; color: var(--text-dim); }
.easter .btn-primary { margin-top: 16px; }

/* ---------- ending ---------- */
.view-ending { background: var(--ink-2); }
.ending-scroll { flex: 1; overflow: auto; padding: 0 0 24px; }
.er-head {
  padding: 16px 20px 8px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.er-head .years { font-family: var(--mono); font-size: 18px; letter-spacing: 0.04em; }
.er-head .lab { font-size: 13px; color: var(--white-dim); letter-spacing: 0.12em; }
.er-scene {
  margin: 0 16px;
  height: 220px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--hairline);
}
.er-scene canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.er-body { padding: 16px 20px 0; }
.epithet {
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.3;
  color: var(--mint);
}
.er-name { margin-top: 4px; font-size: 14px; color: var(--white-dim); }
.asset-panel {
  margin-top: 16px;
  background: var(--sheet);
  color: var(--text);
  border-radius: 16px;
  padding: 14px;
}
.tier {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.1em;
  border-radius: 4px;
  padding: 2px 7px;
  background: var(--amber-dim);
  color: #7a5a20;
  font-weight: 700;
}
.tier.zero { background: #fde8e8; color: var(--fail); }
.tier.below { background: #fde9c8; color: #8a5a12; }
.tier.hold { background: #e8eef8; color: #345; }
.tier.gain { background: #e6f6ee; color: #1a6b42; }
.tier.moon { background: var(--mint-dim); color: #0e3d32; }
.asset-panel .big {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.asset-panel .sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tag {
  font-size: 12px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--white-dim);
}
.er-meters { margin-top: 16px; background: var(--chrome-2); border-radius: 14px; padding: 12px; }
.er-meters .meters { padding: 0; }
.block-path { margin-top: 18px; }
.block-path h3, .decisions h3, .wish-block h3, .score-block h3 {
  font-size: 13px; letter-spacing: 0.1em; color: var(--white-dim); font-weight: 500; margin-bottom: 8px;
}
.timeline {
  display: flex; align-items: center; gap: 0;
  overflow-x: auto; padding: 8px 0 4px;
}
.tl-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 3px var(--mint-dim);
  flex: 0 0 10px;
  position: relative;
}
.tl-dot.climax { width: 14px; height: 14px; background: var(--amber); box-shadow: 0 0 0 3px var(--amber-dim); }
.tl-line { height: 2px; flex: 1; min-width: 16px; background: rgba(62,224,176,0.25); }
.tl-caption { font-size: 11px; color: var(--text-faint); margin-top: 6px; display: flex; justify-content: space-between; }
.block-list { margin-top: 8px; }
.block-list li { font-size: 13px; line-height: 1.6; color: var(--white); list-style: none; padding: 3px 0; }
.block-list li span { color: var(--mint); font-family: var(--mono); font-size: 12px; margin-right: 8px; }
.decisions { margin-top: 16px; }
.decisions li { list-style: none; padding: 8px 0; border-top: 1px solid var(--hairline); font-size: 13.5px; line-height: 1.55; }
.decisions li .y { color: var(--mint); font-family: var(--mono); font-size: 12px; }
.wish-block, .score-block { margin-top: 16px; }
.wish-block p, .closing { font-size: 14px; line-height: 1.7; }
.score-num {
  font-family: var(--display);
  font-size: 40px;
  color: var(--mint);
  line-height: 1;
}
.score-num small { font-size: 16px; color: var(--white-dim); }
.formula { margin-top: 6px; font-size: 12px; color: var(--text-faint); line-height: 1.6; }
.percentile { margin-top: 8px; font-size: 13.5px; }
.hook {
  margin: 20px 0 8px;
  text-align: center;
  font-family: var(--display);
  font-size: 16px;
  color: var(--mint);
}
.ending-actions { padding: 8px 20px 0; display: flex; flex-direction: column; gap: 8px; }

/* poster overlay */
.poster-ov {
  position: absolute; inset: 0; z-index: 50;
  background: rgba(6,8,12,0.82);
  display: flex; flex-direction: column;
  padding: 20px 20px 16px;
}
.poster-ov h3 { font-size: 15px; text-align: center; margin-bottom: 6px; }
.poster-ov .hint2 { text-align: center; font-size: 12px; color: var(--white-dim); margin-bottom: 10px; }
.poster-preview {
  flex: 1; min-height: 0;
  display: grid; place-items: center;
}
.poster-preview canvas, .poster-preview img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.whatif-list button, .whatif-list .wi {
  width: 100%;
  text-align: left;
  background: var(--chrome-2);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.5;
}
.whatif-list .y { color: var(--mint); font-family: var(--mono); font-size: 12px; display: block; margin-bottom: 2px; }

/* toast */
.toast {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #1a1c22; color: var(--white);
  padding: 8px 14px; border-radius: 99px;
  font-size: 12.5px; z-index: 70;
  border: 1px solid var(--hairline);
  animation: pop 0.2s ease;
}

@keyframes pop { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes stampIn { from { transform: rotate(12deg) scale(1.6); opacity: 0; } to { transform: rotate(12deg) scale(1); opacity: 0.9; } }

/* scrollbar */
.screen *::-webkit-scrollbar { width: 0; height: 0; }

/* Real phones: fill the visible viewport, no decorative bezel, no CSS scale.
   100svh stays above the Safari toolbar; JS also syncs visualViewport. */
html, body {
  height: 100%;
  height: 100dvh;
  height: 100svh;
}
.desktop {
  min-height: 100%;
  min-height: 100dvh;
  min-height: 100svh;
}

@media (max-width: 720px) {
  html, body {
    position: fixed;
    inset: 0;
    width: 100%;
    overflow: hidden;
    touch-action: manipulation;
  }
  .desktop, .phone-slot, .phone, .screen {
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    border-radius: 0;
    box-shadow: none;
    transform: none !important;
  }
  .desktop {
    display: block;
    background: var(--ink-2);
  }
  .phone-slot {
    display: block;
  }
  .phone {
    overflow: hidden;
  }
  .phone-hairline { display: none; }
  .hud-scene {
    height: min(188px, 28svh);
    flex-basis: min(188px, 28svh);
  }
  .vn-card, .choice-sheet, .result-sheet, .ending-actions, .cine-caption, .landing-body {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .vn-card {
    margin-bottom: 8px;
  }
  .overlay {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .vn-next {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    color: var(--mint-2);
    font-weight: 600;
    padding: 8px 0 0;
  }
  .choice-sheet, .result-sheet {
    max-height: calc(100% - 12px);
  }
}

@media (max-width: 720px) and (max-height: 700px) {
  .hud-scene {
    height: min(140px, 22svh);
    flex-basis: min(140px, 22svh);
  }
  .title-block h1 { font-size: 42px; }
  .hero-frame { height: 160px; }
}

button, .overlay, .opt-head, .vn-card, .placard {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(62, 224, 176, 0.2);
}

/* ---- CHAINLIFE game drop panel ---- */
.drop-panel { margin: 14px 0 4px; padding: 12px 14px; border: 1px solid var(--mint-glow); border-radius: 12px; background: rgba(14, 61, 50, 0.35); color: var(--white); font-family: var(--sans); font-size: 12.5px; line-height: 1.5; text-align: left; }
.drop-panel.ending { background: var(--mint-deep); margin: 12px 0; }
.drop-panel .dp-title { font-family: var(--pixel); font-size: 11px; letter-spacing: 0.08em; color: var(--mint); margin-bottom: 6px; }
.drop-panel .dp-line { font-size: 13px; margin-bottom: 6px; }
.drop-panel .dp-line b { color: var(--mint); font-weight: 700; }
.drop-panel .dp-addr { color: var(--white-dim); font-family: var(--mono); font-size: 11.5px; }
.drop-panel .dp-bar { position: relative; height: 8px; margin: 8px 0 4px; border-radius: 4px; background: rgba(255,255,255,0.10); overflow: hidden; }
.drop-panel .dp-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--mint); border-radius: 4px; }
.drop-panel .dp-bar em { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--amber); }
.drop-panel .dp-prog { font-family: var(--mono); font-size: 11.5px; color: var(--white); }
.drop-panel .dp-note { color: var(--white-dim); font-size: 11.5px; margin-top: 4px; }
.drop-panel .dp-err { color: #ff9b9b; font-size: 11.5px; margin-top: 4px; word-break: break-word; }
.drop-panel .dp-rules { color: var(--white-dim); font-size: 11px; margin-top: 8px; border-top: 1px solid var(--hairline); padding-top: 8px; }
.drop-panel .dp-connect { width: 100%; margin-top: 4px; }
.drop-panel .dp-claim { width: 100%; margin-top: 10px; }
