/* ============ 球王模拟器 · 木地板美学 v2(2026-10-03) ============ */
/* 体育馆的暖:木色渐变底 + 胡桃结构色 + 篮球橙强调 */
:root {
  --paper: #f0e4d0;
  --paper-deep: #e2d0b2;
  --card: #fffaf0;
  --card-line: #e6d5b8;
  --ink: #3d3226;
  --ink-soft: #95826b;
  --red: #e8722a;          /* 主强调:篮球橙 */
  --red-deep: #c75e1e;     /* 深橙:数字与按压态 */
  --wood: #7a4a2b;         /* 胡桃:结构与标题 */
  --wood-soft: #c9a87c;
  --gold: #7a4a2b;         /* 兼容旧变量名:描金位 → 胡桃 */
  --gold-soft: #c9a87c;
  --gold-pale: #f7eedc;
  --green: #4e7a46;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

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

html, body { height: 100%; }
body {
  background: #2b2119;
  font-family: var(--sans);
  color: var(--ink);
  display: flex;
  justify-content: center;
}

#phone {
  width: min(480px, 100vw);
  height: 100vh;
  height: 100dvh;
  background: linear-gradient(184deg, #f0e4d0 0%, #ecdcc2 55%, #e5d3b4 100%);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 44px rgba(43,33,25,.55);
}

.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }
.hidden { display: none !important; }

