:root {
  color-scheme: dark;
  --bg: #090c0d;
  --panel: #111617;
  --panel-2: #171d1e;
  --line: rgba(255, 255, 255, 0.1);
  --muted: #8b9695;
  --text: #edf1ed;
  --amber: #dd9b42;
  --orange: #b84e2a;
  --red: #a83e35;
  --green: #72966b;
  --blue: #647d8b;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif; color: var(--text); }
button { font: inherit; }
.hidden { display: none !important; }

.start-screen {
  min-height: 100vh;
  position: relative;
  display: grid;
  align-items: center;
  overflow: hidden;
  background: url("cover.png") center/cover no-repeat;
}
.start-shade {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(5, 7, 8, .97) 0%, rgba(5, 7, 8, .78) 34%, rgba(5, 7, 8, .12) 68%, rgba(5, 7, 8, .3) 100%),
              linear-gradient(0deg, rgba(5, 7, 8, .9), transparent 34%);
}
.start-content { position: relative; z-index: 1; margin-left: clamp(54px, 8vw, 150px); max-width: 650px; }
.eyebrow, .panel-kicker, .node-kicker, .dialog-kicker {
  color: var(--amber); text-transform: uppercase; letter-spacing: .22em; font-size: 12px; font-weight: 700;
}
.start-content h1 { margin: 14px 0 12px; font-size: clamp(72px, 9vw, 142px); letter-spacing: -.07em; line-height: .9; font-weight: 900; }
.start-content h1 span { color: var(--amber); text-shadow: 0 5px 0 #542b1f; }
.start-copy { color: #cbd1ce; font-size: 21px; line-height: 1.8; text-shadow: 0 2px 20px #000; }
.start-actions { display: flex; gap: 12px; margin-top: 34px; }
.primary-btn, .secondary-btn {
  border: 0; cursor: pointer; min-width: 170px; padding: 15px 24px; font-weight: 800; letter-spacing: .06em; transition: .18s ease;
}
.primary-btn { background: var(--amber); color: #14110d; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .28); }
.primary-btn:hover { background: #f1ad50; transform: translateY(-2px); }
.secondary-btn { color: var(--text); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(10px); }
.secondary-btn:hover { background: rgba(255,255,255,.14); }
.ironman-note { margin-top: 17px; color: #79817f; font-size: 12px; letter-spacing: .13em; }
.start-footer { position: absolute; z-index: 1; bottom: 27px; left: 38px; right: 38px; display: flex; justify-content: space-between; color: rgba(255,255,255,.38); font-size: 10px; letter-spacing: .2em; }

.game-screen { min-height: 100vh; background: radial-gradient(circle at 55% 0%, #182021 0, #090c0d 42%); }
.topbar { height: 72px; display: grid; grid-template-columns: 260px 1fr 260px; align-items: center; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(8, 11, 12, .92); position: sticky; top: 0; z-index: 5; }
.brand { border: 0; background: none; color: #d5dad7; font-weight: 900; font-size: 18px; letter-spacing: .07em; cursor: pointer; text-align: left; }
.brand b { color: var(--amber); font-size: 24px; }
.day-track { justify-self: center; width: min(520px, 100%); display: grid; grid-template-columns: 110px 1fr 100px; gap: 14px; align-items: center; font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.day-track span:last-child { text-align: right; }
.day-progress { height: 3px; background: #242b2b; overflow: hidden; }
.day-progress i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--orange), var(--amber)); transition: width .5s ease; }
.top-actions { justify-self: end; display: flex; gap: 8px; }
.icon-btn { border: 1px solid var(--line); background: #121718; color: var(--muted); font-size: 11px; padding: 9px 12px; cursor: pointer; }
.icon-btn:hover { color: var(--text); border-color: rgba(255,255,255,.25); }
.icon-btn.danger:hover { color: #dc7569; }

.game-layout { display: grid; grid-template-columns: 230px minmax(550px, 1fr) 260px; gap: 20px; padding: 20px; max-width: 1680px; margin: 0 auto; }
.stats-panel, .log-panel { background: rgba(15, 20, 21, .86); border: 1px solid var(--line); min-height: calc(100vh - 112px); padding: 20px; }
.panel-kicker { margin: 0 0 16px; }
.stat-card { position: relative; padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; align-items: end; }
.stat-card span { color: var(--muted); font-size: 12px; letter-spacing: .1em; }
.stat-card strong { font-size: 30px; line-height: 1; }
.stat-card small { grid-column: 1 / 3; margin-top: 6px; color: #596260; font-size: 10px; }
.meter { grid-column: 1 / 3; height: 3px; background: #272d2d; margin-top: 11px; }
.meter i { display: block; height: 100%; width: 50%; background: var(--amber); transition: width .35s ease, background .35s ease; }
.mini-section { margin-top: 22px; }
.mini-heading { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; letter-spacing: .1em; }
.mini-heading b { color: #d9dedb; }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip-list span { font-size: 10px; padding: 6px 8px; background: #202727; border-left: 2px solid var(--amber); color: #cbd0cd; }
.empty-list { color: #4f5755; font-size: 11px; }

.story-stage { min-width: 0; }
.scene-art { height: min(38vh, 360px); min-height: 250px; position: relative; background: url("cover.png") center/cover no-repeat; border: 1px solid var(--line); box-shadow: var(--shadow); transition: background-image .4s ease; overflow: hidden; }
.scene-art::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 70% 30%, transparent 0 30%, rgba(0,0,0,.25) 80%); pointer-events: none; }
.scene-gradient { position: absolute; inset: 0; background: linear-gradient(0deg, #101415 0, transparent 48%); }
.scene-caption { position: absolute; z-index: 1; left: 24px; right: 24px; bottom: 18px; display: flex; justify-content: space-between; align-items: end; }
.scene-caption span { font-size: 12px; color: #c9ceca; letter-spacing: .14em; }
.scene-caption b { color: var(--amber); font-size: 13px; letter-spacing: .14em; }
.story-card { background: rgba(18, 23, 24, .96); border: 1px solid var(--line); border-top: 0; padding: 28px 34px 32px; min-height: 420px; }
.story-heading { display: flex; align-items: start; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.node-kicker { margin: 0 0 7px; }
.story-heading h2 { margin: 0; font-size: 27px; letter-spacing: -.03em; }
.seen-badge { color: #6f7977; font-size: 10px; padding: 5px 7px; border: 1px solid #343b3a; }
.story-text { color: #cfd4d0; font-size: 15px; line-height: 1.95; padding: 20px 0 10px; }
.story-text p { margin: 0 0 12px; }
.story-text em { color: #8e9895; font-style: normal; }
.story-text strong { color: #f0b35e; }
.choices { display: grid; gap: 9px; margin-top: 16px; }
.choice-button { width: 100%; display: grid; grid-template-columns: 35px 1fr auto; align-items: center; text-align: left; border: 1px solid #2b3332; background: #171d1e; color: #dfe3df; padding: 13px 15px; cursor: pointer; transition: .15s ease; }
.choice-button:hover:not(:disabled) { transform: translateX(4px); border-color: #8c6033; background: #202423; }
.choice-button:disabled { cursor: not-allowed; opacity: .43; }
.choice-key { width: 24px; height: 24px; display: grid; place-items: center; background: #2a302f; color: var(--amber); font-size: 11px; font-weight: 800; }
.choice-text { font-size: 13px; line-height: 1.55; }
.choice-cost { color: #8e9795; font-size: 10px; margin-left: 12px; white-space: nowrap; }
.effect-toast { border-left: 3px solid var(--amber); background: rgba(221, 155, 66, .08); color: #d5b27f; font-size: 11px; padding: 9px 12px; margin: 5px 0 12px; }
.repeat-choice { margin-top: 15px; border: 0; color: #8b9694; background: none; text-decoration: underline; cursor: pointer; font-size: 11px; }
.game-credit { margin: 12px 2px 0; color: #68716f; font-size: 10px; letter-spacing: .06em; text-align: right; }

.log-panel { display: flex; flex-direction: column; }
.log-heading { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .12em; color: var(--muted); padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.log-heading b { color: #ce5c4e; font-size: 9px; }
.event-log { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 13px; padding: 16px 0; overflow: hidden; max-height: calc(100vh - 270px); }
.log-item { display: grid; grid-template-columns: 7px 1fr; gap: 10px; font-size: 10px; color: #7e8986; line-height: 1.5; animation: log-in .25s ease; }
.log-item i { width: 5px; height: 5px; margin-top: 5px; background: #46504e; transform: rotate(45deg); }
.log-item.good i { background: var(--green); }
.log-item.bad i { background: var(--red); }
.log-item.gold i { background: var(--amber); }
.fate-note { margin-top: auto; border: 1px solid #302b25; background: rgba(96, 61, 31, .08); padding: 14px; }
.fate-note span { color: var(--amber); font-size: 10px; letter-spacing: .14em; }
.fate-note p { color: #6e7774; font-size: 10px; line-height: 1.65; margin: 8px 0 0; }

dialog { width: min(450px, calc(100vw - 40px)); border: 1px solid #3b403e; background: #131819; color: var(--text); padding: 0; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0,0,0,.78); backdrop-filter: blur(5px); }
dialog form { padding: 30px; }
dialog h3 { font-size: 24px; margin: 8px 0 10px; }
dialog p:not(.dialog-kicker) { color: var(--muted); font-size: 13px; line-height: 1.7; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 26px; }
.dialog-actions button { min-width: 110px; }

@keyframes log-in { from { opacity: 0; transform: translateY(-5px); } }
@media (max-width: 1180px) {
  .game-layout { grid-template-columns: 210px minmax(500px, 1fr); }
  .log-panel { display: none; }
  .topbar { grid-template-columns: 220px 1fr 210px; }
}
@media (max-width: 850px) {
  .topbar { grid-template-columns: 1fr auto; }
  .day-track { display: none; }
  .game-layout { grid-template-columns: 1fr; padding: 12px; }
  .stats-panel { min-height: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 12px; }
  .stats-panel .panel-kicker, .mini-section { display: none; }
  .stat-card { padding: 8px; border: 0; background: #171c1d; }
  .story-card { padding: 22px 20px; }
}
