/* ============================================================
   隔空掷筊 · 阴杯乌杯
   Token 系统
   色：--void 底 / --deep-red 主仪式红 / --ember-red 朱笔强调
       --rice-gold HUD 描边与文字 / --jade-teal 信号点
   字：展示字 = 衬线（仪式感）｜界面字 = 无衬线｜数据字 = 等宽（传感读数）
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@600;700&family=Noto+Sans+SC:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --void: #050304;
  --ink-black: #120709;
  --deep-red: #5c0f1c;
  --ember-red: #c23b2f;
  --rice-gold: #d8b877;
  --rice-gold-dim: rgba(216, 184, 119, 0.4);
  --jade-teal: #4fd6c0;
  --mist-white: #f2ece1;

  --font-display: 'Noto Serif SC', serif;
  --font-ui: 'Noto Sans SC', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--void);
  color: var(--mist-white);
  font-family: var(--font-ui);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- 舞台：摄像头永远是主体 ---------- */

#stage {
  position: fixed;
  inset: 0;
  background: var(--void);
}

#stage.manual-mode::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(194,59,47,0.2), transparent 34%),
    radial-gradient(ellipse at 50% 86%, rgba(216,184,119,0.14), transparent 46%),
    linear-gradient(180deg, #090405 0%, #17080c 48%, #050304 100%);
}

#camera-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* 镜像，像照镜子 */
  filter: saturate(0.75) contrast(1.05) brightness(0.85);
}

#camera-video.is-hidden { display: none; }

#stage.manual-mode #camera-video,
#stage.manual-mode #press-zone {
  display: none;
}

#stage.manual-mode #effects-canvas {
  transform: none;
}

#effects-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: scaleX(-1);
}

/* 暗角渗透，让画面往仪式感靠拢 */
#vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 40%, rgba(5,3,4,0.75) 100%),
    linear-gradient(to bottom, rgba(92,15,28,0.35), transparent 22%, transparent 78%, rgba(5,3,4,0.85));
}

/* ---------- HUD 取景框 ---------- */

#hud-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--rice-gold-dim);
}
.corner.tl { top: calc(18px + var(--safe-top)); left: 18px; border-right: none; border-bottom: none; }
.corner.tr { top: calc(18px + var(--safe-top)); right: 18px; border-left: none; border-bottom: none; }
.corner.bl { bottom: calc(18px + var(--safe-bottom)); left: 18px; border-right: none; border-top: none; }
.corner.br { bottom: calc(18px + var(--safe-bottom)); right: 18px; border-left: none; border-top: none; }

#status-bar {
  position: absolute;
  top: calc(20px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--rice-gold);
  text-transform: uppercase;
  white-space: nowrap;
}

#status-bar .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--jade-teal);
  box-shadow: 0 0 6px var(--jade-teal);
  animation: pulse-dot 1.6s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

#phase-label {
  position: absolute;
  bottom: calc(20px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--mist-white);
  opacity: 0.75;
  text-align: center;
}

/* ---------- 启动页 ---------- */

#screen-start {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 32px;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(92,15,28,0.55), transparent 60%),
    var(--void);
  z-index: 20;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.35em;
  color: var(--jade-teal);
  text-transform: uppercase;
  margin-bottom: 18px;
}

.title-glyph {
  font-family: var(--font-display);
  font-size: clamp(40px, 12vw, 72px);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--mist-white);
  margin: 0 0 2px;
  line-height: 1.15;
}

.title-glyph em {
  font-style: normal;
  color: var(--ember-red);
}

.subtitle {
  margin-top: 14px;
  font-size: 14px;
  color: var(--rice-gold);
  letter-spacing: 0.08em;
  max-width: 560px;
  line-height: 1.8;
}

.rules-strip {
  width: min(720px, 90vw);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 22px;
  border-top: 1px solid rgba(216,184,119,0.24);
  border-bottom: 1px solid rgba(216,184,119,0.24);
  background: rgba(216,184,119,0.2);
}

.rule-item {
  min-width: 0;
  padding: 14px 12px 13px;
  background: rgba(5,3,4,0.62);
}

.rule-item strong {
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.16em;
  color: var(--mist-white);
  margin-bottom: 5px;
}

.rule-item span {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  line-height: 1.5;
  color: rgba(216,184,119,0.86);
  overflow-wrap: anywhere;
}

.ritual-note {
  margin: 12px 0 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1.7;
  color: rgba(242,236,225,0.48);
}

.disclaimer {
  margin-top: 10px;
  font-size: 11px;
  color: rgba(242,236,225,0.4);
  letter-spacing: 0.08em;
}

