:root {
  --night: #05070f;
  --night-lift: #10141f;
  --glass: #3ee0d0;
  --glass-deep: #157f78;
  --blood: #c4474e;
  --gold: #c4a24a;
  --paper: #f3efe6;
  --ink: #eef6f7;
  --mute: #c5d6da;
  --line: rgba(62, 224, 208, 0.28);
  --shadow: 12px 28px 48px -16px rgba(0, 0, 0, 0.7);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  --pad: clamp(20px, 4.2vw, 40px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; background: var(--night); color: var(--ink); }
body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
::selection { background: rgba(62, 224, 208, 0.32); color: var(--ink); }
:focus-visible {
  outline: 2px solid var(--glass);
  outline-offset: 3px;
}
input { caret-color: var(--glass); }

html { scrollbar-color: var(--glass-deep) var(--night); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--night); }
::-webkit-scrollbar-thumb { background: var(--glass-deep); }

#app { min-height: 100dvh; }

.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* —— 门：彩窗即墙 —— */
.gate {
  position: relative;
  isolation: isolate;
  justify-content: flex-end;
  padding: calc(var(--pad) + env(safe-area-inset-top)) var(--pad) calc(36px + env(safe-area-inset-bottom));
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--gold);
}
.gate-glass,
.gate-glass-bloom {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;
}
.gate-glass-bloom {
  filter: blur(28px) saturate(1.2);
  opacity: 0.72;
  transform: scale(1.08);
  -webkit-mask-image: radial-gradient(ellipse 70% 78% at 50% 42%, #000 18%, transparent 72%);
  mask-image: radial-gradient(ellipse 70% 78% at 50% 42%, #000 18%, transparent 72%);
}
.gate-glass {
  -webkit-mask-image: radial-gradient(ellipse 64% 72% at 50% 40%, #000 36%, rgba(0, 0, 0, 0.4) 62%, transparent 82%);
  mask-image: radial-gradient(ellipse 64% 72% at 50% 40%, #000 36%, rgba(0, 0, 0, 0.4) 62%, transparent 82%);
}
.gate-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(5, 7, 15, 0.08) 0%, rgba(5, 7, 15, 0.2) 36%, rgba(5, 7, 15, 0.88) 68%, #05070f 100%);
  pointer-events: none;
}
.gate-lab {
  position: relative;
  z-index: 2;
  align-self: flex-start;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.32em;
  text-decoration: none;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
}
.gate-copy {
  position: relative;
  z-index: 2;
  max-width: 22em;
}
.gate h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(36px, 6.2vw, 60px);
  line-height: 1.15;
  letter-spacing: 0.18em;
  white-space: nowrap;
}
.gate .latin {
  margin-top: 8px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(17px, 2.6vw, 22px);
  letter-spacing: 0.02em;
  color: var(--mute);
}
.gate .quote {
  margin-top: 22px;
  font-family: var(--serif);
  font-size: clamp(18px, 2.8vw, 24px);
  line-height: 1.5;
}
.gate .ask {
  margin-top: 14px;
  color: var(--mute);
  font-size: 16px;
  line-height: 1.85;
  max-width: 28em;
}
.gate-actions {
  position: relative;
  z-index: 2;
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
}
.btn {
  min-height: 52px;
  padding: 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  letter-spacing: 0.2em;
  background: var(--glass);
  color: var(--night);
  text-decoration: none;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.38; cursor: not-allowed; filter: none; transform: none; }
.btn-gold { background: var(--gold); color: var(--night); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--glass); }
.btn-blood { background: var(--blood); color: var(--paper); }

.linkish {
  min-height: 48px;
  padding: 0 2px;
  color: var(--mute);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}
.linkish:hover { color: var(--ink); }

a.shop-link {
  display: inline-flex;
  align-items: center;
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}
a.shop-link:hover { color: var(--ink); }
.shop-line {
  margin-top: 28px;
  max-width: 36em;
  font-size: 15px;
  line-height: 1.75;
  color: var(--mute);
}
.shop-line .shop-link {
  margin-left: 0.35em;
  min-height: 48px;
}

/* —— 牌桌 —— */
.table {
  background:
    radial-gradient(ellipse 90% 42% at 50% -10%, rgba(21, 127, 120, 0.22), transparent 58%),
    var(--night);
  padding: calc(10px + env(safe-area-inset-top)) var(--pad) calc(20px + env(safe-area-inset-bottom));
  gap: 16px;
}
.sill {
  height: 64px;
  margin: 0 calc(var(--pad) * -1);
  background: center 42% / 120% no-repeat;
  opacity: 0.88;
  pointer-events: none;
}
.col-oracle.is-empty { display: none; }
@media (max-width: 979px) {
  .col-oracle:not(.is-empty) {
    width: 92px;
    align-self: flex-start;
  }
}
.hud {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  color: var(--mute);
  font-family: var(--serif);
  font-size: 15px;
}
.hud-hint {
  flex: 1 0 100%;
  margin: 2px 0 0;
  font-size: 13px;
  letter-spacing: 0.04em;
}
.hud-exit { margin-left: auto; font-size: 14px; }
.hud strong {
  color: var(--ink);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.hud a {
  color: var(--mute);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.table {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  min-height: 0;
  overflow: auto;
  padding-bottom: 8px;
}

.flip {
  width: min(68vw, 260px);
  perspective: 1400px;
}
.flip-inner {
  position: relative;
  padding-top: 164.5%;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.16, 0.84, 0.32, 1);
}
.flip.is-face .flip-inner { transform: rotateY(180deg); }
.flip .face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.flip .back { background: #05070f; }
.flip .front { transform: rotateY(180deg); background: #111; }
.flip img { width: 100%; height: 100%; object-fit: cover; }
.card-zoom { cursor: zoom-in; }

.elem {
  width: min(48vw, 200px);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--paper);
}
.elem img {
  width: 100%;
  height: auto;
  max-height: 42vh;
  object-fit: contain;
  object-position: top;
}

.stamp {
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: 0.28em;
}
.stamp.ok { color: var(--glass); }
.stamp.no { color: var(--blood); }
.reason {
  max-width: 32em;
  text-align: center;
  color: var(--mute);
  font-size: 17px;
  line-height: 1.75;
}
.oracle-name {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.12em;
  text-align: center;
}

.rules {
  width: min(100%, 440px);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.85;
  text-align: left;
}
.rules dt {
  color: var(--glass);
  margin-top: 14px;
  letter-spacing: 0.08em;
}
.rules dt:first-child { margin-top: 0; color: var(--ink); font-size: 22px; }
.rules dd { color: var(--ink); }

.wager-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.chip-n {
  min-width: 52px;
  min-height: 52px;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--mute);
  font-family: var(--serif);
  font-size: 22px;
}
.chip-n:hover { color: var(--ink); }
.chip-n.on {
  background: var(--glass);
  color: var(--night);
  box-shadow: none;
}

.pile, .godhand, .mirrors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: min(100%, 560px);
}
.mini {
  width: 58px;
  overflow: hidden;
  box-shadow: 8px 14px 24px -12px rgba(0, 0, 0, 0.62);
  background: var(--paper);
}
.mini img { width: 100%; height: auto; }
.mini.is-fail { opacity: 0.42; filter: grayscale(0.45); }
.mini.on { outline: 2px solid var(--glass); outline-offset: 2px; }
button.mini { padding: 0; width: 72px; }

.chips {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  height: 88px;
}
.chips img {
  width: 40px;
  margin-left: -26px;
  box-shadow: 8px 12px 20px -12px rgba(0, 0, 0, 0.7);
}

.hand {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 8px;
  width: 100%;
  max-width: 720px;
}
.hand .insp {
  flex: 0 0 148px;
  text-align: left;
}
.hand img {
  width: 96px;
  box-shadow: var(--shadow);
  background: var(--paper);
}
.hand span {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  color: var(--mute);
  line-height: 1.45;
  white-space: normal;
}
.hand span b {
  display: block;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 2px;
}
.zero-pick {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 720px;
  justify-content: center;
}

.caption {
  font-size: 13px;
  color: var(--mute);
  letter-spacing: 0.12em;
  text-align: center;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  width: 100%;
  flex-shrink: 0;
  z-index: 5;
  padding: 14px 0 calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, var(--night) 28%);
}
.actions .btn { min-width: 168px; }

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  color: var(--mute);
}
.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--glass);
}

