:root {
  color-scheme: dark;
  --ink: #f0e7d5;
  --muted: #a8a294;
  --paper: #0d0e12;
  --panel: #16171b;
  --line: #38332a;
  --gold: #d8b477;
  --bronze: #8d6b3e;
  --serif: "Iowan Old Style", "Palatino Linotype", "Songti SC", "STSong", Georgia, serif;
  font-family: "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 14% 0%, #71451d20, transparent 48%),
    radial-gradient(ellipse at 100% 28%, #21304620, transparent 48%),
    #0d0e12;
}
::selection { background: #ba935a; color: #111217; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled, input:disabled { cursor: wait; opacity: .55; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; z-index: 5; top: -80px; left: 20px; background: var(--gold); color: var(--paper); padding: 14px; }
.skip-link:focus { top: 10px; }
.site-header, main, .site-footer { width: min(1100px, calc(100% - 80px)); margin-inline: auto; }
.site-header { display: grid; grid-template-columns: auto 1fr; align-items: center; border-bottom: 1px solid var(--line); gap: 32px; padding-block: 20px; }
main { padding-top: 24px; }
.brand { display: flex; align-items: center; gap: 22px; min-width: 0; }
.brand-plaque { flex-shrink: 0; width: 96px; aspect-ratio: 1 / 1; border: 1px solid #bba67b; background: #ebdfc6; box-shadow: 0 0 0 4px #141414, 0 0 0 5px #504330, 0 8px 20px #0005; }
/* Show the entire original square logo at its natural proportions, without cropping. */
.brand-logo { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; mix-blend-mode: multiply; }
.brand-copy strong { display: block; color: #e8d4ab; font-family: var(--serif); font-size: 27px; letter-spacing: 4px; line-height: 1.25; font-weight: 600; }
.brand-caption { display: block; color: #b3aa98; font-size: 11px; letter-spacing: 2px; margin-top: 9px; }
.header-ranking { display: flex; align-items: center; justify-content: flex-end; gap: 24px; min-width: 0; }
h1 { font-family: var(--serif); font-size: 28px; font-weight: 600; letter-spacing: 3px; line-height: 1.35; white-space: nowrap; color: #f1e4c8; text-shadow: 0 2px 20px #a07b3920; }
.month-label { padding: 10px 16px; white-space: nowrap; border: 1px solid #55452f; background: linear-gradient(135deg, #30271965, #17171b); font-family: var(--serif); font-size: 22px; color: #e4c792; letter-spacing: 1px; font-weight: 500; font-variant-numeric: tabular-nums; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 28px; }
.podium-card { --card-accent: #929ea8; min-width: 0; position: relative; padding: 18px 26px 22px; border: 1px solid #545960; border-radius: 12px 12px 3px 3px; background: linear-gradient(145deg, #262a32, #14171d 75%); box-shadow: inset 0 0 0 4px #0c0e1255, 0 8px 24px #0003; outline: 1px solid #acbdd21a; outline-offset: -7px; }
.podium-card:first-child { --card-accent: #e1bd7a; border-color: #a2824f; background: radial-gradient(ellipse at 50% 0%, #8a61252e, transparent 70%), linear-gradient(145deg, #34291b, #1b1918 80%); outline-color: #d8b47733; box-shadow: inset 0 0 0 4px #0c0e1270, 0 8px 28px #0005; }
.podium-card:nth-child(3) { --card-accent: #ca936e; border-color: #73513d; background: linear-gradient(145deg, #30231e, #1b1717 75%); outline-color: #cb956425; }
.podium-label { min-height: 48px; display: flex; align-items: center; justify-content: space-between; color: var(--card-accent); font-size: 10px; letter-spacing: 3px; }
.podium-label > span { border-bottom: 1px solid #a3875840; padding-bottom: 7px; }
.podium-label b { font-family: var(--serif); font-size: 44px; color: var(--card-accent); letter-spacing: -1px; font-weight: 400; line-height: 1; opacity: .8; }
.podium-name { font-family: var(--serif); font-size: 25px; font-weight: 550; margin-top: 10px; overflow-wrap: anywhere; line-height: 1.45; letter-spacing: 2px; color: #f2e8d7; }
.podium-points { display: flex; align-items: baseline; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid #ffffff10; color: var(--card-accent); font-family: var(--serif); font-size: 40px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1; }
.podium-points span { color: var(--muted); font-family: "PingFang SC", system-ui, sans-serif; font-size: 10px; font-weight: 400; letter-spacing: 2px; }
.board { border: 1px solid #605039; border-radius: 3px; background: #16171b; overflow: hidden; box-shadow: 0 16px 45px #0004; }
.board-heading { display: flex; align-items: center; justify-content: space-between; padding: 22px 28px; gap: 18px; background: linear-gradient(110deg, #27231c75, #191a1f); border-bottom: 1px solid #52432c; }
.board-title { display: flex; align-items: center; gap: 12px; }
h2 { font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: 2px; white-space: nowrap; }
.count-label { font-size: 10px; color: #c3b397; background: #b89c6412; border: 1px solid #66523370; padding: 4px 8px; border-radius: 2px; white-space: nowrap; }
.board-controls { display: flex; align-items: center; gap: 10px; }
.search-field { display: flex; align-items: center; gap: 8px; border: 1px solid #4c463b; padding: 0 11px; border-radius: 2px; color: #b6a789; background: #101114; }
.search-field input { width: 155px; min-width: 0; height: 40px; border: 0; background: transparent; color: var(--ink); font-size: 12px; }
.search-field input::placeholder { color: #9b9588; }
.search-field:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.search-field input:focus { outline: none; }
.refresh-button, .retry-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; border: 1px solid #80643b; border-radius: 2px; background: linear-gradient(#3b3020, #292319); color: #e8c993; padding: 0 13px; font-size: 12px; transition: background-color .15s, border-color .15s; }
.refresh-button:hover:not(:disabled), .retry-button:hover { background: #493a24; border-color: #d0a366; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
thead { background: #111216; color: #b1a58f; }
th { padding: 13px 28px; border-bottom: 1px solid #353129; text-align: left; font-weight: 500; font-size: 11px; letter-spacing: 2px; }
.rank-column { width: 112px; }
.points-column { width: 160px; text-align: right; }
td { padding: 16px 28px; border-bottom: 1px solid #ffffff09; font-size: 14px; overflow-wrap: anywhere; }
tbody tr:nth-child(even) { background: #ffffff02; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #ac8d4c10; }
.rank-value { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; font-family: var(--serif); font-size: 16px; font-weight: 500; color: #bcb3a1; font-variant-numeric: tabular-nums; }
.top-rank .rank-value { color: #d1d5dd; background: #93a2b412; border: 1px solid #66707c; border-radius: 3px; }
.top-rank:first-child .rank-value { color: #f0cd8c; border-color: #9e7a41; background: #b78e4620; }
.top-rank:nth-child(3) .rank-value { color: #dea781; border-color: #7c5942; background: #a8783a15; }
.player-name { font-weight: 500; line-height: 1.5; letter-spacing: .7px; }
.score { text-align: right; font-family: var(--serif); font-size: 23px; font-weight: 500; color: #dfc18c; font-variant-numeric: tabular-nums; }
.score span { font-family: "PingFang SC", system-ui, sans-serif; font-size: 10px; margin-left: 7px; font-weight: 400; color: var(--muted); }
.board-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 28px; border-top: 1px solid #4c3d28; color: #a9a08f; background: #121317; font-size: 10px; line-height: 1.6; }
.board-footer > span { white-space: nowrap; }
.state-panel { padding: 54px 24px; min-height: 250px; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; }
.state-panel h3 { font-family: var(--serif); font-size: 21px; font-weight: 550; letter-spacing: 1px; color: #e4cc9e; }
.state-panel p { max-width: 390px; color: var(--muted); font-size: 12px; line-height: 1.9; }
.state-number { font-family: var(--serif); font-size: 45px; color: #8c713e; font-weight: 450; }
.loading-line { height: 2px; width: 90px; background: linear-gradient(90deg, transparent, #d8b477, transparent); animation: breathe 1.5s ease-in-out infinite alternate; margin-bottom: 12px; }
@keyframes breathe { to { opacity: .35; } }
.rules { display: grid; grid-template-columns: 140px 1fr; gap: 18px; margin: 24px 0 38px; font-size: 11px; line-height: 1.9; color: var(--muted); }
.rules strong { font-family: var(--serif); font-size: 14px; letter-spacing: 1px; font-weight: 500; color: #c7b18c; }
.site-footer { padding: 24px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; font-family: var(--serif); font-size: 10px; letter-spacing: 2px; color: #aa9776; }
.preview-notice { padding: 9px 14px; border: 1px solid #6d532c; border-left: 3px solid #bb9256; background: #9770370f; color: #ccb188; font-size: 11px; line-height: 1.6; margin-bottom: 20px; }
@media (max-width: 900px) {
  .site-header { gap: 20px; }
  .brand { gap: 16px; }
  .brand-plaque { width: 80px; }
  .brand-copy strong { font-size: 22px; letter-spacing: 2px; }
  .header-ranking { gap: 14px; }
  h1 { font-size: 24px; letter-spacing: 2px; }
  .month-label { padding: 9px 12px; font-size: 18px; }
}
@media (max-width: 680px) {
  .site-header, main, .site-footer { width: calc(100% - 32px); }
  .site-header { grid-template-columns: 1fr; gap: 20px; padding-block: 16px; }
  main { padding-top: 20px; }
  .brand { gap: 14px; }
  .brand-plaque { width: 72px; }
  .brand-copy strong { font-size: 20px; letter-spacing: 2px; }
  .brand-caption { font-size: 9px; letter-spacing: .6px; margin-top: 6px; }
  .header-ranking { justify-content: space-between; gap: 12px; }
  h1 { font-size: 23px; letter-spacing: 1px; }
  .month-label { font-size: 17px; }
  .podium { gap: 8px; margin-bottom: 20px; }
  .podium-card { padding: 12px 11px 14px; border-radius: 8px 8px 2px 2px; outline-offset: -5px; }
  .podium-label { font-size: 9px; letter-spacing: .5px; min-height: 30px; gap: 5px; }
  .podium-label > span { padding-bottom: 4px; }
  .podium-label b { font-size: 27px; letter-spacing: -1.5px; }
  .podium-name { font-size: 16px; letter-spacing: 1px; margin-top: 10px; }
  .podium-points { font-size: 31px; margin-top: 13px; padding-top: 10px; gap: 5px; }
  .podium-points span { font-size: 8px; letter-spacing: 0; }
  .board-heading { align-items: stretch; flex-direction: column; padding: 18px 16px; gap: 14px; }
  .board-controls { width: 100%; }
  .search-field { flex: 1; min-width: 0; }
  .search-field input { width: 100%; height: 42px; }
  .refresh-button { min-height: 44px; }
  .rank-column { width: 65px; }
  .points-column { width: 98px; }
  td, th { padding: 13px 14px; }
  td { font-size: 13px; }
  .score { font-size: 21px; }
  .board-footer { padding: 13px 16px; align-items: flex-start; flex-direction: column; gap: 3px; }
  .rules { grid-template-columns: 1fr; gap: 6px; margin: 22px 0 28px; }
  .site-footer { font-size: 9px; letter-spacing: 1px; flex-wrap: wrap; }
}
@media (max-width: 360px) {
  .podium-card { padding-inline: 9px; }
  .podium-label { flex-direction: column-reverse; align-items: flex-start; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { .loading-line { animation: none; } }
