/* Match the existing secondary actions, including the pure-white theme. */
.about-entry button{background:var(--surface-soft);border:1px solid var(--line);border-radius:4px;box-shadow:none;padding:10px 12px;min-height:44px;font-size:16px;color:var(--text);font-weight:400}
.about-entry button:hover{background:var(--panel);border-color:var(--muted);box-shadow:none}
body[data-theme="minimal"] .about-entry button{background:#fff;border-color:#e1e1e1;color:#1b1b1b}
body[data-theme="minimal"] .about-entry button:hover{background:#f7f7f7;border-color:#737373}
@media(min-width:761px){
  .shell{--panel-width:302px;--arena-gap:24px;--shell-inset:48px;--board-side:min(calc(100svh - 120px),calc(100vw - var(--shell-inset) - var(--panel-width) - var(--arena-gap)),calc(1440px - var(--shell-inset) - var(--panel-width) - var(--arena-gap)));padding-bottom:24px}
  .topbar{height:80px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:24px}
  .topbar .brand{white-space:nowrap}
  .desktop-controls{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;min-width:0;gap:14px;max-width:none;overflow-x:auto;scrollbar-width:thin;scrollbar-color:var(--line) transparent;font-size:16px}
  .desktop-controls .theme-toolbar,.desktop-controls .field-top{display:contents;font-size:16px;white-space:nowrap;letter-spacing:0}
  .desktop-controls .theme-toolbar>label{flex-shrink:0}
  .desktop-controls .theme-toolbar select{font-size:16px;padding:6px 8px;max-width:132px;flex-shrink:0}
  .desktop-controls #custom-open{font-size:15px;min-height:36px;padding:5px 10px;flex-shrink:0}
  .desktop-controls .theme-toolbar #coord{order:2;font-size:16px;margin-left:0;max-width:135px;overflow:hidden;text-overflow:ellipsis;flex-shrink:0}
  .desktop-controls .field-top>span:first-child{order:1;flex-shrink:0}
  .desktop-controls #placement-hint{order:3;font-size:16px;flex-shrink:0}
  main{padding-top:16px}
  .arena-layout{display:grid;grid-template-columns:var(--board-side) var(--panel-width);gap:var(--arena-gap);justify-content:center;align-items:start}
  .battle-section{width:100%}
  .board-frame{width:100%}
  .command-panel{height:var(--board-side);max-height:var(--board-side);margin-top:0;display:flex;flex-direction:column;overflow:visible;position:relative;container:game-panel / size;padding:12px}
  .command-panel>*{flex-shrink:0}
  .command-panel .about-entry{margin:0;padding-top:8px;border-top:1px solid var(--line);justify-content:center}
  .command-panel .mode-tabs{padding:3px;gap:3px}.command-panel .mode-tabs button{font-size:15px;min-height:38px;padding:5px 4px}
  .command-panel:has(#difficulty-wrap:not([hidden])) .mode-tabs{padding-right:70px}
  .command-panel #difficulty-wrap{position:absolute;right:17px;top:17px;width:60px;z-index:1}
  .command-panel #difficulty-wrap .setting-row{margin:0;font-size:0;gap:0}.command-panel #difficulty{width:60px;min-height:30px;font-size:13px;padding:3px 4px}
  .command-panel .players{margin-top:10px}.command-panel .player{padding:9px 8px}.command-panel .versus{padding:5px 0}
  .command-panel .forecast{margin-top:10px;padding-top:9px}.command-panel .forecast-sides{margin:6px 0}.command-panel .forecast-sides strong{font-size:20px}.command-panel .forecast-note{margin-top:5px;font-size:13px;min-height:18px;line-height:1.4}
  .command-panel .stats{margin:10px 0;padding:9px 0}.command-panel .stats strong{font-size:20px}.command-panel .stats span{font-size:13px}
  .command-panel .actions{gap:7px}.command-panel .actions button{min-height:40px;font-size:15px;padding:6px 10px;gap:6px}
  .command-panel .move-details{flex:1 1 0;min-height:34px;position:relative;border-bottom:0;margin-top:5px}
  .command-panel .move-details summary{padding:7px 0;font-size:14px}
  .command-panel .move-log{position:absolute;top:37px;bottom:4px;left:0;right:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--line) transparent}
  .command-panel .history{max-height:none;overflow:visible}.command-panel .history li{font-size:13px;padding:5px 0}.command-panel .rules-note{font-size:12px;margin:6px 0}
  @container game-panel (max-height:620px){
    .command-panel .players{display:flex;gap:7px;margin-top:8px}.command-panel .players .versus{display:none}.command-panel .player{flex:1;min-width:0;gap:6px;padding:6px}.command-panel .player-label{font-size:14px}.command-panel .player .mini-core,.command-panel .player .cosmic-mini{width:25px;height:25px}
    .command-panel .forecast{margin-top:8px;padding-top:7px}.command-panel .forecast-head{font-size:13px}.command-panel .forecast-sides{font-size:13px;margin:5px 0}.command-panel .forecast-sides strong{font-size:18px}.command-panel .forecast-bar{height:6px}.command-panel .forecast-note{font-size:12px;margin-top:4px}
    .command-panel .stats{margin:8px 0;padding:7px 0}.command-panel .stats span{font-size:12px}.command-panel .stats strong{font-size:19px}
  }
  @container game-panel (max-height:480px){
    .command-panel .mode-tabs button{font-size:14px;min-height:32px;padding:3px}.command-panel .mode-tabs [data-mode="ai"]>span{display:none}
    .command-panel .players{margin-top:6px}.command-panel .player{padding:4px;gap:5px}.command-panel .player .mini-core,.command-panel .player .cosmic-mini{width:22px;height:22px}.command-panel .player-label{font-size:13px}
    .command-panel .forecast{margin-top:7px;padding-top:6px}.command-panel .forecast-sides strong{font-size:17px}.command-panel .forecast-head small{font-size:11px}
    .command-panel .stats{margin:6px 0;padding:5px 0}.command-panel .stats strong{font-size:18px;line-height:1.3;margin-top:1px}.command-panel .stats span{font-size:12px}
    .command-panel .actions button{font-size:14px;min-height:36px;padding:5px 8px}.command-panel .move-details{margin-top:3px}.command-panel .move-details summary{padding:5px 0}
  }
}
@media(min-width:761px) and (max-width:1100px){
  .topbar{gap:16px}
  .topbar .brand{font-size:20px;letter-spacing:0}
  .topbar .brand-mark{display:none}
  .topbar .header-actions{gap:5px}
  .topbar .sound-btn,.topbar .music-btn{font-size:12px;padding:7px 8px}
  .topbar .sound-btn #sound-icon{display:none}
}

/* A quiet, small footer action shared by all themes. */
.about-entry{gap:10px}
.about-entry #about-open{width:auto;min-width:96px;min-height:36px;padding:6px 20px;border:1px solid var(--line);border-radius:22px;background:color-mix(in srgb,var(--panel) 66%,transparent);color:var(--muted);font-size:14px;font-weight:400;line-height:1.4;letter-spacing:1px;box-shadow:none;flex:0 0 auto}
.about-entry #about-open:hover{color:var(--cyan);background:var(--panel);border-color:color-mix(in srgb,var(--cyan) 50%,var(--line));box-shadow:none}
.about-entry #about-open:focus-visible{outline:2px solid var(--cyan);outline-offset:3px}
@media(max-width:760px){
  .about-entry{margin-top:9px;padding:0 0 4px}.about-entry #about-open{min-width:100px;min-height:44px;padding:8px 22px}
  .about-entry:before,.about-entry:after{content:"";height:1px;width:28px;background:linear-gradient(90deg,transparent,var(--line))}.about-entry:after{transform:rotate(180deg)}
}
@media(min-width:761px) and (max-width:1000px){
  .shell{--panel-width:270px;--arena-gap:16px;--shell-inset:32px}
  .topbar{gap:12px}
  body[data-theme] .topbar .brand{font-size:18px;letter-spacing:0}
  .desktop-controls{gap:8px;font-size:15px}
  .desktop-controls .theme-toolbar>label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .desktop-controls .theme-toolbar,.desktop-controls .field-top{font-size:15px}
  .desktop-controls .theme-toolbar select{font-size:15px;min-width:112px;max-width:112px;padding:5px 6px}
  .desktop-controls #custom-open{font-size:14px;padding:5px 7px;min-height:34px}
  .desktop-controls .theme-toolbar #coord{font-size:15px;max-width:94px}
  .desktop-controls .field-top>span:first-child{max-width:104px;overflow:hidden;text-overflow:ellipsis}
  .desktop-controls #placement-hint{font-size:15px}
}

/* Phone controls: one status line, one action line, and a full-width board. */
@media(max-width:760px){
  .mobile-status-strip{display:flex;align-items:center;gap:7px;height:42px;padding:0 5px;min-width:0;font-size:14px}
  body[data-theme] .mobile-status-strip .theme-toolbar,.mobile-status-strip .field-top{display:contents;font-size:14px;white-space:nowrap}
  .mobile-status-strip .theme-toolbar>label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .mobile-status-strip .field-top>span:first-child{order:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .mobile-status-strip .live-dot{margin-right:5px}
  body[data-theme] .mobile-status-strip #coord{display:block;order:2;margin-left:0;font-size:12px;white-space:nowrap;flex-shrink:0;color:var(--muted)}
  .mobile-status-strip #custom-open{order:3;flex-shrink:0;font-size:12px;min-height:34px;padding:4px 6px}
  body[data-theme] .mobile-status-strip select{order:4;margin-left:auto;flex-shrink:0;min-width:104px;width:110px;max-width:110px;min-height:36px;font-size:14px;padding:4px 5px}
  body[data-theme="minimal"] .mobile-status-strip select{min-width:140px;width:140px;max-width:140px;font-size:13px}
  #placement-hint,.command-panel .players{display:none}
  .arena-layout{gap:8px}.command-panel{padding:0 5px}.mobile-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;align-items:stretch}
  .mobile-actions .actions,.mobile-actions .mode-tabs{display:contents}
  .mobile-actions button{display:flex;align-items:center;justify-content:center;gap:4px;width:100%;min-width:0;min-height:44px;margin:0;padding:6px 3px;border:1px solid var(--line);border-radius:5px;background:var(--surface);color:var(--text);font-size:14px;font-weight:400;line-height:1.25;white-space:nowrap;box-shadow:none;touch-action:manipulation}
  .mobile-actions button.selected{background:color-mix(in srgb,var(--cyan) 12%,var(--panel));color:var(--cyan);border-color:var(--cyan)}
  .mobile-actions #restart>span,.mobile-actions [data-mode="ai"]>span{display:none}
  .mobile-actions button:disabled{opacity:.4}.mobile-actions button:active:not(:disabled){background:color-mix(in srgb,var(--cyan) 12%,var(--panel))}
  .command-panel .forecast{margin-top:9px;padding-top:8px}.command-panel .forecast-head{font-size:14px}.command-panel .forecast-sides{margin:5px 0;font-size:13px}.command-panel .forecast-sides strong{font-size:18px}.command-panel .forecast-note{margin-top:4px;min-height:18px;font-size:12px;line-height:1.5}.command-panel .forecast-bar{height:6px}
  .command-panel .stats{margin:8px 0 0;padding:8px 0}.command-panel .stats span{font-size:12px}.command-panel .stats strong{font-size:20px}
  .command-panel .move-details summary{font-size:14px;padding:9px 0}.command-panel .setting-row{margin:8px 0}.about-entry{margin-top:8px}
}
@media(min-width:761px){body[data-theme="minimal"] .desktop-controls .theme-toolbar select{min-width:172px;max-width:172px}}
@media(max-width:360px){body[data-theme="minimal"] .mobile-status-strip{gap:4px}body[data-theme="minimal"] .mobile-status-strip #custom-open{padding:4px}body[data-theme="minimal"] .mobile-status-strip select{min-width:128px;width:128px;max-width:128px;font-size:12px;padding:4px 2px}body[data-theme="minimal"] .mobile-status-strip #coord{font-size:11px}}
