:root {
  --orbit: #08112c;
  --rail: #122455;
  --rail-2: #1d3970;
  --paper: #fff6dc;
  --paper-cool: #eef4ff;
  --ink: #172044;
  --white: #fffdfa;
  --gold: #f6c86e;
  --gold-soft: #ffe6a7;
  --signal: #5fa8ff;
  --energy: #ff7d78;
  --time: #57d5c1;
  --pollution: #f05c95;
  --feedback: #a489ff;
  --line: rgba(204, 222, 255, .22);
  --line-strong: rgba(231, 238, 255, .42);
  --shadow: 0 22px 68px rgba(0, 5, 24, .46);
  --display: "Yuanti SC", "STYuanti-SC-Bold", "Hiragino Maru Gothic ProN", "PingFang SC", sans-serif;
  --body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --utility: "SFMono-Regular", "SF Mono", "Menlo", "Monaco", monospace;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--orbit);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--white);
  font-family: var(--body);
  background:
    radial-gradient(circle at 13% 7%, rgba(74, 111, 210, .4), transparent 29%),
    radial-gradient(circle at 91% 12%, rgba(131, 73, 182, .29), transparent 27%),
    linear-gradient(154deg, #071027 0%, #0d1d49 52%, #21164a 100%);
  overflow-x: hidden;
}

button { color: inherit; font: inherit; }
button:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--gold-soft);
  outline-offset: 4px;
}

.hidden { display: none !important; }

.star-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .67;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, .95) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 218, 137, .8) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(163, 195, 255, .68) 0 1.1px, transparent 1.8px);
  background-position: 20px 18px, 78px 112px, 151px 59px;
  background-size: 172px 172px, 244px 244px, 313px 313px;
}

.app-frame {
  width: min(1540px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px clamp(12px, 1.8vw, 28px) 28px;
}

.overline {
  margin: 0 0 5px;
  color: #9fb9e8;
  font: 800 10px/1.3 var(--utility);
  letter-spacing: .13em;
  text-transform: uppercase;
}

.command-bar {
  min-height: 66px;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 8px 12px 11px;
  border-bottom: 1px solid var(--line-strong);
}

.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  color: #1a2450;
  background: var(--gold);
  border: 1px solid #fff0b9;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(246, 200, 110, .11), 0 0 30px rgba(246, 200, 110, .2);
}
.brand-lockup h1 {
  margin: 0;
  color: #fff9e9;
  font: 900 clamp(18px, 1.6vw, 25px)/1 var(--display);
  letter-spacing: .02em;
}

