:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,'Segoe UI',Arial,sans-serif;color-scheme:dark;--bg:#101824;--panel:#1c2838;--edge:#314256;--muted:#a5b5c4;--text:#f3f6fa;--red:#ff697c;--blue:#67b8ff;--yellow:#ffd56e;--green:#54e2b0;--light:#dfe4d5;--dark:#75977e}
*{box-sizing:border-box}[hidden]{display:none!important}
body{margin:0;min-height:100vh;background:radial-gradient(ellipse at 30% 0%,#253b47 0%,var(--bg) 65%);color:var(--text)}
button,input,select{font:inherit}button{cursor:pointer}button:disabled,select:disabled{opacity:.44;cursor:default}button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #9bdfcb;outline-offset:2px}
.page{max-width:1600px;margin:0 auto;padding:21px clamp(12px,2.4vw,34px)}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:20px;padding-bottom:19px;border-bottom:1px solid #304052}
.brand{display:flex;align-items:center;gap:14px}.logo{height:58px;width:58px;display:grid;place-items:center;background:transparent;border-radius:0;box-shadow:none}.brand strong{font-size:23px;letter-spacing:.08em;color:#f3f8ff}.brand strong span{color:#b9d0e8}.brand small{display:block;color:var(--muted);font-size:11px}
.header-actions{display:flex;gap:10px;flex-wrap:wrap}
.button{border:1px solid transparent;border-radius:10px;padding:11px 15px;font-size:13px;font-weight:750;transition:background .15s,transform .12s}.button:active{transform:translateY(1px)}.button.outline{background:#1d2c3d;border-color:#3d5267;color:var(--text)}.button.outline:hover:not(:disabled){background:#2a4051}.button.primary{background:#9de5c3;color:#16322c}.button.primary:hover:not(:disabled){background:#b4f5d8}.button.full{width:100%}.button.danger{color:#ffc2c8}
.main-layout{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:25px;padding-top:25px;align-items:start}.game-panel{min-width:0}.game-header{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:3px 2px 18px}.eyebrow{font-size:10px;font-weight:800;letter-spacing:.17em;color:#aac4df}.game-mode-big{display:block;font-size:13px;letter-spacing:.22em;color:#d9e9fb}.game-header h1{margin:5px 0 0;font-size:clamp(22px,2.5vw,32px);letter-spacing:-.035em}.room-tag{display:flex;align-items:center;gap:9px;border:1px solid #36556a;background:#1c3040;color:#c4e7dc;border-radius:22px;padding:10px 12px;font-size:12px;font-weight:650;white-space:nowrap}.pulse{width:7px;height:7px;display:inline-block;border-radius:50%;background:#71deb0;box-shadow:0 0 0 3px #71deb021}
.board-wrapper{position:relative;max-width:900px;margin:auto;border:1px solid #41526b;background:#263748;padding:8px;border-radius:12px;box-shadow:0 20px 50px #0005}.board,.editor-board{display:grid;grid-template-columns:repeat(14,minmax(0,1fr));grid-template-rows:repeat(14,minmax(0,1fr));width:100%;aspect-ratio:1;user-select:none}.square,.cutout{min-width:0;min-height:0}.square{border:0;position:relative;display:grid;place-items:center;padding:0;outline-offset:-3px;touch-action:manipulation}.square.light{background:var(--light)}.square.dark{background:var(--dark)}.square:hover{filter:brightness(1.08)}.cutout{background:#263748}.square.last-move{background:#c2bf6e}.square.last-move.dark{background:#a2a45b}.square.selected{box-shadow:inset 0 0 0 3px #fef4a7;z-index:2}.square.queued{box-shadow:inset 0 0 0 3px #fda94f;z-index:2}.square.king-check{box-shadow:inset 0 0 0 3px #ed5265}.square.can-move:after{content:"";position:absolute;width:25%;aspect-ratio:1;border-radius:50%;background:#121d2b65;z-index:2}.square.can-take:after{content:"";position:absolute;inset:3%;border:4px solid #b34a52a6;border-radius:50%;z-index:3}.piece{display:grid;place-items:center;position:relative;z-index:1;width:83%;height:83%;font-family:Georgia,'DejaVu Sans',serif;font-size:clamp(16px,3.2vw,46px);font-weight:500;line-height:1;filter:drop-shadow(0 1px 2px #080f15b8);text-shadow:0 1px #142029,1px 0 #142029,-1px 0 #142029,0 -1px #142029}.piece.red{color:var(--red)}.piece.blue{color:var(--blue)}.piece.yellow{color:var(--yellow)}.piece.green{color:var(--green)}.piece.dead{color:#89919e;opacity:.55}
.piece.skin-classic{background:transparent}.piece.skin-royal{border-radius:7px;border:1px solid #ffedc38c;background:linear-gradient(145deg,#243c47eb,#0b1924e8);font-weight:bold;filter:drop-shadow(0 2px 2px #0009)}.piece.skin-neon{border:1px solid currentColor;border-radius:50%;background:#101928;box-shadow:0 0 8px currentColor,inset 0 0 11px #ffffff18;text-shadow:0 0 7px currentColor}.piece.skin-wood{background:radial-gradient(circle at 30% 24%,#80614f,#30291f 76%);border:2px solid #dbc5a15c;border-radius:50%;text-shadow:0 2px 2px #0009}.piece.skin-minimal{font-family:ui-sans-serif,system-ui,sans-serif;font-weight:900;font-size:clamp(13px,2.6vw,37px);border-radius:11px;background:#13202d;letter-spacing:-.08em;border:2px solid currentColor;text-shadow:none}
.coord{position:absolute;color:#2d4037;font-size:clamp(6px,.7vw,11px);font-weight:750;opacity:.68;pointer-events:none;z-index:4}.coord.file{bottom:2px;right:3px}.coord.rank{top:2px;left:3px}.board-loading{position:absolute;z-index:5;left:50%;top:50%;transform:translate(-50%,-50%);width:min(80%,360px);padding:25px;color:#edf6f5;text-align:center;border:1px solid #48677e;background:#142533f0;border-radius:16px;box-shadow:0 12px 30px #0008;font-size:15px;font-weight:750}.board-footer{display:flex;justify-content:space-between;gap:15px;padding:13px 6px;color:#d4e3ea;font-size:13px}.subtle{color:var(--muted)}.premove-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px;margin:5px 0;border:1px solid #a17f56;background:#3c342a;border-radius:10px;font-size:13px}
.sidebar{display:flex;flex-direction:column;gap:13px}.side-card{padding:18px;border:1px solid #2f4357;border-radius:14px;background:#1b2939;box-shadow:0 7px 15px #0002}.section-top{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:13px}.section-top h3{font-size:16px;margin:0}.section-top .side-note,.side-note{font-size:11px;color:#9eaec1}.small-indicator{font-size:11px;color:#b9cfe1;border-radius:12px;background:#2c3d50;padding:5px 9px}.current-player{display:flex;gap:13px;align-items:center}.avatar,.player-avatar{display:grid;place-items:center;flex-shrink:0;border-radius:11px;font-size:27px;background:#122337;border:1px solid #35506a;width:44px;height:44px}.avatar.red,.player-avatar.red{color:var(--red)}.avatar.blue,.player-avatar.blue{color:var(--blue)}.avatar.yellow,.player-avatar.yellow{color:var(--yellow)}.avatar.green,.player-avatar.green{color:var(--green)}.avatar.neutral{color:#c6dbeb}.current-player h2{font-size:19px;margin:0 0 4px}.current-player p{font-size:11px;color:var(--muted);margin:0}.players{display:grid;gap:6px}.player-row{padding:9px 7px;display:flex;align-items:center;gap:10px;border:1px solid transparent;border-radius:9px}.player-row.playing{background:#2b4252;border-color:#405b70}.player-row.eliminated{opacity:.45}.player-avatar{width:34px;height:34px;font-size:24px;border-radius:9px}.player-info{flex:1;min-width:0}.player-name-line{display:flex;align-items:center;gap:6px;min-width:0}.player-info strong{display:block;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.seat-badge{display:inline-flex;align-items:center;gap:4px;flex-shrink:0;font-size:10px;font-weight:800;letter-spacing:.02em;color:#dbe8f6;background:#2b3f52;border:1px solid #456079;border-radius:999px;padding:3px 7px}.player-info small{display:block;font-size:10px;color:#9bacbd;line-height:1.5}.clock{font-size:15px;color:#eaf3fd;font-weight:800;font-variant-numeric:tabular-nums;font-family:ui-monospace,SFMono-Regular,Consolas,monospace}.clock.low-clock{color:#ff7885}.helper{font-size:12px;color:#aec1d1;line-height:1.55}.copy-code{width:100%;display:flex;justify-content:space-between;align-items:center;font-size:21px;font-weight:800;letter-spacing:.2em;color:#e9ffe9;border:1px dashed #648a7a;border-radius:9px;background:#253b44;padding:13px 17px;margin:10px 0}.tiny-badge{font-size:10px;color:#b9edd5;background:#29463c;padding:5px 8px;border-radius:5px}.options-summary{color:#adc5d1;font-size:11px;line-height:1.7;margin:12px 0}.appearance-card label{display:block;color:#b4c6d4;font-size:12px;margin:10px 0 6px}.appearance-card select{width:100%;margin-bottom:7px}.checkline{display:flex!important;align-items:center;gap:9px;line-height:1.5;cursor:pointer}.checkline input{accent-color:#7ce6b8;min-width:16px;min-height:16px}
.history-card{flex:1}.history{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:7px;min-height:150px;max-height:390px;overflow:auto}.history li{font-size:12px;color:#d1e0ec;background:#26384a;border-radius:7px;padding:9px 11px}.history .muted-item{color:#8ba1b4}.bottom-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px}.bottom-actions button{padding:10px 6px}.fineprint{font-size:11px;line-height:1.6;color:#8fa4b7;margin:0 3px}.footer{padding:24px 0 5px;text-align:center;color:#72859a;letter-spacing:.17em;font-size:10px}.footer span{color:#91e6c2}
.dialog{border:1px solid #425b70;background:#1b2b3b;color:white;box-shadow:0 25px 90px #0009;border-radius:18px;max-width:min(420px,calc(100% - 25px));width:100%;max-height:90vh;overflow:auto;padding:25px}.wide-dialog{max-width:min(750px,calc(100% - 25px))}.dialog::backdrop{background:#07121dcb;backdrop-filter:blur(4px)}.dialog-head{display:flex;align-items:center;justify-content:space-between;gap:20px}.dialog h2{font-size:23px;margin:0}.dialog h3{margin:5px 0 13px;font-size:16px}.dialog p{font-size:13px;color:#b9c9d6;line-height:1.6}.icon-button{border:0;background:transparent;color:#c3d2de;font-size:28px;line-height:1;padding:3px}.dialog label{display:block;margin-top:13px;font-size:12px;color:#c6d6e4}.dialog input:not([type=checkbox]),.dialog select,.appearance-card select{width:100%;background:#142334;color:#f4f7fa;border:1px solid #456075;padding:11px;border-radius:9px;margin-top:7px}.dialog select{cursor:pointer}.dialog .button.full{margin-top:15px}.form-error{color:#ff9fac!important;min-height:16px;font-size:12px!important}.settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 18px}.settings-section{margin-top:20px;padding-top:16px;border-top:1px solid #30485b}.preset-line{display:flex;flex-wrap:wrap;gap:8px}.preset-line .button{padding:8px 12px;font-size:11px}.settings-section .helper{margin:12px 0 0}.field{min-width:0}.field select{display:block}.editor-tools{display:flex;gap:10px;align-items:end;flex-wrap:wrap}.editor-tools label{flex:1;min-width:135px;margin:0}.editor-tools button{font-size:11px;padding:9px}.editor-board{max-width:500px;border:5px solid #263748;border-radius:7px;margin:13px auto 0}.editor-board .piece{font-size:clamp(11px,1.8vw,24px)}.editor-board .square{aspect-ratio:1}.editor-board .square:focus-visible{outline-offset:-2px}.promotion-choices{display:grid;grid-template-columns:1fr 1fr;gap:10px}.promotion-choices button{font-size:17px;padding:16px}.toast{position:fixed;bottom:20px;left:50%;transform:translate(-50%,12px);opacity:0;pointer-events:none;z-index:99;background:#294e50;color:#edfff6;border:1px solid #6aab9a;border-radius:12px;padding:13px 18px;max-width:min(500px,90vw);text-align:center;font-size:13px;transition:transform .2s,opacity .2s}.toast.visible{transform:translate(-50%,0);opacity:1}
@media(max-width:1140px){.main-layout{grid-template-columns:minmax(0,1fr) 287px;gap:15px}.side-card{padding:14px}.piece{font-size:clamp(15px,3vw,40px)}}
@media(max-width:870px){.main-layout{display:block}.board-wrapper{max-width:700px}.sidebar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));margin-top:15px}.history-card,.fineprint{grid-column:1/-1}.piece{font-size:clamp(16px,4.7vw,42px)}}
@media(max-width:560px){.page{padding:12px 6px}.topbar{display:block;padding:4px 5px 12px}.header-actions{margin-top:15px}.header-actions .button{flex:1;padding:10px 7px;font-size:11px}.game-header{padding:13px 4px}.game-header h1{font-size:22px}.room-tag{font-size:10px;padding:8px}.eyebrow{font-size:9px}.board-wrapper{padding:3px;border-radius:6px}.piece{font-size:clamp(13px,5.1vw,27px)}.piece.skin-minimal{font-size:clamp(10px,4vw,24px);border-width:1px;border-radius:4px}.piece.skin-royal,.piece.skin-wood{border-width:1px}.square.selected{box-shadow:inset 0 0 0 2px #fff4a0}.square.can-take:after{border-width:2px}.coord{font-size:6px}.sidebar{display:flex}.history{max-height:420px}.settings-grid{grid-template-columns:1fr 1fr;gap:2px 10px}.dialog{padding:16px}.dialog h2{font-size:20px}.dialog label{font-size:11px}.editor-board .piece{font-size:clamp(9px,3vw,20px)}.editor-tools button{font-size:10px}}

.square.can-castle:after{content:"";position:absolute;inset:5%;border:3px solid #3fd5a6;border-radius:50%;z-index:3}
/* BaldChess — responsive splash, themed figures, drag support. */
.welcome{position:fixed;z-index:20;inset:0;background:radial-gradient(ellipse at 50% 20%,#29475b,#111723 70%);display:flex;justify-content:center;align-items:center;overflow:auto;padding:24px}
.welcome-inner{text-align:center;width:min(820px,100%);margin:auto}
.welcome-mark{width:132px;height:132px;border-radius:0;background:transparent;color:#183b32;margin:0 auto 14px;display:grid;place-items:center;font-size:55px;box-shadow:none}
.welcome h1{font-size:clamp(54px,9vw,106px);line-height:1;margin:10px 0;letter-spacing:-.075em;font-weight:900;color:#f8fbff}
.welcome h1 span{color:#b8d0e8}
.welcome-inner>p{font-size:18px;color:#d8e7f6;margin:16px 0 27px}
.mode-cards{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin:0 auto 24px}
.mode-card{color:inherit;min-height:230px;background:linear-gradient(145deg,#293a4d,#192637);border:1px solid #445971;border-radius:20px;padding:24px;display:flex;flex-direction:column;align-items:center;justify-content:center;transition:.2s}
.mode-card:hover{background:linear-gradient(145deg,#3c5669,#23374b);transform:translateY(-4px);border-color:#a1e6c5}
.mode-card strong{font-size:25px;letter-spacing:.03em}.mode-card small{font-size:13px;color:#b3c5d5;margin-top:9px}
.mode-visual{display:block;font-size:64px;line-height:.95;min-height:115px;color:#ade6d2;filter:drop-shadow(0 4px 6px #0007)}
.mode-visual b{font-size:15px;color:#a5c5d3;vertical-align:middle}.mode-four{font-size:42px;letter-spacing:.26em}
.welcome-lang{margin:30px auto 0;display:flex;justify-content:center;align-items:center;gap:12px;color:#d3e0ec;font-size:14px}
.welcome-lang select,.header-actions select{color:#ebf7fc;background:#1d3042;border:1px solid #496477;border-radius:8px;padding:9px 12px}
.piece{width:89%;height:89%;display:flex;align-items:center;justify-content:center;line-height:1;filter:drop-shadow(0 1px 1px #0b1118cc) drop-shadow(0 2px 4px #08101888);text-shadow:none;font-size:clamp(20px,3.3vw,48px)}
.piece .art{display:block;width:100%;height:100%;filter:drop-shadow(0 1px 1px #0e1721cc) drop-shadow(0 2px 4px #0b142088)}
.piece .art svg{display:block;width:100%;height:100%;overflow:visible}
.piece .glyph{font-family:Georgia,'DejaVu Sans',serif;font-size:1em;line-height:1;filter:drop-shadow(0 1px 1px #101820d9) drop-shadow(0 2px 3px #0b13208a);text-shadow:0 1px 1px #0d1520e0,0 0 2px #ffffff26,-1px 0 #0d152066,1px 0 #0d152066}
.piece.dead{color:#818998!important;opacity:.36;filter:grayscale(1)}
.board .square{touch-action:none;cursor:grab}.board .square:active{cursor:grabbing}
.drag-ghost{position:fixed;pointer-events:none;z-index:1000;transform:translate(-50%,-50%);width:70px;height:70px;filter:drop-shadow(0 11px 12px #07131b99)}
.drag-ghost .piece{width:100%;height:100%;font-size:58px}
.drag-ghost .art{width:100%;height:100%}
.appearance-card input[type=color]{width:100%;height:46px;cursor:pointer;margin:5px 0 13px;background:#102435;border:1px solid #42647a;border-radius:9px;padding:5px}
.takeover{font-size:10px;padding:6px;max-width:108px;min-width:84px;white-space:normal;line-height:1.25}
.player-row{gap:7px}.player-info{min-width:0}.player-info small{font-size:10px}
.board:has(.square:nth-child(64):last-child) .piece{font-size:clamp(27px,5vw,80px)}
.editor-board .piece{font-size:clamp(12px,2.1vw,36px)}
.editor-board .art{width:100%;height:100%}
.mode-card:focus-visible{outline:3px solid #ade8ce;outline-offset:3px}
@media(max-width:600px){.welcome{position:fixed;padding:16px 11px}.mode-cards{gap:9px}.mode-card{padding:12px;min-height:170px}.mode-visual{font-size:47px;min-height:77px}.mode-four{font-size:29px}.mode-card strong{font-size:18px}.mode-card small{font-size:10px}.welcome h1{font-size:50px}.header-actions select{flex-basis:100%}.drag-ghost{width:49px;height:49px}.piece{font-size:clamp(15px,5vw,35px)}.takeover{max-width:88px;font-size:9px}}


/* BaldChess branding and appearance, version 5 */
:root{--bg:#101824;--panel:#1c2838;--muted:#aabbcc;--light:#e6dfcd;--dark:#8393a3}
.welcome{background:radial-gradient(ellipse at 50% 17%,#2e4356,#111723 70%)}
.welcome h1 span,.brand strong span{color:#b8d0e8}
.brand .logo{width:62px;height:62px;border-radius:0;overflow:visible;background:transparent}
.brand .logo img{width:100%;height:100%;object-fit:contain;display:block;filter:drop-shadow(0 4px 10px #07111d66)}
.welcome-mark{width:148px;height:148px;border-radius:0;background:transparent;overflow:visible;border:0}
.welcome-mark img{width:100%;height:100%;object-fit:contain;display:block;filter:drop-shadow(0 8px 18px #07111d55)}
.button.primary{background:#a1bddb;color:#18283b}.button.primary:hover:not(:disabled){background:#b8d2ed}
.button:focus-visible,.mode-card:focus-visible{outline-color:#bfd2e9}
.eyebrow,.footer span{color:#98b6d5}
.mode-card:hover{border-color:#a9c3e2}
.board-wrapper{background:#27374a;border-color:#465a70}
.square.light{background-color:var(--tile-light,var(--light))}.square.dark{background-color:var(--tile-dark,var(--dark))}
.square.theme-art{background-image:linear-gradient(135deg,#ffffff14 0%,transparent 43%,#0608171b 100%);}
.square.theme-art[data-art="cosmos"]{background-image:radial-gradient(circle at 25% 20%,#dae5ff26 0 1px,transparent 2px),linear-gradient(125deg,#c2d5f50f,#0e0e3512)}
.square.theme-art[data-art="dragons"]{background-image:linear-gradient(135deg,#f0a76b18,transparent 50%,#230b181c)}
.square.theme-art[data-art="mystic"]{background-image:radial-gradient(circle at 90% 12%,#e1b8ff30,transparent 45%)}
.square.theme-art[data-art="fortress"]{background-image:linear-gradient(155deg,#cddce121,transparent 45%,#101b2524)}
.square.theme-art[data-art="celestial"]{background-image:radial-gradient(circle at 50% 20%,#fff9e247,transparent 68%)}
.square.theme-art[data-art="abyss"]{background-image:linear-gradient(35deg,#5c4ca02c,transparent 65%)}
.square.last-move{background-color:#cfba72!important}.square.last-move.dark{background-color:#ad985a!important}
.board .square .art{filter:drop-shadow(1px 2px 1px #0b172688) drop-shadow(-1px -1px 0 #ffffff31)}
.board .square .art svg{overflow:hidden}
.history-card{min-height:280px}
.history{min-height:220px;max-height:500px}
.display-card .section-top{margin-bottom:7px}.display-card .small-button{font-size:11px;padding:7px 9px}
.display-toggle{padding:6px 0 1px;color:#e0e9f2;font-size:13px}.display-card .helper{margin:6px 0 0}
.appearance-dialog{max-width:min(760px,calc(100% - 25px))}
.appearance-tabs{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:21px 0}
.appearance-tab{border:1px solid #435a73;padding:12px;border-radius:10px;color:#ceddec;background:#26374b;font-weight:700}
.appearance-tab.active{background:#425d7b;color:#fff;border-color:#a2bfdb}
.appearance-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.appearance-option{min-width:0;border-radius:12px;border:2px solid #30475e;background:#202e40;color:#f2f7fa;padding:7px 7px 12px;text-align:left}
.appearance-option:hover{background:#2b4054;border-color:#799ebf}
.appearance-option.selected-look{border-color:#c6daf2;box-shadow:0 0 0 1px #aac8e0}
.appearance-option strong{display:block;margin:9px 5px 0;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.appearance-swatches{height:88px;position:relative;display:grid;grid-template-columns:repeat(2,1fr);grid-template-rows:repeat(2,1fr);overflow:hidden;border-radius:6px}
.appearance-swatches .piece{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);height:73px;width:73px;filter:drop-shadow(0 3px 3px #0009);font-size:62px}
.appearance-preview{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-top:17px;padding:12px;border:1px solid #435972;border-radius:12px;background:#1a2b3d}
.appearance-preview strong{font-size:12px}.appearance-preview p{margin:7px 0 0!important}
.mini-board{width:min(100%,310px);display:grid;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(4,minmax(0,1fr));aspect-ratio:2}
.mini-square{min-width:0;min-height:0;display:grid;place-items:center;overflow:hidden}
.mini-square .piece{width:100%;height:100%;font-size:clamp(10px,2.8vw,32px)}
.mini-square .art{width:100%;height:100%}
@media(max-width:570px){.appearance-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.appearance-preview{display:block}.mini-board{margin-top:14px;width:100%}.welcome-mark{width:110px;height:110px}}

.topbar{padding-top:4px}.brand strong{line-height:1}.brand{min-width:fit-content}.game-title[hidden]{display:none!important}.mode-card{box-shadow:0 10px 24px #00000022}

/* BaldChess 5.8 — nickname-first player list, no color or position icons. */
.player-row{padding:12px 10px;gap:8px;align-items:center}
.player-info{display:flex;flex-direction:column;gap:5px;justify-content:center;min-width:0}
.player-info strong{font-size:14px;font-weight:750;color:#f0f6fc;line-height:1.2}
.player-info small{font-size:11px;color:#99afc3;line-height:1.35}
.player-row .clock{margin-left:auto;flex-shrink:0;font-size:15px;color:#dbe8f5}
.current-player{gap:0}
.current-player h2{font-size:21px;font-weight:800;color:#f3f8fe}
.current-player p{font-size:12px;color:#aebfd0}

/* BaldChess 6.0 — board-first desktop layout.
   Board gets the biggest square which fits both viewport height and available width.
   Sidebar uses full viewport height; history alone scrolls within its card. */
@media (min-width:880px){
 .page:not([hidden]){max-width:2000px;height:100dvh;min-height:0;overflow:hidden;padding:7px clamp(12px,1.5vw,30px) 7px;display:flex;flex-direction:column}
 .topbar{height:56px;min-height:56px;flex:0 0 56px;padding:0 0 7px}
 .brand{gap:12px}
 .brand .logo{width:53px;height:53px}
 .brand strong{font-size:23px}
 .header-actions{gap:9px;flex-wrap:nowrap}
 .header-actions .button{padding:9px 13px;font-size:13px;white-space:nowrap}
 .header-actions select{font-size:13px;padding:9px 10px}
 .main-layout{flex:1 1 auto;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) clamp(330px,27vw,400px);gap:clamp(13px,1.45vw,25px);padding-top:8px;align-items:stretch}
 .game-panel{display:grid;grid-template-rows:32px minmax(0,1fr) 26px;min-height:0;min-width:0;justify-items:stretch;align-items:stretch}
 .game-header{min-height:0;padding:0 3px 6px;align-items:center}
 .game-mode-big{font-size:13px;letter-spacing:.16em}
 .room-tag{padding:7px 10px;font-size:12px}
 .board-wrapper{position:relative;box-sizing:border-box;min-width:0;min-height:0;aspect-ratio:1/1;width:min(100%,calc(100dvh - 136px));height:auto;max-height:100%;max-width:100%;padding:5px;border-radius:10px;justify-self:center;align-self:center;margin:auto;flex:none}
 .board{width:100%;height:100%;aspect-ratio:1}
 .board-footer{box-sizing:border-box;justify-self:center;align-self:start;min-height:0;width:min(100%,1050px);margin:auto;padding:5px 3px 0;font-size:13px}
 .sidebar{display:flex;flex-direction:column;gap:8px;margin:0;height:100%;max-height:100%;min-height:0;min-width:0}
 .side-card{padding:12px 14px;border-radius:12px;flex-shrink:0}
 .section-top{margin-bottom:9px}
 .section-top h3{font-size:16px}
 .turn-card .section-top{margin-bottom:8px}
 .current-player h2{font-size:20px;margin:0 0 3px}
 .current-player p{font-size:12px}
 .players{gap:4px}
 .player-row{padding:8px 8px;gap:8px;border-radius:8px;min-height:40px}
 .player-info{gap:3px}
 .player-info strong{font-size:14px}
 .player-info small{font-size:11px}
 .player-row .clock{font-size:15px}
 .history-card{display:flex;flex-direction:column;flex:1 1 160px;min-height:95px;overflow:hidden;padding-bottom:10px}
 .history-card .section-top{flex-shrink:0}
 .history{flex:1 1 auto;min-height:0;max-height:none;overflow-y:auto;gap:6px;scrollbar-width:thin;scrollbar-color:#49637b transparent}
 .history li{font-size:12px;line-height:1.35;padding:8px 10px}
 #invite-panel{padding:9px 12px}
 #invite-hint{display:none}
 #invite-panel .section-top{margin-bottom:4px}
 .copy-code{margin:4px 0;padding:7px 11px;font-size:17px;letter-spacing:.13em}
 #copy-link{font-size:12px;padding:8px 10px}
 #room-options-summary{margin:4px 0;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.3}
 #edit-settings{font-size:12px;padding:7px 9px;margin-top:3px}
 #invite-panel.compact-lobby{padding:0;border:0;background:transparent;box-shadow:none}
 #invite-panel.compact-lobby > :not(#copy-link){display:none!important}
 #invite-panel.compact-lobby #copy-link{padding:9px 10px;background:#24364a;border-color:#384f66}
 #invite-panel:not(.compact-lobby){display:grid;grid-template-columns:1fr 1fr;gap:4px 7px;align-items:center}
 #invite-panel:not(.compact-lobby) .section-top{grid-column:1/-1}
 #invite-panel:not(.compact-lobby) .copy-code{grid-column:1;min-width:0;margin:0}
 #invite-panel:not(.compact-lobby) #copy-link{grid-column:2}
 #invite-panel:not(.compact-lobby) #room-options-summary,
 #invite-panel:not(.compact-lobby) #edit-settings{grid-column:1/-1}
 .display-card{padding:9px 12px}
 .display-card .section-top{margin-bottom:3px}
 .display-card .section-top h3{font-size:13px}
 .display-toggle{padding:4px 0 0;font-size:13px}
 .display-card .helper{display:none}
 .bottom-actions{flex-shrink:0;gap:8px}
 .bottom-actions .button{padding:10px 7px;font-size:12px}
 .fineprint,.footer{display:none}
}
@media (min-width:880px) and (max-height:790px){
 .sidebar{gap:7px}
 .side-card{padding:9px 12px}
 .section-top{margin-bottom:6px}
 .turn-card .section-top{margin-bottom:5px}
 .player-row{padding:6px 6px;min-height:36px}
 .players{gap:2px}
 .history-card{min-height:82px}
 .history li{padding:6px 9px}
 #invite-panel{padding:6px 11px}
 .display-card{padding:8px 11px}
 .bottom-actions .button{padding:8px 6px}
}
@media (min-width:880px) and (max-height:740px){
 .sidebar{gap:5px}
 .side-card{padding:7px 11px}
 .section-top{margin-bottom:5px}
 .turn-card .section-top{margin-bottom:4px}
 .player-row{padding:4px 6px;min-height:33px}
 .players{gap:1px}
 .history-card{min-height:74px}
 .history li{padding:5px 8px}
 .display-card{padding:7px 11px}
 .bottom-actions .button{padding:7px 6px}
 #invite-panel:not(.compact-lobby){padding:5px 10px}
 #invite-panel:not(.compact-lobby) .copy-code{padding:6px 9px}
 #invite-panel:not(.compact-lobby) #copy-link{padding:7px}
 #invite-panel:not(.compact-lobby) #edit-settings{padding:6px 8px}
}
@media (min-width:880px) and (max-height:675px){
 .topbar{height:49px;min-height:49px;flex-basis:49px}
 .brand .logo{width:46px;height:46px}
 .main-layout{padding-top:5px}
 .game-panel{grid-template-rows:27px minmax(0,1fr) 22px}
 .sidebar{gap:5px}
 .player-row{min-height:31px;padding:3px 5px}
 .side-card{padding:6px 10px}
 .section-top{margin-bottom:4px}
 .history-card{min-height:62px}
 .history li{padding:4px 7px}
 .bottom-actions .button{padding:6px}
}
/* The board should be as wide as practical on portrait/mobile, but the sidebar
   remains below it where a second column would shrink the board dramatically. */
@media (max-width:879px){
 .page:not([hidden]){padding:10px 8px}
 .topbar{padding-bottom:10px}
 .brand .logo{width:47px;height:47px}
 .brand strong{font-size:20px}
 .main-layout{display:block;padding-top:10px}
 .game-header{padding-bottom:8px}
 .board-wrapper{width:min(100%,calc(100dvh - 115px),780px);max-width:780px;padding:4px}
 .board-footer{width:min(100%,calc(100dvh - 115px),780px);margin:auto}
 .sidebar{margin-top:13px;display:flex;flex-direction:column;gap:10px;height:auto;max-height:none}
 .side-card{padding:12px 14px}
 .player-row{padding:9px 8px}
 .player-info strong{font-size:14px}
 .player-row .clock{font-size:15px}
 .history-card{display:flex;flex-direction:column;min-height:200px;max-height:290px}
 .history{min-height:100px;max-height:210px;overflow-y:auto}
 #invite-panel.compact-lobby > :not(#copy-link){display:none!important}
 #invite-panel.compact-lobby{padding:0;border:0;background:transparent;box-shadow:none}
 .display-card .helper{display:none}
 .fineprint,.footer{display:none}
}
@media (max-width:560px){
 .header-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px}
 .header-actions select{min-width:0;flex-basis:auto;padding:8px 5px}
 .header-actions .button{padding:9px 5px;font-size:11px}
 .game-mode-big{font-size:11px;letter-spacing:.08em}
 .room-tag{font-size:10px;padding:7px 8px}
 .side-card{padding:11px 12px}
}
@media(max-height:750px){
 .welcome-mark{width:115px;height:115px;margin-bottom:8px}
 .welcome h1{font-size:clamp(45px,8vw,80px);margin:7px 0}
 .welcome-inner>p{margin:10px 0 17px}
 .mode-card{min-height:175px;padding:15px}
 .mode-visual{font-size:48px;min-height:89px}
 .mode-four{font-size:32px}
 .welcome-lang{margin-top:17px}
}

/* 5.13: balanced figure sizes. The artwork stays inside each square, while
   classic glyphs remain responsive to the REAL cell width, not the viewport. */
.board{container-type:inline-size}
.board .square .piece{width:94%;height:94%;min-width:0;min-height:0}
/* Fallback for browsers that don't support cqw container query units. */
.board .square .piece .glyph{line-height:.88;transform:scale(1.08);transform-origin:center}
@supports (font-size:1cqw){
 .board .square .piece .glyph{font-size:calc(100cqw / 14 * 1.08);transform:none}
 .board:has(.square:nth-child(64):last-child) .square .piece .glyph{font-size:calc(100cqw / 8 * 1.06)}
}
/* Art is 97.8% of a cell (94% * 1.04), leaving breathing space. */
.board .square .piece .art{transform:scale(1.04);transform-origin:center}


/* BaldChess 5.14 — richer piece lighting, subtle board lift, no gaudy crystal look. */
.piece .art{filter:drop-shadow(0 1px 1px #0c1420cc) drop-shadow(0 3px 5px #09111a6e)}
.board .square .art svg{overflow:visible}
.board .square .piece .art{transform:scale(1.02);transform-origin:center}
.board .square .piece .art-classic,
.board .square .piece .art-fortress,
.board .square .piece .art-celestial{filter:drop-shadow(0 1px 1px #111823cc) drop-shadow(0 3px 4px #08111b76) brightness(1.03)}
.board .square .piece .art-dragons,
.board .square .piece .art-abyss{filter:drop-shadow(0 1px 1px #101822d1) drop-shadow(0 4px 5px #070d167e) saturate(1.05)}
.board .square .piece .art-cosmos,
.board .square .piece .art-mystic,
.board .square .piece .art-pixel{filter:drop-shadow(0 1px 1px #121b28d0) drop-shadow(0 3px 5px #09111a7d) brightness(1.02)}

@media (min-width:880px){
 .game-panel{grid-template-rows:28px minmax(0,1fr) 24px}
 .game-header{padding:0 3px 4px}
 .board-wrapper{transform:translateY(-6px)}
 .board-footer{padding:3px 3px 0}
}

/* BaldChess 5.15 — a single cohesive hand-inked piece style for every palette
   and themed skin. The viewBox / base proportions are the same in both modes. */
.board .square .piece{width:95%;height:95%}
.board .square .piece .art{transform:scale(1.065);transform-origin:center;filter:drop-shadow(0 1px 1px #0b111a9f) drop-shadow(0 3px 3px #090d1666)}
.board .square .piece .art svg{display:block;width:100%;height:100%;overflow:visible}
.editor-board .piece .art,.mini-square .piece .art,.appearance-swatches .piece .art{filter:drop-shadow(0 2px 2px #060b134d)}
.editor-board .piece .art svg,.mini-square .piece .art svg,.appearance-swatches .piece .art svg{overflow:visible}
