/* Permanent Record —— 竖屏优先；黑板 + 褪色毕业照的美术方向 */

:root {
  --chalk: #eae4d3;
  --chalk-dim: #a8a291;
  --board: #24302b;
  --board-2: #1b2420;
  --paper: #f2ece0;
  --ink: #2a2620;
  --accent: #e3b23c;
  --danger: #c0553f;
  --good: #6a9c6a;
  --line: rgba(234, 228, 211, 0.18);
  --radius: 14px;
  --safe-t: var(--discord-safe-area-inset-top, env(safe-area-inset-top, 0px));
  --safe-b: var(--discord-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --safe-l: var(--discord-safe-area-inset-left, env(safe-area-inset-left, 0px));
  --safe-r: var(--discord-safe-area-inset-right, env(safe-area-inset-right, 0px));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--board);
  color: var(--chalk);
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, "Songti SC", serif;
  font-size: 18px;
  line-height: 1.45;
  overscroll-behavior: none;
}

body {
  padding: calc(var(--safe-t) + 12px) calc(var(--safe-r) + 14px)
           calc(var(--safe-b) + 14px) calc(var(--safe-l) + 14px);
  max-width: 720px;
  margin: 0 auto;
}

h1, h2, h3 { font-weight: 600; margin: 0 0 .4em; letter-spacing: .01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
.muted { color: var(--chalk-dim); }
.small { font-size: .85rem; }
.center { text-align: center; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

/* ---- 黑板区（公共信息） ---- */
.board {
  background:
    radial-gradient(120% 80% at 30% 0%, rgba(255,255,255,.05), transparent 60%),
    var(--board-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.board .title { font-size: 1.15rem; }
.board .sub { color: var(--chalk-dim); font-size: .9rem; }

/* ---- 课桌区（私人信息） ---- */
.desk {
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 6px 0 rgba(0,0,0,.25);
}
.desk h2 { color: var(--ink); }

/* ---- 按钮 ---- */
button, .btn {
  display: block;
  width: 100%;
  min-height: 56px;
  margin: 10px 0;
  padding: 12px 16px;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: transform .06s ease, background .15s ease;
}
button:active { transform: translateY(2px); }
button[disabled] { opacity: .4; cursor: not-allowed; }
button.selected { background: var(--accent); border-color: var(--ink); font-weight: 700; }
button.danger.selected { background: var(--danger); color: #fff; }
button.good.selected { background: var(--good); color: #fff; }
button .hint { display: block; font-size: .8rem; color: #6b6355; margin-top: 2px; }
button.selected .hint { color: rgba(0,0,0,.6); }

input {
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  font: inherit;
  font-size: 1.1rem;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 12px;
  margin: 8px 0;
}
input.code { text-transform: uppercase; letter-spacing: .35em; text-align: center; font-weight: 700; }

/* ---- 倒计时 ---- */
.timer {
  font-variant-numeric: tabular-nums;
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.timer.warn { color: var(--accent); }
.timer.hot { color: var(--danger); }

/* ---- 名单 ---- */
.roster { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .9rem;
}
.chip.locked { background: rgba(227,178,60,.18); border-color: rgba(227,178,60,.5); }
.chip.off { opacity: .4; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--chalk-dim); }
.chip.locked .dot { background: var(--accent); }

/* ---- 房间码 ---- */
.code-big {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: clamp(2.6rem, 14vw, 5rem);
  letter-spacing: .18em;
  font-weight: 700;
  color: var(--accent);
}

/* ---- 结算 ---- */
.verdict { font-size: 1.5rem; font-weight: 700; margin: 8px 0; }
.verdict.caught { color: var(--danger); }
.verdict.escaped { color: var(--good); }
.scoreline { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); }
.scoreline .delta.pos { color: var(--good); }
.scoreline .delta.neg { color: var(--danger); }

.stage { min-height: 40vh; }
.fade { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 放学时刻：换一套暖色，情绪要变 */
body.dusk { background: linear-gradient(180deg, #3a2f2a 0%, #241d1a 100%); }
body.dusk .board { background: rgba(255,240,220,.06); }

@media (prefers-reduced-motion: reduce) {
  .fade { animation: none; }
}
