/* 1.1 — a game table first, with rules close at hand. */
:root{--table:#214f40;--board-light:#f0e5ca;--board-dark:#819776;--board-edge:#314b3e}
select{width:100%;min-width:0;margin-top:8px;padding:11px 12px;border:1px solid var(--line);border-radius:10px;background:#fffefa;font:inherit;color:var(--ink);min-height:44px}
.in-game{background:#eff1e9}.in-game .site-header{padding-top:13px;padding-bottom:13px}.in-game footer{margin-top:23px;padding-top:17px}
.session-nav{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:17px 0;font-size:12px;color:var(--muted)}
.session-nav-right{display:flex;align-items:center;gap:14px;font-size:11px;letter-spacing:.8px}.text-button{background:none;border:0;padding:4px 0;font-size:12px;color:var(--green);font-weight:800}
.play-area{padding:0 26px}.play-top{margin:2px 0 19px}.play-top h1{font-size:30px;margin-top:4px}.play-top small{font-size:11px}.phase-badge{background:#e0e9dc;border:1px solid #cad6c4;border-radius:100px;color:var(--green);font-size:11px;font-weight:800;padding:9px 12px;white-space:nowrap}
.game-shell{grid-template-columns:minmax(0,1fr) 244px;gap:20px}.game-main{padding:23px;border-radius:20px;box-shadow:0 4px 18px #243a2710}.game-prompt{font-size:22px;line-height:1.45}
.play-sidebar{min-width:0;display:flex;flex-direction:column;gap:14px}.score-panel{background:#fffef9;border-color:#d5dbcf;padding:17px}.score-panel h3{font-size:14px}.score-panel .player-list{max-height:240px}.score-panel .avatar{background:#e8ece1}.game-status{padding:10px 13px;background:#edf2e7;border-radius:10px;border-left:3px solid var(--green);line-height:1.6;font-size:12px}
.game-text{font-size:13px;color:#536056;line-height:1.75}.game-main>.game-text+.game-text{margin-top:6px}.spectator{padding:8px 12px;margin-bottom:12px;font-size:11px}.game-main>.choices{margin-top:18px}.choice{background:#f3f4ed;border-color:#d5dccd;min-height:51px;font-size:14px;line-height:1.6}.choice:hover:not(:disabled){background:#e3eadc}.choice:active:not(:disabled){transform:translateY(1px)}
.private-box{background:#faf0cf;box-shadow:inset 0 0 0 3px #fff5dd;border-color:#ccba78}.private-box summary{font-size:13px;display:list-item;line-height:1.7}.private-box p{font-size:15px;font-weight:700;padding:3px 0}.rules{margin-top:20px}.rules summary,.advanced-input summary{font-size:12px;font-weight:700;line-height:1.7;cursor:pointer}.advanced-input{margin-top:15px;color:var(--muted);font-size:12px}.advanced-input .game-form{margin-top:10px}.history-panel{padding:13px;border:1px solid var(--line);border-radius:15px;background:#fffef9;margin-top:0}.history-panel>div{padding:3px 0}
.game-guide{font-size:13px;line-height:1.8;color:#49594c}.guide-goal{font-size:15px!important;font-weight:800;color:var(--ink)!important;margin:8px 0 14px!important}.game-guide ol{padding-left:22px;margin:10px 0 17px}.game-guide li{padding:4px 0 4px 3px}.guide-section{padding:13px 0;border-top:1px solid var(--line)}.guide-section strong{color:var(--green);font-size:12px}.guide-section p{font-size:12px;margin:5px 0 0!important}.guide-note{color:#6b695a}.modal-meta{font-size:11px;color:var(--muted);padding:0 0 13px;border-bottom:1px solid var(--line);margin-bottom:13px}.game-settings{padding:16px;background:#eff1e8;border:1px solid #d5dccd;border-radius:14px;display:grid;gap:13px;margin:12px 0 18px}.game-settings label{font-size:12px}.game-settings p{margin:0}
.round-result{padding:24px;background:#e7efdf;border:1px solid #bacaab;border-radius:16px;margin:0 0 16px;animation:result-appear .25s ease-out}.round-result h2{font-size:24px;margin:7px 0}.round-result p{white-space:pre-wrap;font-size:14px;color:#34533e}.round-result small{display:block;margin-top:15px;color:#60735e;font-size:11px}.result-kicker{display:block;font-size:10px;font-weight:900;letter-spacing:2px;opacity:.75}.finished-banner{padding:21px;background:#234f40;border-radius:16px}.finished-banner strong{display:block;margin-top:8px;font-size:24px}.end-actions .button{min-width:130px}
.board-container{padding:2px;margin-top:15px;border-radius:9px}.game-board{gap:0;border:6px solid var(--board-edge);padding:0;border-radius:8px;width:min(100%,var(--board-max,560px));box-shadow:0 7px 16px #1d392826}.board-cell{border-radius:0;position:relative;overflow:visible;user-select:none;-webkit-user-select:none;touch-action:manipulation;background:var(--board-light);font-size:clamp(12px,3vw,28px);aspect-ratio:1}
.board-cell:focus-visible{z-index:5;outline:3px solid #f17143;outline-offset:-3px}.board-cell:disabled{cursor:default}.coordinate{position:absolute;z-index:4;font-size:clamp(7px,1vw,10px);font-weight:800;line-height:1;pointer-events:none}.coordinate-file{right:4px;bottom:3px}.coordinate-rank{left:4px;top:3px}.board-cell.cell-last{box-shadow:inset 0 0 0 3px #d1aa38}.board-cell.cell-selected{box-shadow:inset 0 0 0 4px #f9b73c;z-index:2}.board-cell.cell-check{background:#e8a19c!important}.board-cell.cell-legal:not(:disabled){cursor:pointer}
/* Chess: the piece colour is independent of the square colour. */
.chess-main{padding:16px 21px 20px}.chess-main>.game-prompt{font-size:15px;margin-bottom:10px}.chess-main .game-status{margin:0 0 10px;padding:8px 11px}.chess-main .board-container{margin:0}.game-board.chess{width:min(100%,clamp(225px,calc(100dvh - 282px),560px));background:var(--board-edge);border-width:6px}
.chess .board-cell.square-light{background:var(--board-light);color:#284231}.chess .board-cell.square-dark{background:var(--board-dark);color:#fff9e5}.chess .board-cell:hover:not(:disabled){filter:brightness(1.07)}.chess .board-cell.cell-last.square-light{background:#e1dc95;box-shadow:none}.chess .board-cell.cell-last.square-dark{background:#a9b16b;box-shadow:none}.chess .board-cell.cell-selected{box-shadow:inset 0 0 0 4px #f2be43;background:#bbbd7b;z-index:2}
.chess-piece{display:block;width:88%;height:88%;object-fit:contain;pointer-events:none;position:relative;z-index:2;filter:drop-shadow(0 1px 1px #15231d40)}.legal-dot{position:absolute;width:25%;height:25%;background:#233d3550;border-radius:50%;left:37.5%;top:37.5%;pointer-events:none;z-index:3}.legal-capture{position:absolute;inset:3px;border:4px solid #fff4c3b0;border-radius:50%;pointer-events:none;z-index:3}
.chess-player{width:min(100%,clamp(225px,calc(100dvh - 282px),560px));margin:0 auto;display:flex;align-items:center;gap:10px;min-height:53px;padding:7px 0}.chess-player-name{display:flex;align-items:center;gap:6px;min-width:0}.chess-player-name>img{width:34px;height:34px}.chess-player-name>div{min-width:0}.chess-player-name strong{display:block;font-size:12px;overflow-wrap:anywhere}.chess-player-name small{display:block;font-size:9px;color:var(--muted);margin-top:3px;letter-spacing:.3px}.captured-pieces{display:flex;flex-wrap:wrap;gap:0;flex:1;min-width:0}.captured-pieces>img{width:17px;height:21px;margin-right:-3px;filter:none}.chess-clock{margin-left:auto;min-width:88px;text-align:center;background:#eaede4;color:#687166;border:1px solid #d7dece;border-radius:8px;padding:9px 10px;font-size:24px;letter-spacing:.7px;font-variant-numeric:tabular-nums;font-weight:850;line-height:1}.clock-active .chess-clock{background:#244f3d;color:white;border-color:#244f3d;box-shadow:inset 4px 0 #e7bd5c}.chess-clock.clock-low{color:#d74627;background:#fff0e9}.clock-active .chess-clock.clock-low{background:#b94227;color:white}.chess-main>.choices{margin-top:10px;grid-template-columns:repeat(2,minmax(0,1fr))}.chess-main>.choices .choice{font-size:11px;min-height:40px;padding:8px}.chess-main.phase-promotion>.choices .choice{min-height:50px;font-size:14px;background:#f6e8b3;border-color:#bd9a4b}.chess-history{background:#fffef9;border:1px solid #d5dbcf;border-radius:17px;padding:16px}.chess-history h3{font-size:14px;margin-bottom:12px}.chess-history .muted{font-size:11px;color:var(--muted)}.move-list{display:grid;grid-template-columns:30px 1fr 1fr;gap:0;max-height:240px;overflow:auto;font-size:12px;font-variant-numeric:tabular-nums}.move-list span{padding:7px 4px;border-bottom:1px solid #e8ebdf}.move-number{color:#88917e;font-size:11px}
/* The rest of the boards get their own physical affordances. */
.gomoku{background:#d6b581;border-color:#8c6f49;gap:0}.gomoku .board-cell{background:#ddbe8b;color:#795b3a;font-size:10px}.gomoku .board-cell:before,.gomoku .board-cell:after{content:'';position:absolute;background:#95764d;pointer-events:none}.gomoku .board-cell:before{height:1px;width:100%;top:50%;left:0}.gomoku .board-cell:after{width:1px;height:100%;left:50%;top:0}.gomoku .board-cell:hover:not(:disabled){background:#eccd95}.gomoku .cell-last{box-shadow:none}.gomoku .cell-last>.stone:after{content:'';position:absolute;width:20%;height:20%;background:#e9a545;border:1px solid #785425;border-radius:50%;left:40%;top:40%}.gomoku .coordinate{font-size:7px;opacity:.65}
.stone{display:block;width:79%;height:79%;border-radius:50%;z-index:2;position:relative;box-shadow:0 2px 3px #0004;pointer-events:none}.stone-black{background:radial-gradient(circle at 33% 27%,#69716b,#202c24 64%,#111b16);border:1px solid #15231b}.stone-white{background:radial-gradient(circle at 32% 25%,white,#ecefe5 68%,#b7c3b1);border:1px solid #c2cbbb}.gomoku .stone{width:87%;height:87%}
.reversi{border-color:#244f3d;gap:1px;background:#1c4f39}.reversi .board-cell{background:#438864;color:#b4d5b3}.reversi .board-cell:hover:not(:disabled){background:#5b9f74}.reversi .coordinate{color:#dcebd1}.reversi .cell-last{box-shadow:inset 0 0 0 3px #f2d476}
.connect4{border-color:#3a658d;padding:8px;gap:6px;background:#4e7ca4}.connect4 .board-cell{border-radius:50%;background:#eaf0eb;box-shadow:inset 0 3px 4px #24466a66}.connect4 .board-cell:has(.stone){background:transparent;box-shadow:none}.connect4 .stone{width:100%;height:100%}.connect4 .stone-black{background:radial-gradient(circle at 30% 25%,#ffb28b,#d95b39 70%);border-color:#ca4c31}.connect4 .stone-white{background:radial-gradient(circle at 30% 25%,#ffefa3,#e5ba4c 70%);border-color:#d4a532}.connect4 .coordinate{display:none}
.janggi{border-color:#94764c;gap:1px;background:#9c8259}.janggi .board-cell{background:#e6d0a8;font-size:clamp(12px,3vw,26px)}.janggi-piece{display:grid;place-items:center;width:84%;height:84%;border-radius:50%;background:#f8e8c4;border:2px solid currentColor;box-shadow:0 2px 3px #634a2944;color:#26583e;font-weight:900;font-family:"Noto Serif KR","Batang",serif;position:relative;z-index:2}.janggi .piece-han{color:#a43d2d}.janggi .coordinate{font-size:7px;color:#846d4c}.janggi .cell-legal{background:#e4dca0}.janggi .cell-selected{background:#f1cf78}.janggi .cell-check{background:#e69b7f!important}
.battleship{border-color:#43677a;gap:2px;background:#8aa7b0}.battleship .board-cell{background:#e0eff1;color:#628899;font-size:18px}.battleship .state-hit{background:#f3a88b;color:#923c2d}.battleship .state-miss{background:#bdced2;color:#7797a0}.battleship .state-ship{background:#4c7781;color:white}
.territory{border:0;box-shadow:none;background:transparent;padding:3px;gap:2px;grid-template-columns:repeat(4,9px minmax(0,1fr)) 9px;grid-template-rows:repeat(4,9px minmax(0,1fr)) 9px;aspect-ratio:1}.territory .board-cell{aspect-ratio:auto;background:none;font-size:16px}.territory .cell-dot{background:#4f6453;border-radius:50%;color:transparent}.territory .cell-edge{background:#dce3d5;color:transparent;border-radius:4px;position:relative}.territory .cell-edge:hover:not(:disabled){background:#f1bd67}.territory .edge-vertical{justify-self:center;width:9px}.territory .edge-horizontal{align-self:center;height:9px}.territory .edge-filled{background:#3f7652}.territory .cell-box{background:#f2f2e5;border-radius:4px}.territory .owner-1{background:#d7e6f2;color:#34628d}.territory .owner-2{background:#f4dfc7;color:#a05d36}.territory .coordinate{display:none}
/* Cards keep suit/colour/rank visible instead of becoming a wall of text. */
.card-table{margin-top:20px;background:#2b5f4b;border:1px solid #244f40;border-radius:17px;padding:19px;box-shadow:inset 0 0 0 5px #ffffff0c;display:flex;flex-wrap:wrap;justify-content:center;gap:18px}.card-pile{min-width:0;text-align:center}.pile-label{font-size:10px;color:#e3e9d3;letter-spacing:.5px;display:block;margin-bottom:10px}.card-fan{display:flex;justify-content:center;flex-wrap:wrap;gap:7px}.playing-card{position:relative;display:inline-flex;align-items:center;justify-content:center;width:70px;height:96px;background:#fffdf2;border:1px solid #d9d9c9;border-radius:8px;box-shadow:0 3px 3px #152d2440;color:#25392d;flex-shrink:0;font-family:system-ui,sans-serif;line-height:1.1}.card-corner{position:absolute;top:7px;left:7px;font-size:13px;font-weight:850;text-align:center}.card-corner small{display:block;font-size:11px;margin-top:2px}.card-bottom{transform:rotate(180deg);top:auto;left:auto;bottom:7px;right:7px}.card-center{font-size:27px;font-weight:900}.card-red,.card-hearts,.card-diamonds,.card-H,.card-D{color:#b43e2d}.card-blue{color:#2f6598}.card-green{color:#24704c}.card-yellow{color:#9c721d}.card-red:before,.card-blue:before,.card-green:before,.card-yellow:before{content:'';position:absolute;inset:25px 11px;border:2px solid currentColor;border-radius:50%;transform:rotate(-20deg);opacity:.35}.card-back{background:repeating-linear-gradient(45deg,#2f5e4d 0 4px,#3d6e58 4px 8px);border:5px solid #fffdf2;color:#eee9c4;box-shadow:inset 0 0 0 1px #afc1a4,0 3px 3px #152d2440;font-size:32px;font-weight:900}.card-choices{display:flex;flex-wrap:wrap;gap:8px;align-items:flex-start}.card-choice{min-height:0;background:none!important;padding:0;border:0;display:block;line-height:0}.card-choice:hover:not(:disabled){transform:translateY(-5px)}.card-choice:disabled{opacity:.36}.card-choice .playing-card{border:2px solid #7b9976}.card-choices>.choice:not(.card-choice){min-height:44px;align-self:center;padding:11px 16px}.card-choice .playing-card:after{content:'내기';position:absolute;bottom:-7px;left:18px;right:18px;background:var(--green);color:white;font-size:9px;line-height:16px;border-radius:5px}.card-choice:disabled .playing-card:after{display:none}
.game-reaction:not(.phase-result):not(.phase-finished){min-height:310px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;background:#f2e5d5}.game-reaction.phase-signal{background:#266248!important;color:white}.game-reaction.phase-signal .game-text{color:#edf1dd}.game-reaction.phase-signal .game-prompt{font-size:34px}.game-reaction>.choices{width:100%;max-width:440px;grid-template-columns:1fr}.game-reaction .choice{font-size:20px;min-height:85px;background:#fffdf3;border:0;box-shadow:0 4px 0 #173d2b33}.game-memory .game-text{font-variant-numeric:tabular-nums}.game-memory.phase-reveal .game-text:last-of-type{font-size:34px;letter-spacing:5px;font-weight:900;color:var(--green);text-align:center;padding:20px;background:#edf2e7;border-radius:12px}
@keyframes result-appear{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}
@media(max-width:900px){.play-area{padding:0 20px}.game-shell{grid-template-columns:minmax(0,1fr) 196px;gap:15px}.game-main{padding:18px}.chess-main{padding:12px 15px 16px}.score-panel{padding:13px}.chess-player-name strong{font-size:11px}.chess-player-name>img{width:28px}.chess-clock{min-width:78px;font-size:22px}.captured-pieces>img{width:14px}.chess-history{padding:13px}}
@media(max-width:640px){.play-area{padding:0 12px}.in-game .site-header{padding:10px 14px}.in-game .brand-mark{width:31px;height:31px;font-size:28px;border-radius:10px}.in-game .brand{font-size:15px}.in-game .brand small{font-size:7px;letter-spacing:2px}.session-nav{padding:10px 2px}.session-nav-right{gap:8px}.session-nav-right>span{font-size:9px}.session-nav .button{font-size:10px;padding:7px 10px}.play-top{margin:0 0 13px;padding:0 2px}.play-top h1{font-size:25px;margin-top:3px}.play-top small{font-size:10px}.play-top .room-top-actions{gap:5px;max-width:65%;justify-content:flex-end}.phase-badge{font-size:10px;padding:7px 9px}.play-top .timer{font-size:10px;padding:7px 9px}.play-top .button{font-size:10px;padding:7px 10px;min-height:37px}.game-shell{grid-template-columns:1fr;gap:14px}.game-main{padding:17px 13px;border-radius:17px}.game-prompt{font-size:19px!important}.game-text{font-size:12px}.play-sidebar{gap:10px}.play-sidebar .score-panel .player-list{grid-template-columns:repeat(2,minmax(0,1fr));max-height:160px}.play-sidebar .chess-history{order:1}.chess-history h3{font-size:12px}.move-list{max-height:110px;font-size:11px}.chess-main{padding:9px 10px 15px}.chess-main>.game-prompt{font-size:12px!important;margin:3px 0 5px}.chess-main .game-status{font-size:11px;padding:6px 9px;margin-bottom:6px}.game-board.chess{width:100%;max-width:calc(100dvh - 272px);border-width:4px}.chess-player{width:100%;max-width:calc(100dvh - 272px);min-height:47px;padding:6px 0}.chess-player-name strong{font-size:11px}.chess-player-name>img{width:25px;height:28px}.chess-player-name small{font-size:8px;letter-spacing:0}.chess-clock{font-size:22px;min-width:77px;padding:8px 9px}.captured-pieces>img{width:13px;height:17px}.chess-main>.choices .choice{font-size:10px;padding:7px;min-height:38px}.chess-main.phase-promotion>.choices .choice{font-size:12px}.coordinate-file{right:3px;bottom:2px}.coordinate-rank{left:3px;top:2px}.coordinate{font-size:8px}.legal-capture{border-width:3px;inset:2px}.chess-main>.rules{margin-top:12px;padding-top:10px}.game-settings{padding:13px;gap:12px}.round-result{padding:20px 15px}.round-result h2{font-size:21px}.round-result p{font-size:13px}.card-table{padding:15px 12px}.playing-card{width:60px;height:84px}.card-center{font-size:24px}.card-corner{font-size:11px;left:6px;top:6px}.card-bottom{left:auto;top:auto;right:6px;bottom:6px}.card-choices{gap:7px}.card-choice .playing-card:after{left:12px;right:12px}.game-guide{font-size:12px}.guide-goal{font-size:14px!important}.game-guide li{padding:4px 0}.game-main .finished-banner{padding:17px}.finished-banner strong{font-size:21px}.game-reaction.phase-signal .game-prompt{font-size:28px!important}.game-reaction .choice{min-height:76px}.janggi-piece{border-width:1.5px}.gomoku .coordinate{display:none}}
@media(max-width:350px){.play-top h1{font-size:22px}.phase-badge{display:none}.play-top .room-top-actions{max-width:62%}.chess-clock{min-width:68px;font-size:20px}.chess-player-name strong{font-size:10px}.chess-player-name>img{width:22px}.captured-pieces>img{width:11px}.playing-card{width:55px;height:77px}.card-corner{font-size:10px}.card-center{font-size:22px}.board-cell.cell-selected{box-shadow:inset 0 0 0 3px #f2be43}}
@media(orientation:landscape) and (max-height:520px){.game-shell{grid-template-columns:minmax(0,1fr) 180px}.play-top{margin-bottom:10px}.play-top h1{font-size:23px}.session-nav{padding:7px 0}.game-board.chess,.chess-player{width:min(100%,320px);max-width:none}.game-main{padding:12px}.chess-main>.game-prompt{font-size:12px}.game-text{font-size:11px}.game-guide{font-size:12px}}
@media(prefers-reduced-motion:reduce){.round-result{animation:none}.card-choice:hover:not(:disabled){transform:none}}

.card-option{display:flex;flex-direction:column;align-items:center;gap:7px;max-width:78px}.card-caption{display:block;font-size:10px;line-height:1.45;color:var(--ink);overflow-wrap:anywhere;text-align:center;min-height:28px}.card-choice .playing-card:after{display:none}.card-colorful:before{content:"";position:absolute;inset:24px 11px;border:2px solid var(--card-color,currentColor);border-radius:50%;transform:rotate(-20deg);opacity:.35}.guide-extra{border-top:1px solid var(--line);margin-top:8px;padding-top:12px}.guide-extra summary{font-size:12px;font-weight:800;cursor:pointer;min-height:36px;color:var(--green)}.guide-extra h3{font-size:13px;margin:12px 0 7px}.guide-extra ul{padding-left:19px;font-size:12px}.guide-extra li{padding:4px 0}
.personal-info{padding:13px 15px;background:#eef3e6;border:1px solid #d0ddc3;border-radius:12px;margin:13px 0;font-size:13px;line-height:1.7;color:#34583c}.personal-info p+p{margin-top:5px}.game-memory.phase-input .personal-info{font-size:18px;letter-spacing:1px;font-weight:800}.live-notes{margin-top:10px;color:var(--muted);font-size:11px}.live-notes summary{cursor:pointer;min-height:32px;line-height:1.8}.live-notes .game-text{font-size:12px}@media(max-width:640px){.personal-info{font-size:12px;padding:11px 12px}.game-memory.phase-input .personal-info{font-size:16px}}