/* ============ 通用按钮 ============ */
.btn {
  border: 1px solid var(--card-line);
  background: var(--card);
  color: var(--ink);
  font-size: 15px;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--sans);
  transition: transform .05s;
  box-shadow: 0 1px 3px rgba(122,74,43,.08);
}
.btn:active { transform: scale(.97); }
.btn.solid {
  background: linear-gradient(180deg, #f08a3c, var(--red));
  border-color: var(--red-deep);
  color: #fff7ec;
  font-weight: 600;
  letter-spacing: 2px;
  box-shadow: 0 3px 10px rgba(199,94,30,.32);
}
.btn.solid:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn-row { display: flex; gap: 10px; margin-top: 12px; }
.btn-row .btn { flex: 1; }

/* ============ 开始界面 ============ */
.start-scroll { overflow-y: auto; padding: 40px 20px 30px; }
.brand { text-align: center; margin-bottom: 22px; }
.app-icon {
  width: 72px; height: 72px;
  margin: 0 auto 14px;
  background: linear-gradient(160deg, #7a4a2b, #5e3820);
  border-radius: 18px;
  color: #ffe9d2;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 2px;
  box-shadow: inset 0 0 0 2px rgba(255,233,210,.28), 0 5px 14px rgba(94,56,32,.4);
  writing-mode: vertical-rl;
}
.app-title {
  font-family: var(--serif);
  font-size: 28px;
  letter-spacing: 6px;
  color: var(--wood);
  margin-bottom: 10px;
}
.app-slogan { font-size: 13px; color: var(--ink-soft); line-height: 1.7; padding: 0 10px; }

.panel {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(122,74,43,.07);
}
.panel-caption { font-size: 15px; font-weight: 700; color: var(--wood); letter-spacing: 1px; margin-bottom: 12px; }

.last-run-line { font-size: 13px; color: var(--ink-soft); line-height: 1.8; }
.last-run-line b { color: var(--red-deep); font-weight: 700; }

.talent-box {
  background: var(--paper);
  border: 1px dashed #d4bf99;
  border-radius: 12px;
  padding: 14px;
  display: flex; align-items: center; gap: 12px;
}
.talent-mystery { font-family: var(--serif); font-size: 22px; color: #bda88a; letter-spacing: 4px; }
.talent-mystery-sub { flex: 1; font-size: 12px; color: var(--ink-soft); }
.talent-result {
  margin-top: 12px;
  background: var(--gold-pale);
  border: 1px solid var(--wood-soft);
  border-radius: 12px;
  padding: 12px 14px;
  animation: rise .3s ease;
}
.talent-result .t-name { font-family: var(--serif); font-size: 17px; font-weight: 700; color: var(--red-deep); }
.talent-result .t-pos {
  display: inline-block; font-size: 11px; color: var(--wood);
  border: 1px solid var(--wood-soft); border-radius: 20px;
  padding: 1px 8px; margin-left: 8px; vertical-align: 2px;
}
.talent-result .t-desc { font-size: 13px; color: #6b5c47; margin-top: 6px; line-height: 1.7; }
.talent-result .t-bonus { font-size: 12px; color: var(--green); margin-top: 6px; }
.talent-result .t-reroll { margin-top: 8px; font-size: 12px; color: var(--ink-soft); background: none; border: none; cursor: pointer; text-decoration: underline; }

.points-left { font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; }
.points-left b { color: var(--red-deep); font-size: 16px; font-family: var(--serif); }

.alloc-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.alloc-name { width: 52px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 2px; }
.alloc-tip-line { flex-basis: 100%; font-size: 11px; color: var(--ink-soft); margin: -7px 0 0; }
.alloc-btn {
  width: 28px; height: 28px; border-radius: 8px;
  border: 1px solid var(--card-line); background: var(--card);
  font-size: 16px; cursor: pointer; color: var(--ink); line-height: 1;
}
.alloc-btn:active { background: var(--paper-deep); }
.alloc-track { flex: 1; height: 10px; background: #eadcc0; border-radius: 6px; overflow: hidden; border: 1px solid #ddc9a4; }
.alloc-fill { height: 100%; background: linear-gradient(90deg, #f0a45f, var(--red)); border-radius: 6px; transition: width .15s; }
.alloc-val { width: 34px; text-align: center; font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--wood); }
.alloc-tip { font-size: 11px; color: var(--ink-soft); margin-top: 2px; min-height: 15px; }
.attr-line span i { font-style: normal; color: var(--wood); font-size: 11px; margin-left: 4px; }
.attr-desc { font-size: 11px; color: var(--ink-soft); margin: -6px 0 8px; }
.sum-seasons { max-height: 216px; overflow-y: auto; border: 1px solid var(--card-line); border-radius: 8px; padding: 4px 10px; background: var(--paper); }
.season-row { display: flex; gap: 6px; justify-content: space-between; align-items: baseline; font-size: 11px; padding: 5px 0; border-bottom: 1px dashed #ddc9a4; color: var(--ink); }
.season-row:last-child { border-bottom: none; }
.season-row b { flex: 1; text-align: left; font-weight: 600; color: var(--wood); }
.season-row.out { opacity: .55; }
.radar-wrap { text-align: center; padding: 4px 0 2px; }
.radar-svg { width: 232px; max-width: 100%; }
.radar-legend { font-size: 10px; color: var(--ink-soft); margin: 2px 0 0; }
.radar-power { font-size: 12px; color: var(--ink-soft); margin: -2px 0 10px; }
.radar-power b { font-family: var(--serif); font-size: 22px; color: var(--red-deep); margin-left: 6px; }
.hud-right { display: flex; align-items: center; gap: 8px; }
.mini-radar { width: 72px; height: 72px; flex: none; cursor: pointer; }
.mini-radar svg { width: 100%; height: 100%; display: block; }
.mini-radar:active { opacity: .7; }

.btn-start { width: 100%; padding: 14px; font-size: 17px; margin-top: 4px; }
.start-footnote { text-align: center; font-size: 11px; color: #b3a084; margin-top: 14px; letter-spacing: 1px; }
.ver-tag { display: inline-block; margin-top: 6px; color: #bfa98a; letter-spacing: 0; }

/* ============ HUD ============ */
.hud {
  padding: 14px 16px 10px;
  background: linear-gradient(180deg, rgba(240,228,208,.96) 78%, rgba(240,228,208,0));
  z-index: 5;
}
.hud-row1 { display: flex; justify-content: space-between; align-items: flex-start; }
.hud-left { display: flex; align-items: baseline; gap: 10px; }
.hud-age { font-family: var(--serif); }
.hud-age b { font-size: 44px; color: var(--red-deep); font-weight: 700; line-height: 1; }
.hud-age { font-size: 15px; color: var(--red-deep); }
.realm-badge {
  background: linear-gradient(180deg, #7a4a2b, #5e3820);
  color: #ffe9d2;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 18px;
  letter-spacing: 1px;
  box-shadow: 0 2px 4px rgba(94,56,32,.3);
}
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--card-line); background: var(--card);
  font-size: 22px; color: var(--ink-soft); cursor: pointer; line-height: 1;
}
.hud-row2 { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.hud-bar { flex: 1; display: flex; align-items: center; gap: 8px; }
.hud-bar-track { flex: 1; height: 8px; background: #e0cfae; border-radius: 5px; overflow: hidden; border: 1px solid #d4bf99; }
.hud-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #f0a45f, var(--red)); border-radius: 5px; transition: width .4s; }
.hud-bar-num { font-size: 11px; color: var(--ink-soft); min-width: 38px; }
.bag-btn {
  border: 1.5px solid var(--red); background: var(--card);
  color: var(--red-deep); font-size: 13px; font-weight: 600;
  padding: 6px 14px; border-radius: 20px; cursor: pointer;
}
.bag-btn:active { background: var(--gold-pale); }
.hud-chips { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.hud-profile {
  font-size: 11px; color: #7d6c55; line-height: 1.5;
  margin-top: 6px; padding: 4px 8px;
  background: rgba(255,250,240,.65); border: 1px dashed #d4bf99; border-radius: 8px;
}
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: #6b5c47;
  border: 1px solid var(--card-line); background: var(--card);
  border-radius: 16px; padding: 4px 10px;
  box-shadow: 0 1px 2px rgba(122,74,43,.06);
}
.chip b { font-family: var(--serif); color: var(--wood); }
.chip.gold { border-color: var(--wood-soft); color: var(--wood); background: var(--gold-pale); }
.chip.gold b { color: var(--wood); }

/* ============ 事件流 ============ */
#feed { flex: 1; overflow-y: auto; padding: 6px 16px 90px; }

.card {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
  animation: rise .35s ease;
  line-height: 1.75;
  font-size: 14px;
  color: #4a3f30;
  box-shadow: 0 1px 4px rgba(122,74,43,.07);
}
@keyframes rise { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.age-tag {
  display: inline-block;
  background: linear-gradient(180deg, #f08a3c, var(--red-deep));
  color: #fff3e2;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-right: 8px;
  vertical-align: 1px;
}
.card.choice-card { background: var(--gold-pale); border-color: var(--wood-soft); }
.card.choice-card .age-tag { background: var(--wood); }
/* 事件情绪色:正面绿条 / 负面红条(按实际数值涨落判定,中立卡不着色) */
.card.good { border-left: 3px solid #5c8a52; background: linear-gradient(90deg, #f0f5ea, var(--card) 55%); }
.card.bad { border-left: 3px solid #c75e1e; background: linear-gradient(90deg, #fbeee2, var(--card) 55%); }
/* 关键事件:橙边提字,信息流里一眼可见(优先级高于情绪色) */
.card.imp {
  font-size: 15px;
  border: 1.5px solid var(--red);
  background: linear-gradient(180deg, #fdf0e4, var(--card) 72%);
  box-shadow: 0 3px 14px rgba(232,114,42,.22);
  padding: 14px 16px;
  line-height: 1.85;
}
.card.imp b { font-size: 16px; color: var(--red-deep); }
.card.imp .age-tag { background: linear-gradient(180deg, #7a4a2b, #5e3820); }
.card.sys-card { padding: 8px 12px; box-shadow: none; background: rgba(255,250,240,.8); }
.delta-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.card .delta-row { margin-top: 8px; }
.delta-chip {
  font-size: 11px; color: #7d6a4f;
  border: 1px solid #ddc9a4; background: #fdf7ea;
  border-radius: 12px; padding: 2px 8px;
}
.delta-chip.plus { color: var(--green); border-color: #c4d4b8; background: #f0f5ea; }
.delta-chip.minus { color: var(--red-deep); border-color: #eec4a4; background: #fbeee2; }

/* ============ 控制栏 ============ */
.ctrl-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(240,228,208,.96) 68%, rgba(240,228,208,0));
  z-index: 6;
}
.ctrl-btn {
  border: 1px solid var(--card-line); background: var(--card);
  font-size: 13px; color: var(--ink);
  padding: 8px 14px; border-radius: 18px; cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 3px rgba(122,74,43,.08);
}
.ctrl-hint { font-size: 10px; color: #b3a084; flex: 1; text-align: right; line-height: 1.4; }

/* ============ 抽屉 ============ */
.mask {
  position: absolute; inset: 0; background: rgba(60,42,24,.30);
  z-index: 10; animation: fade .25s ease;
}
.mask.dark { background: rgba(38,26,14,.6); }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--card);
  border-radius: 22px 22px 0 0;
  border-top: 1px solid var(--card-line);
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
  z-index: 11;
  max-height: 78%;
  overflow-y: auto;
  animation: up .3s ease;
  box-shadow: 0 -10px 34px rgba(60,42,24,.28);
}
.sheet.tall { max-height: 92%; }
@keyframes up { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-grip { width: 40px; height: 4px; border-radius: 3px; background: #d4bf99; margin: 4px auto 14px; }

.choice-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.choice-icon { font-size: 38px; filter: sepia(.25) saturate(1.2); }
.choice-title { font-size: 17px; font-weight: 700; color: var(--wood); line-height: 1.5; font-family: var(--serif); }
.choice-body { font-size: 15px; line-height: 1.8; color: #4a3f30; margin-bottom: 12px; }
.choice-hint {
  font-size: 12px; color: #9a6a30;
  background: #fdf3e4; border: 1px solid #ecd2ae;
  border-radius: 10px; padding: 8px 12px; line-height: 1.7; margin-bottom: 14px;
}
.choice-opts { display: flex; flex-direction: column; gap: 10px; }
.choice-btn {
  text-align: left; width: 100%;
  border: 1px solid var(--card-line); background: var(--paper);
  border-radius: 14px; padding: 13px 16px; cursor: pointer;
  box-shadow: 0 1px 3px rgba(122,74,43,.06);
  transition: border-color .12s;
}
.choice-btn:active { background: var(--paper-deep); border-color: var(--red); }
.choice-btn .c-label { font-size: 15px; font-weight: 700; color: var(--wood); }
.choice-btn .c-sub { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.choice-btn .c-sub.warn { color: var(--red-deep); }

/* ============ 行囊 ============ */
.bag-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.bag-tab {
  flex: 1; border: 1px solid var(--card-line); background: var(--paper);
  font-size: 13px; padding: 7px 0; border-radius: 10px; cursor: pointer; color: var(--ink-soft);
}
.bag-tab.active { background: var(--red); color: #fff7ec; border-color: var(--red-deep); font-weight: 600; }
.bag-body { font-size: 13px; line-height: 1.7; min-height: 200px; }
.attr-line { display: flex; justify-content: space-between; padding: 7px 2px; border-bottom: 1px dashed #ddc9a4; }
.attr-line b { font-family: var(--serif); color: var(--wood); }
.bag-section-title { font-size: 12px; color: var(--ink-soft); margin: 14px 0 6px; letter-spacing: 1px; }
.honor-item {
  display: inline-block; margin: 0 6px 6px 0;
  background: var(--gold-pale); border: 1px solid var(--wood-soft); color: var(--wood);
  font-size: 12px; border-radius: 12px; padding: 4px 10px;
}
.bag-empty { color: #b3a084; text-align: center; padding: 30px 0; font-size: 12px; }

/* ============ 总结 ============ */
.sum-title { text-align: center; font-family: var(--serif); font-size: 26px; color: var(--red-deep); letter-spacing: 4px; margin: 6px 0 4px; }
.sum-sub { text-align: center; font-size: 12px; color: var(--ink-soft); margin-bottom: 16px; }
.sum-letter {
  background: var(--gold-pale); border: 1px solid var(--wood-soft); border-radius: 12px;
  padding: 14px; font-size: 13px; line-height: 1.9; color: #6b5c47; margin-bottom: 14px;
}
.sum-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.sum-cell { background: var(--paper); border: 1px solid var(--card-line); border-radius: 10px; padding: 10px 6px; text-align: center; }
.sum-cell b { display: block; font-family: var(--serif); font-size: 19px; color: var(--red-deep); }
.sum-cell span { font-size: 11px; color: var(--ink-soft); }
.sum-list { font-size: 13px; line-height: 2; color: #4a3f30; }
.sum-actions { display: flex; gap: 10px; margin-top: 16px; }
.sum-actions .btn { flex: 1; }

/* ============ 里程碑图鉴 ============ */
.mile-prog { font-size: 12px; color: #9a6a30; background: #fdf3e4; border: 1px solid #ecd2ae; border-radius: 10px; padding: 8px 12px; margin-bottom: 6px; }
.mile-cat-title {
  font-size: 13px; font-weight: 700; color: var(--wood); letter-spacing: 1px;
  margin: 14px 0 8px; display: flex; justify-content: space-between; align-items: baseline;
}
.mile-cat-title span { font-size: 11px; color: var(--ink-soft); font-weight: 400; }
.mile-item {
  border: 1px solid var(--card-line); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 8px; background: var(--paper);
}
.mile-item b { display: block; font-size: 14px; margin-bottom: 3px; }
.mile-item span { font-size: 12px; color: var(--ink-soft); line-height: 1.6; }
.mile-item.got { background: var(--gold-pale); border-color: var(--wood-soft); }
.mile-item.got b { color: var(--wood); }
.mile-item.got span { color: #6b5c47; }
.mile-item.lock b { color: #b3a084; }
.honor-item.mile-new { background: var(--gold-pale); color: var(--wood); border-color: var(--wood); font-weight: 600; }

/* ---- 金色结局页(球王登基 / 已解锁) ---- */
#summary-sheet.gold { background: linear-gradient(180deg, #fdf6e4, var(--card) 30%); border-top: 2px solid #c99a3a; }
#summary-sheet.gold .sum-title { color: #b0812f; text-shadow: 0 1px 0 rgba(201,154,58,.3); }
#summary-sheet.gold .sum-letter { border-color: #c99a3a; }
#summary-sheet.gold .sum-cell b { color: #b0812f; }

/* ---- 「加冕」解锁:上一档生涯卡描金 ---- */
.panel.gold { border-color: #c99a3a; box-shadow: inset 0 0 0 1px rgba(201,154,58,.5); }
.panel.gold .panel-caption { color: #b0812f; }

/* ---- 金战靴 HUD(集齐全部里程碑后) ---- */
#screen-game.golden .realm-badge {
  background: linear-gradient(180deg, #c99a3a, #9a7c33);
  box-shadow: 0 2px 4px rgba(154,124,51,.35), inset 0 0 0 1px rgba(253,246,228,.4);
}
#screen-game.golden .hud-bar-fill { background: linear-gradient(90deg, #c99a3a, #e0b45c); }
#screen-game.golden #hud-boots { border-color: #c99a3a; color: #9a7c33; background: #fdf6e4; font-weight: 600; }

/* ---- 分配:一键随机按钮 ---- */
.alloc-random { font-size: 12px; padding: 3px 10px; border-radius: 12px; margin-left: 8px; vertical-align: 1px; }

/* ---- 难度选择 ---- */
.diff-row { display: flex; gap: 8px; margin-bottom: 6px; }
.diff-btn {
  flex: 1; border: 1px solid var(--card-line); background: var(--paper);
  font-size: 13px; padding: 8px 0; border-radius: 10px; cursor: pointer; color: var(--ink-soft);
}
.diff-btn.active { background: var(--red); color: #fff7ec; border-color: var(--red-deep); font-weight: 600; }
.diff-tip { font-size: 11px; color: var(--ink-soft); line-height: 1.6; margin-bottom: 10px; }

/* ---- 行囊设置 ---- */
.set-row { display: flex; gap: 8px; margin-top: 12px; }
.set-btn { flex: 1; font-size: 13px; padding: 8px 0; }

::-webkit-scrollbar { width: 0; height: 0; }
