/* Approved local two-player lobby entry; logical coordinates share the lobby scale. */
#lobby-stage #lobby-championship-slot{display:grid;grid-template-columns:451px 451px;gap:22px;height:160px}
#lobby-stage #show-tournament{grid-column:1;width:451px;height:160px;display:flex;flex-direction:column;justify-content:center;align-items:stretch;padding:18px 22px 18px 110px;gap:9px;text-align:left}
#lobby-stage #show-tournament .championship-trophy{left:22px;top:46px;width:70px;height:67px}
#lobby-stage #lobby-championship{position:relative;left:auto;top:auto;width:auto;height:auto;font-size:36px;line-height:1.2;white-space:normal;overflow:visible;text-overflow:clip}
#lobby-stage #lobby-championship:lang(en){font-size:32px}
#lobby-stage #championship-countdown{position:relative;left:auto;top:auto;width:auto;height:auto;font-size:32px;line-height:1.2;text-align:left}
#lobby-stage #championship-countdown:lang(ko){font-size:32px}
#lobby-stage #show-tournament :is(.championship-chevron,.championship-divider){display:none}
#lobby-stage #show-together{position:relative;grid-column:2;display:flex;align-items:center;justify-content:center;gap:16px;width:451px;height:160px;min-height:0;padding:20px 35px 20px 16px;border:3px solid #c6b176;border-radius:30px;background:linear-gradient(#fff7dc,#e9dcb7);box-shadow:inset 0 3px #fff8,0 5px 8px #00160799;color:#285130;text-align:left}
#lobby-stage .together-entry-label{display:grid;gap:9px;min-width:0}#lobby-stage .together-entry-label strong{font-size:38px;line-height:1.15;white-space:normal}#lobby-stage .together-entry-label small{font-size:31px;line-height:1.15;color:#677252}#lobby-stage #show-together:lang(en) .together-entry-label strong{font-size:34px}#lobby-stage #show-together:lang(en) .together-entry-label small{font-size:29px}
#lobby-stage .together-entry-pair{position:relative;display:block;flex:none;width:92px;height:100px}#lobby-stage .together-entry-pair .stone{position:absolute;width:69px;height:69px;font-size:48px;box-shadow:none}#lobby-stage .together-entry-pair .white{top:0;right:0}#lobby-stage .together-entry-pair .black{bottom:0;left:0}#lobby-stage .together-entry-chevron{position:absolute;right:12px;top:45px;font-size:53px;color:#7d8a59}
body.in-together #lobby-stage-host{visibility:hidden;pointer-events:none}
.tg-dialog{position:fixed;inset:var(--ncq-top) var(--ncq-right) var(--ncq-bottom) var(--ncq-left);width:min(440px,calc(100vw - var(--ncq-left) - var(--ncq-right) - 24px));height:min(720px,calc(100dvh - var(--ncq-top) - var(--ncq-bottom) - 24px));max-width:none;max-height:none;margin:auto;padding:12px;border:1px solid #cbb17b;border-radius:21px;background:linear-gradient(140deg,#fff9ec,#ede0c5);color:#284a2d;font-family:'Jangi Noto Sans KR',sans-serif;container-type:size;box-shadow:0 12px 32px #00170b99;overflow:hidden}
.tg-dialog::backdrop{background:#001b11bd}.tg-dialog button{font-family:inherit;line-height:1.25;white-space:normal}.tg-dialog h3{margin:0}.tg-dialog .tg-formation-shell{height:100%;display:flex;flex-direction:column;gap:8px}.tg-side{display:flex;flex:1;min-height:0;flex-direction:column;justify-content:center;gap:9px;padding:3px 0}.tg-upper{transform:rotate(180deg);color:#8b392c}.tg-side header{display:flex;align-items:center;gap:7px}.tg-side header>div{flex:1;min-width:0}.tg-side h3{font-size:16px;line-height:1.25;font-weight:850}.tg-side header p{font-size:11px;color:#827257;margin-top:2px}.tg-side .tg-king{width:35px;height:35px;font-size:25px;box-shadow:none}.tg-ready-state{font-size:11px;flex:none;padding:3px 6px;border:1px solid #cebca0;border-radius:6px;background:#f1e9d7;color:#7b745e}.tg-side[data-ready] .tg-ready-state{background:#d7e8bd;border-color:#8eaf76;color:#345c2e}.tg-choices{display:grid;grid-template-columns:1fr 1fr;gap:7px}.tg-choices button{position:relative;display:grid;justify-items:center;align-content:center;gap:4px;min-width:0;min-height:62px;padding:6px 3px;border:1px solid #cbb993;border-radius:9px;background:#fffaf0;color:#657254;box-shadow:inset 0 1px #fff}.tg-choices button[aria-pressed=true]{border:2px solid #4b7b40;background:#e9f0d8;padding:5px 2px}.tg-upper .tg-choices button[aria-pressed=true]{border-color:#b55b42;background:#f9e6d8}.tg-choices button[aria-pressed=true]::after{content:'✓';position:absolute;right:4px;top:0;font-size:12px;color:#49713a}.tg-choices button:disabled{opacity:1}.tg-choice-pieces{display:flex;gap:2px;align-items:center;justify-content:center}.tg-choice-pieces .stone{width:24px;height:24px;font-size:18px;box-shadow:none}.tg-choice-pieces .stone:nth-child(3){margin-left:5px}.tg-choice-label{font-size:11px;line-height:1.15;letter-spacing:.7px}.tg-confirm{width:100%;min-height:44px;padding:7px;border:1px solid #9bae7c;border-radius:9px;background:linear-gradient(#5c8648,#3c6732);color:#fff9e8;font-size:13px;font-weight:800}.tg-upper .tg-confirm{border-color:#b66e56;background:linear-gradient(#c6755a,#a4513c)}.tg-side[data-ready] .tg-confirm{background:#e4eccf;color:#3f6535;border-color:#98b57d}.tg-upper[data-ready] .tg-confirm{background:#f2dfd1;color:#99543c;border-color:#ce9d83}.tg-divider{display:flex;flex:none;align-items:center;justify-content:space-between;gap:6px;padding:8px 0;border-block:1px solid #d3c09c;color:#385b37}.tg-divider h2{font-size:18px;font-weight:850}.tg-divider p{font-size:11px;color:#7c795e}.tg-divider>div{text-align:center}.tg-close{width:44px;min-height:44px;padding:0;flex:none;border:1px solid #c8b38d;border-radius:50%;background:#fff6e2;color:#5c7050;font-size:25px}#tg-ready-count{font-size:11px;min-width:52px;text-align:right;color:#7a765c}.tg-dialog .tg-primary{min-height:44px;padding:8px;border:1px solid #c89927;border-radius:11px;background:linear-gradient(#ffe77a,#efb824);color:#574010;font-size:14px;font-weight:850;box-shadow:inset 0 1px #fff4bc}
#together-match{position:fixed;z-index:15;inset:var(--ncq-top) var(--ncq-right) var(--ncq-bottom) var(--ncq-left);width:min(560px,calc(100% - var(--ncq-left) - var(--ncq-right)));margin:auto;display:flex;flex-direction:column;justify-content:center;padding:8px 10px;color:#fff8df;font-family:'Jangi Noto Sans KR',sans-serif}
.tg-player{position:relative;flex:none;height:56px;min-height:56px;padding:0;overflow:hidden;border-radius:13px}.tg-far{transform:rotate(180deg);justify-content:center}.tg-undo{min-width:146px;min-height:46px;padding:9px 14px;border:2px solid #b9b58b;border-radius:13px;background:linear-gradient(#e9dfc8,#cec5ac);color:#536249;font-size:16px;line-height:1.25;font-weight:850;box-shadow:0 3px 4px #00150977}.tg-player[data-active] .tg-undo{background:linear-gradient(#d65c41,#aa3427);border-color:#e3d063;color:#fff5df;box-shadow:0 0 8px #e3d06377,0 3px 4px #00150977}.tg-player .tg-undo:disabled{opacity:.75}.tg-round-button{display:grid;place-items:center;flex:none;min-width:44px;min-height:44px;padding:7px;border:1px solid #b7b18b;border-radius:12px;background:#efe4c7;color:#435d38;font-size:25px;line-height:1}.tg-round-button img{width:24px;height:24px;object-fit:contain}
#tg-board-slot{display:grid;place-items:center;flex:none;width:100%;min-height:0}#tg-board{position:relative;width:min(100%,calc(var(--tg-board-height,400px) * .9));aspect-ratio:9/10;margin:0;flex:none}#tg-grid{position:absolute;inset:3%;width:94%;height:94%;display:grid;grid-template:repeat(10,minmax(0,1fr))/repeat(9,minmax(0,1fr));container-type:inline-size}#tg-grid .cell{position:relative;display:grid;place-items:center;min-width:0;min-height:0;padding:0;border:0;border-radius:0;box-shadow:none;background:transparent}#tg-grid .cell:disabled{opacity:1}#tg-grid .stone{left:50%;top:50%;transform:translate(-50%,-50%);z-index:2}#tg-grid .stone-shadow{position:absolute;left:50%;top:53%;transform:translate(-50%,-50%);width:103%;aspect-ratio:1;background:radial-gradient(closest-side,#291d0b80,transparent)}#tg-grid .cell[data-stone='2'] .jangi-glyph{transform:translateY(.06em) rotate(180deg)}#tg-board[data-turn='2'] .jangi-threat-speech{rotate:180deg}#tg-after{flex:none;display:flex;justify-content:center;gap:8px}#tg-after button{min-height:44px;padding:8px 14px;border:1px solid #cfb766;border-radius:10px;background:#efe6c9;color:#36542d;font-weight:800}
.tg-dialog.tg-small{height:fit-content;max-height:calc(100dvh - var(--ncq-top) - var(--ncq-bottom) - 24px);width:min(400px,calc(100vw - var(--ncq-left) - var(--ncq-right) - 24px));container-type:normal;overflow:auto}.tg-menu{display:flex;flex-direction:column;gap:10px;padding:4px}.tg-menu h2{font-size:20px;line-height:1.25;text-align:center}.tg-menu p{font-size:13px;line-height:1.5}.tg-menu>button,.tg-buttons button{min-height:44px;padding:9px 12px;border:1px solid #c2b38c;border-radius:9px;background:#fff8e5;color:#3e5d35;font-size:14px;font-weight:750}.tg-buttons{display:flex;gap:8px}.tg-buttons button{flex:1;min-width:0}.tg-small[data-side='2'] .tg-menu{transform:rotate(180deg)}
#tg-grid .tg-last{position:absolute;inset:4%;border:2px solid #e0b936;border-radius:6px;background:#ffe97722;pointer-events:none;z-index:1}
@container(max-height:600px){.tg-dialog .tg-formation-shell{gap:5px}.tg-side{gap:5px;padding:0}.tg-side header p{display:none}.tg-side h3{font-size:14px}.tg-side .tg-king{width:27px;height:27px;font-size:20px}.tg-choices{grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}.tg-choices button{min-height:48px;padding:3px}.tg-choices button[aria-pressed=true]{padding:2px}.tg-choice-pieces{display:grid;grid-template-columns:repeat(2,1fr);gap:1px}.tg-choice-pieces .stone{width:19px;height:19px;font-size:14px}.tg-choice-pieces .stone:nth-child(3){margin:0}.tg-choice-label{display:none}.tg-divider{padding-block:4px}.tg-divider h2{font-size:16px}}
@media(max-height:600px){#together-match{padding-block:4px;gap:3px}.tg-player{height:52px;min-height:52px}.tg-undo{min-height:44px}}

.tg-auto-start{flex:none;margin:0;text-align:center;font-size:12px;line-height:1.4;color:#657254}

/* Keep controls and captured pieces with the board, centered in the safe area. */
#tg-table{display:flex;flex:none;flex-direction:column;align-items:center;gap:6px;width:100%}
#tg-table>.tg-player,#tg-table>.tg-captured{width:min(100%,max(300px,calc(var(--tg-board-height,400px) * .9)))}


#tg-table>.tg-captured{--capture-size:24px;flex:none;height:32px;min-height:32px;padding:0;gap:8px;border:0;background:none;box-shadow:none}
.tg-captured .jangi-captured-token .stone{font-size:18px}
.tg-dialog#together-confirm{height:min(240px,calc(100dvh - var(--ncq-top) - var(--ncq-bottom) - 24px))}
#together-confirm .tg-menu{height:100%;justify-content:center}
#together-confirm .tg-menu h2{font-size:18px}
#together-confirm .tg-menu p{overflow-wrap:anywhere}

/* The approved controls share a centered undo column in both orientations. */
.tg-controls{display:grid;grid-template-columns:minmax(0,1fr) min(146px,calc(100% - 184px)) minmax(0,1fr);align-items:center;height:100%}
.tg-controls[inert]{visibility:hidden;pointer-events:none}
.tg-controls-left{justify-self:start;display:flex;align-items:center}
.tg-controls-right{justify-self:end;display:flex;align-items:center;gap:4px}
.tg-controls-far{justify-self:end;align-self:end}
.tg-controls>.tg-undo{min-width:0;width:100%;padding:9px 4px;white-space:nowrap}
.tg-slide-actions{position:absolute;inset:0;z-index:3;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:3px;border:1px solid #789063;border-radius:13px;background:#174f35;color:#36583c;transform:translateY(110%);visibility:hidden;pointer-events:none;transition:transform 280ms cubic-bezier(.2,.8,.2,1),visibility 0s linear 280ms}
.tg-slide-actions[data-open='true']{transform:translateY(0);visibility:visible;pointer-events:auto;transition-delay:0s}
.tg-slide-actions button{min-width:0;min-height:44px;padding:5px 2px;border:1px solid #c0b58b;border-radius:9px;background:linear-gradient(#fff6da,#e6d9b7);color:#36583c;font:750 14px/1.25 'Jangi Noto Sans KR',sans-serif;box-shadow:none}
.tg-slide-actions [data-together='resign']{border-color:#ba8e6b;background:linear-gradient(#fae4c8,#e8ceb0);color:#a32e25}
.tg-slide-actions [data-together='close-actions']{border-color:#a9bb98;background:#d2dcc4}