.dice {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.die {
  width: 40px;
  height: 40px;
  background: var(--paper);
  color: var(--night);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 22px;
  box-shadow: var(--shadow);
}

.zoom {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(5, 7, 15, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}
.zoom img {
  max-height: 92dvh;
  width: auto;
  max-width: 92vw;
  box-shadow: var(--shadow);
}

.end.table {
  display: flex;
  flex-direction: column;
  height: auto;
  max-height: none;
  min-height: 100dvh;
  overflow: auto;
  padding-top: 8px;
}
.end {
  max-width: 40em;
  margin: 0 auto;
  width: 100%;
}
.end .oracles img { width: 100%; }
.end h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(40px, 8vw, 64px);
  letter-spacing: 0.16em;
  line-height: 1.05;
}
.end p { margin-top: 18px; font-size: 18px; }
.end .oracles {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.end .oracles figure { width: 92px; }
.end .oracles figcaption {
  margin-top: 8px;
  font-size: 12px;
  color: var(--mute);
  text-align: center;
  font-family: var(--serif);
}
.end .ach { margin-top: 20px; color: var(--mute); }

.ask-gender {
  position: fixed;
  inset: 0;
  z-index: 24;
  background: rgba(5, 7, 15, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.ask-gender .sheet {
  width: min(100%, 28em);
  background: var(--night-lift);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 28px 24px 24px;
}
.ask-gender p {
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
}
.ask-gender p + p { margin-top: 10px; color: var(--mute); }
.ask-gender .row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--night-lift);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 12px 18px;
  font-size: 14px;
  pointer-events: none;
  z-index: 30;
}

@media (max-width: 720px) {
  .gate {
    height: 100dvh;
    overflow: auto;
    justify-content: flex-end;
  }
  .gate-glass,
  .gate-glass-bloom {
    inset: 0 0 auto 0;
    height: 34dvh;
    background-size: contain;
    background-position: center 40%;
  }
  .gate-veil {
    background: linear-gradient(180deg, transparent 12%, rgba(5, 7, 15, 0.35) 28%, #05070f 48%);
  }
  .gate h1 { font-size: 32px; letter-spacing: 0.12em; }
  .gate .ask { font-size: 17px; line-height: 1.6; margin-top: 10px; }
  .gate .quote { margin-top: 10px; }
  .gate-actions { margin-top: 16px; }
}
@media (min-width: 721px) {
  .gate {
    justify-content: center;
    padding-left: 8vw;
  }
  .gate-glass,
  .gate-glass-bloom {
    inset: 0;
    width: auto;
    height: auto;
    background-position: 72% 50%;
    background-size: auto 96%;
  }
  .gate-glass-bloom {
    background-size: auto 108%;
    transform: none;
    filter: blur(28px) saturate(1.18);
    opacity: 0.62;
    -webkit-mask-image: radial-gradient(ellipse 48% 80% at 72% 50%, #000 20%, transparent 72%);
    mask-image: radial-gradient(ellipse 48% 80% at 72% 50%, #000 20%, transparent 72%);
  }
  .gate-glass {
    -webkit-mask-image: radial-gradient(ellipse 42% 74% at 72% 50%, #000 34%, rgba(0, 0, 0, 0.5) 58%, transparent 78%);
    mask-image: radial-gradient(ellipse 42% 74% at 72% 50%, #000 34%, rgba(0, 0, 0, 0.5) 58%, transparent 78%);
  }
  .gate-veil {
    background: linear-gradient(90deg, #05070f 0%, rgba(5, 7, 15, 0.9) 30%, rgba(5, 7, 15, 0.22) 52%, transparent 66%);
  }
  .gate-copy { max-width: 24em; }
}
@media (min-width: 980px) {
  .table {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr) 220px;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    gap: 18px 40px;
    padding: 20px 48px 24px;
  }
  .sill { grid-column: 1 / -1; grid-row: 1; margin: 0 -48px; height: 80px; }
  .hud { grid-column: 1 / -1; grid-row: 2; }
  .col-oracle { grid-column: 1; grid-row: 3; align-self: start; overflow: auto; min-height: 0; }
  .col-oracle.is-empty { display: none; }
  .table:has(.col-oracle.is-empty) .stage { grid-column: 1 / 3; }
  .stage { grid-column: 2; grid-row: 3; }
  .col-side { grid-column: 3; grid-row: 3; overflow: auto; min-height: 0; }
  .hand, .zero-pick { grid-column: 1 / -1; grid-row: 4; }
  .actions { grid-column: 1 / -1; grid-row: 5; }
  .flip { width: 280px; }
  .elem { width: 230px; }
  .col-oracle .flip { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .flip-inner { transition: none; }
  .flip.is-face .flip-inner { transform: none; }
  .flip .front { transform: none; }
  .flip:not(.is-face) .front { display: none; }
  .flip.is-face .back { display: none; }
  .btn:active { transform: none; }
}

/* —— 选模式、阶梯 —— */
.modes {
  min-height: 100dvh;
  padding: calc(20px + env(safe-area-inset-top)) var(--pad) calc(36px + env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse 80% 40% at 50% -10%, rgba(21, 127, 120, 0.2), transparent 60%),
    var(--night);
}
.modes h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(32px, 5vw, 48px);
  letter-spacing: 0.14em;
  margin-top: 12px;
}
.modes-back { display: inline-flex; margin-top: 8px; }
.mode-grid {
  display: grid;
  gap: 22px;
  margin-top: 28px;
  max-width: 920px;
}
.mode-card {
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}
.mode-card h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 28px;
  letter-spacing: 0.14em;
  line-height: 1.3;
}
.kicker {
  font-family: var(--serif);
  letter-spacing: 0.28em;
  color: var(--gold);
  font-size: 12px;
}
.mode-card p { font-size: 17px; line-height: 1.75; color: var(--mute); }
.mode-card .btn { margin-top: 4px; }

.table.ladder {
  height: auto;
  min-height: 100dvh;
  max-height: none;
  overflow: auto;
}
.ladder .col-oracle {
  width: 100%;
  max-width: 36em;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.ladder .col-oracle > img { width: min(46vw, 180px); box-shadow: var(--shadow); }
.law-fixed, .law-next {
  font-size: 17px;
  line-height: 1.7;
  margin-top: 10px;
  text-align: center;
}
.law-next { color: var(--gold); }
.rungs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: min(100%, 680px);
}
.rung {
  min-height: 132px;
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 8px 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.rung i {
  font-style: normal;
  font-family: var(--serif);
  letter-spacing: 0.18em;
  font-size: 13px;
  color: var(--gold);
}
.rung img { width: 100%; height: auto; }
.rung em { font-style: normal; color: var(--mute); font-size: 13px; }
.rung .seen-as { color: var(--gold); letter-spacing: 0.04em; }
.object-banner {
  width: min(100%, 680px);
  margin: 18px auto 0;
  box-shadow: inset 0 0 0 1px var(--blood);
  padding: 12px 14px;
  font-size: 17px;
  line-height: 1.65;
  text-align: center;
}
.axiom-card {
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 16px;
}
.axiom-card h3 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: 0.16em;
  font-size: 22px;
  margin: 4px 0 8px;
}
.axiom-card p { color: var(--mute); font-size: 16px; line-height: 1.65; }
.axiom-card.is-spent { opacity: 0.55; }
.seal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  color: var(--mute);
  font-family: var(--serif);
  letter-spacing: 0.14em;
}
.pips { display: inline-flex; gap: 6px; }
.pip {
  width: 10px;
  height: 10px;
  box-shadow: inset 0 0 0 1px var(--gold);
}
.pip.on { background: var(--gold); }
.ladder-card {
  flex: 0 0 auto;
  width: 92px;
  padding: 0;
  text-align: center;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.ladder-card img { width: 100%; height: auto; }
.ladder-card span {
  display: block;
  padding: 4px 2px 6px;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--night);
}
.ladder-card.on { outline: 2px solid var(--glass); outline-offset: 3px; }
.insp-line { color: var(--mute); }
.ladder-axiom {
  min-height: 100dvh;
  padding: calc(12px + env(safe-area-inset-top)) var(--pad) 40px;
  background: var(--night);
}
.ladder-axiom-copy { max-width: 960px; margin: 12px auto 0; }
.ladder-axiom h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: 0.12em;
  margin: 8px 0 10px;
}
.ladder-axiom-copy > p { color: var(--mute); font-size: 17px; max-width: 36em; }
.axiom-offer {
  display: grid;
  gap: 14px;
  margin: 22px 0 18px;
}
.axiom-offer button {
  text-align: left;
  padding: 20px 18px;
  min-height: 168px;
  box-shadow: inset 0 0 0 1px var(--line);
  background: transparent;
}
.axiom-offer button:hover { box-shadow: inset 0 0 0 1px var(--glass); }
.axiom-offer strong {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: 0.16em;
  font-size: 22px;
  margin-bottom: 10px;
}
.axiom-offer span { color: var(--mute); font-size: 17px; line-height: 1.65; }
.end .seed { margin-top: 8px; color: var(--mute); font-size: 13px; letter-spacing: 0.08em; }
.fb {
  width: min(100%, 680px);
  margin: 28px auto 8px;
  text-align: left;
}
.fb h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.08em;
  margin: 8px 0;
}
.fb > p { color: var(--mute); font-size: 17px; line-height: 1.7; }
.fb fieldset { border: 0; margin: 18px 0; padding: 0; }
.fb legend { font-size: 17px; margin-bottom: 8px; }
.fb-options { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-opt {
  min-height: 44px;
  padding: 8px 12px;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.4;
  text-align: left;
}
.fb-opt.is-on { box-shadow: inset 0 0 0 1px var(--gold); color: var(--gold); }
.fb-note { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 17px; }
.fb-note span { color: var(--mute); font-size: 13px; }
.fb textarea.fb-opinion { min-height: 168px; }
.fb textarea {
  width: 100%;
  margin-top: 8px;
  min-height: 96px;
  padding: 10px 12px;
  background: transparent;
  color: var(--ink);
  border: 0;
  box-shadow: inset 0 0 0 1px var(--line);
  font: inherit;
  font-size: 16px;
  line-height: 1.6;
  resize: vertical;
}
.fb-count, .fb-error { color: var(--mute); font-size: 13px; margin: 6px 0; }
.fb-error { color: var(--blood); }
.fb .btn { margin-top: 8px; }
.fb.is-sent h3 { letter-spacing: 0.06em; }

@media (min-width: 800px) {
  .mode-grid { grid-template-columns: 1fr 1fr; }
  .axiom-offer { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .rungs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ladder .hud {
    position: sticky;
    top: 0;
    z-index: 4;
    background: var(--night);
    padding: 10px 0 8px;
    order: 1;
  }
  .ladder .hud strong { font-size: 22px; }
  .table.ladder { overflow: visible; }
  .ladder .rung { min-height: 0; }
  .ladder .rung img { width: auto; max-height: 112px; }
  .ladder .col-oracle > img { width: min(42vw, 148px); }
  .ladder .rungs { order: 1; }
  .ladder .object-banner,
  .ladder .guide-hold { order: 2; }
  .ladder .stage > .reason:not(.pending-note) { order: 3; }
  .ladder .actions .btn {
    white-space: normal;
    line-height: 1.35;
    padding: 10px 16px;
    letter-spacing: 0.08em;
    max-width: 100%;
  }
  .mode-card h2 { font-size: 24px; }
  .table.ladder { display: flex; flex-direction: column; }
  .ladder .hud { order: 1; }
  .ladder .col-oracle { order: 2; }
  .ladder .stage { order: 3; }
  .ladder .hand { order: 4; }
  .ladder .actions { order: 5; }
  .ladder .col-side { order: 6; }
}
@media (min-width: 980px) {
  .table.ladder {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    grid-template-columns: 300px minmax(0, 1fr) 260px;
  }
  .ladder .col-oracle,
  .ladder .col-side,
  .ladder .stage {
    align-self: stretch;
    min-height: 0;
    max-height: 100%;
    overflow: auto;
  }
  .ladder .col-oracle { width: auto; max-width: none; }
  .ladder .col-oracle > img { width: min(100%, 148px); }
  .ladder .rung { min-height: 0; }
  .ladder .rung img { width: auto; max-height: 78px; }
}

/* 背景音乐 / 问规则：右下角叠放，不抢牌桌 */
.bgm-toggle,
.oa-ask-toggle {
  position: fixed;
  z-index: 50;
  right: max(14px, env(safe-area-inset-right));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid rgba(196, 162, 74, 0.55);
  border-radius: 999px;
  background: rgba(5, 7, 15, 0.78);
  color: var(--mute);
  font: 500 12px/1 var(--sans);
  letter-spacing: 0.12em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px -16px rgba(0, 0, 0, 0.75);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.bgm-toggle {
  bottom: calc(14px + env(safe-area-inset-bottom));
}
.oa-ask-toggle {
  bottom: calc(64px + env(safe-area-inset-bottom));
  z-index: 51;
}
.bgm-toggle:hover,
.oa-ask-toggle:hover {
  color: var(--ink);
  border-color: var(--gold);
  background: rgba(16, 20, 31, 0.9);
}
.bgm-toggle.is-off {
  color: rgba(197, 214, 218, 0.55);
  border-color: rgba(62, 224, 208, 0.2);
}
.oa-ask-toggle.is-open {
  color: var(--ink);
  border-color: var(--gold);
  background: rgba(16, 20, 31, 0.95);
}
.bgm-ico,
.oa-ask-ico {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--glass);
  box-shadow: 0 0 0 3px rgba(62, 224, 208, 0.18);
}
.bgm-toggle.is-off .bgm-ico {
  background: transparent;
  border: 1px solid rgba(197, 214, 218, 0.45);
  box-shadow: none;
}
.oa-ask-toggle .oa-ask-ico {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(196, 162, 74, 0.2);
}

.oa-ask-panel {
  position: fixed;
  z-index: 52;
  right: max(14px, env(safe-area-inset-right));
  bottom: calc(118px + env(safe-area-inset-bottom));
  width: min(380px, calc(100vw - 28px));
  max-height: min(68vh, 540px);
  display: flex;
  flex-direction: column;
  background: rgba(8, 11, 20, 0.96);
  border: 1px solid rgba(196, 162, 74, 0.45);
  box-shadow: 0 22px 48px -20px rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--ink);
}
.oa-ask-panel[hidden] { display: none; }
.oa-ask-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.oa-ask-kicker {
  font-family: var(--serif);
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--gold);
}
.oa-ask-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.14em;
  margin-top: 4px;
}
.oa-ask-x {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  font-size: 22px;
  color: var(--mute);
  cursor: pointer;
  flex: none;
}
.oa-ask-x:hover { color: var(--ink); }
.oa-ask-body { flex: 1; overflow: auto; padding: 14px 16px 8px; }
.oa-ask-welcome { font-size: 13.5px; line-height: 1.85; color: var(--mute); }
.oa-ask-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.oa-ask-chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--mute);
  font-size: 12px;
  padding: 8px 10px;
  min-height: 40px;
  cursor: pointer;
  font-family: var(--sans);
  text-align: left;
  line-height: 1.45;
}
.oa-ask-chip:hover {
  border-color: var(--gold);
  color: var(--ink);
}
.oa-ask-thread { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.oa-ask-msg-user { align-self: flex-end; max-width: 92%; }
.oa-ask-msg-assistant { align-self: flex-start; max-width: 92%; }
.oa-ask-meta {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--mute);
  margin-bottom: 4px;
}
.oa-ask-bubble {
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(16, 20, 31, 0.9);
}
.oa-ask-msg-user .oa-ask-bubble {
  background: rgba(196, 162, 74, 0.14);
  border-color: rgba(196, 162, 74, 0.35);
}
.oa-ask-link {
  display: inline-block;
  margin-top: 6px;
  color: var(--gold);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.oa-ask-form {
  display: flex;
  border-top: 1px solid var(--line);
  background: rgba(5, 7, 15, 0.9);
}
.oa-ask-input {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 12px 14px;
  font-size: 14px;
  font-family: var(--sans);
  color: var(--ink);
  outline: none;
  min-height: 48px;
}
.oa-ask-input::placeholder { color: rgba(197, 214, 218, 0.45); }
.oa-ask-send {
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--gold);
  color: #05070f;
  padding: 0 16px;
  letter-spacing: 0.16em;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 600;
}
.oa-ask-send:hover { filter: brightness(1.06); }
.oa-ask-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 8px 14px 10px;
  border-top: 1px solid rgba(62, 224, 208, 0.12);
}
.oa-ask-shop {
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-decoration: none;
}
.oa-ask-shop:hover { text-decoration: underline; text-underline-offset: 4px; }
.oa-ask-hint { font-size: 11px; color: var(--mute); letter-spacing: 0.04em; text-align: right; }

/* 结局底部小字。只加大结局操作区的下边距，给右下角固定按钮留空。 */
.end .zx-quiet {
  flex: 1 0 100%;
  margin: 4px 0 0;
  padding: 0 12px;
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: 0.04em;
}
.end .zx-quiet a {
  display: inline-block;
  padding: 8px 4px;
  color: var(--mute);
  font-size: 12px;
  line-height: 1.7;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.end .actions {
  padding-bottom: calc(112px + env(safe-area-inset-bottom));
}

@media (max-width: 620px) {
  .oa-ask-panel {
    right: max(10px, env(safe-area-inset-right));
    left: max(10px, env(safe-area-inset-left));
    width: auto;
    bottom: calc(118px + env(safe-area-inset-bottom));
    max-height: min(62vh, 520px);
  }
}