@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&display=swap');
:root{color-scheme:dark;--gold:#ffcb75;--ice:#deebff;--muted:#a4acb7;--line:#424d58}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 50% 20%,#192129 0,#090d11 55%,#030506 100%);color:#e8edf2;font-family:Inter,Arial,sans-serif;font-weight:300;min-height:100vh}button,input{font:inherit}button{cursor:pointer;color:inherit}button:disabled{cursor:default;opacity:.35}button:focus-visible,input:focus-visible{outline:2px solid var(--gold);outline-offset:4px}[hidden]{display:none!important}.game{width:min(100%,var(--game-width));margin:auto;padding:24px var(--game-right) 30px var(--game-left);background:linear-gradient(115deg,#060b0fdd,#030606f0);min-height:100vh;box-shadow:0 0 100px #0008}header{display:flex;align-items:center;justify-content:space-between;height:95px;margin-bottom:22px}h1{font-size:28px;letter-spacing:8px;font-weight:300;margin:0 0 0 8px;position:relative}h1:after{content:'';width:48px;height:1px;background:linear-gradient(90deg,transparent,#d7e5f5,transparent);position:absolute;left:calc(50% - 24px);bottom:-17px}.icon-button{background:none;border:0;font-size:37px;padding:6px;color:#d4e4f7;width:42px;height:46px;display:grid;place-items:center}.icon-button svg{width:28px;fill:none;stroke:currentColor;stroke-width:1.7}.player{border:1px solid #4c5764;border-radius:22px;display:flex;align-items:center;padding:22px 18px;gap:20px;min-height:132px;background:linear-gradient(120deg,#0c1218a0,#02060680);transition:border-color .2s}.White{--team:var(--gold);--glow:#ffa92788}.Black{--team:var(--ice);--glow:#629dff88}.player.active{border-color:var(--team);box-shadow:0 0 18px color-mix(in srgb,var(--team) 7%,transparent)}.identity{display:flex;align-items:center;gap:17px;flex:1}.emblem{width:72px;height:78px;flex-shrink:0}h2{font-size:20px;letter-spacing:1px;font-weight:400;margin:0 0 10px}small,label{font-size:12px;letter-spacing:.7px;color:#b2bdcc}label{display:block;margin-bottom:13px}.reserves{border-left:1px solid #76818c;padding-left:20px;flex:1.2;min-width:0}.reserve-slots{display:flex;gap:10px;align-items:center;height:40px}.reserve-slot{width:32px;height:36px;background:none;border:0;padding:0;flex-shrink:1;min-width:16px}.vacant{border:1px solid #465463;border-radius:50%;width:28px;height:28px}.reserve-slot svg{width:100%;height:100%}.reserve-slot.ready{cursor:pointer;filter:drop-shadow(0 0 4px var(--team))}.turn-number{border-left:1px solid #76818c;padding-left:18px;text-align:center}.turn-number strong{font-size:39px;color:var(--ice);font-weight:300}.turn-number label{margin-bottom:3px}.field{position:relative;margin:15px 22px 22px 27px}#board{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr));aspect-ratio:1;border:1px solid #73808c;border-radius:5px;overflow:hidden}.cell{position:relative;border:0;border-right:1px solid #535c6677;border-bottom:1px solid #535c6677;padding:0;display:grid;place-items:center;background:linear-gradient(120deg,#11171d,#090d11);aspect-ratio:1}.cell.dark{background:linear-gradient(120deg,#1e252e,#171d24)}.cell:nth-child(8n){border-right-color:transparent}.cell:nth-last-child(-n+8){border-bottom-color:transparent}.piece{width:88%;height:88%;position:relative;pointer-events:none;display:block}.piece svg{width:100%;height:100%;overflow:visible;filter:drop-shadow(0 0 4px var(--glow))}.piece-shape{fill:#05090dbb;stroke:var(--team);stroke-width:2.1;stroke-linejoin:round}.piece-center{fill:#0c1115;stroke:var(--team);stroke-width:1.5}.cell.selected,.cell.pending{box-shadow:inset 0 0 0 2px var(--gold);background:radial-gradient(circle,#74512344,#17180e);border-radius:5px}.cell.last{background:linear-gradient(120deg,#343020,#171b1c)}.legal:after{content:'';width:29%;height:29%;border:2px solid #ffcf77;border-radius:50%;box-shadow:0 0 14px #ffaa3c66,inset 0 0 9px #ffaa3c33;position:absolute;pointer-events:none}.legal.capture:after{
  border-color:#ff8793;
  box-shadow:0 0 14px #ff536666,inset 0 0 9px #ff536633;
}.ball{position:absolute;width:55%;height:55%;border:2px solid #f2f6ff;border-radius:50%;background:radial-gradient(circle at 33% 28%,#ffffff 0,#f5f8fc 12%,#b4becb 38%,#586371 65%,#d8e0eb 100%);box-shadow:0 0 22px #b5d4ff77,inset 0 0 5px #ffffff;pointer-events:none;z-index:3}.ball.carried{width:26%;height:26%;left:50%;top:50%;right:auto;bottom:auto;transform:translate(-50%,-50%)}.rank{display:none}.ranks{position:absolute;left:-26px;top:0;bottom:34px;display:grid;grid-template-rows:repeat(8,1fr);align-items:center;font-size:16px}.files{display:grid;grid-template-columns:repeat(8,1fr);text-align:center;height:34px;align-items:end;font-size:16px}#end-turn{background:#111007;border:2px solid var(--gold);border-radius:15px;color:var(--gold);font-size:17px;letter-spacing:.8px;padding:20px 16px;white-space:nowrap;box-shadow:inset 0 0 6px #f5c16a22}#end-turn:disabled{opacity:.55}.piece-guide{display:flex;align-items:center;gap:24px;border:1px solid #4c5764;border-radius:22px;padding:28px 24px;margin-top:19px;background:linear-gradient(120deg,#0c121850,#030606)}.guide-icon{width:110px;height:110px}.guide-icon .piece,.emblem .piece{width:100%;height:100%}.guide-copy{border-left:1px solid #66717a;border-right:1px solid #66717a;padding:8px 22px;flex:1}.guide-copy p{font-size:16px;line-height:1.6;color:#bbc1ca;margin:0}#directions{width:100px;height:100px}#directions svg{width:100%;height:100%;color:var(--gold)}.match-status{display:flex;justify-content:space-between;gap:10px;font-size:11px;margin-top:19px;color:#aeb9c5}#turn{color:var(--gold)}#status{font-size:11px;color:#8d9aa7;line-height:1.5;min-height:18px;margin-bottom:0}.gold{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--gold);margin-right:6px}#cancel-move{background:none;border:0;color:var(--gold);padding:9px 0;font-size:12px}#drawer{position:fixed;inset:0 0 0 auto;z-index:10;width:min(100%,400px);background:#0d131bf5;backdrop-filter:blur(22px);border-left:1px solid #536271;padding:28px;overflow:auto;box-shadow:-30px 0 90px #000a}.drawer-head{display:flex;align-items:center;justify-content:space-between}.drawer-head button{font-size:30px;border:0!important}.drawer-head h2{margin:0}#drawer button,dialog button:not(.close){background:#151d25;border:1px solid #49576a;border-radius:8px;padding:10px 14px;margin:5px 3px 5px 0;font-size:12px}#drawer p,dialog p{font-size:13px;line-height:1.7;color:#aab5c4}#drawer h3{font-size:14px;font-weight:400;margin-top:25px}.queue{border-top:1px solid #35404d;padding:8px 0}.queue-items{display:flex;gap:8px}.queued{font-size:11px;color:var(--gold)}.mini{display:none}.entry{display:flex;justify-content:space-between;font-size:12px;padding:8px 0;border-bottom:1px solid #2d3741}#history{max-height:180px;overflow:auto;margin-bottom:25px}.empty{color:#8996a7;font-size:12px}.seed-row{display:flex;align-items:center;gap:5px}input{background:#080e15;border:1px solid #405065;padding:9px;color:#c9d3e0;min-width:0;width:100%;border-radius:6px}dialog{background:#0b1119;color:#e5ebf3;border:1px solid #677483;border-radius:20px;padding:35px;width:min(90%,480px)}dialog::backdrop{background:#000b;backdrop-filter:blur(6px)}dialog h2{font-size:29px;margin-top:15px}.close{position:absolute;right:16px;top:10px;background:none;border:0;font-size:26px}.eyebrow{font-size:10px;letter-spacing:2px;color:var(--gold)}.cell.last .piece{animation:arrive .25s ease-out}@keyframes arrive{from{opacity:.3;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@media(max-width:600px){.game{padding:10px 16px 22px}header{height:76px;margin-bottom:14px}h1{font-size:23px;letter-spacing:6px}.player{padding:15px 12px;gap:12px;border-radius:17px;min-height:100px}.emblem{width:50px;height:56px}.identity{gap:10px}h2{font-size:15px;margin-bottom:7px}small,label{font-size:9px}.reserves{padding-left:12px}.reserve-slots{gap:6px;height:29px}.reserve-slot{width:25px;height:27px}.vacant{width:21px;height:21px}.turn-number{padding-left:12px}.turn-number strong{font-size:31px}label{margin-bottom:9px}.field{margin:13px 8px 19px 22px}.ranks{font-size:13px;left:-21px}.files{font-size:13px}#end-turn{font-size:12px;padding:18px 11px;border-radius:12px}.piece-guide{gap:14px;padding:21px 15px;border-radius:17px}.guide-icon{width:78px;height:85px}.guide-copy{padding:4px 14px}.guide-copy p{font-size:12px}#directions{width:66px;height:76px}.match-status{font-size:10px}}@media(max-width:380px){.game{padding:8px 10px}.player{gap:8px;padding:12px 8px}.emblem{width:38px;height:48px}.identity{gap:7px}.reserves{padding-left:8px}.reserve-slots{gap:4px}.reserve-slot{width:20px}.vacant{width:17px;height:17px}.guide-icon{width:62px}.piece-guide{gap:8px}.guide-copy{padding:4px 10px}#directions{width:50px}#end-turn{font-size:10px;padding:17px 8px}small{font-size:8px}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
.reserve-slot.vacant:disabled{opacity:.85}.reserve-slot .piece{width:100%;height:100%}
#game-mode{width:100%;background:#101923;color:#dce8f5;border:1px solid #4a5a6c;border-radius:8px;padding:12px;margin:8px 0 12px;font:inherit;font-size:12px}.drawer-head{margin-bottom:24px}
.loss-count{font-weight:300;font-size:25px;color:var(--team);letter-spacing:2px}#black-ready{background:#101b27;border:1px solid var(--ice);color:var(--ice);padding:10px 8px;border-radius:8px;font-size:10px;white-space:nowrap}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(max-width:600px){.loss-count{font-size:20px}.reserves{flex:.9}.turn-number strong{font-size:25px}#black-ready{font-size:9px;padding:9px 5px}}
/* Compact navigation, with existing match controls one level deeper. */
#menu-backdrop{position:fixed;inset:0;z-index:9;background:#0009;backdrop-filter:blur(5px);border:0;width:100%;height:100%;cursor:default}
#drawer{inset:70px 20px auto auto;width:min(460px,calc(100vw - 32px));max-height:calc(100dvh - 100px);padding:25px 30px 30px;border:1px solid #3d4852;border-radius:24px;background:linear-gradient(120deg,#0b1115,#030709);box-shadow:0 25px 80px #000a}
#drawer .drawer-head{position:relative;justify-content:center;margin:0 0 32px;height:44px}
#drawer .drawer-head h2{font-size:22px;letter-spacing:5px;font-weight:300;margin:0}
#drawer .drawer-head h2:after{content:'';display:block;width:38px;height:1px;margin:12px auto 0;background:linear-gradient(90deg,transparent,#c0c7ce,transparent)}
#drawer .drawer-head button{position:absolute;top:-5px;background:none;padding:5px;margin:0;color:#9ba6b1}
#drawer #drawer-close{right:-15px;font-size:26px}#drawer #menu-back{left:-15px;font-size:23px}
#menu-home{display:flex;flex-direction:column;gap:0}
#drawer .nav-row{display:flex;align-items:center;gap:26px;width:100%;min-height:86px;margin:0;padding:18px 24px;background:none;border:0;border-bottom:1px solid #27303980;border-radius:0;text-align:left;font-size:17px;font-weight:500;letter-spacing:1.1px;color:#d5dce4}
#drawer .nav-row svg{flex-shrink:0;width:36px;height:36px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
#drawer .nav-row:last-child{border-bottom:0}#drawer .nav-row:focus-visible{outline:2px solid var(--gold);outline-offset:-3px}
#drawer .placeholder{text-align:center;padding:35px 0 45px;color:#8f9daa;font-size:13px}
#menu-settings-page{padding-top:3px}#menu-settings-page .match-status{flex-wrap:wrap}
@media(min-width:900px){#drawer{right:max(24px,calc((100vw - 760px)/2));top:90px}}
@media(max-width:480px){#drawer{top:60px;right:12px;width:calc(100vw - 24px);padding:22px 26px;max-height:calc(100dvh - 80px)}#drawer .nav-row{min-height:78px;padding:17px 20px;gap:22px;font-size:15px}#drawer .drawer-head h2{font-size:21px}#drawer .nav-row svg{width:32px;height:32px}}

/* Visual rules reference */
dialog:has(.piece-reference){width:min(94vw,700px);max-height:92dvh;padding:28px;background:linear-gradient(130deg,#091217,#020708);border-color:#35434e}
.reference-heading{height:auto;min-height:50px;justify-content:center;margin:0 0 26px}
.reference-heading h2{font-size:20px;letter-spacing:4px;font-weight:300;margin:0;text-align:center}
.reference-heading:after{display:none}
.reference-card{display:grid;grid-template-columns:96px 1fr 110px;align-items:center;gap:24px;padding:25px 20px;border:1px solid #34434e;border-radius:18px;margin:14px 0;background:linear-gradient(120deg,#0b151b55,#030909)}
.reference-icon{width:96px;height:96px;display:grid;place-items:center;position:relative}
.reference-icon .piece{width:100%;height:100%}
.reference-copy h3{font-size:20px;font-weight:400;letter-spacing:1px;margin:0 0 10px}
dialog .reference-copy p{font-size:16px;line-height:1.55;margin:0;color:#b8c6d3}
.reference-copy small{display:block;margin-top:10px;font-size:12px;letter-spacing:0;color:var(--gold)}
.reference-directions{width:110px;height:110px;border-left:1px solid #34434e;padding-left:16px;color:var(--gold);fill:none;stroke:currentColor;stroke-width:1.3}
.reference-directions .arrow-tip{fill:currentColor;stroke:none}
.ball-reference{grid-template-columns:96px 1fr}
.ball-reference .ball{width:70px;height:70px}
.reference-rules{margin-top:24px;border-top:1px solid #34434e;padding-top:18px}
.reference-rules summary{cursor:pointer;color:#c7d3df;font-size:14px;letter-spacing:1px}
.reference-rules b{font-weight:500;color:#e0e8ee}
@media(max-width:520px){dialog:has(.piece-reference){padding:25px 15px}.reference-heading h2{font-size:15px;letter-spacing:3px}.reference-card{grid-template-columns:62px 1fr 68px;gap:12px;padding:22px 12px}.reference-icon{width:62px;height:68px}.reference-copy h3{font-size:15px;margin-bottom:8px}dialog .reference-copy p{font-size:12px}.reference-directions{width:68px;height:82px;padding-left:10px}.ball-reference{grid-template-columns:62px 1fr}.ball-reference .ball{width:52px;height:52px}.reference-copy small{font-size:10px}}

/* Match result */
dialog:has(.game-over){width:min(92vw,490px);padding:38px 34px 34px;background:radial-gradient(ellipse at 50% 40%,#17170e55,transparent 65%),#050a0d;border:1px solid #3d4851;border-radius:25px}
.game-over{text-align:center}.game-over-label{font-size:15px;letter-spacing:3px;color:#d7dfe7}.game-over h2{font-size:clamp(32px,8vw,48px);font-weight:300;letter-spacing:4px;color:var(--gold);margin:42px 0 16px}.game-over p{font-size:15px;line-height:1.6;margin:0 auto 32px;max-width:330px;color:#bfc7cf}
.result-actions{display:grid;gap:12px}dialog .result-actions button{margin:0;padding:20px 12px;width:100%;font-size:15px;font-weight:500;letter-spacing:1.5px;border-radius:15px;background:#090d0e;border:1px solid #566068;color:#bdc5cd}
@media(max-width:420px){dialog:has(.game-over){padding:32px 22px 25px}.game-over p{font-size:14px}.game-over-label{font-size:13px}}

.header-spacer{width:42px;flex-shrink:0}

#drawer:has(#menu-settings-page:not([hidden])){
  inset:0; width:100%; max-height:none; border:0; border-radius:0;
  padding:24px calc(max(0px,(100% - var(--game-width))/2) + var(--game-right))
    34px calc(max(0px,(100% - var(--game-width))/2) + var(--game-left));
  background:radial-gradient(ellipse at top,#0b151c,#04090e 72%);
}
#drawer:has(#menu-settings-page:not([hidden])) .drawer-head{margin-bottom:33px}
#menu-settings-page{display:grid;gap:22px}
#menu-settings-page .settings-card{padding:14px 20px 18px;border:1px solid #8093a4;border-radius:20px;background:#101e252e;min-width:0}
#menu-settings-page :is(h3,label,summary){margin:0 0 14px;font-size:15px;letter-spacing:.25em;text-transform:uppercase;color:#edf3f9;font-weight:400}
#menu-settings-page summary{cursor:pointer}
#menu-settings-page details:not([open]) summary{margin-bottom:0}
.mode-picker,.remaining-team{display:flex;align-items:center;gap:18px;border:1px solid #62788b;border-radius:15px;padding:8px 18px}
.mode-picker{position:relative;min-height:72px}
#mode-emblem{width:58px;height:58px;flex:none}
#mode-emblem .piece,.settings-piece .piece{width:100%;height:100%}
.mode-display,.remaining-identity div{display:grid;gap:4px}
.mode-display strong,.remaining-identity strong{font-weight:500;text-transform:uppercase;letter-spacing:.1em}
.mode-display span,.remaining-identity div span{color:#c5d1dc}
#menu-settings-page .mode-picker select{position:absolute;inset:0;width:100%;opacity:0;cursor:pointer}
.mode-picker:focus-within{outline:2px solid var(--gold);outline-offset:3px}
.settings-chevron{margin-left:auto;border:solid currentColor;border-width:0 2px 2px 0;width:13px;height:13px;transform:rotate(45deg);margin-right:5px}
.settings-actions{display:grid;grid-template-columns:1fr;gap:18px}
#drawer #menu-settings-page button{margin:0;min-height:48px;padding:10px 14px;border-color:#9db2c3;border-radius:12px;background:linear-gradient(130deg,#12212c,#070e14);font-size:14px;text-transform:uppercase;letter-spacing:.12em}
#drawer #menu-settings-page button span{font-size:1.35em;margin-right:.45em}
#drawer #menu-settings-page #new{color:var(--gold);border-color:var(--gold);background:linear-gradient(140deg,#332511,#15130b)}
#casualties{display:grid;gap:9px}
.remaining-identity{display:flex;align-items:center;gap:14px;flex:0 0 37%;border-right:1px solid #62788b}
.settings-piece{display:block;width:28px;height:28px;flex:none}
.remaining-identity .settings-piece{width:47px;height:47px}
.remaining-counts{flex:1;display:flex;justify-content:space-around;gap:8px}
.remaining-count{display:flex;align-items:center;gap:6px;white-space:nowrap}
#menu-settings-page #history{margin:0;max-height:195px;border:1px solid #62788b;border-radius:12px;padding:0 10px}
#history .entry{display:grid;grid-template-columns:3ch 24px 1fr auto;align-items:center;gap:12px;padding:5px 6px;font-size:14px}
#history .entry:last-child{border-bottom:0}
#history .entry .settings-piece{width:24px;height:24px}
#history .empty{padding:12px 5px}
.log-piece-name{text-transform:uppercase}
#menu-settings-page .seed-row{gap:12px}
#seed{min-height:48px;border-color:#829bad;border-radius:11px}
#seed-start{flex:none}
.settings-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
#drawer .settings-footer p{margin:0}
.settings-pending:has(button[hidden]){display:none}
@media(max-width:520px){
  #menu-settings-page{gap:13px}
  #menu-settings-page .settings-card{padding:12px}
  #menu-settings-page :is(h3,label,summary){font-size:12px}
  #drawer #menu-settings-page button{font-size:11px;letter-spacing:.07em;padding:8px}
  .mode-picker,.remaining-team{padding:7px 9px;gap:9px}
  .remaining-identity{gap:6px;font-size:12px}
  .remaining-identity .settings-piece{width:30px;height:30px}
  .remaining-counts{gap:3px;font-size:12px}
  .remaining-count{gap:2px}
  .remaining-count .settings-piece{width:19px;height:19px}
  #history .entry{font-size:12px;gap:7px}
}

/* Phone layout: prioritize the field and keep controls within easy reach. */
@media (max-width: 600px) {
  .game {
    padding: 8px var(--game-right) max(14px, env(safe-area-inset-bottom)) var(--game-left);
    min-height: 100dvh;
  }
  .game > header { height: 54px; margin-bottom: 12px; }
  .game h1 { font-size: clamp(19px, 5vw, 23px); }
  .game h1::after { bottom: -8px; }
  #menu, .header-spacer { width: 44px; }
  .player { min-height: 74px; padding: 10px; gap: 8px; }
  .player h2 { margin-bottom: 4px; }
  .player .emblem { width: clamp(35px, 10vw, 52px); height: auto; aspect-ratio: 1; }
  .player .reserves, .turn-number { padding-left: 8px; }
  .player label { margin-bottom: 4px; }
  .loss-count { font-size: clamp(16px, 5vw, 22px); letter-spacing: .04em; }
  #end-turn, #black-ready { min-height: 44px; padding: 8px; }
  .field { margin: 11px 0 12px 18px; }
  .ranks { left: -17px; bottom: 24px; }
  .files { height: 24px; }
  #drawer .nav-row { min-height: 60px; padding-block: 12px; }
  #drawer :is(#drawer-close, #menu-back), dialog .close { min-width: 44px; min-height: 44px; }
  #drawer:has(#menu-settings-page:not([hidden])) {
    padding: max(14px, env(safe-area-inset-top)) var(--game-right)
      max(20px, env(safe-area-inset-bottom)) var(--game-left);
  }
  #drawer:has(#menu-settings-page:not([hidden])) .drawer-head { margin-bottom: 16px; }
  #drawer:has(#menu-settings-page:not([hidden])) #menu-back { left: 0; }
  #drawer:has(#menu-settings-page:not([hidden])) #drawer-close { right: 0; }
  #menu-settings-page .seed-row { gap: 8px; }
  #menu-settings-page #seed { font-size: 16px; }
  .settings-actions { gap: 8px; }
  dialog:has(.piece-reference) { max-height: 92dvh; }
  .reference-card { padding-block: 15px; }
}
@media (max-width: 360px) {
  .remaining-team { padding-inline: 6px; gap: 6px; }
  .remaining-identity .settings-piece { width: 24px; height: 24px; }
  .reference-card { grid-template-columns: 46px 1fr 50px; gap: 9px; }
  .reference-icon, .reference-directions { width: 100%; }
  .ball-reference { grid-template-columns: 46px 1fr; }
  .ball-reference .ball { width: 38px; height: 38px; }
}

/* Game Rules */
dialog:has(.piece-reference){width:min(94vw,700px);border-color:#8397a8}
.piece-reference{--rules-edge:#8296a6;--rules-divider:#526572}
.piece-reference h3,.piece-reference h4{margin:0;text-transform:uppercase;letter-spacing:.15em;font-weight:500}
.piece-reference h3{font-size:15px}
.piece-reference h4{font-size:16px;margin-bottom:4px}
.rules-box{border:1px solid var(--rules-edge);border-radius:18px;padding:0 18px;background:#08141a66}
.rules-objective{display:grid;grid-template-columns:1fr 2.3fr;align-items:center;gap:18px;padding-block:18px}
.rules-objective h3{text-align:center}
dialog .rules-box p,.rules-ball li{font-size:15px;line-height:1.45;color:#e1e8ef;margin:0}
.rules-objective p{border-left:1px solid var(--rules-edge);padding-left:18px}
.rules-group{margin-top:22px;border-top:1px solid var(--rules-divider);padding-top:10px}
.rules-group>h3{margin:0 0 12px 12px}
.rules-piece{display:grid;grid-template-columns:74px minmax(0,1fr) 90px;gap:18px;align-items:center;padding:10px 0;border-bottom:1px solid var(--rules-divider)}
.rules-piece .reference-icon{width:100%;height:auto;aspect-ratio:1}
.rules-piece .reference-directions{width:100%;height:68px}
.rules-turn{text-align:center;padding:12px 0}
.rules-ball{margin:0;list-style:none}
.rules-ball li{padding:11px 8px}
.rules-ball li+li{border-top:1px solid var(--rules-divider)}
@media(max-width:520px){
  .rules-box{padding-inline:10px;border-radius:13px}
  .rules-objective{grid-template-columns:1fr;gap:7px;padding-block:12px}
  .rules-objective h3{text-align:left}
  .rules-objective p{border:0;padding:0}
  .rules-piece{grid-template-columns:44px minmax(0,1fr) 51px;gap:9px}
  .rules-piece .reference-directions{height:48px;padding-left:6px}
  .piece-reference h3,.piece-reference h4{font-size:12px}
  dialog .rules-box p,.rules-ball li{font-size:13px}
}

:is(#setups,.setups-panel){display:grid;grid-template-columns:minmax(0,1fr) repeat(3,44px);grid-template-areas:"heading previous next save" "track track track track";align-items:center;gap:12px;border:1px solid #536372;border-radius:16px;padding:10px;margin-bottom:16px;background:#0b131b88}
.setups-heading{grid-area:heading;display:flex;align-items:center;flex-wrap:wrap;gap:5px 10px}
:is(#setup-prev,.setups-prev){grid-area:previous}
:is(#setup-next,.setups-next){grid-area:next}
:is(#setup-save,.setups-plus){grid-area:save}
.setups-heading h2{text-transform:uppercase;font-size:13px;letter-spacing:.14em;margin:0}
:is(#setup-count,#playbook-count){font-size:12px;color:var(--muted)}
#setup-team{display:block;margin-top:5px;font:inherit;font-size:12px}
:is(#setups,.setups-panel)>button{width:44px;height:44px;border:1px solid #536372;border-radius:10px;background:#111a22;font-size:26px}
#setups>:is(#setup-save,.setups-plus){border-color:var(--gold);color:var(--gold);background:#211b10}
:is(#setup-track,.setup-track){grid-area:track;display:grid;grid-auto-flow:column;grid-auto-columns:calc((100% - 16px)/3);gap:8px;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;padding:4px;scroll-padding-inline:4px}
:is(#setup-track,.setup-track)::-webkit-scrollbar{display:none}
.setup-option{min-width:0;padding:0 0 3px;border:0;background:none;font-size:clamp(12px,3.4vw,15px);scroll-snap-align:start}
.setup-option:focus-visible{outline-offset:-2px}
.setup-preview{
  display:block;
  width:100%;
  aspect-ratio:auto;
  padding:0;
  overflow:hidden;
  border:1px solid #526170;
  border-radius:8px;
  margin-bottom:9px;
  background:#101820;
}
.setup-preview svg{
  display:block;
  width:100%;
  height:auto;
  aspect-ratio:660 / 260;
}
.setup-option[aria-pressed=true] .setup-preview{border-color:var(--gold);box-shadow:0 0 6px #ffcb7550}
.setup-option[aria-pressed=true] .setup-preview{--team:var(--gold);--glow:#ffa92788}
@media(min-width:601px){
  :is(#setups,.setups-panel){padding:18px}
}

#drawer:has(#menu-playbook-page:not([hidden])){
  inset:0;
  width:100%;
  max-height:none;
  border:0;
  border-radius:0;
  padding:24px calc(max(0px,(100% - var(--game-width))/2) + var(--game-right))
    34px calc(max(0px,(100% - var(--game-width))/2) + var(--game-left));
  background:radial-gradient(ellipse at top,#0b151c,#04090e 72%);
}
#drawer:has(#menu-playbook-page:not([hidden])) #menu-back{left:0}
#drawer:has(#menu-playbook-page:not([hidden])) #drawer-close{right:0}
.playbook-field{display:grid;grid-template-columns:18px minmax(0,1fr);margin:0 5px 12px 0}
.playbook-ranks{display:grid;grid-template-rows:repeat(3,1fr);align-items:center;font-size:12px}
.playbook-files{grid-column:2;display:grid;grid-template-columns:repeat(8,1fr);text-align:center;padding:8px 0;font-size:12px}
#drawer .setups-panel button{margin:0;padding:0}
#drawer .setups-panel>button{font-size:24px}
#drawer .setups-panel .setup-option{border:0;background:none;font-size:clamp(11px,3.3vw,15px)}
#drawer .setups-panel .setups-plus{color:var(--gold);border-color:var(--gold)}
#playbook-board{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));border:1px solid #62788b;border-radius:8px;overflow:hidden}
#drawer .playbook-square{position:relative;display:grid;place-items:center;aspect-ratio:1;margin:0;padding:0;background:#10171e;border:1px solid #35404b;border-radius:0}
#drawer .playbook-square.dark{background:#1c2630}
#drawer .playbook-square[aria-pressed=true]{box-shadow:inset 0 0 0 2px var(--gold)}
#drawer .playbook-square:focus-visible{outline-offset:-4px}

#drawer .setups-panel{
  grid-template-columns:minmax(0,1fr) minmax(0,230px) repeat(4,44px);
  grid-template-areas:"heading name delete previous next save" "track track track track track track";
  column-gap:6px;
}
#drawer .setups-panel #playbook-delete{
  grid-area:delete;
  color:var(--gold);
  border-color:var(--gold);
  background:#211b10;
}

/* The main menu and Play page share the same content edges. */
.menu-panel{display:contents}
#drawer.main-menu-screen:has(#menu-home:not([hidden])){
  inset:0;
  width:100%;
  max-height:none;
  border:0;
  border-radius:0;
  padding:max(14px,env(safe-area-inset-top))
    calc(max(0px,(100% - var(--game-width))/2) + var(--game-right))
    max(20px,env(safe-area-inset-bottom))
    calc(max(0px,(100% - var(--game-width))/2) + var(--game-left));
  background:radial-gradient(ellipse at 50% 12%,#101b24,#05090d 70%);
}
#drawer.main-menu-screen:has(#menu-home:not([hidden])) .menu-panel{
  display:block;
  padding:18px 16px;
  border:1px solid #3d4852;
  border-radius:17px;
  background:linear-gradient(120deg,#0b1115,#030709);
}
#drawer.main-menu-screen:has(#menu-home:not([hidden])) .drawer-head{
  height:54px;
  margin-bottom:12px;
}
#drawer.main-menu-screen:has(#menu-home:not([hidden])) .drawer-head h2{
  font-size:clamp(19px,5vw,23px);
  letter-spacing:6px;
}
@media(min-width:601px){
  #drawer.main-menu-screen:has(#menu-home:not([hidden])){padding-top:24px}
  #drawer.main-menu-screen:has(#menu-home:not([hidden])) .menu-panel{
    padding:24px 30px;
    border-radius:22px;
  }
  #drawer.main-menu-screen:has(#menu-home:not([hidden])) .drawer-head h2{
    font-size:28px;
    letter-spacing:8px;
  }
}


/* Shared page dimensions and panel treatments, based on the Play screen. */
:root {
  --game-width: 760px;
  --game-left: max(12px, env(safe-area-inset-left));
  --game-right: max(12px, env(safe-area-inset-right));
  --page-top: max(8px, env(safe-area-inset-top));
  --page-title: clamp(19px, 5vw, 23px);
  --page-title-spacing: 6px;
  --panel-radius: 17px;
  --panel-border: #4c5764;
}
@media (min-width: 601px) {
  :root {
    --game-left: 30px;
    --game-right: 30px;
    --page-top: 24px;
    --page-title: 28px;
    --page-title-spacing: 8px;
    --panel-radius: 22px;
  }
}
#drawer:has(:is(#menu-settings-page,#menu-playbook-page,#menu-statistics-page):not([hidden])),
#drawer.main-menu-screen:has(#menu-home:not([hidden])) {
  inset: 0;
  width: 100%;
  max-height: none;
  border: 0;
  border-radius: 0;
  padding: var(--page-top)
    calc(max(0px,(100% - var(--game-width))/2) + var(--game-right))
    max(24px,env(safe-area-inset-bottom))
    calc(max(0px,(100% - var(--game-width))/2) + var(--game-left));
  background: linear-gradient(115deg,#090f14,#040809);
}
#drawer:has(:is(#menu-settings-page,#menu-playbook-page,#menu-statistics-page):not([hidden])) .drawer-head,
#drawer.main-menu-screen:has(#menu-home:not([hidden])) .drawer-head {
  height: 54px;
  margin-bottom: 12px;
}
#drawer:has(:is(#menu-settings-page,#menu-playbook-page,#menu-statistics-page):not([hidden])) .drawer-head h2,
#drawer.main-menu-screen:has(#menu-home:not([hidden])) .drawer-head h2,
.reference-heading h2 {
  font-size: var(--page-title);
  letter-spacing: var(--page-title-spacing);
  font-weight: 300;
}
#drawer:has(:is(#menu-settings-page,#menu-playbook-page,#menu-statistics-page):not([hidden])) #menu-back {left:0}
#drawer:has(:is(#menu-settings-page,#menu-playbook-page,#menu-statistics-page):not([hidden])) #drawer-close {right:0}
#drawer.main-menu-screen:has(#menu-home:not([hidden])) .menu-panel,
#drawer #menu-settings-page .settings-card,
#drawer .setups-panel,
#menu-statistics-page,
dialog:has(.piece-reference,.game-over) {
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  background: linear-gradient(120deg,#0c1218,#070c0f);
}
#menu-statistics-page .placeholder {margin:0}
dialog:has(.piece-reference,.game-over) {
  width: calc(min(100%,var(--game-width)) - var(--game-left) - var(--game-right));
  max-width: none;
}
.reference-heading {padding-inline:32px}
@media (max-width: 360px) {
  .reference-heading h2 {letter-spacing:4px}
}

#playbook-name{
  font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,monospace;
  grid-area:name;
  width:100%;
  height:44px;
  margin:0;
  padding:8px;
  font-size:16px;
}
@media(max-width:520px){
  #drawer .setups-panel{
    grid-template-columns:minmax(0,1fr) repeat(4,44px);
    grid-template-areas:"heading heading heading heading heading"
      "name delete previous next save" "track track track track track";
    row-gap:8px;
  }
  #playbook-name{max-width:230px}
}
#drawer .setups-panel .setups-heading{min-width:0;gap:3px}
#playbook-count{font-size:10px}
.setup-name{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

#menu-back svg{
  width:28px;
  height:28px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.7;
}

/* Shared Play-screen background across all page surfaces. */
:root{
  --page-backdrop:radial-gradient(ellipse at 50% 20%,#192129 0,#090d11 55%,#030506 100%);
  --page-surface:linear-gradient(115deg,#060b0fdd,#030606f0);
}
body{background:var(--page-backdrop)}
.game,
#drawer,
#drawer:has(:is(#menu-settings-page,#menu-playbook-page,#menu-statistics-page):not([hidden])),
#drawer.main-menu-screen:has(#menu-home:not([hidden])),
dialog,
dialog:has(.piece-reference,.game-over){
  background-image:var(--page-surface),var(--page-backdrop);
  background-color:#030506;
}

.reference-heading{position:relative}
dialog #rules-back{
  position:absolute;
  left:0;
  top:0;
  min-width:44px;
  min-height:44px;
  margin:0;
  padding:0;
  border:0;
  background:none;
  color:#9ba6b1;
  font-size:23px;
}

dialog:has(.piece-reference,.game-over) > .close{display:none}

/* Center the in-match menu within the usable phone viewport. */
#drawer:not(.main-menu-screen):has(#menu-home:not([hidden])){
  inset:0;
  margin:auto;
  width:min(420px,calc(100% - 36px));
  height:fit-content;
  max-height:calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}

/* Pointer, touch, and keyboard feedback for navigation and action controls. */
button:not(.cell):not(.playbook-square):not(#menu-backdrop), summary{
  transition:background-color .15s,color .15s,box-shadow .15s,border-color .15s;
}
@media(hover:hover) and (pointer:fine){
  #drawer .nav-row:not(:disabled):hover{
    background:#ffcb751a;
    color:#ffdb9e;
    box-shadow:inset 0 0 0 1px #ffcb7580;
    border-radius:12px;
  }
  button:not(.cell):not(.playbook-square):not(.nav-row):not(.setup-option):not(#menu-backdrop):not(:disabled):hover{
    filter:brightness(1.2);
    box-shadow:inset 0 0 0 1px #ffcb7580;
  }
  .setup-option:not(:disabled):hover .setup-preview{
    border-color:var(--gold);
    box-shadow:0 0 8px #ffcb7540;
  }
  .setup-option:not(:disabled):hover{color:var(--gold)}
  summary:hover{color:var(--gold)}
}
button:not(.cell):not(.playbook-square):not(.nav-row):not(#menu-backdrop):not(:disabled):active{
  filter:brightness(1.25);
}
button:not(.cell):not(.playbook-square):not(#menu-backdrop):focus-visible,
summary:focus-visible{
  outline:2px solid var(--gold);
  outline-offset:2px;
}
button:disabled{filter:none}

@media(hover:hover) and (pointer:fine){
  dialog .result-actions button:not(:disabled):hover{
    border-color:var(--gold);
    color:var(--gold);
    background:#13130b;
    box-shadow:inset 0 0 0 1px #ffcb7580;
  }
}

html[data-input-mode="pointer"] :is(button,summary):focus-visible{
  outline:none!important;
}
html[data-input-mode="pointer"] .mode-picker:focus-within{
  outline:none;
}

.game-over:focus{outline:none}

.play-choice h2{font-size:clamp(24px,6vw,36px);letter-spacing:3px}

#white-panel + #setups{margin-top:14px;margin-bottom:0}

.rules-info{margin-top:22px}
.rules-info h3{overflow-wrap:anywhere}
.rules-info-copy{border-left:1px solid var(--rules-edge);padding-left:18px}
.rules-info-copy p{border:0;padding:0}
.rules-info-copy p+p{margin-top:12px}
@media(max-width:520px){
  .rules-info-copy{border:0;padding:0}
}

#drawer .nav-row{
  justify-content:flex-start;
  text-align:left;
}

#drawer.main-menu-screen:has(#menu-home:not([hidden])) .menu-panel{
  width:calc(100% - 12px);
  max-width:640px;
  margin-inline:auto;
}

.main-menu-logo{display:none}
#drawer.main-menu-screen:has(#menu-home:not([hidden])) .main-menu-logo{
  display:block;
  position:relative;
  width:clamp(80.96px,14.52svh,123.2px);
  aspect-ratio:1;
  margin:0 auto 0;
}
.main-menu-logo::before{
  content:"";
  display:block;
  width:100%;
  height:100%;
  background:var(--ice);
  -webkit-mask:url('assets/gridiron-logo.svg') center / contain no-repeat;
  mask:url('assets/gridiron-logo.svg') center / contain no-repeat;
}

/* Match the logo and board-piece glow while keeping menu labels crisp. */
#drawer .nav-row svg{
  filter:drop-shadow(0 0 4px color-mix(in srgb,currentColor 53%,transparent));
}

/* Shared title glow for the game and menu page headers. */
.game > header h1,
#menu-title{
  text-shadow:0 0 4px color-mix(in srgb,currentColor 53%,transparent);
}

#drawer.main-menu-screen:has(#menu-home:not([hidden])) .drawer-head h2{
  font-size:clamp(26px,6vw,34px);
}

/* Compact settings use the same panels and controls at every screen size. */
#menu-settings-page{gap:14px}
#menu-settings-page .settings-card{padding:16px}
#menu-settings-page .settings-card h3{margin-bottom:8px}
#menu-settings-page label.preference-row{
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  margin:0;padding:12px 0;min-height:48px;
  font-size:15px;font-weight:300;letter-spacing:0;text-transform:none;
}
#menu-settings-page .preference-row + .preference-row{border-top:1px solid #42536566}
#menu-settings-page .preference-row:last-child{padding-bottom:0}
#menu-settings-page input[role="switch"]{
  appearance:none;-webkit-appearance:none;flex:none;width:44px;height:26px;
  margin:0;padding:3px;border:1px solid #62788b;border-radius:20px;background:#101923;cursor:pointer;
}
#menu-settings-page input[role="switch"]::before{
  content:'';display:block;width:18px;height:18px;border-radius:50%;background:#9cabb9;
  transition:transform .15s,background .15s;
}
#menu-settings-page input[role="switch"]:checked{background:#44321a;border-color:var(--gold)}
#menu-settings-page input[role="switch"]:checked::before{transform:translateX(18px);background:var(--gold)}
#menu-settings-page select{max-width:50%;padding:8px 12px;border:1px solid #62788b;border-radius:9px;background:#0b141b;color:var(--ice);font:inherit}
#menu-settings-page .settings-hint{font-size:13px;color:var(--muted);margin:10px 0 0}
#menu-settings-page #mode-note{margin:0;font-size:12px;line-height:1.6;color:#b2bdcc}
#menu-settings-page summary{letter-spacing:.12em;line-height:1.5;font-size:14px;margin-bottom:12px}
.game.hide-legal-highlights .cell.legal::after{display:none}
.game.hide-board-coordinates .field :is(.ranks,.files){visibility:hidden}

/* Shared ice-blue halo for the main-menu logo and heading. */
#drawer.main-menu-screen:has(#menu-home:not([hidden])) :is(.main-menu-logo,#menu-title){
  filter:drop-shadow(0 0 4px #629dff88);
}

/* Allow scrolling and pinch zoom without mobile double-tap zoom. */
html{touch-action:manipulation}

/* Menu options each have their own panel. */
#drawer.main-menu-screen:has(#menu-home:not([hidden])) .menu-panel{
  border:0;
  border-radius:0;
  background:none;
  box-shadow:none;
}
#drawer #menu-home{display:grid;gap:12px}
#drawer #menu-home .nav-row{
  border:1px solid var(--panel-border);
  border-radius:18px;
  background:linear-gradient(120deg,#0c1218,#070c0f);
}
@media(hover:hover) and (pointer:fine){
  #drawer #menu-home .nav-row:not(:disabled):hover{
    border-color:#ffcb7580;
    background:#ffcb751a;
  }
}

#drawer.main-menu-screen:has(#menu-home:not([hidden])) #menu-title{
  color:var(--ice);
  text-shadow:none;
}

/* Pieces and destination rings share the square's exact positioning box. */
#board .cell > .piece{
  position:absolute;
  inset:0;
  margin:auto;
}
#board .piece svg{display:block}
#board .cell.legal::after{
  inset:0;
  margin:auto;
}

/* Both destination rings use identical SVG geometry and stroke settings. */
.destination-preview{display:none;fill:none;stroke:#ffcf77;stroke-width:2px;vector-effect:non-scaling-stroke}
#board .cell.legal::after{display:none}
#board .cell.legal .destination-preview{display:block;filter:drop-shadow(0 0 4px #ffaa3c66)}
#board .cell.legal.capture .destination-preview{stroke:#ff8793;filter:drop-shadow(0 0 4px #ff536666)}
.game.hide-legal-highlights #board .destination-preview{display:none}

.carrier-ball{
  stroke:#f2f6ff;
  stroke-width:2px;
  vector-effect:non-scaling-stroke;
  filter:drop-shadow(0 0 5px #b5d4ff77);
}

.main-menu-logo .logo-ball{
  position:absolute;inset:0;width:100%;height:100%;pointer-events:none;
}

/* Possession colors the rim; the silver sphere stays neutral. */
#board .piece:is(.White,.Black) .carrier-ball{
  stroke:var(--team);
  filter:drop-shadow(0 0 5px var(--glow));
}

/* The ball palette is shared by loose balls, carriers, and the logo. */
:root{
  --ball-stop-0:#b56cff;--ball-stop-1:#b56cff;--ball-stop-2:#ad61f5;
  --ball-stop-3:#a357ec;--ball-stop-4:#9650df;
  --ball-rim:#c99bff;--ball-glow:#b56cff88;--ball-rim-width:1.2px;
}
:root[data-ball-style="silver"]{
  --ball-stop-0:#ffffff;--ball-stop-1:#f5f8fc;--ball-stop-2:#b4becb;
  --ball-stop-3:#586371;--ball-stop-4:#d8e0eb;
  --ball-rim:#f2f6ff;--ball-glow:#b5d4ff77;--ball-rim-width:2px;
}
.carrier-ball{stroke:var(--ball-rim);stroke-width:var(--ball-rim-width);filter:drop-shadow(0 0 3px var(--ball-glow))}
.ball{
  border-color:var(--ball-rim);
  border-width:var(--ball-rim-width);
  background:radial-gradient(circle at 33% 28%,var(--ball-stop-0) 0,var(--ball-stop-1) 12%,var(--ball-stop-2) 38%,var(--ball-stop-3) 65%,var(--ball-stop-4) 100%);
  box-shadow:0 0 18px var(--ball-glow),inset 0 0 5px var(--ball-rim);
}

/* Desktop overlays follow the top of the content instead of centering
   vertically in a tall window. Mobile keeps its existing modal layout. */
@media(min-width:601px){
  :root{--overlay-top:clamp(24px,4dvh,48px)}
  dialog[open]{
    position:fixed;
    inset:var(--overlay-top) 0 auto;
    margin:0 auto;
    max-height:calc(100dvh - var(--overlay-top) - 24px);
    overflow:auto;
  }
  #drawer:not(.main-menu-screen):has(#menu-home:not([hidden])){
    inset:var(--overlay-top) 0 auto;
    margin:0 auto;
    max-height:calc(100dvh - var(--overlay-top) - 24px);
  }
}

/* Optional match history sits directly beneath the player's controls. */
.match-log{
  margin-top:14px;padding:16px;border:1px solid var(--panel-border);
  border-radius:var(--panel-radius);background:linear-gradient(120deg,#0c1218,#070c0f);
}
.match-log summary{cursor:pointer;font-size:14px;letter-spacing:.12em;text-transform:uppercase;line-height:1.5}
.match-log[open] summary{margin-bottom:12px}
.match-log #history{margin:0;max-height:195px;overflow:auto;border:1px solid #62788b;border-radius:12px;padding:0 10px}
.match-log .entry{gap:8px}
.game.hide-match-log .match-log{display:none}

/* Keep history at five visible rows while retaining the full match log. */
.match-log{--log-row-height:36px}
.match-log #history{max-height:calc(var(--log-row-height) * 5 + 2px)}
.match-log #history .entry{
  height:var(--log-row-height);
  min-height:var(--log-row-height);
}

/* The Play screen uses the shared background across the entire viewport. */
body{
  background-image:var(--page-surface),var(--page-backdrop);
  background-color:#030506;
  background-attachment:fixed;
}
.game{background:none;box-shadow:none}

#board .cell.legal:not(.capture) .destination-preview{
  stroke:var(--move-color,var(--gold));
  filter:drop-shadow(0 0 4px color-mix(in srgb,var(--move-color,var(--gold)) 40%,transparent));
}
.player.Black #end-turn{color:var(--ice);border-color:var(--ice);background:#0c1420;box-shadow:inset 0 0 6px #629dff22}

.friends-screen{text-align:left}
.friends-screen > .game-over-label,.friends-screen > h2{text-align:center}
.friends-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
dialog .friends-toolbar h3{margin:0;font-size:14px;letter-spacing:2px;font-weight:400}
.friends-toolbar h3 span{margin-left:6px;color:var(--muted);letter-spacing:0}
dialog .friends-toolbar button{margin:0;padding:10px 12px;min-height:44px;color:var(--gold);border-color:var(--gold);background:#13130b}
.friends-list{list-style:none;padding:0;margin:0;border:1px solid var(--panel-border);border-radius:15px;max-height:300px;overflow:auto}
.friend-row{display:flex;align-items:center;gap:12px;padding:14px;border-bottom:1px solid var(--line)}
.friend-row:last-child{border-bottom:0}
.friend-avatar{flex:none;width:38px;height:38px;display:grid;place-items:center;color:var(--ice);background:#12212c;border:1px solid #62788b;border-radius:50%;font-size:16px}
.friend-name{flex:1;min-width:0;overflow-wrap:anywhere;font-size:16px}
dialog .friend-row button{margin:0;min-height:40px;padding:8px 10px;flex:none}
.friends-empty{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:12px;text-align:center;min-height:210px;padding:28px 16px}
.friends-empty svg{width:48px;height:48px;fill:none;stroke:var(--ice);stroke-width:1.5;opacity:.8}
.friends-empty strong{font-size:16px;font-weight:400}
.friends-empty span{font-size:14px;color:var(--muted)}
dialog .friends-screen .friends-note{font-size:13px;line-height:1.6;color:var(--muted);margin:14px 0 22px;max-width:none}
.friends-screen .friend-label{text-transform:none;letter-spacing:0;font-size:15px;margin:0 0 10px}
#friend-name{font-size:16px;min-height:48px;padding:12px;border-radius:10px}
@media(max-width:420px){.friend-row{gap:8px;padding:12px 10px}.friends-toolbar{gap:8px}.friends-list{max-height:260px}}
