:root{--ink:#222;--muted:#999;--line:#ededed;--paper:#faf9f6}
*{box-sizing:border-box}
body{margin:0;background:#fff;color:var(--ink);font:13px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;-webkit-tap-highlight-color:transparent}
button,input{font:inherit}button{cursor:pointer;color:inherit;background:none;border:0}button:disabled{opacity:.3;cursor:default}a{color:inherit;text-decoration:none}button,a,input{touch-action:manipulation}
button:focus-visible,a:focus-visible,summary:focus-visible{outline:2px solid #888;outline-offset:3px}
h1,h2,h3,p{margin:0}h1{font-size:24px;font-weight:550;letter-spacing:.5px}h2{font-size:15px;font-weight:550}h3{font-size:13px;font-weight:500}
svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
[hidden]{display:none!important}
.topbar{max-width:1000px;margin:auto;height:76px;padding:0 24px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}
.brand{display:flex;align-items:center;gap:9px;font-size:17px;font-weight:550}.brand small{font-size:11px;font-weight:400;color:#aaa;margin-left:3px}.brand img{display:block}
.top-actions{display:flex;align-items:center;gap:15px}.connection{display:flex;align-items:center;gap:6px;font-size:10px;color:#999}.connection i{width:4px;height:4px;background:#7d9c88;border-radius:50%}.connection.offline i{background:#aaa}
.icon-button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;padding:6px;color:#999;font-size:23px;line-height:1}.icon-button.active{color:#222}.icon-button svg{width:16px;height:16px}
main{max-width:952px;margin:0 auto;padding-bottom:calc(32px + env(safe-area-inset-bottom))}
.lobby{max-width:352px;margin:58px auto 0}.entry-card h1{margin-bottom:31px}.field-label{display:block;color:#777;font-size:12px;margin-bottom:9px}
input:not([type=checkbox]){width:100%;min-width:0;height:44px;border:1px solid #e7e7e7;border-radius:5px;padding:0 12px;background:#fff;color:#222;outline:none}input:not([type=checkbox]):focus{border-color:#888}input::placeholder{color:#b3b3b3;font-size:12px}input[type=checkbox]{accent-color:#333}
.entry-tabs{display:flex;gap:28px;border-bottom:1px solid var(--line);margin-top:28px}.entry-tabs button{padding:0 0 12px;font-size:12px;color:#a0a0a0;border-bottom:1px solid transparent;margin-bottom:-1px}.entry-tabs button[aria-selected=true]{color:#222;border-color:#222}
.room-option{height:66px;display:flex;align-items:center;justify-content:space-between;font-size:12px;color:#777}.switch{position:relative;width:29px;height:17px}.switch input{position:absolute;opacity:0;inset:0;width:100%;height:100%;margin:0}.switch>span{display:block;width:29px;height:17px;background:#dedede;border-radius:10px;pointer-events:none}.switch>span:after{content:"";position:absolute;width:11px;height:11px;left:3px;top:3px;border-radius:50%;background:white}.switch input:checked+span{background:#444}.switch input:checked+span:after{left:15px}.switch input:focus-visible+span{outline:2px solid #888;outline-offset:3px}
.button{height:40px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 15px;border:1px solid #e5e5e5;border-radius:5px;background:#fff;font-size:12px;font-weight:450;white-space:nowrap}.button.primary{background:#292929;border-color:#292929;color:#fff}.button.primary:hover:not(:disabled){background:#444}.button.small{height:31px;padding:0 10px;font-size:11px}.button.small svg{width:13px;height:13px}.button.full{width:100%}
#joinPane .code-input{margin:17px 0 14px;height:42px;text-align:center;letter-spacing:4px;font-size:16px}.code-input::placeholder{letter-spacing:1px}
.hall{margin-top:44px}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}.section-heading h2{font-size:12px;font-weight:500;color:#666}.text-button{display:inline-flex;align-items:center;justify-content:center;gap:5px;padding:5px 0;font-size:11px;color:#999}.text-button svg{width:13px;height:13px}.text-button:hover{color:#333}
.room-list{margin-top:12px}.empty-hall{padding:24px 0;text-align:center;border-top:1px solid var(--line);font-size:11px;color:#b0b0b0}.room-tile{display:flex;align-items:center;gap:10px;width:100%;text-align:left;padding:14px 0;border-top:1px solid var(--line)}.room-tile .avatar{width:28px;height:28px;font-size:11px}.room-tile strong{display:block;max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:400}.room-tile small{display:block;font-size:10px;color:#aaa;margin-top:3px}.room-tile>span:last-child{margin-left:auto;font-size:15px;color:#999}
/* 对局：棋盘与一列轻量工具，不使用装饰卡片。 */
.game-layout{display:grid;grid-template-columns:minmax(0,620px) minmax(190px,1fr);gap:30px 42px;margin-top:24px}.game-heading{grid-column:1/-1;display:flex;justify-content:space-between;align-items:center}.game-heading>div{display:flex;align-items:center;gap:18px}.room-caption{font-size:11px;color:#aaa}.room-caption b{font-size:12px;color:#555;font-weight:400;letter-spacing:1px;margin-left:4px}.badge{font-size:10px;color:#aaa;white-space:nowrap}
.board-card{min-width:0}.board-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:24px}.board-heading h2{font-size:18px;font-weight:500}.board-heading p{font-size:11px;color:#aaa;margin-top:5px}.timer{display:flex;align-items:baseline;gap:5px;color:#555}.timer span{font-size:23px;font-weight:400;font-variant-numeric:tabular-nums}.timer small{font-size:10px;color:#aaa}.timer.urgent{color:#a2584a}
.board-wrap{padding:19px;border:1px solid #e6e3db;background:var(--paper);border-radius:3px}.board{position:relative;aspect-ratio:1;width:100%;background-image:linear-gradient(to right,#d9d6ce 1px,transparent 1px),linear-gradient(to bottom,#d9d6ce 1px,transparent 1px);background-size:calc(100% / 14) calc(100% / 14);border-right:1px solid #d9d6ce;border-bottom:1px solid #d9d6ce;isolation:isolate}.star{position:absolute;width:4px;height:4px;background:#b5b0a4;border-radius:50%;transform:translate(-50%,-50%);pointer-events:none}
.cell{position:absolute;transform:translate(-50%,-50%);width:6.8%;height:6.8%;display:flex;align-items:center;justify-content:center;padding:0;border-radius:50%;z-index:1;outline-offset:0!important}.stone{position:relative;display:flex;align-items:center;justify-content:center;width:85%;height:85%;border-radius:50%;font-size:10px;font-variant-numeric:tabular-nums}.cell.black .stone{background:#303030;border:1px solid #222;color:#fff}.cell.white .stone{background:#fff;border:1px solid #c4c4be;color:#555}.cell.last .stone:after{content:"";width:4px;height:4px;border-radius:50%;position:absolute;left:calc(50% - 2px);top:calc(50% - 2px);background:#bd9668}.board.numbers .cell.last .stone:after{left:auto;top:auto;right:2px;bottom:2px;width:3px;height:3px}.cell.winning .stone{outline:1px solid #9b8971;outline-offset:2px}.cell.preview .stone{border:1px dashed #777;background:#33333312}.board.interactive .cell.empty:hover .stone{background:#3333330b}
.board-bottom{display:flex;align-items:center;gap:18px;margin-top:15px;font-size:10px;color:#999}.board-bottom>span{margin-right:auto}.board-bottom label{display:flex;align-items:center;gap:5px;cursor:pointer;white-space:nowrap}.board-bottom input{width:11px;height:11px;margin:0}
.placement,.result-banner,.offer-banner{display:flex;align-items:center;gap:12px;border-top:1px solid var(--line);margin-top:18px;padding-top:16px;font-size:12px;color:#777}.placement>span,.offer-banner>span,.result-banner>div{flex:1}.result-banner strong{font-size:13px;font-weight:500;color:#444}.result-banner p{font-size:10px;color:#999;margin-top:4px}
.game-aside{padding-top:4px}.players-card>.section-heading{padding-bottom:12px;border-bottom:1px solid var(--line)}.player{display:flex;align-items:center;gap:10px;padding:17px 0}.player+.player{border-top:1px solid #f3f3f3}.avatar{display:flex;align-items:center;justify-content:center;flex-shrink:0;position:relative;width:34px;height:34px;border-radius:50%;background:#f1f1f1;color:#777;font-size:13px;font-weight:400}.avatar.empty{background:#fafafa;color:#bbb}.piece-dot{position:absolute;width:10px;height:10px;border-radius:50%;background:#333;right:-2px;bottom:0;border:1px solid #fff}.piece-dot.white{background:#fff;border-color:#ccc}.player-info{min-width:0;flex:1}.player-name{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.you{font-size:10px;color:#aaa;font-weight:400;margin-left:7px}.player-meta{font-size:10px;color:#aaa;margin-top:4px}.player-meta i{display:inline-block;width:3px;height:3px;background:#899d8c;border-radius:50%;margin-right:4px}.player-meta i.off{background:#bbb}.turn-dot{width:4px;height:4px;border-radius:50%;background:#555;margin-left:auto}
.match-tools{display:flex;justify-content:space-between;border-top:1px solid var(--line);padding-top:18px;gap:8px}.match-tools button{display:flex;align-items:center;justify-content:center;gap:5px;padding:0;font-size:11px;color:#777;min-height:30px}.match-tools svg{width:14px;height:14px;color:#888}.close-room{display:block;margin:13px 0 0 auto;font-size:10px;color:#aaa}
/* 默认折叠聊天；收到消息时显示文字提示。 */
.chat-card{margin-top:28px;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.chat-card summary{display:flex;justify-content:space-between;align-items:center;padding:15px 0;cursor:pointer;list-style:none;font-size:12px;color:#666}.chat-card summary::-webkit-details-marker{display:none}.chat-card summary>span:first-child{display:flex;align-items:center;gap:7px}.chat-card summary svg{width:14px;height:14px;color:#999}.disclosure{font-size:15px;color:#aaa}.chat-card[open] .disclosure{font-size:0}.chat-card[open] .disclosure:after{content:'−';font-size:15px}.unread{font-size:9px;color:#777;border-bottom:1px solid #bbb;margin-left:4px}.chat-log{height:180px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;margin-bottom:13px}.chat-empty{text-align:center;padding-top:50px;font-size:11px;color:#bbb}.chat-message{max-width:92%;margin:12px 0;font-size:11px}.chat-message.mine{margin-left:auto;text-align:right}.chat-message small{display:block;color:#aaa;font-size:9px;margin-bottom:4px}.chat-message p{display:inline-block;padding:7px 9px;background:#f6f6f6;border-radius:4px;text-align:left;white-space:pre-wrap;word-break:break-word;line-height:1.6}.chat-message.mine p{background:#ededed;color:#444}.chat-form{display:flex;gap:8px;padding-bottom:15px}.chat-form input:not([type=checkbox]){height:35px;font-size:12px;padding:0 9px}.chat-form input::placeholder{font-size:11px}.chat-form button{display:flex;align-items:center;justify-content:center;width:32px;padding:0;flex-shrink:0;color:#777}.chat-form button svg{width:16px;height:16px}.mobile-players{display:none}
dialog{border:1px solid #e4e4e4;border-radius:7px;padding:22px;width:calc(100% - 40px);max-width:370px;color:#222}dialog::backdrop{background:#00000030}.modal-heading{display:flex;justify-content:flex-end;margin:-9px -9px 2px}.modal-heading .icon-button{font-size:21px}dialog h2{font-size:18px;font-weight:500}dialog p{font-size:12px;line-height:1.9;color:#888;white-space:pre-line;margin-top:14px}.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:24px}#copyInput{margin-top:15px;font-size:11px}.toast{position:fixed;left:50%;bottom:calc(24px + env(safe-area-inset-bottom));transform:translateX(-50%);background:#333;color:#fff;border-radius:5px;padding:11px 16px;font-size:12px;text-align:center;max-width:calc(100% - 32px);opacity:0;pointer-events:none;z-index:20}.toast.visible{opacity:1}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
@media(max-width:1040px){main{margin-left:32px;margin-right:32px}.topbar{margin:0 8px}.game-layout{grid-template-columns:minmax(0,1fr) 210px;column-gap:32px}}
@media(min-width:721px) and (max-height:850px){.game-layout{grid-template-columns:minmax(0,540px) minmax(190px,1fr);max-width:860px;margin-left:auto;margin-right:auto}.board-heading{margin-bottom:19px}}
@media(max-width:720px){
 .topbar{height:62px;padding:0 20px;margin:0}.brand{font-size:16px;gap:7px}.brand img{width:22px;height:22px}.brand small{font-size:10px}.top-actions{gap:10px}.icon-button{width:27px;height:30px}.icon-button svg{width:15px;height:15px}.connection{font-size:9px;gap:5px}
 main{margin:0 20px}.lobby{margin-top:38px;max-width:352px}.entry-card h1{font-size:22px;margin-bottom:28px}.hall{margin-top:36px}.entry-tabs{margin-top:26px}input:not([type=checkbox]){font-size:16px}.room-tile strong{max-width:220px}
 .game-layout{display:flex;flex-direction:column;gap:21px;margin-top:18px}.game-heading>div{gap:14px}.game-heading .badge{display:none}.game-heading .button{height:29px;font-size:10px}.game-heading .text-button{font-size:10px}.room-caption{font-size:10px}.room-caption b{font-size:11px}
 .board-heading{margin-bottom:16px}.board-heading h2{font-size:17px}.board-heading p{font-size:10px;margin-top:4px}.timer span{font-size:22px}.timer small{font-size:9px}.mobile-players{display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--line);padding:11px 0 14px;gap:12px}.mini-player{display:flex;align-items:center;gap:6px;min-width:0;font-size:10px;color:#888}.mini-piece{width:10px;height:10px;border-radius:50%;background:#333;flex-shrink:0}.mini-player.white .mini-piece{background:#fff;border:1px solid #bbb}.mini-player span:last-child{max-width:118px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mini-vs{font-size:8px;color:#bbb}
 .board-wrap{padding:12px}.stone{font-size:8px}.board-bottom{margin-top:13px;font-size:9px;gap:16px}.board-bottom input{height:10px;width:10px}.game-aside{padding-top:0}.players-card>.section-heading,.players-card #players{display:none}.match-tools{padding-top:10px;justify-content:flex-start;gap:31px}.match-tools button{font-size:11px;min-height:32px}.match-tools svg{width:13px;height:13px}.players-card{position:relative;padding-right:64px}.close-room{position:absolute;right:0;top:16px;margin:0;font-size:9px;max-width:60px}.chat-card{margin-top:15px}.chat-card summary{padding:14px 0;font-size:11px}.chat-log{height:150px}.chat-form input:not([type=checkbox]){font-size:16px}
 .placement,.result-banner,.offer-banner{font-size:11px;gap:9px;margin-top:15px;padding-top:13px}.placement .button,.result-banner .button,.offer-banner .button{font-size:10px;height:30px;padding:0 9px}.result-banner strong{font-size:12px}.result-banner p{font-size:9px}
}
@media(max-width:350px){main{margin:0 15px}.topbar{padding:0 15px}.brand small{display:none}.top-actions{gap:7px}.board-wrap{padding:10px}.board-bottom{gap:12px}.match-tools{gap:20px}.mini-player span:last-child{max-width:100px}}
