/* 数学擂台 v1.0.0 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: radial-gradient(1200px 800px at 50% -10%, #1B2C4A 0%, #0E1626 55%) fixed #0E1626;
  color: #E7ECF5; min-height: 100vh; line-height: 1.55;
}
.wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px calc(28px + env(safe-area-inset-bottom)); }
h1 { font-size: 34px; letter-spacing: 6px; }
h2 { font-size: 22px; margin-bottom: 14px; }
h3 { font-size: 15px; margin: 10px 0 4px; }
button { font: inherit; cursor: pointer; }

/* 首页 */
.home { text-align: center; }
.hero { padding: 34px 0 18px; }
.logo {
  width: 84px; height: 84px; margin: 0 auto 12px; border-radius: 22px;
  background: linear-gradient(160deg, #1E3357, #14213B);
  border: 2px solid #F0B429; color: #F0B429;
  font-size: 44px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.sub { color: #9AA7BD; font-size: 14px; margin-top: 8px; letter-spacing: 1px; }
.micro { color: #6E7C95; font-size: 12px; margin-bottom: 12px; }
.foot { color: #54617A; font-size: 11px; margin-top: 22px; }

/* 按钮 */
.btn {
  display: block; width: 100%; margin: 10px 0; padding: 13px 16px;
  border-radius: 14px; border: 1px solid #2A3B5C;
  background: #17233A; color: #E7ECF5; font-size: 17px; text-align: center;
  transition: transform .06s ease, background .15s;
}
.btn:active { transform: scale(.985); }
.btn.primary { background: linear-gradient(135deg, #F0B429, #D99A1F); color: #1A1505; font-weight: 700; border: none; }
.btn.big { font-size: 19px; padding: 15px 16px; }
.btn.ghost { background: transparent; font-size: 14px; padding: 10px; color: #9AA7BD; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 .btn { margin: 0; margin-top: 10px; }
.back { background: none; border: none; color: #9AA7BD; font-size: 15px; padding: 0 0 12px; }

/* 设置 */
.lab { display: block; color: #9AA7BD; font-size: 13px; margin: 16px 0 8px; }
.nameRow { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.nameRow input {
  width: 100%; padding: 11px 10px; border-radius: 12px; border: 1px solid #2A3B5C;
  background: #101B2E; color: #E7ECF5; font-size: 16px; text-align: center;
}
.vs { color: #F0B429; font-weight: 800; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 13px; border-radius: 999px; border: 1px solid #2A3B5C;
  background: #101B2E; color: #B9C4D8; font-size: 14px;
}
.chip.on { background: #F0B429; border-color: #F0B429; color: #1A1505; font-weight: 700; }
.wrap > .btn.primary.big { margin-top: 22px; }

/* 对局 */
.play { max-width: 560px; }
.meta { display: flex; justify-content: space-between; align-items: center; color: #8A97AF; font-size: 13px; margin-bottom: 10px; }
.stars { color: #F0B429; letter-spacing: 2px; }
.scoreBar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.pScore {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: #17233A; border: 1px solid #2A3B5C; border-radius: 12px;
}
.pScore.serving { border-color: #F0B429; box-shadow: 0 0 0 1px #F0B429 inset; }
.pScore.soloP { grid-column: 1 / -1; }
.serveMark { width: 14px; height: 16px; position: relative; flex: none; }
.pScore.serving .serveMark::before {
  content: ''; position: absolute; left: 2px; top: 3px;
  border-left: 9px solid #F0B429; border-top: 5px solid transparent; border-bottom: 5px solid transparent;
}
.pScore.serving .serveMark.st::before { border-left-color: #F87171; }
.pn { font-size: 14px; color: #B9C4D8; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps { font-size: 20px; font-weight: 800; color: #F0B429; font-variant-numeric: tabular-nums; }
.twrap { height: 4px; background: #22314E; border-radius: 4px; overflow: hidden; margin-bottom: 14px; }
.tbar { height: 100%; width: 100%; background: #4E9AF1; border-radius: 4px; }
.tbar.low { background: #F87171; }
.stealBanner {
  background: #3A1D22; border: 1px solid #F87171; color: #FCA5A5;
  padding: 8px 12px; border-radius: 10px; font-size: 14px; text-align: center; margin-bottom: 12px;
}
.sb {
  background: #F87171; color: #1A0A0C; border-radius: 6px;
  padding: 1px 8px; font-size: 12px; font-weight: 800; margin-right: 8px;
}
.qcard { background: #17233A; border: 1px solid #2A3B5C; border-radius: 16px; padding: 18px 16px; margin-bottom: 14px; }
.qcard.small { padding: 14px 16px; }
.qtext { font-size: 18px; font-weight: 600; }
.ansLine { margin-top: 8px; color: #9AA7BD; font-size: 14px; }
.ansLine b { color: #34D399; }
.opts { display: grid; gap: 10px; }
.opt {
  padding: 14px 14px; border-radius: 14px; border: 1px solid #2A3B5C;
  background: #17233A; color: #E7ECF5; font-size: 16px; text-align: left;
  transition: transform .06s ease;
}
.opt:active { transform: scale(.985); }
.opt.good { background: #12331F; border-color: #34D399; }
.opt.bad { background: #331519; border-color: #F87171; }
.hint { color: #5F6D87; font-size: 12px; text-align: center; margin-top: 14px; }

/* 解析 */
.explainCard { background: #17233A; border: 1px solid #2A3B5C; border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.eline { color: #F0B429; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.explainCard p { font-size: 15px; color: #D7DFEE; }
.trap {
  margin-top: 10px; background: #2A2233; border: 1px solid #7C5CBF;
  color: #D9CCF2; border-radius: 10px; padding: 9px 11px; font-size: 13px;
}

/* 结算 */
.resultHero { text-align: center; padding: 18px 0 6px; }
.crown {
  width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%;
  background: linear-gradient(160deg, #F0B429, #D99A1F); color: #1A1505;
  font-size: 30px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.resultHero h2 { margin: 6px 0 2px; font-size: 24px; }
.chStat { background: #17233A; border: 1px solid #2A3B5C; border-radius: 14px; padding: 12px 14px; margin: 12px 0 4px; }
.chRow { display: flex; align-items: baseline; gap: 10px; padding: 5px 0; flex-wrap: wrap; }
.chRow b { font-size: 14px; color: #B9C4D8; min-width: 3.2em; }
.cchips { display: flex; flex-wrap: wrap; gap: 6px; }
.cchip { background: #101B2E; border: 1px solid #2A3B5C; border-radius: 999px; padding: 3px 9px; font-size: 12px; color: #9AA7BD; }
.secT { color: #9AA7BD; font-size: 14px; font-weight: 600; margin: 16px 0 8px; }
.replay details { background: #17233A; border: 1px solid #2A3B5C; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.replay summary { cursor: pointer; font-size: 14px; color: #B9C4D8; list-style: none; }
.replay summary::-webkit-details-marker { display: none; }
.rk { font-weight: 800; margin-right: 4px; }
.rk.g { color: #34D399; } .rk.r { color: #F87171; }
.rq { margin-top: 8px; font-size: 15px; }
.ra { color: #34D399; font-size: 14px; margin-top: 4px; }
.rw { color: #9AA7BD; font-size: 13px; margin-top: 4px; }
.rw2 { color: #8A97AF; font-size: 13px; margin-top: 6px; }

/* 战报 */
.hItem { background: #17233A; border: 1px solid #2A3B5C; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.hItem summary { cursor: pointer; list-style: none; font-size: 14px; }
.hItem summary::-webkit-details-marker { display: none; }
.hm { background: #22314E; border-radius: 6px; padding: 1px 7px; font-size: 12px; color: #9AA7BD; margin-right: 6px; }
.hs { color: #F0B429; font-weight: 700; margin-left: 6px; }
.dim { color: #54617A; }

/* QA 截图辅助：无动画 */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
