:root{color-scheme:dark;font-family:Inter,Arial,sans-serif;color:#eee9df;background:#101a28;--ink:#101a28;--cream:#f3e8d0;--muted:#b2bfcf;--gold:#e8bc77;--line:#ffffff20}*{box-sizing:border-box}body{margin:0;min-height:100vh;background:radial-gradient(ellipse at 75% 0,#2d425f88,transparent 70%)}button,input,select{font:inherit}button,a,input,select{ -webkit-tap-highlight-color:transparent}button{border:1px solid #8eabc044;border-radius:8px;background:#33475f;color:#f5eddc;padding:10px 14px;cursor:pointer;min-height:44px}button:hover:enabled{background:#415b78}button:disabled{opacity:.4;cursor:default}button.primary{background:#edc183;color:#142035;border-color:#edc183}a{color:inherit;text-decoration:none}a:hover{text-decoration:underline}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #e8bc77;outline-offset:3px}input,select{min-width:0;width:100%;padding:12px;border:1px solid #7892aa66;border-radius:7px;background:#101c2e;color:#fff}label{display:grid;gap:7px;font-size:12px;color:#becada}header{height:80px;display:flex;align-items:center;justify-content:space-between;padding:0 4vw;border-bottom:1px solid var(--line)}.brand{font-family:monospace;font-size:19px;letter-spacing:1px}.brand span{color:#e8bc77}#connection{font-size:12px;color:#b3c8d9}.eyebrow{font-size:11px;font-weight:bold;color:#e8bc77;letter-spacing:2px;margin:0 0 9px}#lobby{max-width:1050px;margin:auto;padding:64px 24px}h1{font-size:clamp(40px,6vw,68px);font-family:Georgia,serif;font-weight:400;line-height:1.07;margin:0 0 22px}.intro{color:#bdc9d8;margin-bottom:32px;line-height:1.6}.panel{background:#26384be0;border:1px solid #91a5ba44;border-radius:14px;padding:20px;box-shadow:0 10px 25px #0001}.welcome{max-width:600px;display:grid;gap:18px}.join{display:grid;grid-template-columns:1fr auto;align-items:end;gap:12px}.solo-heading{margin-top:38px}.solo{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.solo a{padding:18px;background:#24364a;border-radius:12px;border:1px solid #7c99ae44}.solo a:nth-child(2){color:#edc183}.solo a:nth-child(3){color:#f7a5a5}.solo a:nth-child(4){color:#91d2e4}#room{max-width:1600px;margin:auto;padding:24px 30px 48px}.room-heading{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:14px}#roomCode{font-family:monospace;font-size:23px;letter-spacing:3px}.tools{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.room-grid{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:22px}.table-column,.social{min-width:0}.social{display:flex;flex-direction:column;gap:16px}.picker{display:flex;flex-wrap:wrap;gap:12px;align-items:end;margin-bottom:14px}.picker label{flex:1 1 100px}.seating{margin-bottom:16px}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}h2{font-size:17px;margin:0 0 12px}.section-heading span,#gameStatus{font-size:12px;color:var(--muted)}#seats{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0 12px}#seats button{flex:1 1 120px}.empty-table{min-height:320px;border:1px dashed #8799ae55;border-radius:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#c3d0df;text-align:center}.empty-table>span{font-size:42px;color:#edc183;letter-spacing:14px;margin-bottom:24px}.empty-table p{font-size:13px}#members{padding:0;margin:0;list-style:none;display:grid;gap:10px}#members li{display:flex;justify-content:space-between;gap:8px;font-size:13px}#members small{color:#abb9c9}#chatMessages{list-style:none;padding:0;margin:0 0 15px;max-height:280px;min-height:120px;overflow:auto;font-size:13px;overflow-wrap:anywhere}#chatMessages li{padding:8px 0;border-bottom:1px solid #ffffff0b;white-space:pre-wrap}#chatMessages .notice{color:#b0bdcc;font-size:12px}#chatMessages strong{color:#ebc88e;display:block;margin-bottom:3px}#chatForm{display:flex;gap:7px}#chatForm input{flex:1}#videos{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-bottom:10px}#videos figure{margin:0;min-width:0;position:relative;border-radius:8px;overflow:hidden;background:#111c2e}#videos video{width:100%;aspect-ratio:4/3;object-fit:cover;display:block}#videos figcaption{font-size:10px;padding:4px 6px}#roomError,#entryError,#callError{font-size:13px;color:#ffbfad;white-space:pre-wrap}#roomError:empty,#entryError:empty,#callError:empty{display:none}dialog{max-width:440px;width:calc(100% - 40px);border:1px solid #a6b6c677;border-radius:16px;background:#24364a;color:#f7ecd7;padding:24px}dialog::backdrop{background:#000a}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.game-actions{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0}.game-status{font-size:14px;margin:12px 0;color:#e8c58e}.game-result{font:28px Georgia,serif;padding:14px;text-align:center;background:#172536;border:1px solid #e8bc77;border-radius:12px;margin:10px 0}.game-result:empty{display:none}[hidden]{display:none!important}@media(max-width:850px){.room-grid{grid-template-columns:minmax(0,1fr)}.social{display:grid;grid-template-columns:1fr 1fr}.chat-panel{grid-column:1/-1}#room{padding:16px}.room-heading{align-items:start}.tools{gap:6px}}@media(max-width:520px){header{height:66px;padding:0 16px}.brand{font-size:15px}#connection{font-size:10px}#lobby{padding:36px 20px}.solo{grid-template-columns:1fr 1fr}.solo a{padding:15px;font-size:13px}#room{padding:12px}.room-heading{flex-direction:column}.panel{padding:15px}.social{display:flex}.picker{gap:8px}button{font-size:13px;padding:9px 12px}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
.icon{width:22px;height:22px;display:block;flex:none}.icon-button{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:10px}.icon-button[aria-pressed=true]{border-color:var(--gold);background:#536177;box-shadow:inset 0 0 0 1px var(--gold)}.game-icons{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;width:100%}.game-icons button{min-height:64px}.game-icons .icon{width:32px;height:32px}.game-icons button:nth-child(1){color:#e8d6b9}.game-icons button:nth-child(2){color:#edc183}.game-icons button:nth-child(3){color:#f7a5a5}.game-icons button:nth-child(4){color:#91d2e4}#seats button{display:flex;align-items:center;justify-content:center;gap:10px}#seats .icon{width:26px;height:26px}.game-options{display:grid;gap:14px;margin-bottom:18px}#rulesPanel{margin-top:20px;border-top:1px solid var(--line);padding-top:10px}#rulesList{padding-left:20px;font-size:14px;line-height:1.55}#rulesList li{margin-bottom:10px}#gamePicker{max-height:85vh;overflow:auto}#pickerNote{color:var(--muted);font-size:12px}.room-heading .tools{flex-wrap:nowrap}@media(max-width:520px){.room-heading{flex-direction:row;align-items:center;gap:8px}.room-heading .tools{gap:4px}.room-heading .icon-button{padding:8px}.game-icons{gap:8px}}
/* Raised, softly lit controls; the Chess call artwork remains unchanged. */
.icon-button{position:relative;border:1px solid #9fb8d14d;border-top-color:#dcecff70;border-bottom-color:#101b2f;background:linear-gradient(155deg,#60758d 0%,#3b5069 44%,#24364e 100%);box-shadow:inset 0 1px 0 #fff2,0 3px 0 #132035,0 6px 12px #0003;border-radius:13px;transition:transform .16s,box-shadow .16s,filter .16s;color:#e9e6e1}.icon-button .icon{filter:drop-shadow(0 1px 1px #0006)}.icon-button:hover:enabled{background:linear-gradient(155deg,#748da5,#496480 55%,#304760);transform:translateY(-2px);box-shadow:inset 0 1px 0 #fff3,0 4px 0 #132035,0 9px 18px #0004}.icon-button:active:enabled{transform:translateY(2px);box-shadow:inset 0 1px 4px #0003,0 1px 0 #132035}.icon-button[aria-pressed=true]{background:linear-gradient(145deg,#8d704e,#554c49 60%,#3d3e4c);border-color:#efc88c;box-shadow:inset 0 1px 0 #ffe7bd66,0 3px 0 #302937,0 0 16px #e8bc771c}.game-icons button{min-height:78px;border-radius:17px;background:radial-gradient(ellipse at 45% 0,#7e94a66b,transparent 75%),linear-gradient(150deg,#405974,#26384f);overflow:hidden}.game-icons .icon{width:43px;height:43px;stroke-width:1.3;filter:drop-shadow(0 3px 2px #0006)}.game-icons button:nth-child(2){background:radial-gradient(ellipse at 40% 0,#b58b6a66,transparent 75%),linear-gradient(150deg,#554754,#2b3042)}.game-icons button:nth-child(3){background:radial-gradient(ellipse at 40% 0,#ac7c9666,transparent 75%),linear-gradient(150deg,#564157,#302c42)}.game-icons button:nth-child(4){background:radial-gradient(ellipse at 40% 0,#65a6b666,transparent 75%),linear-gradient(150deg,#34576b,#25384d)}#leaveRoom,#leaveCall{color:#ffd0c8}#seats button{background:linear-gradient(150deg,#40556c,#283a50);border-radius:12px;box-shadow:inset 0 1px 0 #ffffff18,0 3px 0 #172538}#seats .icon{color:#e6c99f;filter:drop-shadow(0 2px 1px #0005)}

.native-game{display:block;width:100%;height:850px;border:0;border-radius:16px;background:transparent}.native-game-root{min-width:0;width:100%}

#room[data-playing=true] .seating{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px}#room[data-playing=true] .seating #seats{display:none}#room[data-playing=true] .seating .section-heading{gap:14px}#room[data-playing=true] .seating h2{margin:0}#room[data-playing=true] .picker{padding:12px}#room[data-playing=true] .game-icons button{min-height:54px}#room[data-playing=true] .game-icons .icon{width:32px;height:32px}@media(max-width:520px){#room[data-playing=true] .seating{flex-wrap:wrap}}

.offline-hint{color:var(--muted);font-size:14px;margin:8px 0 18px}.solo a.icon-button{display:flex;align-items:center;justify-content:center;min-height:84px;border-radius:18px;background:linear-gradient(145deg,#465d78,#24364a);box-shadow:inset 0 1px 2px #ffffff35,0 5px 0 #0c1728}.solo a .icon{width:44px;height:44px;filter:drop-shadow(0 3px 2px #0006)}

#savedGames{width:100%;margin-top:10px}#savedDialog{width:min(620px,94vw);max-height:85vh;overflow:auto}#savedList{padding:0;margin:10px 0;list-style:none;display:grid;gap:2px;font-size:13px;line-height:1.35}#savedList li{display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid var(--line);padding:6px 0}#savedList li div{min-width:0;overflow-wrap:anywhere}#savedList small{display:block;font-size:11px;color:var(--muted);margin-top:2px}#savedList button{font-size:12px;padding:6px 10px}#savedStatus{font-size:12px;margin:8px 0}#savedNote{margin:8px 0}#savedNote,#replayNote{font-size:13px;color:var(--muted)}#replayControls{margin-bottom:14px}#replayControls .tools{justify-content:center}#replayPosition{min-width:70px;text-align:center}#replayRange{padding:0;margin-top:10px}#replayTitle{overflow-wrap:anywhere}

.seat-choice{display:flex;align-items:stretch;gap:4px}.seat-choice .computer-seat{padding:9px;min-width:42px}.seat-choice .computer-seat .icon{width:22px;height:22px}#localHandoff{text-align:center;margin:12px 0}#localHandoff p{margin:0 0 12px}#seats:empty{display:none}

#savedAdmin{border-top:1px solid #ffffff26;margin-top:16px;padding-top:14px}#savedAdminLogin{display:flex;gap:10px;align-items:end}#savedAdminLogin label{flex:1;min-width:0}#savedAdminStatus{font-size:13px;color:#dec78e}[data-delete-saved] .icon{width:19px;height:19px}#savedList .danger{padding:10px;min-width:40px}#savedAdminActions{flex-wrap:wrap}

#analyzeGame{width:100%}.analysis-options{display:grid;gap:12px}.analysis-options #savedGames{margin:0}#analysisControls{margin-bottom:14px}#analysisNote{font-size:13px;color:var(--muted)}
#seats .seat-choice{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px;border:1px solid var(--line);border-radius:14px;background:#17283b;min-width:120px;flex:1 1 120px;max-width:220px}#seats .seat-heading{display:flex;align-items:center;gap:8px;font-size:14px}#seats .seat-heading .icon{width:19px;height:19px}#seats .seat-options{display:flex;gap:10px;justify-content:center}#seats .seat-options button{flex:none;width:48px;height:48px;padding:10px}#seats .seat-options button[aria-pressed=true]{border-color:var(--gold);background:#66563e;opacity:1}#seats .seat-choice small{max-width:160px;overflow-wrap:anywhere;color:var(--muted)}.seat-computer{display:flex;align-items:center;padding:10px}

#savedList .saved-actions{display:flex;gap:6px;flex-wrap:wrap;flex-shrink:0}#savedList li>div:first-child{flex:1}@media(max-width:520px){#savedList .saved-actions{flex-direction:row;max-width:152px}#savedList li{gap:8px}}

.status-indicator{--status-color:#91a0b2}.status-indicator[data-tone=good]{--status-color:#63db92}.status-indicator[data-tone=bad]{--status-color:#ff7e7e}.status-indicator[data-tone=waiting]{--status-color:#efc06c}.status-indicator:not(:empty)::before{content:"";display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--status-color);box-shadow:0 0 0 2px color-mix(in srgb,var(--status-color) 15%,transparent);margin-right:7px;vertical-align:middle;flex:none}

.pinned-message{display:flex;align-items:flex-start;gap:16px;justify-content:space-between;margin:0 0 18px;border-color:#e8bc7780;background:linear-gradient(120deg,#454237,#26384b)}.pinned-copy{min-width:0}.pinned-label{font-size:12px;color:var(--gold)}#pinnedText{margin:8px 0 0;white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.5}#unpinMessage{flex-shrink:0}#chatMessages li:not(.notice){display:flex;align-items:flex-start;gap:8px}.chat-message{flex:1;min-width:0;overflow-wrap:anywhere}#chatMessages .chat-pin{flex-shrink:0;min-width:36px;min-height:36px;padding:8px;border-radius:9px}#chatMessages .chat-pin .icon{width:18px;height:18px}

#members li{align-items:center;flex-wrap:wrap}#members .host-handoff{font-size:11px;padding:5px 8px;min-height:32px;margin-left:auto}

#activityMessages{list-style:none;padding:0;margin:0;max-height:180px;overflow:auto;font-size:12px;line-height:1.4;color:var(--muted);overflow-wrap:anywhere}#activityMessages li{padding:6px 0;border-bottom:1px solid #ffffff0b;white-space:pre-wrap}@media(max-width:850px){.activity-panel{grid-column:1/-1}}
/* Keep entry controls readable and contained when the mobile keyboard opens. */
.join{grid-template-columns:minmax(0,1fr) auto}.join>label,.welcome{min-width:0}#joinRoom{white-space:nowrap}@media(max-width:850px){input,select,textarea{font-size:16px}}

/* Keep the call first in reading order and above the board on small screens. */
.room-grid{align-items:start}.table-column{grid-column:1;grid-row:1 / span 2}.room-grid>.call-panel{grid-column:2;grid-row:1}.social{grid-column:2;grid-row:2}
@media(max-width:850px){.room-grid>.call-panel{grid-column:1;grid-row:1}.table-column{grid-column:1;grid-row:2}.social{grid-column:1;grid-row:3}}

#leaveCall{margin-left:auto;background:#b52e3b;border-color:#ed6b75;color:#fff}#leaveCall:hover:enabled{background:#cf3947}

#videos .voice-only{display:flex;align-items:center;gap:7px;padding:6px 0;background:none;border-radius:0}#videos .voice-only figcaption{padding:0;overflow-wrap:anywhere}#videos .voice-icon{display:inline-flex;color:var(--muted)}#videos .voice-icon .icon{width:20px;height:20px}

.game-icons{grid-template-columns:repeat(5,minmax(0,1fr))}@media(max-width:520px){.game-icons{grid-template-columns:repeat(3,minmax(0,1fr))}}

.game-icons{grid-template-columns:repeat(6,minmax(0,1fr))}@media(max-width:520px){.game-icons{grid-template-columns:repeat(3,minmax(0,1fr))}}

.empty-games{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:20px;width:min(100%,620px);padding:22px;margin-bottom:14px}.empty-game{display:flex;flex-direction:column;align-items:center;gap:10px;min-width:0}.empty-game .icon{width:38px;height:38px;color:#edc183}.empty-game span{font-size:11px;letter-spacing:0;color:#c3d0df}.empty-table p{padding:0 14px;line-height:1.5}@media(max-width:600px){.empty-games{grid-template-columns:repeat(3,minmax(0,1fr));gap:20px 12px;max-width:340px;padding:22px 12px}.empty-game .icon{width:32px;height:32px}}

.board-stage{position:relative;isolation:isolate;min-width:0}
#winnerMessage{position:absolute;z-index:2;top:50%;left:50%;transform:translate(-50%,-50%);margin:0;width:max-content;max-width:calc(100% - 24px);padding:16px 24px;border:2px solid #f6cf83;border-radius:16px;background:#16283bf5;color:#ffe6ae;box-shadow:0 8px 32px #0009;text-align:center;font-size:clamp(21px,3vw,34px);font-weight:800;overflow-wrap:anywhere;pointer-events:none}
#winnerMessage[data-celebrate=true]{animation:winner-pulse 1.8s ease-in-out infinite}
@keyframes winner-pulse{50%{opacity:.72;box-shadow:0 8px 36px #e8bc7766}}
@media(prefers-reduced-motion:reduce){#winnerMessage{animation:none}}

#savedList .saved-actions{gap:4px;flex-wrap:nowrap}#savedList .saved-actions .icon-button{width:32px;min-width:32px;height:32px;min-height:32px;padding:6px;border-radius:8px}#savedList .saved-actions .icon{width:18px;height:18px}

.entry-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.entry-option{display:flex;flex-direction:column;min-width:0;padding:18px;border:1px solid var(--line);border-radius:10px;background:#101c2e66}.entry-option h2{margin:0 0 6px}.entry-option p{margin:0 0 18px;color:var(--muted);font-size:13px;line-height:1.5}.entry-option>button,.entry-option>.join{margin-top:auto}.entry-option .join{grid-template-columns:minmax(0,1fr);gap:10px}.welcome input{font-size:16px}@media(max-width:600px){.entry-options{grid-template-columns:minmax(0,1fr);gap:14px}.entry-option{padding:15px}.entry-option p{margin-bottom:12px}.entry-option .join{grid-template-columns:minmax(0,1fr) auto}}

/* The room bell: a waving hand with the name of whoever rang it. */
.bell-banner { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; padding: 8px 10px; border: 1px solid #efc88c; border-radius: 10px; background: #45423a; color: #ffe7bd; font-size: 14px; }
.bell-banner[hidden] { display: none; }
.bell-banner .bell-hand { display: inline-block; font-size: 20px; line-height: 1; transform-origin: 70% 70%; }
.bell-banner.ringing .bell-hand { animation: bell-wave 1.5s ease-in-out 2; }
@keyframes bell-wave { 0%, 60%, 100% { transform: rotate(0deg); } 10%, 30%, 50% { transform: rotate(-18deg); } 20%, 40% { transform: rotate(14deg); } }
@media (prefers-reduced-motion: reduce) { .bell-banner.ringing .bell-hand { animation: none; } }
