/* A personal fitting bay: identical interactions in solo, split-screen and online rooms. */
.gear-view { --gear-color: #83e7ff; --gear-glow: rgba(58, 215, 255, .14); color: #e8f3ff; text-align: left; min-width: 0; }
.gear-view[data-owner="2"] { --gear-color: #ffc184; --gear-glow: rgba(255, 154, 60, .14); }
.gear-heading { color: var(--gear-color); font-size: 12px; letter-spacing: 1px; text-align: center; margin: 4px 0 10px; }
.gear-tools { min-width: 0; }
.coop-pane, #loadoutScreen > .panel { position: relative; }
.gear-stage { display: grid; grid-template-columns: minmax(88px, 1fr) minmax(0, 1.75fr) minmax(88px, 1fr); align-items: center; gap: 12px; }
.gear-slots { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.gear-center { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.gear-view button { font: inherit; color: inherit; cursor: pointer; border: 1px solid #35526c; border-radius: 12px; background: #102036; min-width: 0; margin: 0; }
.gear-view button:disabled { opacity: .38; cursor: default; }
.gear-view button.gear-slot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 108px; padding: 12px 6px; background: linear-gradient(155deg, var(--gear-glow), #0b172b 85%); border-color: var(--gear-color); user-select: none; touch-action: none; }
.gear-view button.gear-slot.empty { border-style: dashed; border-color: #35526c; color: #8aa7be; }
.gear-slot-number { position: absolute; top: 7px; left: 10px; font-size: 10px; opacity: .65; letter-spacing: 2px; }
.gear-icon { font-size: 24px; line-height: 1; color: var(--gear-color); font-variant-emoji: text; }
.gear-slot b, .gear-item b { font-size: 12px; line-height: 1.4; font-weight: 600; overflow-wrap: anywhere; }
.gear-view button.gear-slot-central { min-height: 52px; flex-direction: row; gap: 8px; padding: 20px 8px 6px; border-radius: 10px; }
.gear-slot-central .gear-slot-number { left: 0; width: 100%; text-align: center; letter-spacing: 1px; }
.gear-slot-central .gear-icon { font-size: 20px; }
.gear-preview { position: relative; min-width: 0; height: 310px; border-radius: 50%; background: radial-gradient(ellipse at 50% 55%, var(--gear-glow), transparent 68%); }
.gear-preview::before { content: ''; position: absolute; inset: 8% 0; border: 1px solid var(--gear-glow); border-radius: 50%; pointer-events: none; }
.gear-preview canvas { position: relative; display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.gear-preview canvas:active { cursor: grabbing; }
.gear-preview > small { position: absolute; top: 0; left: 0; width: 100%; text-align: center; color: #7894ac; font-size: 10px; pointer-events: none; }
.gear-preview-controls { position: absolute; bottom: 0; left: 0; width: 100%; display: flex; justify-content: center; gap: 8px; }
.gear-preview-title { display: none; }
.gear-view .gear-preview-controls button { min-height: 32px; width: 40px; padding: 0; border-radius: 999px; color: var(--gear-color); background: #0b1a2b; font-size: 22px; line-height: 1; }
.gear-view .gear-preview-controls button[data-action="preview-expand"] { width: auto; min-width: 48px; padding: 0 10px; font-size: 11px; }
.gear-view .gear-preview.is-expanded { position: absolute; inset: 0; z-index: 5; width: auto; height: auto; padding: 40px 10px 55px; border-radius: 18px; background: radial-gradient(ellipse at center, #173647, #07101f 70%); }
.gear-view[data-owner="2"] .gear-preview.is-expanded { background: radial-gradient(ellipse at center, #453427, #07101f 70%); }
.gear-preview.is-expanded .gear-preview-title { display: block; position: absolute; top: 16px; left: 16px; font-size: 14px; color: var(--gear-color); }
.gear-preview.is-expanded .gear-preview-controls { bottom: 12px; }
.gear-preview.is-expanded > small { display: block; top: auto; bottom: 48px; }
.gear-combos { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 8px 0; }
.gear-combos:empty { display: none; }
.gear-combo-description { display: block; max-width: 36em; margin-top: 3px; font-weight: normal; line-height: 1.5; white-space: normal; color: #c9edff; }
.gear-detail { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: 64px; padding: 10px 12px; border: 1px solid #243c53; border-radius: 10px; background: #0a1626; color: #a3bdd2; font-size: 12px; line-height: 1.5; }
.gear-detail b { color: var(--gear-color); font-size: 13px; }
.gear-model-badge { display:block; color:#8faabd; font-size:9px; font-weight:normal; }
.gear-view button.custom-model { border-color:#ad9ce5; background:linear-gradient(135deg,#302842,#102036); }
.custom-model .gear-model-badge { color:#d5c2ff; }
.gear-base-stats { color:#a9c7d9; line-height:1.7; }
.gear-comparisons { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:6px; }
.gear-comparison { display:flex; flex-direction:column; gap:5px; padding:8px; border:1px solid #33435e; border-radius:9px; background:#0c1c2c; min-width:0; }
.gear-comparison small { font-size:10px; overflow-wrap:anywhere; }
.gear-view .gear-comparison button { padding:8px 4px; min-height:36px; font-size:11px; color:var(--gear-color); }
.gear-stat-deltas { display:flex; flex-wrap:wrap; gap:3px 8px; font-size:10px; }
.gear-detail .gain { color:#79ebbc; }
.gear-detail .loss { color:#ffa48e; }
.gear-link { color:#819ab0; }
.gear-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.gear-view:not(.has-selection) .gear-actions { display: none; }
.gear-view:not(.has-selection) .gear-detail { min-height: 0; border: 0; background: none; padding: 4px 0; }
.gear-view .gear-actions button { flex: 1 1 auto; min-height: 38px; padding: 6px 10px; font-size: 11px; text-align: center; }
.gear-view .gear-action-sell { border-color: #775639; color: #ffd19c; }
.gear-view .gear-action-give { border-color: #40646c; color: #a6e9d8; }
.gear-view h3 { margin: 12px 0 8px; font-size: 13px; color: #b5cee2; }
.gear-bag { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; min-height: 60px; padding: 8px; border: 1px dashed #35526c; border-radius: 12px; background: rgba(4, 12, 23, .5); }
.gear-view button.gear-item { display: flex; gap: 8px; align-items: center; min-height: 54px; padding: 8px; user-select: none; touch-action: none; }
.gear-item .gear-icon { font-size: 20px; }
.gear-empty { grid-column: 1 / -1; padding: 12px 4px; color: #7f9ab1; font-size: 12px; text-align: center; }
.gear-view .gear-hint, .gear-upgrades { margin: 8px 0; color: #7f9ab1; font-size: 11px; line-height: 1.6; }
.gear-view button[aria-pressed="true"] { background: #1d3c51; border-color: var(--gear-color); box-shadow: 0 0 14px var(--gear-glow); }
.gear-view[data-owner="2"] button[aria-pressed="true"] { background: #423025; }
.gear-view button.gear-focused { outline: 2px solid var(--gear-color); outline-offset: 2px; }
.gear-view .gear-slot.is-target { border-color: var(--gear-color); box-shadow: inset 0 0 15px var(--gear-glow); }
.gear-view .gear-drop-active { outline: 2px solid var(--gear-color); outline-offset: -3px; background: #24465b; }
.gear-ghost { position: fixed; z-index: 90; transform: translate(-50%, -50%); pointer-events: none; padding: 10px 14px; border-radius: 10px; border: 1px solid #83e7ff; color: #dcfaff; background: #10283e; box-shadow: 0 6px 28px #0009; font-size: 12px; }
.gear-ghost[data-owner="2"] { border-color: #ffc184; background: #362719; color: #ffe0b7; }
#loadoutScreen > .panel { width: min(880px, 100%); }
.coop-pane .gear-stage { gap: 8px; }
.coop-pane .gear-preview { height: 270px; }
.coop-pane .gear-slot { min-height: 94px; }
@media (max-width: 700px) {
  .gear-stage { gap: 6px; grid-template-columns: minmax(78px, 1fr) minmax(0, 1.65fr) minmax(78px, 1fr); }
  .gear-preview, .coop-pane .gear-preview { height: 230px; }
  .gear-view button.gear-slot { min-height: 84px; gap: 6px; }
  .gear-view button.gear-slot-central { min-height: 52px; }
  .gear-slot b { font-size: 11px; }
  .gear-view .gear-actions button { min-height: 40px; }
}
@media (max-height: 460px) and (orientation: landscape) {
  .gear-heading { display: none; }
  .gear-preview, .coop-pane .gear-preview { height: clamp(120px, calc(100dvh - 246px), 200px); }
  .gear-view button.gear-slot { min-height: 58px; gap: 5px; padding: 9px 5px; }
  .gear-slot-number { top: 4px; left: 6px; font-size: 8px; }
  .gear-icon { font-size: 19px; }
  .gear-slots { gap: 8px; }
  .gear-preview > small { display: none; }
  .gear-center { gap: 4px; }
  .gear-view button.gear-slot-central { min-height: 44px; padding: 17px 5px 5px; gap: 5px; }
  .gear-slot-central b { font-size: 10px; }
  .gear-detail { min-height: 54px; }
}
@media (min-width: 700px) and (max-height: 460px) and (orientation: landscape) {
  #loadoutScreen > .panel > .title { font-size:20px; margin:0 0 6px; }
  .online-prep .gear-preview, #loadoutScreen .gear-preview { height:clamp(90px, calc(100dvh - 270px), 150px); }
  .online-prep .gear-view, #loadoutScreen .gear-view { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 12px; align-items: start; }
  .online-prep .gear-tools, #loadoutScreen .gear-tools { max-height: calc(100dvh - 154px); overflow-y: auto; overscroll-behavior: contain; padding: 0 4px; }
  .online-prep .gear-stage, #loadoutScreen .gear-stage { grid-template-columns: minmax(80px, 1fr) minmax(0, 1.5fr) minmax(80px, 1fr); }
  .online-prep .gear-combos, #loadoutScreen .gear-combos { margin-top: 0; }
  .online-prep .gear-bag, #loadoutScreen .gear-bag { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .online-prep .gear-tools, #loadoutScreen .gear-tools { display: flex; flex-direction: column; }
  .online-prep .gear-tools > *, #loadoutScreen .gear-tools > * { flex-shrink: 0; }
  .online-prep .gear-tools h3, #loadoutScreen .gear-tools h3 { order: 0; margin: 0 0 6px; }
  .online-prep .gear-bag, #loadoutScreen .gear-bag { order: 1; padding: 6px; gap: 6px; }
  .online-prep .gear-view button.gear-item, #loadoutScreen .gear-view button.gear-item { min-height: 44px; padding: 6px; }
  .online-prep .gear-detail, #loadoutScreen .gear-detail { order: 2; }
  .online-prep .has-selection .gear-detail, #loadoutScreen .has-selection .gear-detail { order: -2; }
  .online-prep .gear-actions, #loadoutScreen .gear-actions { order: 3; }
  .online-prep .has-selection .gear-actions, #loadoutScreen .has-selection .gear-actions { order: -1; }
  .online-prep .gear-combos, #loadoutScreen .gear-combos { order: -1; }
  .online-prep .gear-hint, #loadoutScreen .gear-hint { order: 5; }
  .online-prep .gear-upgrades, #loadoutScreen .gear-upgrades { order: 6; }
}
.gear-slot.incompatible { opacity: .38; border-style: dashed; }
.personal-protection { display:block; color:#98dfff; font-size:11px; line-height:1.4; margin-top:4px; }
.auto-skills { display:none !important; }
.combat-toggles { display:flex; gap:8px; flex-wrap:wrap; margin:8px 0; }
.shop-filters { grid-column:1 / -1; display:flex; gap:6px; overflow-x:auto; min-width:0; padding:6px 0 12px; }
.shop-filters button { white-space:nowrap; min-height:36px; padding:6px 12px; }
.shop-filters button[aria-pressed="true"] { background:#18465c; border-color:#7dd5ee; }
.shop-blueprint { grid-column:1 / -1; font-size:12px; color:#9edee6; line-height:1.6; margin:4px 0 8px; }

/* Dropped items use rarity colors while the fitting bay keeps its player's color. */
.gear-view button.custom-model{border-color:var(--item-color);background:linear-gradient(135deg,color-mix(in srgb,var(--item-color) 14%,#102036),#102036)}
.custom-model .gear-model-badge{color:var(--item-color);font-size:10px}
.gear-item.protected::after,.gear-slot.protected::before{content:'◆';position:absolute;right:7px;top:6px;color:#ffe6a0;font-size:10px}
.gear-item{position:relative}
.gear-detail>span{white-space:pre-line;line-height:1.6}
.gear-view button.gear-bulk{order:4;width:100%;margin:8px 0;padding:8px;font-size:11px;min-height:40px;color:#ffd19c;border-color:#775639}
.gear-view button.gear-bulk.armed{border-color:#ffbf70;color:#ffdc9e;background:#382a19}
.gear-combo-description{font-size:10px;max-width:35em}

/* Rarity remains on the outer border; combo membership uses the inner band. */
.gear-slot.combo-linked::after { content:'';position:absolute;inset:4px;border:1px solid var(--combo-color);border-radius:8px;box-shadow:inset 0 0 12px color-mix(in srgb,var(--combo-color) 22%,transparent);pointer-events:none;animation:combo-join .7s ease-out; }
.gear-slot.combo-highlight::after { border-width:2px;box-shadow:inset 0 0 20px color-mix(in srgb,var(--combo-color) 40%,transparent),0 0 12px color-mix(in srgb,var(--combo-color) 30%,transparent); }
.gear-combo-badges {display:flex;gap:4px;position:absolute;right:8px;bottom:4px;font-size:12px;}
.gear-view .combochip {border-color:var(--combo-color);color:var(--combo-color);padding:6px 10px;text-align:left;}
.gear-view .combochip[aria-pressed="true"] {outline:2px solid var(--combo-color);outline-offset:2px;}
@keyframes combo-join {from {opacity:.25;filter:brightness(1.8);}to {opacity:1;filter:brightness(1);}}
.gear-sorting {display:flex;flex-wrap:wrap;gap:6px;margin:10px 0;}
.gear-view .gear-sorting button {min-height:38px;padding:6px 9px;font-size:11px;}
.gear-view .gear-item.sale-selected {outline:2px solid #ffd184;outline-offset:-4px;}
.item-stats {display:flex;flex-direction:column;gap:3px;margin:6px 0;min-width:0;font-size:12px;}
.item-stat {display:flex;justify-content:space-between;gap:14px;padding:4px 0;border-bottom:1px solid #8fb5d415;line-height:1.5;}
.item-stat span {color:inherit;overflow-wrap:anywhere;}
.item-stat b {color:inherit;white-space:nowrap;font-variant-numeric:tabular-nums;font-size:inherit;}
.item-stat.gain,.gear-stat-deltas .gain {color:#79ebbc;}
.item-stat.loss,.gear-stat-deltas .loss {color:#ffa48e;}
.item-signature {color:#ffcf79;line-height:1.6;}
.gear-stat-deltas {display:flex;flex-direction:column;}
.shop-reveal-change {display:block;margin-top:3px;}
.nav-selected {outline:2px solid #a3e8ff;outline-offset:-3px;}
@media(prefers-reduced-motion:reduce) {.gear-slot.combo-linked::after{animation:none;}}

.menu-control-hint {display:block;color:#93adc4;font-size:11px;margin:10px 0;line-height:1.5;}
html.is-touch .menu-control-hint {display:none;}

.item-stats-heading{color:#92aec3;font-size:10px;margin-top:6px;letter-spacing:.8px;}
.shop-reveal-change.gain{color:#79ebbc;}.shop-reveal-change.loss{color:#ffa48e;}