.btn-primary {
  margin-top: 32px;
  padding: 16px 42px;
  background: transparent;
  border: 1px solid var(--rice-gold);
  color: var(--mist-white);
  font-size: 15px;
  letter-spacing: 0.2em;
  border-radius: 2px;
  position: relative;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: -1px;
  border: 1px solid var(--jade-teal);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: rgba(216,184,119,0.08);
  box-shadow: 0 0 24px rgba(216,184,119,0.25);
  outline: none;
}
.btn-primary:hover::before,
.btn-primary:focus-visible::before { opacity: 1; }

.btn-primary:disabled,
.btn-secondary:disabled,
.manual-throw-button:disabled {
  cursor: default;
  opacity: 0.45;
  box-shadow: none;
}

.round-picker {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px;
  border: 1px solid rgba(216,184,119,0.25);
  background: rgba(5,3,4,0.36);
}

.round-picker span {
  padding: 0 8px 0 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(242,236,225,0.55);
  white-space: nowrap;
}

.round-option {
  min-width: 48px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  background: rgba(216,184,119,0.08);
  color: rgba(242,236,225,0.76);
  font-size: 12px;
  letter-spacing: 0.08em;
  border-radius: 2px;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.round-option:hover,
.round-option:focus-visible {
  border-color: rgba(216,184,119,0.45);
  outline: none;
}

.round-option.is-selected {
  border-color: var(--rice-gold);
  background: rgba(216,184,119,0.18);
  color: var(--mist-white);
}

.mode-actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.mode-actions .btn-primary,
.mode-actions .btn-secondary {
  margin-top: 0;
}

.btn-secondary {
  padding: 16px 34px;
  background: rgba(5,3,4,0.2);
  border: 1px solid rgba(216,184,119,0.34);
  color: rgba(242,236,225,0.76);
  font-size: 15px;
  letter-spacing: 0.18em;
  border-radius: 2px;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: rgba(216,184,119,0.07);
  border-color: var(--rice-gold);
  color: var(--mist-white);
  outline: none;
}

.btn-ghost {
  margin-top: 18px;
  background: none;
  border: none;
  color: rgba(242,236,225,0.5);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-decoration: underline;
  text-underline-offset: 4px;
}

#screen-start.is-hidden,
#screen-permission-error.is-hidden { display: none; }

#screen-permission-error {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  background: rgba(5,3,4,0.96);
}

/* ---------- 筊杯悬浮层 ---------- */

#goblet-layer {
  position: absolute;
  top: 10%;
  left: 50%;
  width: min(58vw, 420px);
  height: min(28vw, 210px);
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
  transition: transform 0.18s ease-out, opacity 0.18s ease-out;
}

.jiaobei-pair {
  position: absolute;
  inset: 0;
  transform: translateY(0);
  transition: transform 0.55s cubic-bezier(.7,-0.18,.84,1);
}

.jiaobei-cup {
  position: absolute;
  top: 18%;
  width: 72%;
  height: auto;
  object-fit: contain;
  filter:
    drop-shadow(0 18px 28px rgba(0,0,0,0.42))
    drop-shadow(0 0 14px rgba(194,59,47,0.18));
  transition: transform 0.42s ease-out, filter 0.2s ease-out, opacity 0.2s ease-out;
}

.cup-left {
  left: -2%;
  transform: rotate(-11deg) translateY(0);
}

.cup-right {
  right: -2%;
  transform: rotate(11deg) translateY(0) scaleX(-1);
}

.jiaobei-shadow {
  position: absolute;
  left: 50%;
  bottom: -4%;
  width: 62%;
  height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,0.42);
  opacity: 0;
  transform: translateX(-50%) scaleX(0.8);
  transition: opacity 0.34s ease 0.24s, transform 0.34s ease 0.24s;
}

@keyframes jiaobei-idle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.jiaobei-pair {
  animation: jiaobei-idle 4.5s ease-in-out infinite;
}

/* 掷筊触发态 */
#goblet-layer.is-falling .jiaobei-pair {
  animation: none;
  transform: translateY(310px);
}

#goblet-layer.is-falling .cup-left {
  transform: rotate(-31deg) translate(-8px, 4px);
}

#goblet-layer.is-falling .cup-right {
  transform: rotate(28deg) translate(8px, 2px) scaleX(-1);
}

#goblet-layer.is-falling .jiaobei-shadow {
  opacity: 0.52;
  transform: translateX(-50%) scaleX(1.35);
}

