/* 3D online Royal Chess – dark on dark panels; no white on white, no overlays. */
:root{color-scheme:dark;--ink:#f6f4ff;--muted:#c2c9d9;--accent:#e52d52}
html,body{min-height:100%;background:#0e1023;color:#f5f6fb}
.board-app{background:radial-gradient(circle at 45% 0%,#222643,#111421 65%);min-height:100dvh}
.board-top{background:#14192a;border-color:#414b65;color:#fff;flex-wrap:wrap;gap:8px}
.board-brand strong,.board-brand small,.top-status b{color:#fff}
.board-brand small,.top-status{color:#c6ccde}
.board-brand i{color:#f5cf66;background:#302a40}
.royal-back{display:inline-flex;align-items:center;min-height:38px;padding:8px 11px;border:1px solid #59627f;border-radius:10px;color:#fff;text-decoration:none;font-weight:700;font-size:12px}
.royal-back:hover{background:#323653;color:#fff}
.board-stage{width:min(1500px,100%);grid-template-columns:minmax(0,1fr) minmax(280px,360px)}
.game-card,.panel{background:#171d30;border:1px solid #3c4563;color:#fff}
.game-card-head{background:#21243a}
.game-card-head h1,.panel h2{color:#fff}
.turn-pill{color:#fff;background:#30334d;border-color:#676c89}
.royal-board-wrap{padding:12px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:9px;min-width:0}
.royal-three-board{width:min(100%,720px);aspect-ratio:1.18;position:relative;overflow:hidden;border:2px solid #6e5a47;border-radius:14px;background:radial-gradient(circle at 55% 65%,#2c2b49,#0e1024 75%);box-shadow:0 12px 40px #0007}
.royal-three-board canvas{display:block;width:100%;height:100%;touch-action:none;cursor:grab}
.royal-three-board canvas:active{cursor:grabbing}
.royal-three-board:empty{display:none}
#royal-three-loading{color:#d8dff1;font-size:13px}
#board{width:min(95%,660px);}
.board-wrap.royal-3d-ready #board{display:none!important}
.board-wrap.royal-3d-ready #royal-three-loading{display:none!important}
.royal-views{display:flex;justify-content:center;flex-wrap:wrap;gap:8px;padding:8px 12px 12px}
.royal-views button{font-size:13px;color:#fff;background:#323754;border:1px solid #7a819e;border-radius:10px;padding:8px 11px;min-height:38px;cursor:pointer}
.royal-views button:focus-visible,.royal-views button:hover{background:#485079;outline:2px solid #edcb6e}
.panel .panel-body,.panel h2,.board-footer,.panel small{color:#e3e8f5}
.mode-button{background:#303951;color:#fff;border:1px solid #68748d}
.mode-button small,.dialog p{color:#dbe3f0}
.mode-button:hover{background:#39435d}
.button{background:#e92b51;color:#fff;box-shadow:0 5px 14px #ef31502a}
.button.secondary{background:#323c53;border:1px solid #758098;color:#fff}
.room-code{color:#ffe69d;background:#252a3f}
#roomBody .player-card,.stats-grid div{background:#292f45;color:#fff}
.chat-message{color:#fff}
.chat-message small{color:#dde3ee}
.dialog{color:#fff}
@media(max-width:1000px){.board-stage{grid-template-columns:1fr;gap:9px;padding:10px}.royal-three-board{width:min(100%,680px)}.side-column{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}}
@media(max-width:700px){.board-top{padding:9px 11px}.board-stage{padding:7px}.board-brand strong{font-size:14px}.royal-back{font-size:11px}.royal-board-wrap{padding:6px}.royal-three-board{width:100%;aspect-ratio:1.04;border-radius:8px}.side-column{grid-template-columns:1fr}.royal-views{gap:5px;padding:5px 7px 9px}.royal-views button{padding:6px 8px;font-size:11px;min-height:34px}.game-card-head h1{font-size:17px}.mode-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.board-footer{flex-wrap:wrap}.chat-log{height:160px}}
@media(max-width:365px){.royal-back{padding:6px}.board-brand i{display:none}.royal-three-board{aspect-ratio:1}.royal-views button{font-size:10px}.board-brand strong{font-size:12px}}
