:root {
  --bg: #f2f4f9;
  --panel: #ffffff;
  --panel-2: #eef1f7;
  --line: #d9dee8;
  --text: #1c202a;
  --text-dim: #5d6678;
  --red: #ff4655;
  --green: #14b866;
  --gold: #d99a1b;
  --radius: 12px;
}

html { -webkit-text-size-adjust: 100%; }

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(circle at 1px 1px, rgba(28,32,42,.05) 1.4px, transparent 1.6px) 0 0 / 24px 24px,
    radial-gradient(620px 340px at 12% -2%, rgba(255,70,85,.18), transparent 60%),
    radial-gradient(700px 380px at 90% 4%, rgba(60,120,255,.18), transparent 60%),
    radial-gradient(560px 440px at 50% 116%, rgba(255,70,85,.12), transparent 60%),
    linear-gradient(160deg, #eef1f8 0%, #f4f6fb 55%, #e9eef7 100%);
}

/* ---------- Top bar ---------- */
.topbar {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  max-width: 1080px; margin: 0 auto; padding: 20px 24px 8px;
}
.brand { display: flex; align-items: center; gap: 12px; justify-self: start; }
.brand-mark {
  font-size: 26px; color: var(--red);
  text-shadow: 0 0 18px rgba(255,70,85,.6);
}
.brand-text h1 { font-size: 22px; letter-spacing: 2px; }
.brand-sub { font-size: 11px; letter-spacing: 4px; color: var(--text-dim); }
/* 顶部居中控制组（赛区下拉 + 换一题，原在棋盘卡片内，现上移到 header） */
.top-controls {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
}
.top-actions { display: flex; gap: 8px; align-items: center; justify-self: end; }

button { cursor: pointer; font-family: inherit; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); font-size: 15px;
  transition: .15s;
}
.icon-btn:hover { border-color: var(--red); color: var(--red); }
.lang-btn {
  width: auto; min-width: 38px; padding: 0 10px;
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
  white-space: nowrap; flex: none;
}
.lang-btn:hover { border-color: var(--red); color: var(--red); }
.chip-btn {
  height: 38px; padding: 0 16px; border-radius: 999px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); font-size: 13px; letter-spacing: 1px;
  transition: .15s;
}
.chip-btn:hover, .chip-btn.active { border-color: var(--red); color: var(--red); }

/* ---------- 赛区更换下拉框（可点的「更换赛区」框 + 当前值展示框） ---------- */
.region-select { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.rs-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 14px; border-radius: 999px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); font-size: 13px; letter-spacing: .5px;
  cursor: pointer; transition: .15s; white-space: nowrap;
}
.rs-trigger:hover { border-color: var(--red); color: var(--red); }
.region-select.active .rs-trigger { border-color: var(--red); color: var(--red); }
.rs-label-box { opacity: .72; }
.rs-current-box {
  display: inline-flex; align-items: center; height: 38px; padding: 0 14px;
  border-radius: 999px; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); font-size: 13px; font-weight: 600;
  white-space: nowrap;
}
.rs-caret { font-size: 10px; line-height: 1; opacity: .6; transition: transform .15s; }
.region-select.open .rs-caret { transform: rotate(180deg); }
.rs-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: auto; z-index: 50;
  min-width: 150px; padding: 6px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 30px rgba(20, 24, 36, .18);
  display: none; flex-direction: column; gap: 2px;
}
.region-select.open .rs-menu { display: flex; }
.rs-option {
  text-align: left; padding: 9px 12px; border: none; border-radius: 8px;
  background: transparent; color: var(--text); font-size: 13px; cursor: pointer;
  transition: .12s; white-space: nowrap;
}
.rs-option:hover { background: var(--panel-2); color: var(--red); }
.rs-option.selected { color: var(--red); font-weight: 600; }
.rs-option.selected::after { content: ' ✓'; }
@media (max-width: 380px) {
  .rs-trigger, .rs-current-box { padding: 0 12px; font-size: 12px; }
}

/* ---------- Layout ---------- */
.layout {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px;
  max-width: 1080px; margin: 12px auto 60px; padding: 0 24px;
  align-items: stretch;
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
}

.board-card, .side-card {
  background: rgba(255,255,255,.55);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 34px rgba(20,24,36,.10);
}
.side-card { display: flex; flex-direction: column; }
.side-title { font-size: 13px; letter-spacing: 3px; color: var(--text-dim); margin-bottom: 10px; }
.side-divider { height: 1px; background: var(--line); margin: 18px 0; }
.rule-list { list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--text-dim); }
.rule-list strong { color: var(--text); }

