.chess-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:24px 0 32px}.chess-heading h1{margin:10px 0}.chess-heading p{color:var(--muted)}.chess-lobby,.chess-friends{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px}.chess-welcome{display:flex;flex-direction:column;align-items:flex-start;gap:18px}.chess-welcome p{line-height:1.9;max-width:36em}.chess-welcome small,.chess-match>small{line-height:1.8;color:var(--muted)}.chess-art{display:flex;gap:8px;padding:40px 20px}.chess-art i{width:44px;height:44px;border-radius:50%;background:linear-gradient(145deg,#547569,#17392d);box-shadow:2px 5px 8px #143d2920}.chess-art i:nth-child(2){background:linear-gradient(145deg,#fff,#eee4d5);transform:translateY(-18px)}.chess-game,.friend-row{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;padding:18px;border-radius:18px;text-align:left}.chess-game small{display:block;margin-top:8px;font-size:13px}.friend-row{border-bottom:1px solid var(--line);padding:18px 0}.friend-code{display:flex;align-items:center;justify-content:space-between;gap:8px}.friend-code strong{letter-spacing:.08em;user-select:all;font-size:22px}.chess-empty{padding:32px 0;color:var(--muted);line-height:1.9}.chess-match{max-width:800px;margin:auto;display:flex;flex-direction:column;gap:22px}.chess-players{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:14px}.chess-players>span{display:flex;gap:6px;align-items:center;overflow-wrap:anywhere}.stone-dot{width:18px;height:18px;border-radius:50%;display:inline-block;flex-shrink:0}.stone-dot.black{background:#244438}.stone-dot.white{background:#faf7ec;box-shadow:inset 0 0 0 1px #bfb19d}.chess-board{width:min(100%,600px);aspect-ratio:1;display:grid;grid-template-columns:repeat(15,minmax(0,1fr));margin:auto;padding:10px;background:#eadbc3;border:1px solid #cfb894;border-radius:16px;box-shadow:inset 0 1px 12px #ab835c20;touch-action:manipulation}.chess-board .chess-cell{position:relative;display:grid;place-items:center;min-width:0;min-height:0;padding:0;border:0;border-radius:0;aspect-ratio:1;background:linear-gradient(#ab9272,#ab9272) center/100% 1px no-repeat,linear-gradient(#ab9272,#ab9272) center/1px 100% no-repeat;opacity:1;box-shadow:none}.chess-cell span{display:block;width:88%;height:88%;border-radius:50%;position:relative}.chess-cell.black span{background:radial-gradient(circle at 30% 25%,#4e6257,#182c23 70%);box-shadow:0 2px 3px #39291450}.chess-cell.white span{background:radial-gradient(circle at 30% 25%,#fff,#e8e0d4 80%);box-shadow:0 2px 3px #39291450}.chess-cell.selected span{background:#41746566;outline:2px solid #1b6945}.chess-cell.last span:after{content:'';position:absolute;width:18%;height:18%;border-radius:50%;background:#ce9c50;top:41%;left:41%}.chess-cell.winning span{outline:2px solid #ce9c50;outline-offset:1px}.chess-cell:focus-visible{outline:2px solid #246b4f;outline-offset:-2px;z-index:1}.chess-controls{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:12px;min-height:50px}.chess-controls .primary{min-width:min(100%,260px)}.chess-controls p{width:100%;text-align:center}.chess-friends input{width:100%;min-width:0}.chess-friends .row{flex-wrap:wrap}.chess-heading button[aria-pressed=true]{background:var(--green);color:var(--on-accent,#fff)}@media(max-width:760px){.chess-lobby,.chess-friends{grid-template-columns:1fr}.chess-heading{display:block}.chess-heading>.row{margin-top:20px}.chess-match.card{padding:16px 10px}.chess-board{padding:6px;border-radius:10px}.chess-players{font-size:12px;gap:8px}.friend-code strong{font-size:19px}.chess-match>.row{gap:8px;flex-wrap:wrap}.chess-game{padding:14px}.chess-controls button{min-height:44px}}
/* A quiet game lounge, with invitations as the primary social action. */
.chess-heading h1{font-size:32px}.chess-heading .eyebrow{font-size:10px}.chess-heading p{font-size:14px}.chess-heading .row{gap:4px;border:1px solid var(--line);padding:4px;border-radius:30px}.chess-heading .row button{border:0;border-radius:24px;font-size:13px;padding:10px 20px}.chess-heading button[aria-pressed=true]{color:var(--button-ink)}.chess-lobby{grid-template-columns:minmax(0,1.05fr) minmax(0,1fr)}.chess-games{display:grid;gap:20px;align-content:start}.chess-welcome{padding:34px!important;gap:14px}.chess-welcome h2{font:34px/1.5 "Songti SC","SimSun",serif;margin:4px 0}.chess-welcome>p{font-size:14px;color:var(--muted)}.chess-art{width:180px;height:140px;padding:0;margin:6px 0 18px;position:relative;background:linear-gradient(#b49b6c22 1px,transparent 1px),linear-gradient(90deg,#b49b6c22 1px,transparent 1px);background-size:35px 35px}.chess-art i{position:absolute;width:31px;height:31px;top:19px;left:19px}.chess-art i:nth-child(2){left:54px;top:54px;transform:none}.chess-art i:nth-child(3){left:89px;top:89px}.chess-art i:nth-child(4){left:89px;top:54px;background:linear-gradient(145deg,#fff,#ece4d5)}.chess-art i:nth-child(5){left:124px;top:19px}.chess-invite-list{display:grid;gap:10px;width:100%;margin:12px 0;max-height:400px;overflow:auto}.chess-invite-list button{display:flex;align-items:center;gap:12px;text-align:left;width:100%;padding:12px}.chess-invite-list button>span:nth-child(2){flex:1;min-width:0;overflow-wrap:anywhere}.chess-invite-list button>span:last-child{font-size:12px;white-space:nowrap}.friend-avatar{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;flex-shrink:0;background:var(--soft);color:var(--green);font:20px Georgia,"SimSun",serif}.chess-game{padding:17px 0;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent}.friend-info{display:grid;gap:5px;flex:1;min-width:0;overflow-wrap:anywhere}.friend-info strong{font-size:14px;font-weight:500}.friend-info small{color:var(--muted);font-size:12px;margin:0}.chess-game>span:last-child{font-size:12px;white-space:nowrap}.chess-empty{padding:32px 4px;text-align:center}.chess-empty>span{display:block;font:38px/1.5 Georgia,serif;color:#a98b60}.chess-empty p{font-size:13px;line-height:1.9}.chess-empty h3{font-size:16px;font-weight:500}.chess-games h2,.chess-friends h2{font-size:20px}.chess-incoming{background:var(--soft);text-align:center}.chess-incoming .friend-avatar{margin:auto;background:var(--surface)}.chess-incoming h3{font-size:20px;margin:16px 0 10px}.chess-incoming p{font-size:13px;color:var(--muted)}.chess-incoming .row{justify-content:center;margin-top:22px}.chess-rules{font-size:12px;color:var(--muted);width:100%;padding-top:14px;border-top:1px solid var(--line)}.chess-rules summary{cursor:pointer}.chess-rules p{font-size:12px;margin-top:12px}.chess-history{padding:22px!important}.chess-history summary{cursor:pointer;font-size:14px;color:var(--muted)}.chess-friends{grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);align-items:start}.friend-connect{display:grid;gap:20px}.friend-connect h2{margin:0}.friend-connect>p,.friend-connect>small{font-size:13px;line-height:1.8;color:var(--muted)}.friend-connect .eyebrow{font-size:10px}.friend-mycode{display:grid;gap:12px;padding:18px;background:var(--soft);border-radius:16px}.friend-mycode label,.friend-mycode small{font-size:12px;color:var(--muted)}.friend-mycode>button{justify-self:start;padding:4px 0}.friend-code strong{font-size:18px;letter-spacing:.1em}.friend-row{gap:12px;border-radius:0;flex-wrap:wrap}.friend-row>.row{gap:6px}.friend-row button{font-size:12px;padding:9px 12px}.friend-more{position:relative}.friend-more summary{list-style:none;cursor:pointer;font-size:20px;padding:4px 8px}.friend-more summary::-webkit-details-marker{display:none}.friend-more[open]>button{position:absolute;right:0;top:100%;z-index:2;white-space:nowrap;background:var(--surface);box-shadow:0 8px 20px #17332318;border:1px solid var(--line)}.friend-requests{padding:14px 0 4px}.friend-requests h3{font-size:12px;color:var(--muted);font-weight:400}.chess-wait{max-width:720px;margin:auto;text-align:center;min-height:430px;display:flex;flex-direction:column;align-items:center;gap:22px;padding:36px!important}.chess-wait>button{align-self:flex-start}.chess-wait h2{font:30px/1.5 "Songti SC","SimSun",serif}.chess-wait p,.chess-wait small{color:var(--muted);line-height:1.8}.chess-invite-avatars{display:flex;align-items:center;gap:26px;margin:14px 0}.chess-invite-avatars .friend-avatar{width:70px;height:70px;font-size:29px}.chess-invite-avatars>span:not(.friend-avatar){color:#b19979;font-size:26px}.chess-players{border-bottom:1px solid var(--line);padding:0 0 16px}.chess-player{flex:1;min-width:0;padding:10px;border-radius:16px}.chess-player:last-child{justify-content:flex-end}.chess-player>span:last-child{display:grid;gap:7px;font-size:13px}.chess-player small{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--muted)}.chess-player.is-turn{background:var(--soft)}.chess-player.is-turn .friend-avatar{box-shadow:0 0 0 2px var(--green)}.chess-turn-count{font-size:12px;white-space:nowrap;color:var(--muted)}.chess-match{gap:20px}.chess-match>small{text-align:center;font-size:12px}.chess-controls{gap:8px}.chess-controls button:not(.primary){font-size:13px;border:0;padding:10px}.chess-controls .primary{font-size:14px}.chess-board button:hover{transform:none!important}.stone-dot{width:12px;height:12px}
@media(max-width:760px){.chess-lobby,.chess-friends{grid-template-columns:1fr}.chess-heading{margin:8px 0 22px}.chess-heading h1{font-size:28px}.chess-heading .eyebrow{display:none}.chess-heading>.row{display:inline-flex;margin-top:16px}.chess-welcome{padding:26px!important}.chess-welcome h2{font-size:29px}.chess-art{height:110px;margin:0 0 10px}.chess-wait{padding:22px!important;min-height:380px}.chess-wait h2{font-size:25px}.chess-player{padding:8px 5px;gap:8px!important}.chess-player .friend-avatar{width:30px;height:30px;font-size:16px}.chess-player>span:last-child{font-size:11px}.chess-players{gap:4px}.chess-wait p{font-size:13px}.chess-match>.row button{font-size:12px;padding:8px}.chess-match #chess-status{font-size:13px}.chess-controls .primary{width:100%;min-width:0}.friend-row>.row{margin-left:auto}.chess-incoming .row{flex-wrap:wrap}}
.game-invitation{position:fixed;right:24px;bottom:24px;z-index:90;width:min(390px,calc(100vw - 32px));padding:24px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:24px;box-shadow:0 16px 60px #132f3129;display:grid;grid-template-columns:44px 1fr;gap:14px}.game-invitation h3{font-size:16px;margin:7px 10px 8px 0;line-height:1.6}.game-invitation p,.game-invitation small{font-size:12px;color:var(--muted);line-height:1.7}.game-invitation>.row{grid-column:1/-1;gap:10px}.game-invitation>.row button{font-size:13px;padding:10px 16px}.game-invite-close{position:absolute;right:8px;top:4px;font-size:21px;padding:8px}.game-invitation .friend-avatar{margin-top:14px}@media(max-width:600px){.game-invitation{right:16px;bottom:16px;padding:20px}}
/* Calm, tactile board; only the active clock changes between moves. */
.chess-board{background-color:#e9d7b8;background-image:repeating-linear-gradient(7deg,#a4773710 0,#fff2 1px,transparent 3px,transparent 11px);border:8px solid #d9c29d;box-shadow:0 10px 28px #583d1f18,inset 0 0 30px #89643318;border-radius:12px}.chess-cell[data-x="3"][data-y="3"]:before,.chess-cell[data-x="11"][data-y="3"]:before,.chess-cell[data-x="7"][data-y="7"]:before,.chess-cell[data-x="3"][data-y="11"]:before,.chess-cell[data-x="11"][data-y="11"]:before{content:'';position:absolute;width:5px;height:5px;border-radius:50%;background:#87653f}.chess-cell span{z-index:1}.chess-ambience{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:-10px}.chess-ambience button,.chess-pace{font-size:11px;color:var(--muted)}.chess-ambience button{padding:6px 10px;border:0;background:transparent}.chess-live{display:flex;align-items:center;justify-content:space-between;gap:20px;background:var(--soft);border-radius:16px;padding:16px 20px}.chess-live>div:first-child{font-size:12px;color:var(--muted)}.chess-presence{display:inline-block;width:6px;height:6px;border-radius:50%;background:#aaa99e;margin-right:8px}.chess-presence.is-present{background:#609477;box-shadow:0 0 0 4px #60947715}.chess-clock{display:flex;align-items:center;gap:15px}.chess-clock>span{font-size:11px;color:var(--muted)}.chess-clock strong{font:500 30px/1 Georgia,serif;font-variant-numeric:tabular-nums;min-width:65px;text-align:right;letter-spacing:.04em}.chess-clock.is-low strong{color:#b56e45}.chess-time-choice{display:grid;gap:10px;width:100%;font-size:12px;color:var(--muted)}.chess-time-choice select{width:100%;font-size:13px}.chess-undo-note{display:grid;grid-template-columns:25px minmax(0,1fr);gap:14px;padding:20px;background:var(--soft);border:1px solid #b5a08055;border-radius:18px}.chess-undo-note>span{font-size:24px;color:#ae8b60}.chess-undo-note strong{font-size:14px}.chess-undo-note p{font-size:12px;line-height:1.8;color:var(--muted);margin-top:8px}.chess-undo-note>.row{grid-column:2;flex-wrap:wrap}.chess-undo-note button{font-size:12px;padding:10px 16px}.chess-receipt{font-size:12px;color:var(--muted);text-align:center;line-height:1.8;padding:10px;border-top:1px solid var(--line)}@media(max-width:600px){.chess-board{border-width:5px}.chess-live{padding:14px 12px;gap:10px}.chess-clock{gap:8px}.chess-clock strong{font-size:24px;min-width:53px}.chess-live>div:first-child{font-size:10px}.chess-clock>span{font-size:10px}.chess-undo-note{padding:16px;gap:8px}.chess-undo-note>.row{grid-column:1/-1;justify-content:center}.chess-ambience{padding:0 5px}.chess-match .chess-player{max-width:45%}}
.chess-result{text-align:center;padding:36px 24px 28px;border:1px solid #cbbda355;border-radius:24px;background:radial-gradient(ellipse at top,#e6d6aa2b,transparent 65%)}.chess-result-mark{width:68px;height:68px;border-radius:50%;display:grid;place-items:center;font:42px Georgia,serif;color:#ae8e54;border:1px solid #bfaa6e55;background:linear-gradient(135deg,#faf3dc77,#e3d5b111);margin:0 auto 20px;box-shadow:0 8px 25px #bca76713}.chess-result.is-finished .chess-result-mark{color:#829884;border-color:#82988444}.chess-result h2{font:400 30px/1.5 Georgia,'SimSun',serif;margin:16px 0 12px}.chess-result>p{font-size:13px;color:var(--muted);line-height:1.9}.chess-result-stats{display:grid;grid-template-columns:1fr 1.6fr 1fr;gap:16px;margin:26px 0;padding:22px 0;border-block:1px solid var(--line)}.chess-result-stats span{display:grid;gap:10px}.chess-result-stats strong{font-size:18px;font-weight:500;font-variant-numeric:tabular-nums}.chess-result-stats small,.chess-result>small{font-size:11px;color:var(--muted)}.chess-result>.row{justify-content:center;gap:12px;flex-wrap:wrap}.chess-result>small{display:block;margin-top:15px}.chess-replay{padding-top:4px}.chess-replay summary{font-size:13px;color:var(--muted);cursor:pointer;margin-bottom:20px}.chess-result.is-win .chess-result-mark{animation:chess-settle .45s ease-out}@keyframes chess-settle{from{opacity:0;transform:translateY(5px) scale(.96)}to{opacity:1;transform:none}}@media(max-width:600px){.chess-result{padding:24px 14px}.chess-result h2{font-size:25px}.chess-result-stats{gap:8px}.chess-result-stats strong{font-size:14px}.chess-result>.row button{font-size:13px;padding:12px 18px}}@media(prefers-reduced-motion:reduce){.chess-result.is-win .chess-result-mark{animation:none}}
.chess-match:has(.chess-result)>.chess-ambience,.chess-match:has(.chess-result)>.chess-players,.chess-match:has(.chess-result)>.chess-controls,.chess-match:has(.chess-result)>.chess-receipt{display:none}
