/* 星盘：全屏的一件黄铜仪器。舞台 16:9，所有尺寸跟 cqh / cqw 走。 */

.astro {
  position: absolute;
  inset: 0;
  z-index: 190;
  overflow: hidden;
  background: #05070b;
  color: #e2d6ba;
  font-family: var(--font-serif);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  animation: astro-in .65s var(--ease-out);
}
.astro.is-out { opacity: 0; transition: opacity .45s var(--ease-in-out); }
@keyframes astro-in { from { opacity: 0; } }

/* ---------- 夜空 ---------- */
.astro__sky {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  transition: opacity .6s var(--ease-in-out), filter .6s var(--ease-in-out);
}
.sky-star { fill: #dfeefc; }
.sky-halo { fill: rgba(207, 230, 242, .09); }
.sky-dipper line { stroke: rgba(207, 230, 242, .2); stroke-width: 1; }
.sky-ring {
  fill: none;
  stroke: rgba(240, 178, 74, .6);
  stroke-width: 1.2;
  stroke-dasharray: 3 5;
  animation: sky-pulse 3.6s ease-in-out infinite;
}
.sky-core { fill: #ffffff; filter: drop-shadow(0 0 8px rgba(207, 230, 242, .95)); }
.sky-name {
  fill: rgba(207, 230, 242, .22);
  font-size: 15px;
  letter-spacing: .42em;
  font-family: var(--font-serif);
  text-anchor: middle;
}
@keyframes sky-pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.sky-ground path { fill: #05070a; }
.astro[data-step="align"] .astro__sky,
.astro[data-step="rule"] .astro__sky,
.astro[data-step="result"] .astro__sky,
.astro[data-step="done"] .astro__sky { opacity: .38; filter: blur(1.5px); }

/* 照准仪的延长线：贴着盘沿往天上指的虚线 */
.astro__sightline {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}
.astro__sightline line {
  stroke: rgba(240, 178, 74, .55);
  stroke-width: 1.4;
  stroke-dasharray: 12 14;
  transition: opacity .25s linear;
}

/* ---------- 仪器 ---------- */
.astro__rig {
  position: absolute;
  left: 50%;
  top: 60.5%;
  width: 62cqh;
  height: 62cqh;
  transform: translate(-50%, -50%);
  transition: top .75s var(--ease-in-out), left .75s var(--ease-in-out),
              width .75s var(--ease-in-out), height .75s var(--ease-in-out);
  cursor: grab;
}
.astro[data-step="align"] .astro__rig,
.astro[data-step="rule"] .astro__rig,
.astro[data-step="result"] .astro__rig,
.astro[data-step="done"] .astro__rig {
  top: 44%;
  width: 80cqh;
  height: 80cqh;
}
.astro__rig:active { cursor: grabbing; }
.astro__disc {
  position: absolute;
  inset: 0;
}
.astro__face { display: block; width: 100%; height: 100%; }
.astro__face.is-out { animation: face-out .25s var(--ease-in-out) forwards; }
.astro__face.is-in { animation: face-in .3s var(--ease-out); }
@keyframes face-out { to { transform: scaleX(.05); opacity: .5; } }
@keyframes face-in { from { transform: scaleX(.05); opacity: .5; } }

.limb-tick { stroke: rgba(232, 214, 172, .3); stroke-width: 1.1; }
.limb-tick.is-mid { stroke: rgba(232, 214, 172, .55); }
.limb-tick.is-long { stroke: rgba(248, 232, 194, .9); stroke-width: 1.9; }
.limb-num {
  fill: rgba(240, 224, 190, .72);
  font-size: 20px;
  font-family: var(--font-serif);
  text-anchor: middle;
  dominant-baseline: middle;
}
.astro__motto {
  fill: rgba(200, 163, 90, .4);
  font-size: 16px;
  letter-spacing: 5px;
  font-family: var(--font-sans);
}
.astro__shadow-square line,
.astro__shadow-square rect { fill: none; stroke: rgba(200, 163, 90, .35); stroke-width: 1; }
.astro__engrave circle { fill: none; stroke: rgba(200, 163, 90, .25); stroke-width: 1; }

.alidade .vane rect { fill: #c69d59; stroke: #3a2c18; stroke-width: 1.2; }
.alidade .vernier line { stroke: rgba(40, 28, 14, .8); stroke-width: 1.2; }
.alidade .vernier text { fill: rgba(40, 28, 14, .75); font-size: 15px; font-family: var(--font-sans); }
.alidade__point { fill: #d8b877; stroke: #3a2c18; stroke-width: 1.2; }

/* ---------- 正面盘面 ---------- */
.plategrid .almu { fill: none; stroke: rgba(180, 206, 226, .15); stroke-width: 1; }
.plategrid .azi { fill: none; stroke: rgba(180, 206, 226, .08); stroke-width: 1; }
.plategrid .horizon { fill: none; stroke: rgba(207, 230, 242, .34); stroke-width: 2.2; }
.almu-num { fill: rgba(180, 206, 226, .5); font-size: 15px; font-family: var(--font-sans); }
.cursor-ring {
  fill: none;
  stroke: rgba(240, 178, 74, .9);
  stroke-width: 2.2;
  stroke-dasharray: 6 6;
  filter: drop-shadow(0 0 6px rgba(240, 178, 74, .55));
}

.hour-tick { stroke: rgba(232, 214, 172, .45); stroke-width: 1.4; }
.hour-tick.is-long { stroke: rgba(248, 232, 194, .95); stroke-width: 2.6; }
.hour-num {
  fill: rgba(248, 232, 194, .82);
  font-size: 22px;
  font-family: var(--font-serif);
  text-anchor: middle;
  dominant-baseline: middle;
}

.rete-ring { fill: none; stroke: #b08a44; stroke-width: 7; }
.ecliptic { fill: none; stroke: rgba(200, 163, 90, .34); stroke-width: 2.4; stroke-dasharray: 12 10; }
.rete-star line { stroke: rgba(240, 217, 163, .55); stroke-width: 1.6; }
.rete-link { stroke: rgba(240, 217, 163, .22); stroke-width: 1.2; }
.rete-star circle { fill: #f4e2b4; }
.rete-star text { fill: rgba(240, 224, 190, .8); font-size: 20px; font-family: var(--font-serif); }
.rete-star.is-key line { stroke: rgba(255, 240, 200, .95); stroke-width: 2.4; }
.rete-star.is-key circle { fill: #fff6dd; filter: drop-shadow(0 0 5px rgba(240, 178, 74, .9)); }
.rete-star.is-key text { fill: #ffe9b8; letter-spacing: .12em; }
.sun-mark .sun-circle { fill: rgba(240, 178, 74, .22); stroke: #f0b24a; stroke-width: 2; }
.sun-mark .sun-rays line { stroke: rgba(240, 178, 74, .75); stroke-width: 1.8; }

.rule__sight { stroke: #fff3d0; stroke-width: 2; }
.rule-hub { fill: #2a2014; stroke: #c8a35a; stroke-width: 2; }

/* ---------- 放大镜 / 照门 ---------- */
.astro__scope {
  position: absolute;
  left: 2.8cqw;
  top: 10.5cqh;
  width: clamp(104px, 15.5cqh, 172px);
  height: clamp(104px, 15.5cqh, 172px);
  z-index: 3;
  border-radius: 50%;
  overflow: hidden;
  background: #06080c;
  box-shadow: 0 0 0 .45cqh rgba(12, 9, 6, .6), 0 1.2cqh 3cqh rgba(0, 0, 0, .72),
              inset 0 0 3cqh rgba(0, 0, 0, .85);
  border: 1px solid rgba(200, 163, 90, .45);
  pointer-events: none;
}
.astro__scope-svg { display: block; width: 100%; height: 100%; }
.scope-star {
  fill: #eaf6ff;
  filter: drop-shadow(0 0 6px rgba(180, 220, 255, .9));
  transition: opacity .18s;
}
.scope-star.is-locked { fill: #fff6dd; filter: drop-shadow(0 0 12px rgba(240, 178, 74, 1)); }
.scope-ruler line { stroke: rgba(232, 214, 172, .7); stroke-width: 1.6; }
.scope-index { stroke: #e2703a; stroke-width: 2.2; }
.scope-arc { fill: none; stroke: rgba(232, 214, 172, .7); stroke-width: 1.8; }
.scope-arc-ticks line { stroke: rgba(232, 214, 172, .45); stroke-width: 1.2; }

/* ---------- HUD ---------- */
.astro__hud {
  position: absolute;
  left: 50%;
  bottom: 3cqh;
  width: 74cqw;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .85cqh;
  text-align: center;
  pointer-events: none;
  z-index: 4;
}
/* 底部压一层暗角，字压在铜盘上也读得清 */
.astro__hud::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7cqh;
  width: 132cqw;
  height: 34cqh;
  transform: translateX(-50%);
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 84%, rgba(3, 4, 6, .95), rgba(3, 4, 6, 0) 72%);
}
.astro__kicker {
  position: absolute;
  left: 3cqw;
  top: 3.2cqh;
  margin: 0;
  z-index: 5;
  font-size: max(.8cqw, 10px);
  letter-spacing: .46em;
  text-indent: .46em;
  color: rgba(200, 163, 90, .6);
  font-family: var(--font-sans);
}
.astro__goal {
  margin: 0;
  max-width: 58cqw;
  font-size: max(1.1cqw, 13px);
  line-height: 1.75;
  letter-spacing: .04em;
  color: #e2d6ba;
  text-shadow: 0 .2cqh .9cqh rgba(0, 0, 0, .95);
}
.astro__readout {
  display: flex;
  align-items: baseline;
  gap: .9cqw;
  margin: 0;
  padding: .45cqh 1.5cqw;
  border: 1px solid rgba(200, 163, 90, .42);
  border-radius: .25cqw;
  background: linear-gradient(180deg, rgba(48, 36, 21, .9), rgba(18, 13, 8, .94));
  box-shadow: inset 0 1px 0 rgba(240, 222, 180, .16), 0 .6cqh 2.2cqh rgba(0, 0, 0, .55);
}
.astro__readout span {
  font-size: max(.85cqw, 11px);
  letter-spacing: .18em;
  color: rgba(200, 163, 90, .8);
  font-family: var(--font-sans);
}
.astro__readout b {
  font-size: max(1.55cqw, 17px);
  font-weight: 600;
  letter-spacing: .08em;
  color: #f0d9a3;
  font-variant-numeric: tabular-nums;
}
.astro__hint {
  margin: 0;
  font-size: max(.88cqw, 12px);
  letter-spacing: .05em;
  color: rgba(200, 163, 90, .9);
}
.astro__hint[data-kind="warn"] { color: #dd9166; }
.astro__hint[data-kind="ok"] { color: #b9d19a; }

.astro__actions {
  display: flex;
  align-items: center;
  gap: 1.1cqw;
  margin-top: .5cqh;
  pointer-events: auto;
}
.astro__act { min-width: 11cqw; }
.astro__nudge {
  width: 2.6cqw;
  height: 2.6cqw;
  min-width: 30px;
  min-height: 30px;
  display: grid;
  place-items: center;
  font-size: max(1.2cqw, 15px);
  color: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(16, 12, 8, .7);
}
.astro__nudge:hover { color: var(--amber); border-color: var(--gold); }
.astro__skip {
  position: absolute;
  top: 1.5cqh;
  right: 1.6cqw;
  z-index: 5;
  padding: .5cqh 1.1cqw;
  font-size: max(.82cqw, 11px);
  letter-spacing: .2em;
  color: rgba(232, 214, 172, .55);
  border: 1px solid rgba(200, 163, 90, .22);
  background: rgba(8, 7, 5, .4);
  opacity: 0;
  pointer-events: none;
  transition: color .2s, border-color .2s, opacity .6s;
}
.astro__skip.is-ready,
.astro__skip.is-replay {
  opacity: 1;
  pointer-events: auto;
}
.astro__skip:hover { color: var(--amber); border-color: rgba(200, 163, 90, .6); }

@media (max-height: 520px) {
  .astro__hud { bottom: 1.8cqh; gap: .5cqh; width: 84cqw; }
  .astro__goal { font-size: max(1.35cqw, 12px); line-height: 1.55; max-width: 72cqw; }
  .astro__kicker { display: none; }
  .astro__scope { left: 2.4cqw; top: 6cqh; }

  /* 横向手机：盘面只有三百来像素，刻字得按比例放大才看得见 */
  .limb-num { font-size: 30px; }
  .hour-num { font-size: 34px; }
  .almu-num { font-size: 24px; }
  .rete-star text { font-size: 30px; }
  .astro__motto { font-size: 24px; letter-spacing: 6px; }
  .alidade .vernier text { font-size: 22px; }

  /* 手指要按得中：主按钮与微调键都撑到 44px */
  .astro__actions .btn, .astro__actions .astro__act { min-height: 44px; }
  .astro__nudge { width: 44px; height: 44px; }
}