/* ---------- 本格提示（放在硬核版弹窗的标题行里） ---------- */
.cell-hint {
  display: flex; flex: 1 1 auto; min-width: 0;
  align-items: center; justify-content: flex-end; gap: 7px;
  font-size: 12px; font-weight: 400; letter-spacing: 0;
  line-height: 1.35; color: var(--text-dim); text-align: right;
}
.cell-hint.is-idle { color: var(--text-dim); }
.cell-hint .hint-idle { font-size: 12px; }
.cell-hint .hint-teams {
  font-weight: 800; letter-spacing: .3px; color: var(--text);
  overflow-wrap: anywhere;
}
.cell-hint .hint-teams em {
  font-style: normal; font-weight: 800; color: var(--red);
  margin: 0 5px; opacity: .9;
}
.cell-hint .hint-meta { white-space: nowrap; }
.cell-hint .hint-count {
  font-weight: 800; padding: 1px 7px; border-radius: 6px;
}
.cell-hint .hint-count.easy { color: #0d8f4e; background: rgba(20,184,102,.14); }
.cell-hint .hint-count.mid { color: #a86f00; background: rgba(217,154,27,.18); }
.cell-hint .hint-count.hard { color: #d32a3a; background: rgba(255,70,85,.14); }

/* ---------- Board meta ---------- */
.board-meta {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px;
}
.puzzle-label { font-size: 13px; letter-spacing: 2px; color: var(--text-dim); }
.guesses-left { font-size: 15px; font-weight: 700; color: var(--red); letter-spacing: 1px; }

/* ---------- Grid ---------- */
.board {
  display: grid;
  grid-template-columns: 1fr repeat(3, 1.35fr);
  grid-template-rows: auto repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 560px) {
  .board { grid-template-columns: .8fr repeat(3, 1.2fr); gap: 6px; }
}

.team-chip {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 62px; padding: 8px 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}
.team-chip .logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 40px; border-radius: 9px; flex: none;
  font-weight: 800; font-size: 13px; letter-spacing: .5px;
  background: var(--tc, #333a46);
  color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.5);
  box-shadow: 0 0 14px color-mix(in srgb, var(--tc, #333a46) 45%, transparent);
}
.team-chip .logo.has-img { background: transparent; box-shadow: none; }
.team-chip .logo img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0,0,0,.45)); }
.team-chip .tname { font-size: 12px; font-weight: 700; letter-spacing: 1px; line-height: 1.2; }
.team-chip.col { flex-direction: column; }
.team-chip.corner { background: transparent; border-color: transparent; }
.team-chip.corner span { font-size: 11px; letter-spacing: 3px; color: var(--text-dim); }

.cell {
  position: relative;
  min-height: 88px;
  border-radius: var(--radius);
  border: 1.5px dashed var(--line);
  background: var(--panel-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 14px; color: var(--text-dim);
  transition: .15s;
  user-select: none;
}
.cell:not(.filled):not(.locked):hover {
  border-color: var(--red); color: var(--text); cursor: pointer;
  box-shadow: 0 0 16px rgba(255,70,85,.25);
  transform: translateY(-1px);
}
.cell .mark { font-size: 17px; color: var(--green); line-height: 1; }
.cell .pname { font-weight: 700; color: var(--text); font-size: 14px; }
.cell .pts { font-size: 12px; color: var(--gold); }
.cell .pts.reduced { color: var(--text-dim); }   /* 取消后重填，分数被扣减 */
.cell.filled { border-style: solid; border-color: rgba(46,224,111,.5); background: linear-gradient(160deg, rgba(46,224,111,.10), var(--panel-2) 60%); }
.cell .alt {                                  /* 显示答案时：同格的其他有效答案 */
  max-width: 100%; margin-top: 3px; padding: 2px 7px;
  font-size: 10px; line-height: 1.3; text-align: center;
  color: #0d7a44; background: rgba(20,184,102,.16);
  border-radius: 6px; overflow-wrap: anywhere;
}
.cell.revealed { border-style: solid; border-color: rgba(255,201,77,.45); background: linear-gradient(160deg, rgba(255,201,77,.08), var(--panel-2) 60%); }
.cell.locked { cursor: default; }
.cell.shake { animation: shake .35s; border-color: var(--red) !important; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ---------- Board footer ---------- */
.board-footer { display: flex; gap: 10px; margin-top: 16px; }
.primary-btn {
  flex: 1; height: 44px; border: none; border-radius: 10px;
  background: var(--red); color: #fff; font-size: 14px; font-weight: 700; letter-spacing: 2px;
  transition: .15s;
}
.primary-btn:hover:not(:disabled) { filter: brightness(1.12); }
.primary-btn:disabled { opacity: .35; cursor: not-allowed; }
.primary-btn.wide { width: 100%; flex: none; margin-top: 12px; }

/* ---------- 猜选手弹窗（美化版） ---------- */
.guess-modal { max-width: 460px; }
.mode-badge {
  flex: none; padding: 3px 9px; border-radius: 999px;
  font-size: 10px; font-weight: 800; letter-spacing: 1.2px; color: #fff;
  background: linear-gradient(135deg, var(--red), #ff8a5c);
  box-shadow: 0 2px 6px rgba(255,70,85,.28);
}
.mode-badge.hard { background: linear-gradient(135deg, #333a49, #6a7488); box-shadow: none; }
.modal-head .cell-pos { font-size: 12px; font-weight: 700; letter-spacing: .6px; color: var(--text-dim); }
.modal-head .icon-btn { margin-left: auto; flex: none; }

.guess-pair {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px;
  margin-top: 14px; padding: 14px 12px;
  background: linear-gradient(150deg, rgba(255,70,85,.05), var(--panel-2) 60%);
  border: 1px solid var(--line); border-radius: 12px;
}
.gp-team { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.gp-logo {
  width: 30px; height: 26px; flex: none; border-radius: 7px; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--line);
  font-size: 10px; font-weight: 800; letter-spacing: .3px; color: var(--tc, #3a4150);
}
.gp-logo img { width: 100%; height: 100%; object-fit: contain; }
.gp-name { font-size: 15px; font-weight: 800; letter-spacing: .3px; overflow-wrap: anywhere; }
.gp-x { font-size: 15px; font-weight: 800; color: var(--red); opacity: .85; }

.guess-meta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 7px;
  margin-top: 10px; font-size: 12px; color: var(--text-dim);
}
.guess-meta .hint-count { font-size: 12px; font-weight: 800; padding: 1px 7px; border-radius: 6px; }
.guess-meta .hint-count.easy { color: #0d8f4e; background: rgba(20,184,102,.14); }
.guess-meta .hint-count.mid { color: #a86f00; background: rgba(217,154,27,.18); }
.guess-meta .hint-count.hard { color: #d32a3a; background: rgba(255,70,85,.14); }
.gm-dot { opacity: .5; }
.gm-lives { color: var(--red); font-weight: 800; }

.autocomplete { margin-top: 14px; }
.autocomplete .ac-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  font-size: 13px; opacity: .45; pointer-events: none;
}
.autocomplete input {
  width: 100%; height: 48px; padding: 0 14px 0 38px;
  background: var(--panel-2); color: var(--text);
  border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 15px; outline: none; transition: .15s;
}
.autocomplete input:focus { border-color: var(--red); background: #fff; box-shadow: 0 0 0 3px rgba(255,70,85,.10); }
.autocomplete input::placeholder { color: #9aa3b2; }
.autocomplete .suggest-list { top: 54px; }
.suggest-item { align-items: center; gap: 10px; }
.suggest-item .s-name b { color: var(--red); }
.suggest-item.active, .suggest-item:hover { background: rgba(255,70,85,.18); }

.guess-tip { margin-top: 10px; font-size: 11px; line-height: 1.5; color: var(--text-dim); text-align: center; }
.guess-tip b { color: var(--text); }
.guess-modal .primary-btn.wide {
  height: 48px; border-radius: 12px;
  box-shadow: 0 6px 16px rgba(255,70,85,.22);
}
.ghost-btn {
  height: 44px; padding: 0 18px; border-radius: 10px;
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--line); font-size: 13px;
  transition: .15s;
}
.ghost-btn:hover { color: var(--red); border-color: var(--red); }

/* ---------- Countdown ---------- */
.countdown { font-size: 30px; font-weight: 800; letter-spacing: 3px; font-variant-numeric: tabular-nums; color: var(--text); }
.countdown.practice { font-size: 15px; color: var(--text-dim); letter-spacing: 1px; }

/* ---------- Modals ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(35, 42, 56, .38); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center; padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-mask.hidden, .toast.hidden { display: none; }
.modal {
  width: 100%; max-width: 420px; margin: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px; padding: 20px;
  animation: pop .18s ease-out;
}
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; font-size: 16px; font-weight: 700; letter-spacing: 1px; }
.modal-sub { margin: 10px 0 4px; font-size: 13px; color: var(--text-dim); line-height: 1.6; }

.autocomplete { position: relative; margin-top: 10px; }
.suggest-list {
  position: absolute; left: 0; right: 0; top: 50px; z-index: 10;
  max-height: 220px; overflow-y: auto;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  display: none;
}
.suggest-list.show { display: block; }
.suggest-item {
  padding: 10px 14px; font-size: 14px; cursor: pointer;
  display: flex; justify-content: space-between;
}
.suggest-item:hover, .suggest-item.sel { background: rgba(255,70,85,.15); }
.suggest-item .c { color: var(--text-dim); font-size: 12px; }

/* ---------- Stats ---------- */
.stats-body { margin-top: 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat-box { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 6px; text-align: center; }
.stat-box .v { font-size: 22px; font-weight: 800; }
.stat-box .k { font-size: 10px; color: var(--text-dim); margin-top: 4px; letter-spacing: .5px; white-space: nowrap; }
.dist { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.dist-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); }
.dist-bar { height: 14px; background: var(--red); border-radius: 3px; min-width: 4px; }
.reset-btn {
  display: block; width: 100%; margin-top: 14px; height: 40px; border-radius: 10px;
  background: transparent; border: 1px solid var(--line); color: var(--text-dim);
  font-size: 13px; cursor: pointer; transition: .15s;
}
.reset-btn:hover { border-color: var(--red); color: var(--red); }

/* ---------- Help ---------- */
.help-body { margin-top: 12px; font-size: 14px; line-height: 1.8; color: var(--text-dim); display: flex; flex-direction: column; gap: 10px; }
.help-body strong { color: var(--text); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  z-index: 99; padding: 12px 22px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.5);
  animation: pop .18s ease-out;
}

/* ---------- 联赛版（独立窗口） ---------- */
.league-entry {
  width: 100%; height: 42px; margin-top: 12px;
  border: 1px dashed rgba(255,70,85,.55); border-radius: 10px;
  background: linear-gradient(100deg, rgba(255,70,85,.10), rgba(60,120,255,.08));
  color: var(--red); font-size: 13px; font-weight: 700; letter-spacing: 2px;
  transition: .15s;
}
.league-entry:hover { border-style: solid; filter: brightness(1.06); transform: translateY(-1px); }

.lg-modal { max-width: 560px; }
.lg-toolbar { display: flex; gap: 8px; margin: 14px 0 10px; flex-wrap: wrap; }
.lg-toolbar .chip-btn { height: 34px; font-size: 12px; }
/* 联赛版战绩面板：内嵌在右侧栏底部，与棋盘下沿对齐（磨砂玻璃蓝块） */
.lg-stats {
  margin-top: auto;
  padding: 14px;
  background: rgba(214,226,246,.6);
  -webkit-backdrop-filter: blur(12px) saturate(170%);
  backdrop-filter: blur(12px) saturate(170%);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}
.lg-stats .side-title { margin-bottom: 10px; }
.lg-stats .reset-btn { width: 100%; margin-top: 12px; }

/* 联赛版现在是页面默认视图（不再在弹窗里） */

/* ---------- Footer ---------- */
.site-footer {
  position: relative; z-index: 1;
  max-width: 1080px; margin: 0 auto 34px; padding: 0 24px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  font-size: 13px; color: var(--text-dim); text-align: center;
}
.site-footer .foot-sep { opacity: .5; }

/* ---------- End banner ---------- */
.end-banner {
  margin-top: 14px; padding: 14px; border-radius: 10px; text-align: center;
  background: linear-gradient(120deg, rgba(255,70,85,.15), rgba(60,120,255,.12));
  border: 1px solid var(--line);
  font-size: 15px; font-weight: 700; letter-spacing: 1px;
}
.end-banner .sub { display: block; margin-top: 6px; font-size: 12px; font-weight: 400; color: var(--text-dim); }

/* ---------- 物理外挂：侧边入口 + 选手战队查询弹窗 ---------- */
.cheat-tab {
  position: fixed; left: 0; top: 50%; transform: translateY(-50%);
  z-index: 60; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 16px 9px;
  writing-mode: vertical-rl;
  border: 1px solid rgba(255,70,85,.5); border-left: none;
  border-radius: 0 12px 12px 0;
  background: linear-gradient(180deg, rgba(255,70,85,.16), rgba(60,120,255,.14)), #fff;
  color: var(--red);
  font-size: 12px; font-weight: 800; letter-spacing: 2px; line-height: 1;
  box-shadow: 5px 0 16px rgba(20,24,36,.12);
  transition: .15s;
}
.cheat-tab:hover { padding-left: 13px; background: linear-gradient(180deg, rgba(255,70,85,.24), rgba(60,120,255,.20)), #fff; }

.cheat-modal { max-width: 460px; }
.cheat-result { margin-top: 14px; }
.cheat-result:empty { display: none; }
.cheat-result .cr-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px;
  padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px dashed var(--line);
}
.cheat-result .cr-name { font-size: 19px; font-weight: 800; letter-spacing: .3px; }
.cheat-result .cr-country { font-size: 12px; color: var(--text-dim); }
.cheat-result .cr-count { margin-left: auto; font-size: 12px; color: var(--text-dim); }
.cheat-result .cr-count b { color: var(--red); font-size: 14px; }
.cheat-teams { display: flex; flex-wrap: wrap; gap: 8px; }
.cheat-team {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 10px 6px 8px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
}
.cheat-team .gp-logo { width: 26px; height: 22px; border-radius: 6px; font-size: 9px; }
.cheat-team .ct-name { font-size: 13px; font-weight: 700; letter-spacing: .2px; overflow-wrap: anywhere; }
.cheat-team .ct-years {
  font-size: 11px; font-weight: 700; letter-spacing: 0;
  color: var(--text-dim); background: #fff; border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 6px; white-space: nowrap;
}
.cheat-result .cr-empty {
  padding: 14px; text-align: center; font-size: 13px; line-height: 1.6;
  color: var(--text-dim); background: var(--panel-2);
  border: 1px dashed var(--line); border-radius: 10px;
}

/* 逐条履历表：日期区间 | 队伍（角色） */
.cheat-stints {
  display: flex; flex-direction: column;
  max-height: 46vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 6px 10px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 10px;
}
.cheat-stints .cs-row {
  display: grid; grid-template-columns: minmax(140px, 46%) 1fr;
  align-items: baseline; gap: 10px; padding: 5px 2px; font-size: 13px;
  border-bottom: 1px dashed rgba(28,32,42,.07);
}
.cheat-stints .cs-row:last-child { border-bottom: none; }
.cheat-stints .cs-date { font-variant-numeric: tabular-nums; color: var(--text); letter-spacing: .2px; }
.cheat-stints .cs-date i { font-style: normal; margin: 0 5px; color: var(--text-dim); }
.cheat-stints .cs-date b { font-weight: 700; }
.cheat-stints .cs-date b.now { color: var(--green); }
.cheat-stints .cs-date b.unknown { color: var(--text-dim); font-weight: 500; }
.cheat-stints .cs-team { color: #2f6fd0; font-weight: 700; overflow-wrap: anywhere; }
.cheat-stints .cs-team em { font-style: italic; font-weight: 500; color: var(--text-dim); }

/* ================= 移动端适配 ================= */

/* 赛区按钮：窄屏只显示简称（JS 同时写入 .rg-full / .rg-short） */
.rg-short { display: none; }

@media (max-width: 640px) {
  .rg-full { display: none; }
  .rg-short { display: inline; }

  /* 顶栏：标题 + ? 在第一行，控制组（赛区/换一题）在第二行居中 */
  .topbar { display: flex; flex-wrap: wrap; justify-content: space-between; padding: 14px 14px 6px; gap: 10px; }
  .top-controls { order: 3; flex: 1 1 100%; margin-top: 2px; }
  .brand { gap: 8px; min-width: 0; }
  .brand-mark { display: none; }
  .brand-text { min-width: 0; }
  .brand-text h1 { font-size: 17px; letter-spacing: 1px; white-space: nowrap; }
  .brand-sub { font-size: 9px; letter-spacing: 2px; }
  .top-actions { flex: 0 1 auto; justify-content: flex-end; gap: 6px; }
  .chip-btn { height: 34px; padding: 0 12px; font-size: 12px; letter-spacing: 0; }
  .icon-btn { width: 34px; height: 34px; font-size: 14px; border-radius: 9px; }
  .lang-btn { width: auto; min-width: 34px; height: 34px; padding: 0 8px; font-size: 11px; }

  .layout { margin: 8px auto 36px; padding: 0 14px; gap: 16px; }
  .board-card, .side-card { padding: 14px; border-radius: 14px; }
  .site-footer { padding: 0 14px 0; margin-bottom: calc(28px + env(safe-area-inset-bottom)); font-size: 12px; gap: 6px; }

  /* 弹窗：可滚动 + 内边距收紧，长内容不再被截断 */
  .modal-mask { padding: 12px; }
  .modal { padding: 14px; border-radius: 14px; }
  .modal-head { font-size: 15px; flex-wrap: wrap; row-gap: 5px; }
  .modal-head .icon-btn { margin-left: auto; }
  .modal-head .cell-hint { order: 3; flex: 1 1 100%; justify-content: flex-start; text-align: left; }
  .modal-sub { font-size: 12px; line-height: 1.5; }
  #guess-input { font-size: 16px; }          /* ≥16px 可避免 iOS 聚焦自动放大 */
  .autocomplete input { font-size: 16px; }
  .guess-pair { padding: 12px 10px; gap: 9px; }
  .gp-name { font-size: 14px; }
  .guess-tip { font-size: 10px; }
  .lg-toolbar { gap: 6px; margin: 10px 0 8px; }
  .board-meta { margin-bottom: 10px; }
  .toast { bottom: calc(18px + env(safe-area-inset-bottom)); max-width: calc(100vw - 28px); font-size: 13px; padding: 10px 16px; }

  /* 物理外挂：窄屏改成左下角胶囊，避免竖排长条吃掉竖向空间 */
  .cheat-tab {
    top: auto; bottom: calc(16px + env(safe-area-inset-bottom)); left: 12px; right: auto; transform: none;
    writing-mode: horizontal-tb; padding: 9px 13px;
    font-size: 11px; letter-spacing: 1px;
    border: 1px solid rgba(255,70,85,.5); border-radius: 999px;
    box-shadow: 0 6px 18px rgba(20,24,36,.16);
  }
  .cheat-tab:hover { padding-left: 13px; }
  .cheat-result .cr-name { font-size: 17px; }
}

@media (max-width: 560px) {
  /* 九宫格：整体收紧，长队名允许折行，不再溢出 */
  .board { grid-template-columns: 1fr repeat(3, 1.1fr); gap: 5px; }
  .team-chip { min-height: 54px; padding: 6px 4px; gap: 4px; }
  .team-chip .logo { width: 34px; height: 30px; font-size: 10px; border-radius: 7px; }
  .team-chip .tname { font-size: 10px; letter-spacing: 0; line-height: 1.15; overflow-wrap: anywhere; }
  .team-chip.row { flex-direction: column; gap: 2px; }
  .team-chip.corner span { font-size: 9px; letter-spacing: 2px; }
  .cell { min-height: 62px; font-size: 12px; padding: 4px 2px; }
  .cell .pname { font-size: 12px; overflow-wrap: anywhere; }
  .cell .pts { font-size: 10px; }
  .board-footer { gap: 8px; margin-top: 12px; }
  .primary-btn { font-size: 13px; letter-spacing: 1px; }
  .ghost-btn { padding: 0 12px; font-size: 12px; }
  .league-entry { font-size: 12px; letter-spacing: 1px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-box .v { font-size: 19px; }
  .help-body { font-size: 13px; line-height: 1.7; }
  .side-title { letter-spacing: 2px; }
}

@media (max-width: 380px) {
  .brand-text h1 { font-size: 15px; }
  .brand-sub { font-size: 8px; letter-spacing: 1px; }
  .chip-btn { padding: 0 10px; font-size: 11px; }
  .team-chip .tname { font-size: 9px; }
  .team-chip { min-height: 48px; }
  .team-chip .logo { width: 30px; height: 26px; font-size: 9px; }
  .cell { min-height: 54px; }
}

@media (hover: none) {
  /* 触屏去掉会“粘住”的 hover 效果 */
  .cell:not(.filled):not(.locked):hover { transform: none; box-shadow: none; border-color: var(--line); color: var(--text-dim); }
  .chip-btn:hover { border-color: var(--line); color: var(--text); }
  .icon-btn:hover { border-color: var(--line); color: var(--text); }
  .ghost-btn:hover { color: var(--text-dim); border-color: var(--line); }
  .league-entry:hover { transform: none; filter: none; border-style: dashed; }
}
