:root{color-scheme:dark;--cream:#f9edcf;--paper:#f0dfb5;--black:#352319;--gold:#d7a364;--felt:#122925;--red:#8d352f;--green:#a1c5aa;font-family:system-ui,-apple-system,"PingFang SC","Microsoft YaHei",sans-serif}
*{box-sizing:border-box}
html{min-height:100%;background:#142823}
body{margin:0;min-height:100svh;color:var(--cream);background:linear-gradient(180deg,#12231e55,#08171091),url(/art/table.webp) center/cover fixed,var(--felt)}
body,button,input,select{font-size:16px}
main{width:min(100%,490px);min-height:100svh;margin:auto;padding:max(14px,env(safe-area-inset-top)) max(19px,env(safe-area-inset-right)) max(28px,env(safe-area-inset-bottom)) max(19px,env(safe-area-inset-left));display:flex;flex-direction:column;align-items:stretch;gap:15px}
h1,h2,h3,p,form{margin:0}
h1,h2{font-family:"Songti SC","Noto Serif CJK SC",SimSun,serif;line-height:1.1;text-wrap:balance}
h1{font-size:clamp(42px,12vw,64px);letter-spacing:.035em;text-shadow:0 3px 8px #08120d}
h2{font-size:clamp(26px,7vw,37px)}
p{line-height:1.55;color:#eadbc0}
small{font-size:13px}
button,input,select{font:inherit}
button{min-height:46px;cursor:pointer;font-weight:700}
button:disabled{opacity:.5;cursor:default}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #fff1c0;outline-offset:3px}
button:active:not(:disabled){translate:0 2px}
button.primary{width:100%;min-height:55px;border:1px solid #e3b571;border-radius:9px;background:linear-gradient(#f1cf91,#bf864c);box-shadow:0 4px 0 #683b24,0 8px 16px #07100b66;color:#302014;padding:8px 12px}
button.quiet{color:#f6e7c8;background:#102520c9;border:1px solid #b593655c;border-radius:9px;padding:5px 11px}
button.text{border:0;color:#eadbc0;background:transparent;text-decoration:underline;text-underline-offset:4px}
input,select{display:block;width:100%;min-height:49px;padding:9px 11px;border:1px solid #a98053;border-radius:7px;color:var(--cream);background:#142a24}
label{display:block;margin:8px 0 5px;font-weight:700}
.welcome{padding-top:clamp(10px,5vh,55px);display:flex;flex-direction:column;gap:11px;text-align:center}
.welcome p{font-size:15px}
.deck,.loading-deck{height:clamp(100px,21vh,175px);background:url(/art/deck.webp) center/contain no-repeat}
.loading{display:grid;align-content:center;min-height:78svh;text-align:center;gap:16px}
.loading progress{width:144px;margin:auto;accent-color:#ce9253}
.paper-form{border:1px solid #b7895b88;border-radius:14px;padding:15px;background:#132722df;box-shadow:0 12px 25px #09140ea8;display:grid;gap:10px}
.paper-form p{font-size:14px}
.buttons{display:grid;gap:10px}
.pair{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.score{display:grid;grid-template-columns:1fr auto 1fr;gap:9px;align-items:center;padding:10px;border:1px solid #ac855f88;border-radius:10px;background:#2d2418ed;text-align:center;box-shadow:0 4px 10px #08160f}
.score b{display:block;font-size:24px;line-height:1.1;font-variant-numeric:tabular-nums}
.score em{display:block;font-size:12px;font-style:normal;color:#d3c5ac}
.team-A{color:#ffb39a}.team-B{color:#b7e0bd}
.intro{display:grid;gap:5px;text-align:center;margin-top:2px}
.intro p{font-size:14px}
.felt-panel{padding:12px;border-radius:13px;background:#142720e0;border:1px solid #94734a85}
.table-seats{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.team{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;align-content:start}
.team>strong{grid-column:1/-1;font-size:13px}
.seat{min-width:0;min-height:39px;border:1px solid #92745277;border-radius:7px;background:#1c3024;color:#f6e6c4;font-size:13px;padding:4px;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.seat small{display:block;font-size:10px;overflow:hidden;text-overflow:ellipsis}
.seat.lit{border-color:#e3b571;background:#573a21}
.seat.off{opacity:.52}
.card{width:min(100%,280px);min-height:242px;margin:3px auto;display:grid;place-items:center;text-align:center;border-radius:13px;box-shadow:0 7px 14px #050c06ad;overflow:hidden}
.card.face{padding:23px 20px;color:var(--black);background:#ead6a7 url(/art/face.webp) center/100% 100%}
.card.face p{color:#553a26;font-size:15px}
.card.back{height:238px;background:#6c2e29 url(/art/back.webp) center/100% 100%;border:1px solid #b18054;color:#fff0cb}
.card.back span{padding:8px 12px;border-radius:6px;background:#391d16df}
.card strong{display:block;font-family:"Songti SC",SimSun,serif;font-size:clamp(30px,8vw,44px);overflow-wrap:anywhere;line-height:1.12}
.card small{display:block;margin:5px 0 9px}
.word-line{text-align:center;display:grid;gap:4px;color:#f3d69f;font-family:"Songti SC",SimSun,serif;font-size:clamp(29px,8vw,42px);line-height:1.1}
.word-line small{font-family:system-ui,sans-serif;color:#e8d1a5}
.choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.candidate{min-height:85px;border:1px solid #bf9169;color:#fff2cd;border-radius:10px;background:#5e2e23 url(/art/back.webp) center/cover;text-shadow:0 2px 4px #000;padding:6px}
.candidate span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:#2a170fd9;padding:4px;border-radius:4px}
.candidate.chosen{outline:3px solid #f8d694;transform:translateY(-3px)}
.chips{display:flex;justify-content:center;gap:9px;margin:2px 0}
.chip{height:19px;width:19px;border-radius:50%;border:2px dashed #ad8755;background:#352d22;box-shadow:0 3px 2px #070e09}
.chip.filled{border:2px solid #f1c98b;background:#b37b40}
.links{display:flex;justify-content:center;gap:8px;flex-wrap:wrap}
.rules{font-size:14px}
.rules summary{cursor:pointer;min-height:34px}
.result-stamp{display:block;color:#733b25;font-family:"Songti SC",SimSun,serif;font-size:23px;font-weight:900}
.card a,a{color:inherit;text-underline-offset:4px}
#notice{position:fixed;z-index:5;left:50%;bottom:max(16px,env(safe-area-inset-bottom));width:min(calc(100% - 30px),420px);transform:translateX(-50%);padding:12px 14px;border-radius:9px;background:#462d1f;color:#fff0d3;box-shadow:0 5px 14px #0009;border:1px solid #cc9a65}
[hidden]{display:none!important}
@media(max-height:675px){main{gap:10px}.welcome{padding-top:0}.deck{height:90px}.card{min-height:194px}.card.back{height:197px}}

/* Garden-paper theme. The illustrations carry the texture, controls stay quiet. */
:root{color-scheme:light;--cream:#263e30;--paper:#f8f4e8;--black:#273b31;--gold:#d3ac50;--felt:#f8f4e9;--green:#43724d}
html{background:#f8f4e9}
body{background:#f8f4e9 url(/art/table.webp) center top/cover fixed}
p{color:#415548}
h1{letter-spacing:.02em;text-shadow:none;color:#284334}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline-color:#4a7454}
button.primary{border-color:#688b60;border-radius:15px 12px 15px 11px;background:#dceccc;box-shadow:0 4px 0 #abc09b;color:#273e2e}
button.primary:active:not(:disabled){box-shadow:0 2px 0 #abc09b}
button.quiet{color:#344a38;background:#fffaf0;border-color:#aab79e;border-radius:13px 11px 14px 10px}
button.text{color:#365e42}
input,select{border-color:#a6ad95;color:#2f4636;background:#fffdf6}
.paper-form{border-color:#b8c3a9;background:#fffdf2e8;box-shadow:0 6px 16px #5f6c4219}
.score{border-color:#bbc4aa;background:#fffdf3eb;box-shadow:0 3px 0 #d9ddc5}
.score em{color:#5a6956}
.team-A{color:#8b4b34}.team-B{color:#386046}
.felt-panel{background:#f8faecee;border-color:#bac6a9}
.seat{border-color:#b6c5a2;background:#f2f5e8;color:#354b36}
.seat.lit{border-color:#9b7835;background:#f5e6a8}
.card{border:1px solid #b7bda7;box-shadow:0 5px 0 #d9dcc8,0 9px 20px #66744a1b}
.card.face{background:#fffdf6}
.card.face p{color:#415446}
.card.back{background:#eff5e7 url(/art/deck.webp) center 32%/118px auto no-repeat;border-color:#aabd9e;color:#364d37;align-items:end;padding-bottom:18px}
.card.back span{background:#dceccc}
.word-line{color:#2f4b35}
.word-line small{color:#52664d}
.candidate{border-color:#98ab8d;color:#2e4734;background:#f0f5e5 url(/art/deck.webp) center 32%/42px auto no-repeat;text-shadow:none;padding-top:42px}
.candidate span{background:#f9fbf1c9}
.candidate.chosen{outline-color:#4b7b52;background-color:#dbeccd}
.chip{border-color:#a1b796;background:#f7f7eb;box-shadow:0 2px 0 #d7ddc5}
.chip.filled{border-color:#6b895d;background:#b6d3a6}
.result-stamp{color:#4b7450}
.vote-count{text-align:center}
.mascot{object-fit:contain;margin:0 auto;display:block}
.deck{position:relative;background-position:calc(50% + 24px) center}
.welcome-dog{position:absolute;right:calc(50% + 26px);bottom:0;width:clamp(65px,22vw,98px);height:auto}
.waiting{padding:8px 10px;border:1px dashed #aab99d;border-radius:12px;background:#fffdf4e8;color:#435c44;font-size:13px}
.waiting>div{display:flex;gap:7px;flex-wrap:wrap;margin-top:5px}
.waiting-person{display:inline-flex;align-items:center;gap:4px;background:#eef3e5;padding:2px 6px 2px 3px;border-radius:7px}
.waiting-person img{width:27px;height:27px;object-fit:contain}
.waiting-person small{display:block;font-size:10px}
.waiting-person.off{opacity:.55}
.sending .primary{opacity:.72;translate:0 1px}
#notice{background:#f4edca;color:#354431;box-shadow:0 5px 14px #71805033;border-color:#b2ae85}
