:root {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  color: #182923;
  background: #f0f4ef;
  font-synthesis: none;
  --muted: #51645a;
  --accent: #1f663d;
  --line: #dce6dd;
  --ink: #173627;
  --radius: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.container { width: min(100% - 40px, 1040px); margin-inline: auto; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: inline-flex; gap: 11px; align-items: center; color: var(--ink); text-decoration: none; font-weight: 750; letter-spacing: .02em; white-space: nowrap; }
.brand-mark { display: inline-block; width: 17px; height: 22px; border-radius: 5px; background: var(--accent); transform: rotate(-13deg); box-shadow: 5px 3px 0 -2px #a3bc62; }
.account { display: flex; gap: 18px; align-items: center; min-width: 0; font-size: .875rem; }
.account span { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.text-button { background: none; color: var(--accent); padding: 5px 0; border: 0; font-weight: 650; white-space: nowrap; }

main { padding-block: clamp(22px, 4vw, 54px) 60px; }
h1 { margin: 0 0 27px; font-size: clamp(2rem, 4vw, 3rem); font-weight: 750; line-height: 1.2; letter-spacing: -.06em; }
h2 { margin: 0 0 24px; font-size: 1.26rem; line-height: 1.35; }
p { margin-top: 0; line-height: 1.65; }
.muted { color: var(--muted); }
.page-message { background: #fff3e3; padding: 12px 16px; border: 1px solid #f1d8b7; color: #704214; border-radius: 10px; }
.panel { background: #fff; padding: clamp(20px, 3vw, 29px); border: 1px solid var(--line); border-radius: var(--radius); }

.signin { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; align-items: stretch; }
.signin-intro { padding: clamp(24px, 5vw, 48px); min-height: 330px; position: relative; overflow: hidden; isolation: isolate; border-radius: var(--radius); background: #183a2b; color: #eff6e9; }
.signin-intro h1 { font-size: clamp(2.25rem, 5vw, 3.55rem); }
.signin-intro p { max-width: 18em; color: #e0eddb; }
.card-stack { position: absolute; inset: auto 16% -15% auto; display: grid; place-items: center; z-index: -1; }
.card-stack span { grid-area: 1 / 1; width: 96px; height: 146px; border-radius: 14px; background: #376a42; border: 1px solid #85b97e; transform: translateX(-25px) rotate(-32deg); }
.card-stack span:nth-child(2) { transform: rotate(-13deg); background: #51754b; }
.card-stack span:nth-child(3) { transform: translateX(28px) rotate(11deg); background: #95ad65; }
.signin-form { display: flex; flex-direction: column; justify-content: center; }

.board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.setup, .current { display: flex; flex-direction: column; }
label { display: block; margin: 2px 0 8px; font-size: .94rem; font-weight: 650; }
select, input { width: 100%; min-height: 45px; background: #f9fbf7; border: 1px solid #bdccbe; border-radius: 9px; padding: 9px 13px; color: #182923; }
select { margin-bottom: 18px; }
.hint { margin-block: 9px 20px; font-size: .86rem; }
.primary, .secondary { min-height: 45px; padding: 10px 16px; border: 1px solid transparent; border-radius: 9px; font-weight: 700; }
.primary { background: var(--accent); color: #fff; }
.primary:enabled:hover { background: #194e32; }
.secondary { background: #f5f7f4; color: var(--ink); border-color: var(--line); }
.secondary:enabled:hover { background: #e9f1e8; }
button:disabled { opacity: .55; cursor: not-allowed; }
:focus-visible { outline: 3px solid #668d44; outline-offset: 3px; }
.current-content { flex: 1; min-height: 140px; padding: 22px; margin-bottom: 15px; background: #f2f6ee; border-radius: 12px; }
.current-status { margin-bottom: 6px; color: var(--ink); font-size: 1.23rem; font-weight: 730; }
.current-content p:last-child { margin-bottom: 0; }
.history { margin-top: 22px; }
.history p:last-child { margin-bottom: 0; }
.history-list { list-style: none; padding: 0; margin: 0; }
.history-list li { display: flex; justify-content: space-between; gap: 10px 18px; align-items: baseline; padding-block: 12px; border-top: 1px solid var(--line); }
.history-list small { margin-left: 12px; color: var(--muted); }
.history-list .match-result { font-weight: 700; white-space: nowrap; }
.match-result[data-result="win"] { color: #217243; }
.match-result[data-result="loss"] { color: #a44735; }

@media (max-width: 650px) {
  .container { width: calc(100% - 28px); }
  .signin, .board { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .signin-intro { min-height: 200px; }
  .signin-intro p { max-width: 13em; }
  .history { margin-top: 14px; }
  .history-list small { display: block; margin: 4px 0 0; }
}