/* 结果态：正反面按掷筊规则切换 */
#goblet-layer.result-圣筊 .cup-left,
#goblet-layer.result-圣筊 .cup-right {
  filter:
    drop-shadow(0 16px 28px rgba(0,0,0,0.4))
    drop-shadow(0 0 18px rgba(79,214,192,0.32));
}

#goblet-layer.result-笑筊 .cup-left,
#goblet-layer.result-笑筊 .cup-right {
  filter:
    drop-shadow(0 16px 28px rgba(0,0,0,0.4))
    drop-shadow(0 0 18px rgba(216,184,119,0.28));
}

#goblet-layer.result-阴筊 .cup-left,
#goblet-layer.result-阴筊 .cup-right {
  filter:
    drop-shadow(0 16px 28px rgba(0,0,0,0.45))
    saturate(0.82);
}

/* ---------- 底部掷筊感应区 ---------- */

#press-zone {
  position: absolute;
  left: 50%;
  bottom: calc(44px + var(--safe-bottom));
  width: min(72vw, 520px);
  height: min(17vh, 132px);
  min-height: 92px;
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
}

.throw-lane {
  position: absolute;
  inset: 0;
}

.cup-slot {
  position: absolute;
  bottom: 26px;
  width: clamp(44px, 12vw, 72px);
  height: 24px;
  border-top: 1.5px solid rgba(216,184,119,0.48);
  opacity: 0.72;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

.cup-slot::before,
.cup-slot::after {
  content: '';
  position: absolute;
  top: -1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(216,184,119,0.8);
  box-shadow: 0 0 10px rgba(216,184,119,0.2);
}

.cup-slot::before { left: 0; transform: translateY(-50%); }
.cup-slot::after { right: 0; transform: translateY(-50%); }

.cup-slot span {
  position: absolute;
  left: 50%;
  top: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--rice-gold);
  transform: translate(-50%, -50%);
  background: rgba(18,7,9,0.76);
}

.slot-left {
  left: 22%;
  transform: translateX(-50%) rotate(-5deg);
}

.slot-right {
  right: 22%;
  transform: translateX(50%) rotate(5deg);
}

.lane-line {
  position: absolute;
  left: 21%;
  right: 21%;
  bottom: 38px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(216,184,119,0.2), var(--rice-gold-dim), rgba(216,184,119,0.2), transparent);
}

.lane-line::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 78px;
  height: 58px;
  border-left: 1px solid rgba(216,184,119,0.22);
  border-bottom: 1px solid rgba(216,184,119,0.22);
  border-radius: 0 0 0 58px;
  transform: translateX(-50%) rotate(-22deg);
  transform-origin: left bottom;
}

.lane-glow {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 38%;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(79,214,192,0.18), transparent 68%);
  opacity: 0;
  transform: translateX(-50%) scale(0.78);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

#press-zone.is-active .cup-slot {
  border-color: var(--jade-teal);
  opacity: 1;
  box-shadow: 0 -10px 18px rgba(79,214,192,0.12);
}

#press-zone.is-active .cup-slot::before,
#press-zone.is-active .cup-slot::after,
#press-zone.is-active .cup-slot span {
  background: var(--jade-teal);
  box-shadow: 0 0 13px rgba(79,214,192,0.45);
}

#press-zone.is-active .lane-glow {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

#press-zone.is-charged .cup-slot {
  border-color: var(--rice-gold);
  box-shadow: 0 -12px 24px rgba(216,184,119,0.28);
}

@keyframes charged-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.charge-arc {
  position: absolute;
  width: 54px;
  height: 54px;
  left: 50%;
  bottom: 4px;
  margin-left: -27px;
  transform: rotate(-90deg);
  opacity: 0.85;
}

.charge-arc circle {
  fill: none;
  stroke-width: 3;
}
.charge-arc .track { stroke: rgba(216,184,119,0.15); }
.charge-arc .fill {
  stroke: var(--jade-teal);
  stroke-linecap: round;
  stroke-dasharray: 377;
  stroke-dashoffset: 377;
  transition: stroke-dashoffset 0.08s linear;
}

#press-zone.is-charged .charge-arc .fill { stroke: var(--rice-gold); }

.press-label {
  position: absolute;
  left: 50%;
  bottom: -18px;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--mist-white);
  opacity: 0.68;
  white-space: nowrap;
}

/* ---------- 轨迹清晰度条 ---------- */

#force-meter {
  position: absolute;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  transform: translateX(-50%);
  width: min(50vw, 220px);
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
#force-meter.is-visible { opacity: 1; }

#force-meter .track {
  height: 3px;
  background: rgba(216,184,119,0.15);
  position: relative;
  overflow: hidden;
}
#force-meter .fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--rice-gold), var(--ember-red));
  transition: width 0.06s linear;
}
#force-meter .caption {
  margin-top: 6px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--rice-gold);
  opacity: 0.7;
}

