:root {
  --sky-950: #08122f;
  --sky-900: #0e1738;
  --sky-800: #1c2d66;
  --sky-700: #2b4389;
  --ink: #292748;
  --ink-soft: #464267;
  --muted: #706b87;
  --line: #d5c8e9;
  --paper: #fff8e8;
  --paper-2: #fffdf6;
  --cloud: #f1ecff;
  --white: #ffffff;
  --gold: #f2c46d;
  --gold-light: #ffe8a7;
  --coral: #e9858f;
  --attention: #3978c4;
  --energy: #c95567;
  --time: #287f74;
  --pollution: #7b1d4a;
  --pollution-hot: #ea6b9e;
  --feedback: #7158b8;
  --shadow: 0 28px 80px rgba(5, 12, 38, .34);
  --soft-shadow: 0 14px 32px rgba(37, 28, 77, .13);
  --display: "Yuanti SC", "STYuanti", "Hiragino Maru Gothic ProN", "PingFang SC", "Microsoft YaHei", sans-serif;
  --body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --number: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--sky-950); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--body);
  background:
    radial-gradient(circle at 12% 8%, rgba(85, 111, 214, .42), transparent 30%),
    radial-gradient(circle at 88% 12%, rgba(152, 91, 191, .26), transparent 28%),
    linear-gradient(155deg, var(--sky-950), #101c49 55%, #24184f);
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.95) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255,224,151,.8) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(187,206,255,.7) 0 1.2px, transparent 1.8px);
  background-position: 18px 24px, 63px 96px, 126px 44px;
  background-size: 150px 150px, 210px 210px, 270px 270px;
  opacity: .62;
}
button { color: inherit; font: inherit; }
button:focus-visible, [tabindex="-1"]:focus-visible {
  outline: 3px solid var(--gold-light);
  outline-offset: 4px;
}
.hidden { display: none !important; }
.noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .14;
  background-image: radial-gradient(rgba(255,255,255,.6) .55px, transparent .7px);
  background-size: 5px 5px;
  mix-blend-mode: soft-light;
}
.shell { position: relative; width: min(1560px, 100%); margin: 0 auto; min-height: 100vh; padding: 18px; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font: 800 11px/1.3 var(--number);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.primary, .secondary {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  padding: 12px 21px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease, background-color .2s ease;
}
.primary {
  color: #18204a;
  background: linear-gradient(180deg, #fff0b8, var(--gold));
  border: 1px solid #ffefbc;
  box-shadow: 0 7px 0 #9a6837, 0 13px 28px rgba(35, 21, 61, .26);
}
.secondary { color: var(--sky-800); background: rgba(255,255,255,.72); border: 1px solid rgba(42,48,101,.2); }
.primary:hover:not(:disabled), .secondary:hover:not(:disabled) { transform: translateY(-3px); filter: brightness(1.04); }
.primary:active:not(:disabled), .secondary:active:not(:disabled) { transform: translateY(1px); }
.big { min-height: 54px; padding: 14px 27px; font-size: 16px; }
.small { color: inherit; font-size: 12px; opacity: .7; }

/* 封面：把主视觉当作世界入口，而不是一张装饰海报。 */
.start-screen {
  position: relative;
  isolation: isolate;
  min-height: calc(100svh - 36px);
  display: grid;
  align-items: center;
  overflow: hidden;
  padding: clamp(38px, 6vw, 88px);
  color: white;
  background-image:
    linear-gradient(90deg, rgba(7,15,48,.97) 0%, rgba(9,22,64,.9) 34%, rgba(11,24,65,.36) 59%, rgba(8,15,47,.06) 100%),
    linear-gradient(0deg, rgba(7,13,39,.55), transparent 45%),
    url("assets/art/star-transit-hero.jpg");
  background-position: center, center, center;
  background-size: cover;
  border: 1px solid rgba(255,238,180,.42);
  border-radius: 30px;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,.1);
}
.start-screen::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -16%;
  bottom: -48%;
  width: 76%;
  aspect-ratio: 1;
  border: 1px solid rgba(255,221,129,.28);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(255,221,129,.035), 0 0 90px rgba(242,196,109,.09);
}
.start-screen::after {
  content: "✦";
  position: absolute;
  left: 47%;
  top: 13%;
  color: var(--gold-light);
  font-size: 20px;
  filter: drop-shadow(0 0 12px var(--gold));
  animation: starBreathe 2.8s ease-in-out infinite;
}
.start-copy { position: relative; z-index: 2; width: min(600px, 52%); }
.start-copy .eyebrow { color: #ffe29a; text-shadow: 0 2px 12px rgba(0,0,0,.35); }
.start-copy h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(64px, 7.2vw, 118px);
  font-weight: 900;
  line-height: .88;
  letter-spacing: -.07em;
  text-shadow: 0 7px 0 rgba(34,25,85,.55), 0 16px 42px rgba(0,0,0,.42);
}
.start-copy h1 span { display: inline-block; margin: .11em 0 0 .48em; color: #ffe3a2; white-space: nowrap; }
.lede { max-width: 550px; margin: 27px 0 18px; color: #f7f1ff; font-size: clamp(16px, 1.35vw, 20px); font-weight: 650; line-height: 1.75; text-shadow: 0 2px 12px rgba(0,0,0,.55); }
.first-mission {
  max-width: 590px;
  margin: 0 0 14px;
  padding: 15px 17px 15px 19px;
  background: linear-gradient(110deg, rgba(255,249,235,.18), rgba(174,181,245,.08));
  border: 1px solid rgba(255,237,181,.28);
  border-left: 4px solid var(--gold);
  border-radius: 3px 16px 16px 3px;
  box-shadow: inset 0 1px rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
}
.first-mission strong { display: block; margin-bottom: 5px; color: #fff2bf; font-family: var(--display); font-size: 16px; }
.first-mission p { margin: 0; color: #e3e3fa; font-size: 12px; line-height: 1.65; }
.thesis { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 22px; }
.thesis span { padding: 7px 11px; color: #f8f2ff; background: rgba(18,31,78,.66); border: 1px solid rgba(198,210,255,.28); border-radius: 999px; font-size: 11px; font-weight: 700; backdrop-filter: blur(6px); }
.thesis span::before { content: "✦"; margin-right: 6px; color: var(--gold); }
.start-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.start-actions .secondary { color: white; background: rgba(22,35,84,.68); border-color: rgba(255,255,255,.32); }
.start-copy > .small { margin-top: 19px; color: #d4d7f2; }
.start-deck { display: none; }

/* 主界面 */
.game-screen {
  position: relative;
  min-height: calc(100svh - 36px);
  overflow: hidden;
  padding: clamp(18px, 2.6vw, 38px);
  background:
    radial-gradient(circle at 85% -5%, rgba(188,167,232,.36), transparent 25%),
    radial-gradient(circle at 0 46%, rgba(117,172,222,.13), transparent 30%),
    linear-gradient(180deg, rgba(255,252,244,.98), rgba(244,239,255,.98));
  border: 1px solid rgba(255,239,183,.7);
  border-radius: 28px;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(94,76,150,.08);
}
.game-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image: radial-gradient(circle, #7d70ac 0 1px, transparent 1.4px);
  background-size: 34px 34px;
  mask-image: linear-gradient(90deg, transparent 52%, black);
}
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 19px 21px;
  color: white;
  background:
    radial-gradient(circle at 72% 0, rgba(119,139,231,.42), transparent 30%),
    linear-gradient(135deg, var(--sky-900), var(--sky-800));
  border: 1px solid rgba(255,226,150,.45);
  border-radius: 20px;
  box-shadow: 0 12px 26px rgba(17,24,67,.22), inset 0 1px rgba(255,255,255,.12);
}
.topbar::after { content: "☾  ✦  ✧"; position: absolute; right: 26%; top: 10px; color: rgba(255,229,161,.26); letter-spacing: 1.2em; pointer-events: none; }
.topbar .eyebrow { color: #d8d5ff; }
.topbar-tools { display: flex; align-items: center; gap: 11px; }
.help-button { min-height: 43px; padding: 9px 14px; color: #fff0bb; background: rgba(255,255,255,.07); border: 1px solid rgba(255,229,157,.55); border-radius: 999px; font-size: 12px; font-weight: 800; cursor: pointer; }
.help-button:hover { color: var(--sky-900); background: var(--gold-light); }
.dayline { display: flex; align-items: baseline; gap: 13px; }
.dayline strong { font-family: var(--display); font-size: 35px; letter-spacing: -.03em; }
.dayline span { color: #d3d3ef; font-size: 13px; }
.resources { display: flex; gap: 7px; }
.resource { min-width: 104px; padding: 9px 11px; display: flex; gap: 9px; align-items: center; color: var(--ink); background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(246,240,255,.92)); border: 1px solid rgba(255,229,155,.72); border-radius: 14px; box-shadow: 0 6px 14px rgba(4,10,36,.17), inset 0 1px #fff; }
.resource-icon { display: grid; place-items: center; width: 29px; height: 29px; color: white !important; border-radius: 50%; font-size: 14px; box-shadow: inset 0 1px rgba(255,255,255,.45); }
.resource small { display: block; color: var(--muted); font-size: 10px; }
.resource strong { display: block; font: 900 21px/1 var(--number); }
.resource.attention .resource-icon { background: var(--attention); }
.resource.energy .resource-icon { background: var(--energy); }
.resource.time .resource-icon { background: var(--time); }
.resource.low { border-color: #f19ab7; background: #fff1f6; animation: lowPulse 1.8s ease-in-out infinite; }

.day-track {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin: 14px 0 10px;
  padding: 17px 16px 12px;
  color: white;
  background: linear-gradient(100deg, #142252, #283d80 72%, #38215f);
  border: 1px solid rgba(242,196,109,.48);
  border-radius: 17px;
  box-shadow: inset 0 1px rgba(255,255,255,.08);
}
.day-track::before { content: ""; position: absolute; left: 9%; right: 9%; top: 24px; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,223,139,.78), transparent); box-shadow: 0 0 12px rgba(255,213,110,.55); }
.day-track span { position: relative; min-height: 32px; padding-top: 18px; color: #aaaed1; font: 800 10px var(--number); text-align: center; }
.day-track i { position: absolute; z-index: 1; width: 13px; height: 13px; left: 50%; top: 0; transform: translateX(-50%) rotate(45deg); background: #4b568c; border: 2px solid #838bb3; border-radius: 3px; }
.day-track .done { color: #ffe4a1; }
.day-track .done i { background: var(--gold); border-color: #fff2c8; box-shadow: 0 0 12px rgba(242,196,109,.8); }
.day-track .current { color: white; }
.day-track .current i { width: 17px; height: 17px; top: -2px; background: white; border-color: var(--gold); box-shadow: 0 0 0 5px rgba(242,196,109,.17), 0 0 22px #ffda78; animation: routePulse 2s ease-in-out infinite; }
.day-track span:last-child i { border-radius: 50% 50% 50% 4px; background: #5e345f; border-color: #b57b9f; }
.day-track span:last-child.current i { background: var(--pollution-hot); border-color: #ffd4e5; }

.tutorial { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; color: var(--ink); font-size: 12px; }
.tutorial span { position: relative; padding: 7px 11px; background: rgba(255,255,255,.68); border: 1px solid var(--line); border-radius: 999px; transition: .18s ease; }
.tutorial span.done { color: var(--time); background: #e9f6f1; border-color: #b8ded2; }
.tutorial span.done::after { content: " ✓"; font-weight: 900; }
.tutorial span.active { color: var(--sky-800); background: #fff5d8; border-color: var(--gold); box-shadow: 0 4px 12px rgba(91,65,23,.09); font-weight: 800; }
.tutorial.faded { opacity: .58; }

.coach { position: sticky; z-index: 12; top: 8px; display: grid; grid-template-columns: 125px minmax(0, 1fr) auto; gap: 18px; align-items: center; margin: 0 0 20px; padding: 17px 19px; color: white; background: linear-gradient(110deg, #111b47, #273d82 68%, #4c2d70); border: 1px solid rgba(255,225,151,.55); border-left: 7px solid var(--gold); border-radius: 18px; box-shadow: 0 12px 26px rgba(22,25,73,.22); }
.coach::after { content: "✦"; position: absolute; right: 15%; top: 12px; color: rgba(255,230,162,.23); font-size: 34px; }
.coach-progress span { display: block; color: #ddd9ff; font: 800 11px var(--number); }
.coach-progress > div { display: flex; gap: 5px; margin-top: 9px; }
.coach-progress i { width: 22px; height: 5px; background: #4c5685; border-radius: 999px; }
.coach-progress i.filled { background: var(--gold); box-shadow: 0 0 8px rgba(242,196,109,.55); }
.coach-copy .eyebrow { color: #ffe3a4; }
.coach-copy h2 { margin: 0 0 5px; font-family: var(--display); font-size: 23px; }
.coach-copy > p:last-child { margin: 0; color: #e1e1f7; font-size: 12px; line-height: 1.65; }
.coach-skip { align-self: start; padding: 6px 9px; color: #d2d0ea; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.24); border-radius: 999px; font-size: 10px; cursor: pointer; }
.coach-skip:hover { color: var(--sky-900); background: white; }
.coach-focus { outline: 3px solid rgba(242,196,109,.78); outline-offset: 5px; }
.coach-choice:not(:disabled) { position: relative; z-index: 1; border-color: var(--gold) !important; box-shadow: 0 0 0 3px rgba(242,196,109,.2), 0 8px 20px rgba(67,48,108,.12) !important; }
.coach-choice:not(:disabled)::before { content: "新手建议"; position: absolute; z-index: 4; inset: 7px 7px auto auto; width: auto; height: auto; padding: 4px 7px; color: var(--sky-900); background: var(--gold-light); border: 0; border-radius: 999px; font: 800 9px var(--number); }

.workspace { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; width: 100%; min-width: 0; }
.play-column, .side-column { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }
.hand-section { min-width: 0; overflow: hidden; padding: 2px; }
.panel { position: relative; background: rgba(255,253,247,.91); border: 1px solid rgba(155,127,192,.34); border-radius: 21px; padding: 21px; box-shadow: var(--soft-shadow), inset 0 1px rgba(255,255,255,.9); }
.event-panel { overflow: hidden; padding-top: 29px; background: linear-gradient(135deg, rgba(255,252,237,.98), rgba(250,244,255,.96)); border-color: rgba(187,151,92,.5); box-shadow: 0 15px 34px rgba(38,27,78,.13), inset 0 0 0 4px rgba(242,196,109,.09); }
.event-panel::before { content: "TODAY'S SIGNAL"; position: absolute; right: 18px; top: 18px; color: rgba(82,57,135,.09); font: 900 clamp(38px, 5vw, 72px)/1 var(--number); pointer-events: none; }
.event-panel::after { content: "☾"; position: absolute; right: 24px; bottom: -24px; width: 110px; height: 110px; display: grid; place-items: center; color: rgba(216,163,65,.14); font-size: 100px; transform: rotate(-15deg); pointer-events: none; }
.event-source { position: relative; display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 11px; font-weight: 700; }
.event-source span:first-child::before { content: "✉"; margin-right: 7px; color: var(--feedback); }
.event-panel h2 { position: relative; margin: 25px 0 9px; font-family: var(--display); font-size: clamp(30px, 3.5vw, 47px); letter-spacing: -.03em; }
.event-body { position: relative; max-width: 760px; margin: 0; color: var(--ink-soft); font-size: 16px; line-height: 1.8; }
.signals { position: relative; display: flex; gap: 7px; flex-wrap: wrap; margin: 17px 0; }
.signals span { padding: 5px 9px; color: #645c7d; background: #f3edff; border: 1px solid #d9cbed; border-radius: 999px; font-size: 11px; }
.event-question { position: relative; margin: 22px 0 11px; font-weight: 800; }
.event-actions { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.event-actions button { min-height: 86px; padding: 13px; text-align: left; background: rgba(255,255,255,.76); border: 1px solid var(--line); border-radius: 13px; cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.event-actions button:hover:not(:disabled) { border-color: var(--gold); background: #fff9e9; transform: translateY(-3px); box-shadow: 0 7px 15px rgba(69,45,102,.11); }
.event-actions strong, .event-actions small { display: block; }
.event-actions strong { font-family: var(--display); font-size: 16px; }
.event-actions small { margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.45; }
button:disabled { cursor: default; opacity: .68; }
.resolved-stamp { position: absolute; z-index: 2; right: 18px; bottom: 14px; color: var(--time); font: 900 10px var(--number); letter-spacing: .06em; transform: rotate(-2deg); border: 2px solid var(--time); border-radius: 7px; padding: 5px 8px; background: rgba(255,255,255,.78); }

.section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 13px; }
.section-heading h2 { margin: 0; font-family: var(--display); font-size: 24px; letter-spacing: -.025em; }
.section-heading.compact { align-items: center; }
.section-heading.compact > strong { display: grid; place-items: center; min-width: 45px; height: 45px; padding: 0 9px; color: var(--sky-800); background: #fff2c8; border: 1px solid var(--gold); border-radius: 50%; font: 900 21px var(--number); }
.section-note, .readiness { max-width: 420px; color: var(--muted); font-size: 11px; line-height: 1.5; text-align: right; }

.hand { display: grid; grid-template-columns: repeat(5, minmax(140px, 1fr)); gap: 10px; width: 100%; max-width: 100%; overflow-x: auto; padding: 9px 4px 18px; scrollbar-color: #b8a4db transparent; }
.card { position: relative; isolation: isolate; min-height: 290px; min-width: 145px; padding: 14px; display: flex; flex-direction: column; text-align: left; color: var(--ink); background:
    radial-gradient(circle at 82% 12%, rgba(244,199,105,.18), transparent 25%),
    linear-gradient(155deg, var(--paper-2), #f8f1e8);
  border: 1px solid #b8955b;
  border-radius: 17px;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.85), inset 0 0 0 4px rgba(213,172,97,.24), 0 7px 15px rgba(47,35,82,.12);
  cursor: pointer;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, filter .2s ease;
}
.card::before { content: ""; position: absolute; z-index: -1; inset: 8px; border: 1px solid rgba(128,98,59,.14); border-radius: 11px; pointer-events: none; }
.card:hover:not(:disabled) { z-index: 3; transform: translateY(-8px) rotate(-.7deg); border-color: var(--gold); box-shadow: inset 0 0 0 3px white, inset 0 0 0 4px rgba(213,172,97,.35), 0 16px 25px rgba(46,35,90,.23), 0 0 22px rgba(242,196,109,.25); }
.card-kicker { position: relative; z-index: 2; color: var(--muted); font: 800 9px var(--number); letter-spacing: .06em; }
.card-sigil { position: relative; width: 68px; height: 68px; margin: 16px auto 13px; display: grid; place-items: center; color: white; background:
    radial-gradient(circle at 35% 28%, rgba(255,255,255,.55), transparent 14%),
    linear-gradient(145deg, #547ecf, #364989 62%, #222d68);
  border: 3px solid #fff3c5;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #b98a43, 0 7px 15px rgba(48,45,106,.24), inset 0 1px rgba(255,255,255,.55);
  font: 900 31px var(--display);
}
.card-sigil::before, .card-sigil::after { content: "✦"; position: absolute; color: var(--gold); font-size: 9px; }
.card-sigil::before { left: -18px; top: 6px; }
.card-sigil::after { right: -20px; bottom: 4px; }
.card[data-tag="过滤"] .card-sigil, .card[data-tag="边界"] .card-sigil { background: linear-gradient(145deg, #6ea9df, #3c69b5 58%, #2c3e82); }
.card[data-tag="行动"] .card-sigil, .card[data-tag="程序"] .card-sigil { background: linear-gradient(145deg, #f4a88f, #cf677b 55%, #8a3d69); }
.card[data-tag="深度"] .card-sigil, .card[data-tag="开采"] .card-sigil { background: linear-gradient(145deg, #9f8be3, #6754b1 58%, #433374); }
.card[data-tag="清理"] .card-sigil, .card[data-tag="恢复"] .card-sigil { background: linear-gradient(145deg, #71c7bd, #438f87 58%, #286b69); }
.card-name { position: relative; z-index: 2; margin: 2px 0 8px; font-family: var(--display); font-size: 20px; line-height: 1.18; text-align: center; letter-spacing: -.03em; }
.card-text { position: relative; z-index: 2; color: #55516c; font-size: 11px; line-height: 1.65; }
.card-footer { position: relative; z-index: 2; margin-top: auto; padding-top: 15px; display: flex; justify-content: space-between; gap: 6px; align-items: end; color: var(--muted); font-size: 9px; }
.card-footer > span { max-width: 52%; }
.card-footer b { flex-shrink: 0; padding: 5px 6px; color: var(--sky-800); background: #fff0bd; border: 1px solid #e2bd72; border-radius: 8px; font: 900 10px var(--number); }
.card.pollution { color: white; border-color: #ff94b9; background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 8px, transparent 8px 16px),
    radial-gradient(circle at 70% 15%, #bf356a, transparent 28%),
    linear-gradient(150deg, #581437, #8c204e 62%, #3a1234); box-shadow: inset 0 0 0 3px rgba(255,166,199,.13), 0 8px 18px rgba(77,13,50,.34); }
.card.pollution::before { border-color: rgba(255,177,207,.23); }
.card.pollution .card-sigil { color: #ffe0ec; background: linear-gradient(145deg, #ef6d9e, #8d2454 58%, #421637); border-color: #ffd8e8; box-shadow: 0 0 0 2px #f07aa7, 0 0 22px rgba(236,77,137,.42); }
.card.pollution .card-kicker, .card.pollution .card-text, .card.pollution .card-footer, .card.pollution .card-footer b { color: #ffe1ec; }
.card.pollution .card-footer b { background: rgba(53,10,37,.55); border-color: rgba(255,177,207,.48); }
.card.feedback { border-color: #9c82d2; background:
    radial-gradient(circle at 78% 12%, rgba(255,226,152,.3), transparent 24%),
    linear-gradient(150deg, #fbf7ff, #e9ddff); }
.card.feedback .card-sigil { background: linear-gradient(145deg, #b79ae8, #765ab9 58%, #4d387f); }
.card:disabled:not(.resolved) { opacity: .76; filter: saturate(.7); }
.card:disabled:not(.resolved) .card-sigil { box-shadow: 0 0 0 2px #b5a98f; }
.card.resolved { opacity: .92; }
.card.resolved::after { content: "已触发"; position: absolute; z-index: 5; right: 9px; top: 37px; padding: 5px 7px; color: white; background: rgba(41,39,72,.8); border: 1px solid rgba(255,255,255,.55); border-radius: 7px; font: 900 9px var(--number); transform: rotate(7deg); }
.card.feedback.resolved::after { color: white; background: var(--feedback); }
.streak { position: absolute; z-index: 4; top: 8px; right: -28px; width: 100px; padding: 4px; color: #352747; background: linear-gradient(180deg, #ffeab2, var(--gold)); font-size: 8px; font-weight: 900; text-align: center; transform: rotate(38deg); }

.shot-section { overflow: hidden; background:
    radial-gradient(circle at 95% 0, rgba(242,196,109,.24), transparent 26%),
    linear-gradient(135deg, rgba(255,253,245,.97), rgba(245,240,255,.96));
  border-color: rgba(221,142,139,.52); }
.shot-section::before { content: "☄"; position: absolute; right: 24px; top: 10px; color: rgba(202,86,104,.09); font-size: 86px; transform: rotate(-14deg); }
.shot-copy { position: relative; color: var(--muted); font-size: 12px; line-height: 1.7; }
.shot-actions { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.shot-actions button { position: relative; min-height: 128px; padding: 13px; text-align: left; background: rgba(255,255,255,.78); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; overflow: hidden; }
.shot-actions button::after { content: ""; position: absolute; right: -19px; bottom: -24px; width: 72px; height: 72px; border: 12px solid rgba(201,85,103,.06); border-radius: 50%; }
.shot-actions button:hover:not(:disabled) { border-color: var(--coral); transform: translateY(-4px); box-shadow: 0 9px 17px rgba(85,45,76,.13); }
.action-glyph { display: grid; place-items: center; width: 31px; height: 31px; margin-bottom: 9px; color: white; background: linear-gradient(145deg, #ed9a9d, #bb536b); border: 2px solid #ffe6c3; border-radius: 50%; font-style: normal; font-weight: 900; }
.shot-actions strong, .shot-actions span, .shot-actions b { display: block; position: relative; z-index: 1; }
.shot-actions strong { font-size: 12px; }
.shot-actions span { margin: 6px 0 20px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.shot-actions b { position: absolute; left: 13px; bottom: 11px; color: var(--energy); font: 900 10px var(--number); }
.shot-stamp { right: 21px; top: 14px; bottom: auto; }
.day-controls { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 16px 4px 5px; border-top: 1px solid rgba(123,101,159,.24); }
.day-controls p { margin: 0; max-width: 650px; color: var(--muted); font-size: 12px; }

.deck-panel { overflow: hidden; background: linear-gradient(155deg, rgba(255,252,239,.97), rgba(244,238,255,.97)); }
.deck-panel::before { content: "☾"; position: absolute; right: -15px; top: 52px; color: rgba(113,88,184,.08); font-size: 120px; }
.deck-panel::after { content: ""; position: absolute; inset: auto -23px -44px auto; width: 125px; height: 125px; border: 17px solid rgba(113,88,184,.06); border-radius: 50%; }
.deck-strata { position: relative; z-index: 1; height: 185px; display: flex; flex-direction: column; gap: 4px; transform: perspective(450px) rotateX(4deg) rotateZ(-2deg); margin: 25px 12px 29px; filter: drop-shadow(10px 12px 8px rgba(42,27,77,.13)); }
.stratum { min-height: 7px; border: 1px solid #8a704c; border-radius: 4px; background-size: 15px 15px; }
.stratum.base { background: repeating-linear-gradient(90deg, #fff9e8 0 11px, #eadfc8 11px 14px); }
.stratum.pollution { border-color: #8d2351; background: repeating-linear-gradient(135deg, #711844 0 8px, #c33b71 8px 16px); }
.stratum.feedback { border-color: var(--feedback); background: repeating-linear-gradient(90deg, #a58bd5 0 10px, #ddcff5 10px 15px); }
.deck-legend { position: relative; z-index: 1; display: flex; gap: 12px; flex-wrap: wrap; font-size: 10px; }
.deck-legend span { display: flex; gap: 5px; align-items: center; }
.deck-legend i { width: 10px; height: 10px; border-radius: 3px; }
.deck-legend i.base { background: #efe4c9; border: 1px solid #8a704c; }
.deck-legend i.pollution { background: var(--pollution); }
.deck-legend i.feedback { background: var(--feedback); }
.aside-note, .empty { position: relative; z-index: 1; color: var(--muted); font-size: 10px; line-height: 1.65; }
.program-panel, .log-panel { background: rgba(255,253,248,.88); }
.program-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid #e0d7ed; }
.program-row strong, .program-row small { display: block; }
.program-row strong { font-size: 11px; }
.program-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.program-dots { display: flex; gap: 5px; }
.program-dots i { width: 12px; height: 12px; background: #dfd5ec; clip-path: polygon(50% 0, 61% 35%, 98% 38%, 69% 59%, 79% 96%, 50% 74%, 21% 96%, 31% 59%, 2% 38%, 39% 35%); }
.program-dots i.filled { background: var(--gold); filter: drop-shadow(0 0 4px rgba(198,137,47,.46)); }
.game-log { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow: auto; }
.game-log li { display: grid; grid-template-columns: 30px 1fr; gap: 8px; padding: 9px 0; border-top: 1px solid #e0d7ed; }
.game-log span { color: var(--feedback); font: 800 9px var(--number); }
.game-log p { margin: 0; color: var(--ink-soft); font-size: 10px; line-height: 1.55; }
.game-log .danger p { color: var(--pollution); }
.game-log .good p, .game-log .program p { color: var(--time); }
.game-log .shot p { color: var(--energy); font-weight: 800; }

.boss-panel { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr minmax(250px, .5fr); gap: 30px; align-items: center; margin-bottom: 21px; padding: 24px 26px; color: white; background:
    radial-gradient(circle at 84% 42%, rgba(236,74,139,.3), transparent 18%),
    radial-gradient(circle at 80% 40%, #120b25 0 13%, #8c2454 14% 16%, transparent 17%),
    linear-gradient(110deg, #12152f, #2f1949 70%, #681d4a);
  border: 1px solid #a94a77;
  border-left: 8px solid var(--pollution-hot);
  border-radius: 20px;
  box-shadow: 0 14px 30px rgba(80,17,55,.28);
}
.boss-panel::after { content: "✦  ·  ✧  ·  ✦"; position: absolute; right: 5%; top: 10px; color: rgba(255,200,220,.23); letter-spacing: .7em; }
.boss-panel h2 { margin: 0; font-family: var(--display); font-size: 31px; }
.boss-panel p { margin-bottom: 0; max-width: 650px; color: #d5c6dc; font-size: 11px; }
.boss-panel .eyebrow { color: #ff9fc1; }
.boss-meter { position: relative; z-index: 1; }
.boss-meter > div:first-child { display: flex; justify-content: space-between; align-items: end; }
.boss-meter strong { color: #ff8bb5; font: 900 32px var(--number); text-shadow: 0 0 18px rgba(255,99,157,.52); }
.boss-meter small { color: #d2c0d0; font-size: 9px; }
.meter { height: 12px; margin: 7px 0; overflow: hidden; background: #1c1730; border: 1px solid #7e4164; border-radius: 999px; }
.meter i { display: block; height: 100%; max-width: 100%; background: linear-gradient(90deg, #8c2454, var(--pollution-hot)); border-radius: inherit; box-shadow: 0 0 12px rgba(237,78,142,.65); transition: width .35s ease; }

/* 帮助 */
.help-dialog { width: min(760px, calc(100vw - 30px)); max-height: min(830px, calc(100vh - 30px)); padding: 0; color: var(--ink); background: linear-gradient(155deg, var(--paper), var(--cloud)); border: 1px solid var(--gold); border-radius: 22px; box-shadow: 0 28px 80px rgba(3,8,28,.45); overflow: auto; }
.help-dialog::backdrop { background: rgba(5,10,35,.72); backdrop-filter: blur(6px); }
.help-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; gap: 20px; align-items: start; padding: 22px 24px 17px; color: white; background: linear-gradient(115deg, var(--sky-900), var(--sky-800)); border-bottom: 1px solid var(--gold); }
.help-head .eyebrow { color: #ffe1a1; }
.help-head h2 { margin: 0; font-family: var(--display); font-size: clamp(26px, 4vw, 38px); }
.icon-button { width: 38px; height: 38px; color: white; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.45); border-radius: 50%; font-size: 22px; cursor: pointer; }
.help-lede { margin: 0; padding: 20px 24px; font-size: 16px; line-height: 1.75; }
.help-loop { display: grid; gap: 8px; padding: 0 24px; }
.help-loop article { display: grid; grid-template-columns: 38px 1fr; gap: 13px; padding: 14px; background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 14px; }
.help-loop article > b { display: grid; place-items: center; width: 34px; height: 34px; color: var(--sky-900); background: linear-gradient(180deg, #fff0b7, var(--gold)); border: 1px solid #d9a849; border-radius: 50%; font: 900 15px var(--number); }
.help-loop strong { font-family: var(--display); font-size: 16px; }
.help-loop p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.help-resources { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 18px 24px; }
.help-resources span { padding: 12px; background: rgba(255,255,255,.6); border: 1px solid var(--line); border-radius: 12px; font-size: 10px; line-height: 1.5; }
.help-resources i { margin-right: 5px; font-style: normal; font-size: 15px; }
.help-resources i.attention { color: var(--attention); }
.help-resources i.energy { color: var(--energy); }
.help-resources i.time { color: var(--time); }
.help-win { margin: 0 24px 20px; padding: 15px 17px; border: 1px solid #aed6cc; border-left: 5px solid var(--time); border-radius: 4px 14px 14px 4px; background: #eaf7f2; }
.help-win strong { font-family: var(--display); font-size: 16px; }
.help-win p { margin: 5px 0 0; color: #3c5c54; font-size: 11px; line-height: 1.65; }
.help-dialog > .secondary { margin: 0 24px 24px; background: white; }

/* 结算：一张可收藏的七日回执。 */
.report-screen { min-height: calc(100svh - 36px); display: grid; place-items: center; padding: clamp(22px, 5vw, 66px); background-image:
    linear-gradient(rgba(7,15,48,.52), rgba(16,18,56,.7)),
    url("assets/art/star-transit-hero.jpg");
  background-position: center;
  background-size: cover;
  border: 1px solid rgba(255,231,163,.7);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.report-wrap { position: relative; width: min(980px, 100%); padding: clamp(22px, 4vw, 48px); background: linear-gradient(150deg, rgba(255,252,240,.96), rgba(242,235,255,.95)); border: 1px solid var(--gold); border-radius: 26px; box-shadow: 0 28px 60px rgba(3,8,27,.38), inset 0 0 0 4px rgba(255,255,255,.48); backdrop-filter: blur(12px); }
.report-wrap::after { content: "☾"; position: absolute; right: 35px; top: 25px; color: rgba(112,88,184,.08); font-size: 130px; pointer-events: none; }
.report-title { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 20px; align-items: end; border-bottom: 2px solid #bda66f; padding-bottom: 22px; }
.report-title small { color: var(--muted); }
.report-title h1 { margin: 8px 0 0; font-family: var(--display); font-size: clamp(44px, 7vw, 82px); line-height: .96; letter-spacing: -.055em; }
.report-title > strong { color: var(--feedback); font: 900 clamp(48px, 7vw, 80px)/.8 var(--number); text-shadow: 0 4px #e0d1ff; }
.report-title > strong small { font-size: 13px; }
.boss-result { margin: 22px 0; color: var(--ink-soft); font-size: 18px; font-weight: 700; }
.report-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.report-grid article { min-height: 140px; padding: 15px; display: flex; flex-direction: column; background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 15px; box-shadow: inset 0 1px white; }
.report-grid article span, .report-grid article small { color: var(--muted); font-size: 10px; }
.report-grid article strong { margin: 19px 0 9px; color: var(--sky-800); font: 900 36px var(--number); }
.report-grid article small { margin-top: auto; line-height: 1.4; }
.diagnosis { margin-top: 23px; padding: 20px 23px; border: 1px solid #c7b6e4; border-left: 5px solid var(--feedback); border-radius: 5px 15px 15px 5px; background: rgba(235,228,255,.72); }
.diagnosis h2 { margin: 0 0 12px; font-family: var(--display); }
.diagnosis p { margin: 7px 0; font-size: 12px; line-height: 1.65; }
.next-experiment { display: grid; grid-template-columns: 150px 1fr; margin: 15px 0 27px; padding: 15px; border: 1px dashed #997abc; border-radius: 13px; background: rgba(255,250,231,.55); }
.next-experiment span { font-weight: 800; font-size: 11px; }
.next-experiment p { margin: 0; font-weight: 650; }
.report-actions { display: flex; gap: 12px; }

.toast { position: fixed; left: 50%; bottom: 27px; z-index: 30; max-width: min(540px, calc(100vw - 30px)); padding: 13px 17px; color: white; background: linear-gradient(110deg, var(--sky-900), var(--sky-800)); border: 1px solid rgba(255,230,163,.65); border-radius: 999px; opacity: 0; transform: translate(-50%, 20px); pointer-events: none; transition: .22s ease; box-shadow: 0 12px 28px rgba(3,8,30,.34); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: linear-gradient(110deg, #5d173f, var(--pollution)); }
.toast.success { background: linear-gradient(110deg, #1e625d, var(--time)); }

/* 牌的去向：本轮唯一的强动效。 */
.transit-token { position: fixed; z-index: 100; width: 42px; height: 54px; display: grid; place-items: center; color: var(--sky-900); background: linear-gradient(145deg, #fffdf4, #ffe9ad); border: 2px solid var(--gold); border-radius: 8px; box-shadow: 0 0 0 3px rgba(255,255,255,.62), 0 0 28px rgba(242,196,109,.85); font: 900 20px var(--display); pointer-events: none; transform: translate(-50%, -50%); animation: cardTransit .78s cubic-bezier(.22,.75,.18,1) forwards; }
.transit-token.pollution { color: white; background: linear-gradient(145deg, #e85992, #681a47); border-color: #ffb2d0; box-shadow: 0 0 24px rgba(236,73,137,.78); }
.transit-token.feedback { color: white; background: linear-gradient(145deg, #b79bec, #5c459f); border-color: #ffe2a4; }
.transit-token.played { background: linear-gradient(145deg, #fffdf4, #cfe1ff); }
.transit-pulse { animation: targetPulse .68s ease; }

@keyframes cardTransit {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.65) rotate(-8deg); }
  18% { opacity: 1; transform: translate(-50%, -78%) scale(1.08) rotate(5deg); }
  62% { opacity: 1; transform: translate(calc(-50% + var(--travel-x-mid)), calc(-50% + var(--travel-y-mid))) scale(.94) rotate(15deg); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--travel-x)), calc(-50% + var(--travel-y))) scale(.45) rotate(25deg); }
}
@keyframes targetPulse { 0%, 100% { filter: none; } 45% { filter: drop-shadow(0 0 18px rgba(242,196,109,.72)) brightness(1.05); } }
@keyframes routePulse { 0%, 100% { transform: translateX(-50%) rotate(45deg) scale(1); } 50% { transform: translateX(-50%) rotate(45deg) scale(1.15); } }
@keyframes starBreathe { 0%, 100% { opacity: .45; transform: scale(.82) rotate(0); } 50% { opacity: 1; transform: scale(1.18) rotate(18deg); } }
@keyframes lowPulse { 0%, 100% { box-shadow: 0 6px 14px rgba(4,10,36,.17); } 50% { box-shadow: 0 0 0 3px rgba(234,107,158,.2), 0 6px 14px rgba(4,10,36,.17); } }

@media (max-width: 1160px) {
  .workspace { grid-template-columns: 1fr; }
  .side-column { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .deck-strata { height: 135px; }
  .hand { grid-template-columns: repeat(5, 175px); }
  .start-copy { width: 58%; }
}

@media (max-width: 820px) {
  .shell { padding: 0; }
  .start-screen, .game-screen, .report-screen { min-height: 100svh; border: 0; border-radius: 0; }
  .start-screen { padding: 38px 22px; background-image: linear-gradient(90deg, rgba(7,15,48,.98), rgba(8,18,52,.84) 63%, rgba(8,17,52,.36)), url("assets/art/star-transit-hero.jpg"); background-position: center, 66% center; }
  .start-copy { width: min(620px, 100%); }
  .start-copy h1 { font-size: clamp(60px, 18vw, 96px); }
  .topbar { align-items: flex-start; }
  .topbar-tools { align-items: flex-end; flex-direction: column-reverse; gap: 7px; }
  .resources { gap: 4px; }
  .resource { min-width: 0; padding: 7px; }
  .resource-icon { width: 25px; height: 25px; }
  .resource small { font-size: 8px; }
  .dayline strong { font-size: 27px; }
  .coach { grid-template-columns: 1fr; gap: 11px; padding: 16px; }
  .coach-skip { position: absolute; right: 10px; top: 10px; }
  .coach-copy { padding-right: 48px; }
  .event-actions { grid-template-columns: 1fr; }
  .shot-actions { grid-template-columns: 1fr 1fr; }
  .side-column { grid-template-columns: 1fr; }
  .boss-panel { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .section-note, .readiness { text-align: left; }
  .day-controls { align-items: stretch; flex-direction: column; }
  .report-grid { grid-template-columns: 1fr 1fr; }
  .report-title { align-items: flex-start; flex-direction: column; }
  .next-experiment { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 760px) {
  .coach { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .start-screen { display: block; min-height: 100svh; padding: 300px 22px 38px; background-color: var(--sky-950); background-image: linear-gradient(180deg, rgba(7,15,48,.08) 0, rgba(7,15,48,.62) 260px, rgba(7,15,48,.98) 500px), url("assets/art/star-transit-hero.jpg"); background-position: center, 72% top; background-size: cover, auto 440px; background-repeat: no-repeat; }
  .start-copy h1 { font-size: clamp(50px, 15.5vw, 62px); line-height: .94; }
  .start-copy h1 span { margin-left: .16em; }
  .lede { font-size: 15px; }
  .first-mission { background: rgba(20,31,80,.8); }
  .start-actions { align-items: stretch; flex-direction: column; }
  .start-actions button { width: 100%; }
  .game-screen { padding: 12px; }
  .topbar { padding: 15px; }
  .topbar::after { display: none; }
  .resources { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .resource { justify-content: center; }
  .resource-icon { display: none; }
  .topbar { align-items: stretch; flex-direction: column; }
  .topbar-tools { align-items: stretch; flex-direction: column-reverse; }
  .help-button { align-self: flex-end; }
  .day-track { padding-inline: 5px; }
  .day-track span { font-size: 9px; }
  .tutorial { display: grid; grid-template-columns: 1fr 1fr; }
  .panel { padding: 17px; }
  .hand { grid-template-columns: repeat(5, 166px); scroll-snap-type: x proximity; }
  .card { min-height: 282px; scroll-snap-align: start; }
  .shot-actions { grid-template-columns: 1fr; }
  .help-resources { grid-template-columns: 1fr; }
  .report-screen { padding: 12px; }
  .report-wrap { border-radius: 18px; }
  .report-grid { grid-template-columns: 1fr; }
  .report-actions { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