.resources { display: flex; justify-content: center; gap: 8px; }
.resource {
  min-width: 104px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 11px;
  color: #e9f0ff;
  background: linear-gradient(145deg, rgba(18, 36, 85, .9), rgba(8, 18, 48, .82));
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: inset 0 1px rgba(255, 255, 255, .06);
}
.resource-symbol {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 11px;
}
.resource span:last-child { display: flex; align-items: baseline; gap: 8px; }
.resource small { color: #aebddd; font-size: 10px; font-weight: 700; }
.resource strong { font: 900 21px/1 var(--utility); }
.resource.attention { color: var(--signal); }
.resource.energy { color: var(--energy); }
.resource.time { color: var(--time); }
.resource.low { animation: resourceWarning 1.1s ease-in-out infinite; }

.turn-tools { display: flex; align-items: center; justify-content: flex-end; gap: 11px; }
.turn-label {
  color: #ffe4a5;
  font: 800 11px/1.3 var(--utility);
  letter-spacing: .04em;
}
.quiet-button {
  min-height: 34px;
  padding: 7px 12px;
  color: #d9e3fb;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.quiet-button:hover { background: rgba(255, 255, 255, .11); }

.algorithm-console {
  display: grid;
  grid-template-columns: minmax(255px, .8fr) minmax(430px, 1.55fr) minmax(180px, .55fr);
  align-items: center;
  gap: 18px;
  margin-top: 12px;
  padding: 13px 17px;
  background:
    linear-gradient(90deg, rgba(10, 25, 64, .98), rgba(25, 42, 94, .94) 56%, rgba(14, 25, 64, .96)),
    repeating-linear-gradient(90deg, transparent 0 19px, rgba(255, 255, 255, .025) 19px 20px);
  border: 1px solid rgba(127, 166, 237, .34);
  border-radius: 16px;
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, .06);
}

.algorithm-identity { display: flex; align-items: center; gap: 15px; }
.algorithm-identity h2 {
  margin: 0 0 4px;
  color: #fff3c7;
  font: 900 23px/1 var(--display);
}
.algorithm-state { margin: 0; color: #b7c8e8; font-size: 11px; line-height: 1.45; }
.algorithm-orbit {
  position: relative;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(112, 172, 255, .45);
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(95, 168, 255, .18);
}
.algorithm-orbit::before,
.algorithm-orbit::after {
  content: "";
  position: absolute;
  inset: 8px -5px;
  border: 1px solid rgba(246, 200, 110, .35);
  border-radius: 50%;
  transform: rotate(34deg);
}
.algorithm-orbit::after { transform: rotate(-34deg); }
.algorithm-orbit span { width: 16px; height: 16px; background: var(--signal); border-radius: 50%; box-shadow: 0 0 18px var(--signal); }
.intent-panel {
  min-height: 82px;
  overflow: hidden;
  background: #070f26;
  border: 1px solid rgba(246, 200, 110, .36);
  border-radius: 10px;
  box-shadow: inset 0 0 22px rgba(0, 0, 0, .55), 0 7px 23px rgba(0, 0, 0, .22);
}
.intent-board-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 11px;
  color: #d2def5;
  background: rgba(255, 255, 255, .06);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  font: 700 9px/1.3 var(--utility);
  letter-spacing: .09em;
}
.intent-board-body {
  min-height: 58px;
  display: grid;
  grid-template-columns: 39px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
}
.intent-glyph {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--pollution);
  border: 1px solid currentColor;
  border-radius: 50%;
  box-shadow: 0 0 13px rgba(240, 92, 149, .2);
}
.intent-board-body strong { color: #ffd8e8; font: 900 15px/1.1 var(--display); }
.intent-board-body p { margin: 3px 0 0; color: #9fb0d0; font-size: 10px; }
.intent-strength { color: #ffb3cf; font: 900 25px/1 var(--utility); }

.algorithm-pressure div:first-child { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.algorithm-pressure span { color: #aabbdc; font-size: 10px; }
.algorithm-pressure strong { color: #ffbfd7; font: 900 18px/1 var(--utility); }
.pressure-track {
  height: 8px;
  overflow: hidden;
  background: #080f28;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
}
.pressure-track i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #8255cc, var(--pollution));
  box-shadow: 0 0 14px rgba(240, 92, 149, .55);
  transition: width .35s ease;
}

.table-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 12px;
  margin-top: 12px;
}

.input-board,
.zones-panel,
.hand-table {
  background: linear-gradient(150deg, rgba(245, 248, 255, .98), rgba(227, 235, 251, .96));
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: var(--shadow);
}

.input-board {
  min-height: 266px;
  padding: 14px 16px 16px;
  color: var(--ink);
  border-radius: 17px 7px 7px 17px;
}
.section-heading,
.hand-heading,
.zone-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}
.section-heading h2,
.hand-heading h2,
.zone-heading h2 {
  margin: 0;
  color: var(--ink);
  font: 900 20px/1.1 var(--display);
}
.input-board .overline,
.hand-table .overline,
.zones-panel .overline { color: #657397; }
.target-prompt {
  max-width: 410px;
  margin: 0;
  padding: 7px 10px;
  color: #40517d;
  background: rgba(95, 168, 255, .1);
  border: 1px solid rgba(56, 105, 181, .17);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}
.target-prompt.choosing {
  color: #6a4812;
  background: #fff0bd;
  border-color: #d9ae53;
  animation: targetPrompt 1.1s ease-in-out infinite;
}

.input-rail {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1fr) 26px minmax(0, 1fr);
  align-items: stretch;
  gap: 5px;
  margin-top: 12px;
}
.input-rail::before {
  content: "";
  position: absolute;
  left: 5%;
  right: 5%;
  top: 50%;
  z-index: 0;
  height: 5px;
  background: repeating-linear-gradient(90deg, #8190b0 0 13px, #c2cadb 13px 20px);
  border-radius: 999px;
  opacity: .52;
}
.rail-arrow {
  position: relative;
  z-index: 2;
  align-self: center;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: #6b789c;
  background: #e9effa;
  border: 1px solid #c5cee1;
  border-radius: 50%;
  font: 900 15px var(--utility);
}
.queue-stage {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 9px;
  background: rgba(255, 255, 255, .56);
  border: 1px solid #c7d2e7;
  border-radius: 11px;
}
.queue-stage > header { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.queue-stage > header > span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #7284aa;
  border-radius: 50%;
  font: 800 9px var(--utility);
}
.queue-stage header div { display: flex; align-items: baseline; gap: 7px; }
.queue-stage header strong { color: #29365d; font-size: 13px; }
.queue-stage header small { color: #7180a2; font-size: 9px; }
.danger-stage { border-color: rgba(240, 92, 149, .38); background: rgba(255, 235, 243, .62); }
.danger-stage > header > span { background: #b84f7b; }

.queue-slot {
  min-height: 148px;
  display: grid;
  align-content: stretch;
  gap: 7px;
}
.queue-empty {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 18px;
  color: #8994ae;
  border: 1px dashed #c1cadc;
  border-radius: 8px;
  font-size: 10px;
  text-align: center;
}
.input-card {
  width: 100%;
  min-height: 100%;
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-content: center;
  gap: 8px 10px;
  padding: 12px;
  color: #273358;
  text-align: left;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(238, 242, 252, .96)),
    repeating-linear-gradient(45deg, transparent 0 9px, rgba(31, 63, 117, .03) 9px 10px);
  border: 1px solid #aebbd6;
  border-radius: 8px;
  box-shadow: 0 7px 15px rgba(32, 49, 91, .12);
  cursor: default;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.input-card .input-signal {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #506a9f;
  border-radius: 50%;
}
.input-card .input-copy { min-width: 0; }
.input-card strong { display: block; margin-bottom: 4px; font: 900 13px/1.15 var(--display); }
.input-card p { margin: 0; color: #5e6b8c; font-size: 10px; line-height: 1.4; }
.input-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 5px; }
.input-meta span { padding: 3px 6px; color: #506080; background: #e7ecf6; border-radius: 999px; font-size: 8px; font-weight: 800; }
.input-card.targetable {
  cursor: pointer;
  border-color: #d0a23c;
  box-shadow: 0 0 0 3px rgba(246, 200, 110, .32), 0 10px 22px rgba(96, 70, 18, .18);
  animation: targetable 1.2s ease-in-out infinite;
}
.input-card.targetable:hover { transform: translateY(-4px); }
.input-card.illegal-target { opacity: .48; filter: grayscale(.5); }

.zones-panel {
  min-height: 266px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  padding: 13px;
  color: var(--ink);
  border-radius: 7px 17px 17px 7px;
}
.zone-heading { align-items: center; }
.zone-heading h2 { font-size: 16px; }
.zone-heading > span { color: #75819e; font-size: 9px; }
.program-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 8px; }
.program-slot {
  min-height: 70px;
  display: grid;
  place-items: center;
  padding: 8px;
  color: #6f7b99;
  background: rgba(255, 255, 255, .5);
  border: 1px dashed #abb7cf;
  border-radius: 8px;
  font-size: 9px;
  text-align: center;
}
.program-slot.filled {
  color: #24315a;
  background: linear-gradient(145deg, #fff3c8, #dfeafe);
  border: 1px solid #d1af61;
  box-shadow: 0 5px 12px rgba(54, 69, 118, .13);
}
.program-slot strong { display: block; margin-bottom: 3px; font: 850 10px/1.2 var(--display); }
.program-slot small { color: #69779a; font-size: 8px; }

.pile-zone { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pile-card {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px;
  background: #f7f9fd;
  border: 1px solid #c6d0e3;
  border-radius: 8px;
}
.pile-icon { color: #617193; font-size: 14px; }
.pile-card small { display: block; color: #7783a0; font-size: 7px; }
.pile-card strong { color: #263258; font: 900 14px var(--utility); }
.pile-card.discard { transform: rotate(-1.5deg); }
.pile-card.exhaust { transform: rotate(1.5deg); }

.log-zone { min-height: 0; padding: 8px 9px; background: #e7edf8; border-radius: 8px; overflow: hidden; }
.battle-log { max-height: 65px; margin: 5px 0 0; padding: 0 0 0 17px; color: #526180; font-size: 9px; line-height: 1.45; overflow: auto; }
.battle-log li + li { margin-top: 3px; }

.hand-table {
  margin-top: 12px;
  padding: 13px 16px 17px;
  color: var(--ink);
  border-radius: 17px;
}
.hand-heading { align-items: center; }
.hand-heading h2 { font-size: 19px; }
.hand-heading > p {
  flex: 1;
  margin: 0;
  color: #687594;
  font-size: 10px;
  text-align: center;
}
.end-turn-button {
  min-width: 178px;
  min-height: 46px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 7px 15px;
  color: #fff8e8;
  background: linear-gradient(145deg, #263b77, #162859);
  border: 1px solid #738cce;
  border-radius: 9px;
  box-shadow: 0 5px 0 #0a1536;
  cursor: pointer;
}
.end-turn-button span { font-weight: 900; }
.end-turn-button small { color: #b9c7e9; font-size: 8px; }
.end-turn-button:hover:not(:disabled) { transform: translateY(-2px); }
.end-turn-button:disabled { opacity: .48; cursor: not-allowed; box-shadow: none; }

.cards-dock {
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-top: 11px;
}
.commitment-bay {
  position: relative;
  min-height: 222px;
  padding: 8px;
  background: linear-gradient(150deg, #131f4a, #26366e);
  border: 1px solid #d7b765;
  border-radius: 10px;
  box-shadow: inset 0 0 0 3px rgba(246, 200, 110, .1), 0 8px 19px rgba(28, 31, 70, .22);
}
.commitment-label { margin: 0 0 6px; color: #ffe8ad; font: 700 8px/1.3 var(--utility); text-align: center; }
.commitment-card-host { min-height: 164px; }
.commitment-hint { margin: 6px 4px 0; color: #b9c8ea; font-size: 8px; line-height: 1.35; text-align: center; }

.hand {
  min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 9px;
  padding: 1px 3px 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: #8d9aba #e0e6f1;
  scrollbar-width: thin;
}
.empty-hand {
  min-width: 100%;
  min-height: 210px;
  display: grid;
  place-items: center;
  color: #7f8aa5;
  border: 1px dashed #bdc7d9;
  border-radius: 10px;
  font-size: 11px;
}

.game-card {
  --card-accent: #6284bd;
  position: relative;
  width: 170px;
  min-width: 170px;
  min-height: 210px;
  display: grid;
  grid-template-rows: auto 44px auto 1fr auto;
  gap: 6px;
  padding: 9px 10px 10px;
  color: #253054;
  text-align: left;
  background:
    radial-gradient(circle at 78% 13%, color-mix(in srgb, var(--card-accent) 19%, transparent), transparent 25%),
    linear-gradient(145deg, #fffef8, #f0f3fa);
  border: 1px solid color-mix(in srgb, var(--card-accent) 74%, #7f8ba4);
  border-radius: 9px;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .62), 0 8px 17px rgba(36, 49, 86, .18);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.game-card::before,
.game-card::after {
  content: "";
  position: absolute;
  top: 21px;
  width: 9px;
  height: 17px;
  background: #e7ecf5;
  border: 1px solid color-mix(in srgb, var(--card-accent) 66%, #8f9bb2);
}
.game-card::before { left: -1px; border-left: 0; border-radius: 0 999px 999px 0; }
.game-card::after { right: -1px; border-right: 0; border-radius: 999px 0 0 999px; }
.game-card:hover:not(:disabled) { transform: translateY(-7px) rotate(-.4deg); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .72), 0 15px 26px rgba(36, 49, 86, .25); }
.game-card:active:not(:disabled) { transform: translateY(-2px); }
.game-card:disabled { cursor: not-allowed; opacity: .58; filter: grayscale(.2); }
.game-card.selected {
  transform: translateY(-10px);
  box-shadow: 0 0 0 4px rgba(246, 200, 110, .55), 0 17px 30px rgba(61, 53, 105, .28);
}
.game-card.hand-target {
  cursor: pointer;
  opacity: 1;
  filter: none;
  box-shadow: 0 0 0 4px rgba(246, 200, 110, .58), 0 14px 27px rgba(85, 62, 18, .28);
  animation: targetable 1.2s ease-in-out infinite;
}
.game-card.hand-target::before,
.game-card.hand-target::after { border-color: #c99a32; }
.card-topline { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-kind { color: #687696; font: 800 8px/1.2 var(--utility); letter-spacing: .09em; }
.card-cost {
  min-width: 28px;
  height: 25px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  color: #fff;
  background: var(--card-accent);
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 999px;
  box-shadow: 0 2px 0 color-mix(in srgb, var(--card-accent) 74%, #000);
  font: 900 10px var(--utility);
}
.card-sigil {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--card-accent) 70%, #fff), var(--card-accent));
  border: 1px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--card-accent) 24%, transparent);
  font-size: 17px;
}
.card-name { color: #202b4f; font: 900 14px/1.15 var(--display); }
.card-rules { margin: 0; color: #586584; font-size: 10px; line-height: 1.45; }
.card-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 18px; }
.card-footer span { padding: 3px 6px; color: #52617e; background: #e6ebf4; border-radius: 999px; font-size: 7px; font-weight: 800; }
.card-state { color: #8b5f15; font-size: 8px; font-weight: 850; }

.game-card.pollution { --card-accent: var(--pollution); color: white; background: radial-gradient(circle at 78% 14%, rgba(255, 164, 202, .32), transparent 28%), linear-gradient(145deg, #661b47, #9d285c 64%, #48163f); }
.game-card.pollution .card-name,
.game-card.pollution .card-kind,
.game-card.pollution .card-rules { color: #ffe3ee; }
.game-card.pollution .card-footer span { color: #ffe1ed; background: rgba(51, 8, 35, .48); }
.game-card.feedback { --card-accent: var(--feedback); background: radial-gradient(circle at 76% 13%, rgba(255, 227, 147, .3), transparent 25%), linear-gradient(145deg, #faf5ff, #e7ddff); }
.game-card.commitment {
  --card-accent: var(--gold);
  width: 100%;
  min-width: 0;
  min-height: 164px;
  grid-template-rows: auto 38px auto 1fr auto;
  color: #302544;
  background: radial-gradient(circle at 75% 12%, rgba(255, 255, 255, .7), transparent 24%), linear-gradient(145deg, #fff7cc, #f2c46e 65%, #d89d4e);
  border-color: #fff0b1;
  box-shadow: inset 0 0 0 3px rgba(102, 67, 22, .08), 0 8px 18px rgba(5, 10, 36, .35);
}
.game-card.commitment .card-cost { color: #26315b; background: #fff5cb; border-color: #9e762f; box-shadow: 0 2px 0 #9e762f; }
.game-card.commitment .card-sigil { width: 37px; height: 37px; color: #2b315d; background: #fff5ca; border-color: #9a7130; }
.game-card.commitment .card-name { color: #2a2850; }
.game-card.commitment .card-rules { color: #55466b; font-size: 9px; }
.game-card.commitment.locked { filter: saturate(.55); opacity: .72; }

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 8, 27, .78);
  backdrop-filter: blur(13px);
}
.intro-ticket,
.result-ticket {
  position: relative;
  width: min(540px, 100%);
  padding: clamp(27px, 5vw, 48px);
  color: var(--ink);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, .75), transparent 33%),
    var(--paper);
  border: 1px solid #fff2c4;
  border-radius: 5px 25px 5px 25px;
  box-shadow: 0 34px 100px rgba(0, 0, 0, .55), inset 0 0 0 5px rgba(116, 80, 26, .06);
}
.intro-ticket::before,
.result-ticket::before {
  content: "✦";
  position: absolute;
  right: 31px;
  top: 25px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: #fff4cb;
  background: #21346c;
  border: 2px solid var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(246, 200, 110, .16);
}
.intro-ticket .overline,
.result-ticket .overline { color: #65718f; }
.intro-ticket h2,
.result-ticket h2 {
  max-width: 390px;
  margin: 10px 0 23px;
  color: #19234b;
  font: 900 clamp(29px, 5vw, 45px)/1.05 var(--display);
  letter-spacing: -.035em;
}
.intro-rules { display: grid; gap: 8px; margin-bottom: 24px; }
.intro-rules p { margin: 0; padding: 10px 13px; color: #4c5877; background: rgba(50, 76, 133, .06); border-left: 3px solid #527bc5; border-radius: 2px 9px 9px 2px; font-size: 13px; line-height: 1.5; }
.intro-rules b { color: #203b79; }
.primary-button {
  min-height: 48px;
  padding: 11px 21px;
  color: #fff9e7;
  background: linear-gradient(145deg, #2a4489, #17295c);
  border: 1px solid #7997db;
  border-radius: 9px;
  box-shadow: 0 6px 0 #0b1638, 0 12px 26px rgba(24, 35, 77, .25);
  font-weight: 900;
  cursor: pointer;
}
.primary-button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.06); }
.primary-button:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 #0b1638; }
.primary-button:disabled { opacity: .48; cursor: not-allowed; }
.startup-error { min-height: 17px; margin: 13px 0 0; color: #a72b55; font-size: 11px; line-height: 1.4; }

.result-ticket { width: min(610px, 100%); }
.result-summary { margin: -8px 0 20px; color: #55617f; line-height: 1.65; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 15px; }
.result-stat { padding: 10px; background: rgba(42, 68, 137, .07); border: 1px solid rgba(42, 68, 137, .15); border-radius: 9px; }
.result-stat small { display: block; color: #74809e; font-size: 9px; }
.result-stat strong { color: #23396f; font: 900 18px var(--utility); }
.result-feedback { min-height: 0; margin-bottom: 18px; padding: 11px 13px; color: #55446f; background: #eee7ff; border-left: 4px solid var(--feedback); border-radius: 2px 9px 9px 2px; font-size: 11px; line-height: 1.5; }
.result-feedback:empty { display: none; }

.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 23px;
  max-width: min(520px, calc(100vw - 30px));
  padding: 10px 15px;
  color: #fff9e8;
  background: #14285b;
  border: 1px solid #738fd1;
  border-radius: 999px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .4);
  font-size: 11px;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { color: #fff0f5; background: #7a204b; border-color: #ff92bc; }
.toast.success { color: #183d37; background: #bff4df; border-color: #62bdab; }

@keyframes targetable {
  0%, 100% { box-shadow: 0 0 0 3px rgba(246, 200, 110, .25), 0 10px 22px rgba(96, 70, 18, .16); }
  50% { box-shadow: 0 0 0 5px rgba(246, 200, 110, .43), 0 12px 25px rgba(96, 70, 18, .24); }
}
@keyframes targetPrompt { 50% { transform: translateY(-2px); } }
@keyframes resourceWarning { 50% { border-color: currentColor; box-shadow: 0 0 15px color-mix(in srgb, currentColor 24%, transparent); } }

@media (max-width: 1120px) {
  .command-bar { grid-template-columns: 1fr auto; }
  .resources { order: 3; grid-column: 1 / -1; padding-top: 7px; border-top: 1px solid var(--line); }
  .turn-tools { grid-column: 2; grid-row: 1; }
  .algorithm-console { grid-template-columns: minmax(230px, .7fr) minmax(420px, 1.3fr); }
  .algorithm-pressure { grid-column: 1 / -1; display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 10px; }
  .algorithm-pressure div:first-child { margin: 0; }
  .table-layout { grid-template-columns: 1fr; }
  .input-board { border-radius: 17px; }
  .zones-panel { grid-template-columns: 1.1fr .9fr 1fr; grid-template-rows: auto; border-radius: 17px; }
  .cards-dock { grid-template-columns: 200px minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .app-frame { padding: 8px 8px 20px; }
  .command-bar { gap: 8px; padding-inline: 5px; }
  .brand-lockup .overline { display: none; }
  .brand-mark { width: 32px; height: 32px; }
  .quiet-button { padding-inline: 9px; }
  .turn-label { display: none; }
  .resources { justify-content: stretch; }
  .resource { min-width: 0; flex: 1; padding-inline: 8px; }
  .resource-symbol { width: 22px; height: 22px; }
  .resource span:last-child { display: block; }
  .resource strong { font-size: 16px; }
  .algorithm-console { grid-template-columns: 1fr; }
  .algorithm-identity { display: none; }
  .algorithm-pressure { grid-column: auto; grid-template-columns: 90px 1fr; }
  .intent-board-body { grid-template-columns: 34px 1fr auto; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .target-prompt { max-width: none; width: 100%; }
  .input-rail { grid-template-columns: 1fr; }
  .input-rail::before { left: 50%; right: auto; top: 5%; bottom: 5%; width: 5px; height: auto; }
  .rail-arrow { justify-self: center; transform: rotate(90deg); }
  .queue-slot { min-height: 112px; }
  .zones-panel { grid-template-columns: 1fr; }
  .log-zone { display: none; }
  .hand-heading { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .hand-heading > p { grid-column: 1 / -1; grid-row: 2; text-align: left; }
  .end-turn-button { min-width: 145px; }
  .cards-dock { grid-template-columns: 1fr; }
  .commitment-bay { min-height: 0; }
  .commitment-card-host { min-height: 0; }
  .game-card.commitment { min-height: 150px; }
  .game-card { min-height: 198px; }
  .intro-ticket::before, .result-ticket::before { width: 40px; height: 40px; right: 20px; top: 18px; }
  .result-stats { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* v0.2.1 · 星夜引航牌桌 -------------------------------------------------- */

:root {
  --guide-night: #0a1737;
  --guide-blue: #78baff;
  --guide-gold: #f6c86e;
  --guide-mist: rgba(174, 204, 255, .12);
}

.onboarding-coach {
  display: block;
  min-width: 0;
}

.guide-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.utility-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  color: #d9e6ff;
  background: rgba(17, 35, 78, .78);
  border: 1px solid rgba(157, 187, 241, .26);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}

.utility-button:hover {
  color: #fff7dc;
  background: rgba(35, 64, 124, .88);
  border-color: rgba(246, 200, 110, .52);
  transform: translateY(-1px);
}

.utility-button[aria-pressed="true"] {
  color: #17304a;
  background: #bfe7ff;
  border-color: #ecf8ff;
  box-shadow: 0 0 17px rgba(95, 168, 255, .28);
}

.utility-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: var(--guide-gold);
  background: rgba(246, 200, 110, .1);
  border-radius: 50%;
  font: 900 11px/1 var(--utility);
}

.utility-button[aria-pressed="true"] .utility-icon {
  color: #17304a;
  background: rgba(255, 255, 255, .55);
}

.guide-mast {
  position: relative;
  isolation: isolate;
  min-width: 0;
  display: grid;
  grid-template-columns: 78px minmax(250px, .9fr) minmax(470px, 1.45fr);
  align-items: center;
  gap: 17px;
  margin-top: 12px;
  padding: 12px 16px 12px 10px;
  overflow: hidden;
  color: #eef5ff;
  background:
    linear-gradient(102deg, rgba(19, 42, 91, .97), rgba(12, 28, 68, .95) 55%, rgba(27, 27, 73, .97)),
    var(--guide-night);
  border: 1px solid rgba(126, 177, 255, .36);
  border-left: 4px solid var(--guide-gold);
  border-radius: 8px 18px 18px 8px;
  box-shadow: 0 15px 42px rgba(0, 5, 24, .32), inset 0 1px rgba(255, 255, 255, .07);
}

.guide-mast::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -120% 38% -120% 2%;
  background: conic-gradient(from 205deg, transparent, rgba(95, 168, 255, .18), transparent 28%);
  transform: rotate(-7deg);
  pointer-events: none;
}

.guide-mast::after {
  content: "当前航线";
  position: absolute;
  right: 12px;
  top: 7px;
  color: rgba(180, 207, 255, .34);
  font: 800 7px/1 var(--utility);
  letter-spacing: .16em;
  text-transform: uppercase;
}

.guide-companion {
  position: relative;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 13px rgba(95, 168, 255, .38));
  animation: starlingHover 3.4s ease-in-out infinite;
}

.starling-ring {
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(123, 188, 255, .7);
  border-radius: 50%;
  transform: rotate(-24deg);
  animation: starlingOrbit 9s linear infinite;
}

.starling-ring::before,
.starling-ring::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  background: var(--guide-gold);
  border: 1px solid #fff1ba;
  border-radius: 50%;
  box-shadow: 0 0 9px var(--guide-gold);
}

.starling-ring::before { left: 5px; top: 7px; }
.starling-ring::after { right: 2px; bottom: 12px; }

.starling-core {
  position: relative;
  z-index: 2;
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 37% 30%, #fffce4 0 8%, #bce5ff 9% 28%, #4f8bd6 53%, #253b88 100%);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 48% 52% 47% 53%;
  box-shadow: 0 0 0 5px rgba(95, 168, 255, .12), 0 0 24px rgba(95, 168, 255, .48);
}

.starling-core::before,
.starling-core::after {
  content: "";
  position: absolute;
  top: 13px;
  width: 4px;
  height: 6px;
  background: #102254;
  border-radius: 50%;
  box-shadow: inset 0 1px rgba(255, 255, 255, .85);
}

.starling-core::before { left: 9px; }
.starling-core::after { right: 9px; }

.starling-core i {
  position: absolute;
  left: 50%;
  bottom: 7px;
  width: 7px;
  height: 3px;
  border-bottom: 1px solid #183064;
  border-radius: 50%;
  transform: translateX(-50%);
}

.starling-wing {
  position: absolute;
  z-index: 1;
  top: 25px;
  width: 20px;
  height: 13px;
  background: linear-gradient(135deg, #7fbaff, #f6c86e);
  border: 1px solid rgba(255, 255, 255, .55);
  opacity: .8;
}

.wing-left {
  left: 3px;
  border-radius: 90% 18% 75% 22%;
  transform: rotate(-20deg);
}

.wing-right {
  right: 3px;
  border-radius: 18% 90% 22% 75%;
  transform: rotate(20deg);
}

.guide-task { min-width: 0; }
.guide-kicker {
  margin: 0 0 4px;
  color: #9fc8ff;
  font: 850 9px/1.3 var(--utility);
  letter-spacing: .08em;
}

.guide-task h2 {
  margin: 0;
  color: #fff4ce;
  font: 900 clamp(15px, 1.35vw, 20px)/1.24 var(--display);
  letter-spacing: .01em;
}

.guide-task > p:last-child {
  margin: 5px 0 0;
  color: #b8c9e8;
  font-size: 10px;
  line-height: 1.5;
}

.guide-steps {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-steps li {
  min-width: 0;
  min-height: 51px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  color: #92a7ce;
  background: rgba(5, 14, 39, .42);
  border: 1px solid rgba(150, 181, 234, .16);
  border-radius: 9px;
  transition: opacity .2s ease, color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease;
}

.guide-steps li > span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: inherit;
  border: 1px solid currentColor;
  border-radius: 50%;
  font: 900 9px/1 var(--utility);
}

.guide-steps li div { min-width: 0; }
.guide-steps strong,
.guide-steps small { display: block; }
.guide-steps strong { color: inherit; font-size: 10px; line-height: 1.25; }
.guide-steps small { margin-top: 2px; color: #7589b0; font-size: 8px; line-height: 1.25; }

.guide-steps li[aria-current="step"],
.guide-steps li.is-current {
  color: #fff2bf;
  background: linear-gradient(135deg, rgba(58, 92, 154, .62), rgba(54, 49, 107, .7));
  border-color: rgba(246, 200, 110, .65);
  box-shadow: inset 3px 0 var(--guide-gold), 0 0 20px rgba(95, 168, 255, .15);
  transform: translateY(-1px);
}

.guide-steps li[aria-current="step"] small,
.guide-steps li.is-current small { color: #c8d7f2; }

.guide-steps li.is-complete,
.guide-steps li[data-state="complete"] {
  color: #9de7d9;
  border-color: rgba(87, 213, 193, .34);
}

.guide-steps li.is-complete > span,
.guide-steps li[data-state="complete"] > span {
  color: #153f3a;
  background: #9de7d9;
  border-color: #d6fff7;
}

.onboarding-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: -5px;
}

body:not([data-onboarding-active="true"]) #onboarding-skip-button,
#onboarding-recover-button.hidden {
  display: none;
}

.is-guide-recommended,
[data-onboarding-focus] {
  position: relative;
  z-index: 9;
  opacity: 1 !important;
  filter: none !important;
  outline: 3px solid rgba(255, 222, 137, .96);
  outline-offset: 4px;
  box-shadow: 0 0 0 9px rgba(95, 168, 255, .16), 0 0 34px rgba(246, 200, 110, .42) !important;
  animation: guideTargetPulse 1.35s ease-in-out infinite;
}

@keyframes guideTargetPulse {
  0%, 100% { outline-color: rgba(255, 222, 137, .72); transform: translateY(0); }
  50% { outline-color: #fff4bd; transform: translateY(-3px); }
}

/* 单焦点引导。只有当 JS 同时设置 guide-active 与 data-guide-focus 时才暗化。 */
body.guide-active[data-guide-focus] [data-guide-zone],
.is-guide-dim {
  opacity: .3;
  filter: saturate(.45) brightness(.78);
  pointer-events: none;
  transition: opacity .24s ease, filter .24s ease, transform .24s ease, box-shadow .24s ease;
}

body.guide-active[data-guide-focus="intent"] [data-guide-zone="intent"],
body.guide-active[data-guide-focus="queue"] [data-guide-zone="queue"],
body.guide-active[data-guide-focus="hand"] [data-guide-zone="hand"],
body.guide-active[data-guide-focus="commit"] [data-guide-zone="hand"],
body.guide-active[data-guide-focus="commit"] [data-guide-zone="commit"],
.is-guide-focus {
  position: relative;
  z-index: 6;
  opacity: 1;
  filter: none;
  pointer-events: auto;
  box-shadow: 0 0 0 3px rgba(246, 200, 110, .78), 0 0 0 9px rgba(95, 168, 255, .13), var(--shadow);
}

body.guide-active[data-guide-focus="commit"] [data-guide-zone="hand"] > .hand-heading,
body.guide-active[data-guide-focus="commit"] [data-guide-zone="hand"] > .cards-dock > .hand {
  opacity: .28;
  filter: saturate(.45);
  pointer-events: none;
}

body.guide-active[data-guide-focus="commit"] [data-guide-zone="commit"] {
  opacity: 1;
  filter: none;
  pointer-events: auto;
}

body.guide-active .guide-companion {
  filter: drop-shadow(0 0 17px rgba(246, 200, 110, .55));
}

.algorithm-console,
.input-board,
.hand-table,
.commitment-bay {
  scroll-margin-top: 16px;
}

.intro-ticket h2 { padding-right: 56px; }
.intro-rules p { position: relative; padding-left: 17px; }
.intro-rules p::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(var(--guide-blue), var(--guide-gold));
}

@keyframes starlingHover {
  0%, 100% { transform: translateY(1px) rotate(-1deg); }
  50% { transform: translateY(-4px) rotate(1deg); }
}

@keyframes starlingOrbit {
  to { transform: rotate(336deg); }
}

@media (max-width: 1050px) {
  .guide-mast {
    grid-template-columns: 68px minmax(0, 1fr);
    padding-right: 13px;
  }

  .guide-companion { grid-row: 1; }
  .guide-task { grid-row: 1; }
  .guide-steps { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .app-frame { min-width: 0; }

  .command-bar {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .brand-lockup,
  .resources,
  .turn-tools {
    grid-column: 1;
    min-width: 0;
  }

  .brand-lockup { grid-row: 1; }
  .resources { grid-row: 2; order: initial; }
  .turn-tools {
    grid-row: 3;
    justify-content: stretch;
    gap: 6px;
  }

  .turn-label { display: none; }
  .guide-controls { min-width: 0; flex: 1; }
  .utility-button,
  .quiet-button {
    min-width: 0;
    min-height: 38px;
    justify-content: center;
    padding-inline: 8px;
    font-size: 9px;
  }

  .utility-button { flex: 1; }
  .quiet-button { flex: 0 1 90px; }

  .guide-mast {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 9px;
    padding: 10px 9px 9px 7px;
    border-radius: 7px 14px 14px 7px;
  }

  .guide-companion {
    width: 52px;
    height: 52px;
  }

  .starling-core { width: 30px; height: 30px; }
  .starling-core::before,
  .starling-core::after { top: 11px; }
  .starling-core::before { left: 7px; }
  .starling-core::after { right: 7px; }
  .starling-core i { bottom: 6px; }
  .starling-wing { top: 20px; width: 16px; }

  .guide-task h2 { font-size: 14px; }
  .guide-task > p:last-child { font-size: 9px; }
  .guide-steps { gap: 4px; }
  .guide-steps li {
    min-height: 49px;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 5px;
    padding: 6px 5px;
    border-radius: 7px;
  }
  .guide-steps li > span { width: 19px; height: 19px; font-size: 8px; }
  .guide-steps strong { font-size: 9px; }
  .guide-steps small { display: none; }

  .resource { gap: 5px; padding-inline: 6px; }
  .resource small { font-size: 7px; }
  .intro-ticket { padding: 24px 19px; }
  .intro-ticket h2 { padding-right: 42px; font-size: clamp(27px, 9vw, 34px); }
}

@media (max-width: 390px) {
  .app-frame { width: 100%; padding-inline: 6px; }
  .brand-lockup h1 { font-size: 17px; }
  .resources { gap: 4px; }
  .resource-symbol { display: none; }
  .resource { justify-content: center; text-align: center; }
  .guide-mast::after { display: none; }
  .input-board,
  .zones-panel,
  .hand-table { padding-inline: 10px; }
  .hand { max-width: 100%; }
  .modal-layer { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .guide-companion,
  .starling-ring { animation: none !important; }
  body.guide-active[data-guide-focus] [data-guide-zone],
  .is-guide-dim,
  .is-guide-focus,
  .is-guide-recommended,
  [data-onboarding-focus] { transition: none !important; animation: none !important; }
}

/* v0.2.2 · 夜航简报 ------------------------------------------------------- */

.intro-ticket {
  width: min(760px, 100%);
  padding: clamp(24px, 3.8vw, 38px);
}

.intro-ticket h2 {
  max-width: 630px;
  margin: 8px 0 15px;
  font-size: clamp(30px, 4.2vw, 42px);
}

.context-summary {
  display: grid;
  grid-template-columns: .72fr 1.45fr 1fr;
  gap: 7px;
  margin-bottom: 13px;
}

.context-beat {
  min-width: 0;
  padding: 9px 10px;
  background: rgba(36, 62, 120, .055);
  border-top: 2px solid #6d97dd;
  border-radius: 3px 8px 8px 3px;
}

.context-beat:nth-child(2) { border-top-color: var(--pollution); }
.context-beat:nth-child(3) { border-top-color: var(--guide-gold); }
.context-beat strong { display: block; margin-bottom: 3px; color: #273f78; font: 850 9px/1.2 var(--utility); letter-spacing: .04em; }
.context-beat p { margin: 0; color: #505c78; font-size: 11px; line-height: 1.42; }

.play-preview {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.play-preview::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 21px;
  height: 2px;
  background: linear-gradient(90deg, #6caef1, #7f8ed0 48%, var(--guide-gold));
  opacity: .5;
}

.play-preview li {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px;
  background: rgba(255, 255, 255, .65);
  border: 1px solid rgba(50, 76, 133, .14);
  border-radius: 10px;
}

.play-preview li > span {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  color: #fff8df;
  background: #263e7d;
  border: 1px solid #8eaceb;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(95, 168, 255, .09);
  font: 900 11px/1 var(--utility);
}

.play-preview li:last-child > span { color: #26345f; background: var(--guide-gold); border-color: #fff0bd; }
.play-preview small { display: block; color: #74809e; font: 800 7px/1.2 var(--utility); letter-spacing: .04em; }
.play-preview strong { display: block; margin: 2px 0; color: #25376e; font: 900 12px/1.15 var(--display); }
.play-preview p { margin: 0; color: #606b86; font-size: 9px; line-height: 1.35; }

.training-note {
  margin: 0 0 10px;
  padding: 8px 11px;
  color: #4e4d6f;
  background: linear-gradient(90deg, rgba(246, 200, 110, .2), rgba(116, 157, 225, .08));
  border-left: 3px solid var(--guide-gold);
  border-radius: 3px 9px 9px 3px;
  font-size: 10px;
  line-height: 1.45;
}

.training-note b { color: #624815; }

.context-glossary {
  margin-bottom: 13px;
  color: #3d4e78;
  background: rgba(37, 60, 111, .045);
  border: 1px solid rgba(45, 70, 126, .15);
  border-radius: 9px;
}

.context-glossary summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 8px 11px;
  color: #284172;
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}

.context-glossary summary::marker { color: var(--guide-blue); }
.context-glossary dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 0; padding: 0 10px 10px; }
.context-glossary dl > div { min-width: 0; padding: 7px 8px; background: rgba(255, 255, 255, .64); border-radius: 7px; }
.context-glossary dt { display: flex; flex-wrap: wrap; gap: 4px 7px; align-items: baseline; }
.context-glossary dt strong { color: #243a70; font: 900 10px/1.2 var(--display); }
.context-glossary dt span { color: #81601c; font-size: 8px; font-weight: 800; }
.context-glossary dd { margin: 3px 0 0; color: #66718b; font-size: 8px; line-height: 1.35; }

.briefing-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.secondary-button,
.text-button {
  min-height: 42px;
  padding: 9px 15px;
  border-radius: 9px;
  font-weight: 850;
  cursor: pointer;
}

.secondary-button {
  color: #fff8e7;
  background: linear-gradient(145deg, #2a4489, #17295c);
  border: 1px solid #7997db;
  box-shadow: 0 4px 0 #0b1638;
}

.text-button {
  color: #4e5e83;
  background: transparent;
  border: 1px solid rgba(64, 86, 139, .22);
}

.secondary-button:hover,
.text-button:hover { filter: brightness(1.05); transform: translateY(-1px); }
.secondary-button:focus-visible,
.text-button:focus-visible,
.context-glossary summary:focus-visible { outline: 3px solid rgba(95, 168, 255, .55); outline-offset: 2px; }

.pile-card > span:last-child {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  column-gap: 4px;
}

.pile-card small { grid-column: 1 / -1; }
.pile-card b { color: #4e5c7d; font-size: 7px; line-height: 1.15; }

@media (max-width: 620px) {
  .intro-ticket { padding: 20px 16px; }
  .intro-ticket h2 { padding-right: 42px; margin-bottom: 12px; font-size: clamp(26px, 8vw, 33px); }
  .context-summary { grid-template-columns: 1fr; gap: 4px; }
  .context-beat { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 6px; padding-block: 7px; border-top: 0; border-left: 2px solid #6d97dd; }
  .context-beat:nth-child(2) { border-left-color: var(--pollution); }
  .context-beat:nth-child(3) { border-left-color: var(--guide-gold); }
  .context-beat strong { margin: 1px 0 0; }
  .play-preview { grid-template-columns: 1fr; gap: 4px; }
  .play-preview::before { left: 23px; right: auto; top: 12%; bottom: 12%; width: 2px; height: auto; }
  .play-preview li { grid-template-columns: 30px minmax(0, 1fr); padding-block: 6px; }
  .play-preview li > span { width: 27px; height: 27px; }
  .play-preview p { display: none; }
  .context-glossary dl { grid-template-columns: 1fr; }
  .briefing-actions > button { flex: 1 1 100%; }
}
