:root { color-scheme: dark; font: 16px/1.5 system-ui, 'Microsoft YaHei', sans-serif; color: #f0e4cd; background: #151718; --gold: #ebbd76; --dim: #bfb39f; --line: #574638; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at top, #433021, #151718 36rem); }
a { color: var(--gold); }
header { max-width: 1100px; margin: auto; padding: 22px clamp(16px, 5vw, 46px); display: flex; align-items: baseline; gap: 18px; border-bottom: 1px solid var(--line); }
header span, small, #match { color: var(--dim); }
.brand { font-family: 'Songti SC', SimSun, serif; font-size: 1.55rem; font-weight: 700; text-decoration: none; }
.download { margin-left: auto; white-space: nowrap; }
main { max-width: 1100px; margin: auto; padding: 36px clamp(16px, 5vw, 46px) 60px; }
.heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
h1 { margin: 0; font: 700 clamp(2rem, 6vw, 3.2rem)/1.15 'Songti SC', SimSun, serif; letter-spacing: .06em; }
h2 { color: var(--dim); font-size: .8rem; font-weight: 600; margin: 0 0 8px; }
form, .control-row, .actions { display: flex; align-items: center; gap: 8px; }
.actions { flex-wrap: wrap; }
input, button, select { font: inherit; }
button, select, form input { background: #282321; border: 1px solid var(--line); color: inherit; border-radius: 6px; padding: 7px 13px; }
button { cursor: pointer; }
button:hover, button:focus-visible, .game:hover { border-color: var(--gold); }
button:disabled { opacity: .55; }
form input { width: min(55vw, 280px); }
.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 12px; }
.game { color: inherit; background: #251f1b; border: 1px solid var(--line); text-decoration: none; border-radius: 9px; padding: 12px; display: flex; align-items: center; min-width: 0; gap: 12px; }
.game img { width: 70px; height: 70px; border-radius: 6px; object-fit: cover; }
.game div { display: grid; min-width: 0; overflow-wrap: anywhere; }
.game strong, #round, #play { color: var(--gold); }
#more { margin-top: 16px; }
#status, #export-status { color: var(--dim); }
.back { display: inline-block; margin: 0 0 16px; }
#match { margin: 8px 0 0; }
.table { padding: clamp(10px, 3vw, 26px); border-radius: 14px; border: 1px solid #86684c; background: radial-gradient(ellipse at center, #43362b, #25211e); }
.table-heading { display: flex; justify-content: space-between; margin-bottom: 16px; }
.table section + section { margin-top: 15px; }
.cards { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: clamp(3px, 1vw, 10px); min-height: 36px; }
.hand { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.card { position: relative; min-width: 0; min-height: 56px; aspect-ratio: .9; overflow: hidden; background: #332a26; border-radius: 8px; border: 1px solid #937759; }
.card.golden { border-color: #f5c454; box-shadow: 0 0 8px #dab04360; }
.card img { width: 100%; height: 100%; object-fit: cover; }
.card-id { position: absolute; inset: auto 0 24px; padding: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; background: #17130fba; font-size: clamp(7px, 1.4vw, 11px); }
.stats { position: absolute; inset: auto 0 0; display: flex; justify-content: space-between; }
.stats span { border-radius: 50%; min-width: 19px; padding: 0 3px; text-align: center; font-size: clamp(9px, 1.6vw, 14px); font-weight: 700; background: #734315; }
.stats span + span { background: #722e22; }
.empty { color: var(--dim); margin: 6px 0; }
.controls { margin-top: 15px; }
#seek { width: 100%; accent-color: var(--gold); }
.control-row { flex-wrap: wrap; margin-top: 8px; }
.control-row label { margin-left: auto; }
output { font-variant-numeric: tabular-nums; color: var(--dim); }
@media (max-width: 650px) { .hand { grid-template-columns: repeat(5, minmax(0, 1fr)); } .stats span { min-width: 13px; } }
@media (max-width: 390px) { header span { display: none; } }