/* ---------- 手动掷筊控制 ---------- */

#manual-panel {
  position: absolute;
  left: 50%;
  bottom: calc(42px + var(--safe-bottom));
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 14px;
  transform: translateX(-50%);
  padding: 10px 12px 10px 18px;
  border: 1px solid rgba(216,184,119,0.32);
  background: rgba(18,7,9,0.74);
  box-shadow: 0 18px 40px rgba(0,0,0,0.32), 0 0 24px rgba(194,59,47,0.14);
  backdrop-filter: blur(12px);
}

#manual-panel.is-hidden {
  display: none;
}

#manual-round-label {
  margin: 0;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--rice-gold);
  white-space: nowrap;
}

.manual-throw-button {
  min-width: 124px;
  min-height: 42px;
  padding: 0 22px;
  border: 1px solid var(--rice-gold);
  background: rgba(194,59,47,0.16);
  color: var(--mist-white);
  font-size: 14px;
  letter-spacing: 0.16em;
  border-radius: 2px;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.manual-throw-button:hover,
.manual-throw-button:focus-visible {
  background: rgba(194,59,47,0.26);
  box-shadow: 0 0 22px rgba(216,184,119,0.2);
  outline: none;
}

.manual-throw-button:active:not(:disabled) {
  transform: translateY(1px);
}

/* ---------- 结果面板 ---------- */

#result-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  padding: 28px 24px calc(28px + var(--safe-bottom));
  background: linear-gradient(to top, rgba(5,3,4,0.96) 55%, transparent);
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(.4,0,.2,1);
  text-align: center;
}
#result-panel.is-visible { transform: translateY(0); }

#result-gua {
  font-family: var(--font-display);
  font-size: clamp(30px, 8vw, 46px);
  font-weight: 700;
  color: var(--ember-red);
  letter-spacing: 0.15em;
  margin: 0 0 4px;
}

#result-gua-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--rice-gold);
  text-transform: uppercase;
  margin-bottom: 16px;
}

#result-text {
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--mist-white);
  max-width: 480px;
  margin: 0 auto 22px;
  min-height: 3.8em;
}

#result-text.is-loading { color: rgba(242,236,225,0.4); }

#result-hint {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.15em;
  color: var(--jade-teal);
  opacity: 0.8;
  margin: 0;
}

/* ---------- 手势指引提示（不遮挡视野） ---------- */

#guide-toast {
  position: absolute;
  top: calc(58px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  z-index: 6;
  font-size: 12.5px;
  letter-spacing: 0.1em;
  color: var(--mist-white);
  background: rgba(18,7,9,0.55);
  border: 1px solid var(--rice-gold-dim);
  padding: 8px 18px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
  white-space: nowrap;
  max-width: 88vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
#guide-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 三杯记录 ---------- */

#throw-ledger {
  position: absolute;
  top: calc(88px + var(--safe-top));
  right: 22px;
  z-index: 7;
  width: 150px;
  pointer-events: none;
  color: var(--mist-white);
}

.ledger-title {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.18em;
  color: var(--rice-gold);
}

.ledger-note {
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(242,236,225,0.48);
}

.ledger-list {
  margin-top: 12px;
  border-left: 1px solid rgba(216,184,119,0.28);
}

.ledger-list.is-long {
  margin-top: 10px;
}

