.equipment-editor{padding:16px;margin:12px 0;background:#101c2c;border:1px solid #49677e;border-radius:14px;color:#e8f5ff;text-align:left}
.equipment-editor h3{color:#82e5fc;letter-spacing:2px;margin:0 0 12px}
.equipment-editor p{font:13px/1.5 system-ui;color:#c2d3e6}
.equipment-editor fieldset{border:0;padding:0;margin:18px 0;min-width:0}
.equipment-editor legend{font:800 12px system-ui;letter-spacing:1px;margin-bottom:10px;color:#ffe4a8}
.equipment-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:10px}
.equipment-card{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:7px;min-height:90px;min-width:0;padding:12px 10px;border:1px solid #527087;border-radius:12px;color:#eaf7ff;background:#15273a;font:13px system-ui;text-align:center;touch-action:manipulation}
.equipment-card canvas{width:72px;height:83px;object-fit:contain}
.equipment-card span{font:12px/1.4 system-ui;color:#bbccdd}
.equipment-card small{font:800 9px system-ui;color:#91dcbe}
.equipment-card[aria-pressed=true]{border:2px solid #ffe2a1;background:#263849;box-shadow:inset 0 0 0 1px #ffe2a133}
.equipment-card:focus-visible,.equipment-save:focus-visible{outline:3px solid #ffe2a1;outline-offset:3px}
.equipment-save{width:100%;min-height:48px;border:1px solid #b6eafd;border-radius:10px;background:#204a60;color:#fff;font-weight:900;touch-action:manipulation}
.equipment-editor button:disabled{opacity:.5;cursor:default}
.equipment-summary{padding:12px;background:#081523;border-radius:8px}
.equipment-ability{width:100%;min-height:52px;padding:8px 3px;border:1px solid #f4d58b;background:#3a3041;color:#fff5cf;border-radius:9px;font:800 11px/1.35 system-ui;white-space:normal;overflow-wrap:anywhere;touch-action:manipulation}
.equipment-ability:disabled{opacity:.5}
.equipment-ability[data-phase=holding],.equipment-ability[data-phase=armed]{background:#5a4826;border-color:#fff1a4;opacity:1}
.equipment-player-picker{width:100%;min-height:44px;background:#15273a;color:#eaf7ff;border:1px solid #527087;border-radius:8px;padding:8px}
.equipment-theme{display:block;color:#a5e6ed;font:700 10px/1.35 ui-monospace,monospace;letter-spacing:.04em}
@media(max-width:500px){.equipment-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.equipment-editor{padding:10px}}
/* Independent module choices and hull hangar; all controls remain in menus/backfields. */
.advanced-editor{margin-top:20px;padding-top:14px;border-top:1px solid #34546c;color:#cee9f3}.advanced-editor h3{font:800 17px system-ui;color:#c6f5ff}.advanced-editor p{font:12px/1.55 system-ui}.advanced-editor fieldset{min-width:0;border:1px solid #35516b;border-radius:10px;padding:12px;margin:14px 0}.advanced-editor legend{font:800 11px system-ui;letter-spacing:.6px;color:#91d2e4}.module-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:8px}.module-card,.ship-card{min-height:64px;background:#0d2034;border:1px solid #36566f;border-radius:9px;color:#deeff7;padding:10px;text-align:left;cursor:pointer;touch-action:manipulation;min-width:0}.module-card strong,.ship-card strong{display:block;font:800 13px system-ui}.module-card span,.ship-card span{display:block;font:11px/1.5 system-ui;color:#a9c2d3;margin-top:5px}.module-card[aria-pressed=true],.ship-card[aria-pressed=true]{border-color:#4ee5e5;box-shadow:inset 0 0 0 1px #4ee5e5;background:#163744}.module-card:focus-visible,.ship-card:focus-visible,.module-save:focus-visible,.module-activate:focus-visible{outline:3px solid #f9ce7d;outline-offset:2px}.ship-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:8px}.ship-card canvas{display:block;width:84px;height:112px;margin:auto}.ship-card small{font:9px system-ui;color:#8fddc6}.advanced-editor select{min-height:44px;background:#122d40;color:#d9f3ff;border:1px solid #46677c;border-radius:6px;padding:8px;max-width:100%;margin:7px}.advanced-editor label{display:block;font:12px system-ui}.module-save,.module-activate{min-height:44px;min-width:44px;border:1px solid #62e2e7;background:#164355;color:#e7fbff;border-radius:8px;padding:9px;font:800 11px/1.3 system-ui;touch-action:manipulation;white-space:normal;overflow-wrap:anywhere}.module-save:disabled,.module-activate:disabled{opacity:.5;cursor:default}.module-controls{display:flex;flex-direction:column;gap:5px;width:100%}.module-controls[hidden]{display:none!important}.module-readout{font:10px/1.35 system-ui!important;margin:0!important;color:#a8ebd7}.module-activate{width:100%}.module-activate[data-phase=ready]{border-color:#c2fb85;background:#264c45}.module-selection-summary{color:#a9e9ef}.module-save-status{min-height:18px;color:#b6f3ce}.advanced-editor button{box-sizing:border-box}
@media(max-width:700px){.module-grid,.ship-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.module-card,.ship-card{padding:8px}.module-card strong,.ship-card strong{font-size:12px}.module-controls{gap:3px}.module-readout{font-size:9px!important}.module-activate{padding:6px 3px;font-size:10px}}

/* One horizontal selector per choice; physical frames are attached to ships. */
.advanced-editor .loadout-carousel{display:flex;flex-wrap:nowrap;gap:10px;overflow-x:auto;overflow-y:hidden;max-width:100%;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;padding:5px 3px 12px;scrollbar-color:#6bafa9 #112637;scrollbar-width:thin}
.advanced-editor .loadout-carousel>.module-card{flex:0 0 230px;scroll-snap-align:center;min-height:100px}.advanced-editor .loadout-carousel>.ship-card{flex:0 0 195px;scroll-snap-align:center;min-height:245px}.advanced-editor .carousel-nav{display:flex;justify-content:flex-end;gap:8px;margin-top:5px}.advanced-editor .carousel-nav button{width:44px;min-height:44px;background:#14394b;color:#dcf9ff;border:1px solid #5aa4ae;border-radius:8px;font-size:25px;touch-action:manipulation}.advanced-editor fieldset{margin:10px 0;padding:9px}.advanced-editor details{margin:10px 0}.advanced-editor summary{min-height:44px;line-height:44px;cursor:pointer}.advanced-editor .ship-card small{display:block;margin-top:7px;line-height:1.5}.advanced-editor .module-save{width:100%}
@media(max-width:500px){.advanced-editor .loadout-carousel>.module-card{flex-basis:75%}.advanced-editor .loadout-carousel>.ship-card{flex-basis:72%}}

#practice-arena{min-height:44px;width:100%;max-width:100%;padding:8px;background:#152b3b;color:#e2f3fa;border:1px solid #54818c;border-radius:8px}.arena-preview{display:block;width:100%;max-width:320px;height:auto;border:1px solid #365465;border-radius:8px;margin-top:10px}

.local-preferences>details>summary{min-height:44px;line-height:44px;cursor:pointer}

/* Content-sized cards: end gutters allow the first/last card to center fully. */
.advanced-editor .loadout-carousel{box-sizing:border-box;width:100%;min-width:0;max-width:100%;padding:8px var(--edge-space,12px) 14px;scroll-padding-inline:var(--edge-space,12px);overflow-x:auto;overflow-y:auto;align-items:stretch;touch-action:pan-x pan-y;user-select:none;scroll-behavior:auto;cursor:grab}
.advanced-editor .loadout-carousel:active{cursor:grabbing}
.advanced-editor .loadout-carousel>.module-card,.advanced-editor .loadout-carousel>.ship-card{flex:0 0 var(--card-width,260px);width:var(--card-width,260px);max-width:100%;min-height:0;height:auto;scroll-snap-align:center;scroll-snap-stop:always;padding:12px;white-space:normal;overflow-wrap:anywhere;display:flex;flex-direction:column;gap:7px;position:relative;touch-action:pan-x pan-y}
.advanced-editor .loadout-carousel strong{font:800 14px/1.4 system-ui;white-space:normal;overflow:visible}
.advanced-editor .loadout-carousel span{font:13px/1.5 system-ui;white-space:normal;overflow:visible;margin:0}
.advanced-editor .loadout-carousel small{display:block;font:11px/1.5 system-ui;white-space:normal;color:#c7e4e8;margin:0}
.advanced-editor .ship-card canvas{width:72px;height:96px;flex:0 0 96px;object-fit:contain;pointer-events:none}
.advanced-editor .selection-badge{margin-top:auto!important;min-height:18px;padding-top:7px;color:#bcefae!important;font-weight:800!important;letter-spacing:.4px}
.advanced-editor fieldset{box-sizing:border-box;max-width:100%;overflow:visible}
.advanced-editor .loadout-carousel button:focus-visible{outline-offset:-4px}
@media(max-height:450px){.advanced-editor .ship-card canvas{height:72px;width:54px;flex-basis:72px}.advanced-editor .loadout-carousel>.ship-card{gap:4px}}


/* Quiet match controls. Labels remain available to assistive technology. */
.match-sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important;border:0!important}
.match-backfield.inventory-backfield{justify-content:center!important;padding:48px 8px 12px!important;gap:16px!important}
.match-backfield .module-controls{align-items:center;gap:16px}
.passive-indicator{display:block;width:14px;height:14px;min-height:14px;border:2px solid #657580;border-radius:50%;background:#1b2931;box-sizing:border-box}
.passive-indicator[data-armed=true]{background:#baf784;border-color:#e0ffc3;box-shadow:0 0 7px #a5f764a0}
.passive-indicator[data-active=true]{background:#79e6d4;border-color:#b4fff2;box-shadow:0 0 7px #4cdbc880}
.match-backfield .module-activate,body #match-inventory-items button{display:grid;place-items:center;width:44px;height:44px;min-width:44px;min-height:44px;max-width:44px;padding:10px;border:1px solid #5c8490;border-radius:50%;background:#14303b;color:#b4e8ed;margin:0 auto}
.match-backfield .module-activate:not(:disabled){border-color:#b8efa0;background:#284a39;color:#e1ffcf;box-shadow:0 0 7px #b5f88440}
.match-backfield .module-activate:disabled{opacity:.35;box-shadow:none}
.match-backfield button svg{width:22px;height:22px;pointer-events:none}
.match-audio-options{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px;margin-top:18px}
.match-audio-options>button{min-height:44px;min-width:90px;border:1px solid #516977;border-radius:8px;background:#1c303b;color:#dcebf0;padding:9px 12px;font:700 12px system-ui;cursor:pointer}
body[data-online-match=active] .online-match-toggle,.game-frame.is-match-screen .match-pause-button:not([hidden]){isolation:isolate;display:grid;place-items:center;width:44px;height:44px;min-width:44px;min-height:44px;padding:10px;border:0;border-radius:50%;background:transparent;color:#dae7ed;box-shadow:none;top:max(4px,env(safe-area-inset-top));right:max(6px,env(safe-area-inset-right))}
.online-match-toggle::before,.match-pause-button::before{content:"";position:absolute;inset:7px;z-index:-1;background:#101e29b8;border:1px solid #7d939c88;border-radius:50%}
.online-match-toggle svg,.match-pause-button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;pointer-events:none}
.match-backfield .match-icon-button{display:grid;place-items:center;width:44px;height:44px;min-width:44px;min-height:44px;padding:10px;margin:0 auto;background:#14303b;border:1px solid #5c8490;border-radius:50%;color:#b4e8ed}
.match-backfield .match-icon-button[hidden]{display:none!important}

.match-backfield [hidden]{display:none!important}
.match-backfield .module-activate[data-phase=committed],.match-backfield .module-activate[data-phase=active]{opacity:1;border-color:#ffd68b;background:#4b3c24;color:#ffe3a5;box-shadow:0 0 7px #ffd68b44}