.ledger-item {
  position: relative;
  min-height: 58px;
  padding: 2px 0 14px 18px;
  opacity: 0.46;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.ledger-list.is-long .ledger-item {
  min-height: 42px;
  padding-bottom: 8px;
}

.ledger-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(216,184,119,0.42);
  box-shadow: 0 0 0 rgba(216,184,119,0);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.ledger-item.is-current,
.ledger-item.is-done {
  opacity: 1;
}

.ledger-item.is-current {
  transform: translateX(-3px);
}

.ledger-item.is-current::before {
  background: var(--jade-teal);
  box-shadow: 0 0 14px rgba(79,214,192,0.55);
}

.ledger-item.is-done::before {
  background: var(--rice-gold);
  box-shadow: 0 0 12px rgba(216,184,119,0.32);
}

.ledger-item.result-圣筊::before {
  background: var(--jade-teal);
}

.ledger-item.result-笑筊::before {
  background: var(--rice-gold);
}

.ledger-item.result-阴筊::before {
  background: var(--ember-red);
}

.ledger-index {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(242,236,225,0.46);
  letter-spacing: 0.18em;
  margin-bottom: 3px;
}

.ledger-item strong {
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.14em;
  color: var(--mist-white);
}

.ledger-list.is-long .ledger-item strong {
  font-size: 14px;
}

.ledger-item small {
  display: block;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: rgba(216,184,119,0.76);
  line-height: 1.45;
}

.ledger-list.is-long .ledger-item small {
  font-size: 8px;
  line-height: 1.3;
}

/* ---------- 响应式 ---------- */

@media (max-width: 480px) {
  #screen-start {
    padding: 24px 22px;
  }

  .eyebrow {
    margin-bottom: 12px;
    font-size: 10px;
  }

  .title-glyph {
    font-size: clamp(34px, 13vw, 52px);
  }

  .rules-strip {
    grid-template-columns: 1fr;
    width: min(340px, 92vw);
    margin-top: 16px;
  }

  .rule-item {
    padding: 9px 12px;
  }

  .rule-item strong {
    display: inline;
    font-size: 15px;
    margin-right: 10px;
  }

  .rule-item span {
    display: inline;
    font-size: 9.5px;
  }

  .ritual-note {
    max-width: 330px;
  }

  .btn-primary {
    margin-top: 24px;
  }

  .round-picker {
    margin-top: 14px;
    max-width: 92vw;
    flex-wrap: wrap;
    justify-content: center;
  }

  .mode-actions {
    margin-top: 16px;
    width: min(340px, 92vw);
  }

  .mode-actions .btn-primary,
  .mode-actions .btn-secondary {
    width: 100%;
    padding: 13px 18px;
    font-size: 13px;
  }

  #manual-panel {
    bottom: calc(30px + var(--safe-bottom));
    width: min(92vw, 360px);
    justify-content: space-between;
    gap: 10px;
  }

  #manual-round-label {
    font-size: 12px;
    letter-spacing: 0.12em;
  }

  .manual-throw-button {
    min-width: 112px;
    padding: 0 16px;
  }

  #press-zone {
    bottom: calc(42px + var(--safe-bottom));
    width: 88vw;
    height: 108px;
  }

  #goblet-layer {
    top: 12%;
    width: 76vw;
    height: 34vw;
  }

  #throw-ledger {
    top: calc(54px + var(--safe-top));
    left: 50%;
    right: auto;
    width: min(88vw, 360px);
    transform: translateX(-50%);
    text-align: center;
  }

  .ledger-title,
  .ledger-note {
    display: none;
  }

  .ledger-list {
    display: grid;
    grid-template-columns: repeat(var(--ledger-columns, 3), minmax(0, 1fr));
    gap: 1px;
    margin-top: 0;
    border-left: none;
    border-top: 1px solid rgba(216,184,119,0.22);
    border-bottom: 1px solid rgba(216,184,119,0.22);
    background: rgba(216,184,119,0.16);
  }

  .ledger-item {
    min-height: 50px;
    padding: 7px 6px 8px;
    background: rgba(5,3,4,0.42);
  }

  .ledger-list.is-long .ledger-item {
    min-height: 44px;
    padding: 6px 4px 7px;
  }

  .ledger-list.is-long .ledger-item strong {
    font-size: 12px;
  }

  .ledger-list.is-long .ledger-item small {
    font-size: 7.5px;
  }

  .ledger-item::before {
    left: 50%;
    top: -5px;
    transform: translateX(-50%);
  }

  .subtitle { font-size: 13px; }
  #result-text { font-size: 13.5px; }
}

@media (max-height: 640px) {
  #screen-start {
    justify-content: flex-start;
    padding-top: calc(24px + var(--safe-top));
  }

  .eyebrow {
    margin-bottom: 10px;
  }

  .title-glyph {
    font-size: clamp(34px, 10vw, 54px);
  }

  .subtitle {
    margin-top: 10px;
    line-height: 1.65;
  }

  .rules-strip {
    margin-top: 14px;
  }

  .rule-item {
    padding-top: 10px;
    padding-bottom: 9px;
  }

  .ritual-note,
  .disclaimer {
    margin-top: 8px;
  }

  .btn-primary {
    margin-top: 20px;
    padding-top: 13px;
    padding-bottom: 13px;
  }

  .round-picker {
    margin-top: 10px;
  }

  .mode-actions {
    margin-top: 12px;
  }

  #goblet-layer {
    top: 6%;
    width: 46vw;
    height: 22vw;
  }

  #throw-ledger {
    top: calc(52px + var(--safe-top));
  }

  #press-zone {
    bottom: calc(34px + var(--safe-bottom));
    height: 92px;
  }

  .press-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  #goblet-ring, #goblet-cup, #status-bar .dot { animation: none; }
}
