:root {
  color-scheme: dark;
  --ui-scale: 1;
  --ui-inverse-scale: 1;
  --ui-safe-width: 100vw;
  --ui-safe-height: 100vh;
  --ui-safe-half-width: 50vw;
  --ui-safe-half-height: 50vh;
  --boss-hud-top: 78px;
  --action-slot: 48px;
  --action-orb: 84px;
  --action-gap: 7px;
  --action-bottom: 23px;
  --action-side-width: 213px;
  --action-total-width: 524px;
  --ink: #eef5ff;
  --muted: #8fa0b8;
  --panel: rgba(13, 17, 28, 0.74);
  --panel-strong: rgba(18, 23, 37, 0.9);
  --line: rgba(162, 190, 225, 0.22);
  --cyan: #68e7ff;
  --violet: #a781ff;
  --pink: #ff6fbc;
  --amber: #ffd166;
  --green: #9ee37d;
  --danger: #ff637d;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #05070d;
  color: var(--ink);
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
}

button {
  font: inherit;
}

button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

[hidden] {
  display: none !important;
}

#game-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-width: 320px;
  min-height: 520px;
  background: #070911;
  isolation: isolate;
}

#game {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  image-rendering: pixelated;
  backface-visibility: hidden;
}

.webgl-world-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none;
  background: transparent !important;
  image-rendering: pixelated;
  mix-blend-mode: normal;
}

.offscreen-world-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none;
  background: #070911;
  image-rendering: pixelated;
  mix-blend-mode: normal;
}

.game-overlay-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none;
  background: transparent !important;
  image-rendering: pixelated;
}

.pixi-effects-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none;
  background: transparent !important;
  mix-blend-mode: screen;
}

.perf-debug {
  position: absolute;
  z-index: 6;
  top: 12px;
  left: 76px;
  display: grid;
  gap: 2px;
  min-width: 164px;
  padding: 8px 10px;
  border: 1px solid rgba(104, 231, 255, 0.32);
  border-radius: 5px;
  background: rgba(4, 8, 15, 0.66);
  box-shadow:
    0 0 18px rgba(104, 231, 255, 0.12),
    inset 0 0 0 1px rgba(238, 245, 255, 0.04);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
  pointer-events: none;
}

.perf-debug span {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-variant-numeric: tabular-nums;
}

.perf-debug strong {
  color: var(--cyan);
}

.perf-debug small {
  overflow: hidden;
  max-width: 170px;
  color: var(--amber);
  font-size: 9px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.low-graphics *,
html.low-graphics *::before,
html.low-graphics *::after {
  animation: none !important;
  transition: none !important;
  filter: none !important;
  text-shadow: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

html.low-graphics .hud,
html.low-graphics .battle-timer,
html.low-graphics .boss-hud,
html.low-graphics .minimap-panel,
html.low-graphics .hud-right,
html.low-graphics .chat-panel,
html.low-graphics .bottom-command-bar,
html.low-graphics .quick-button,
html.low-graphics .inventory-panel,
html.low-graphics .storage-panel,
html.low-graphics .trade-panel,
html.low-graphics .market-panel,
html.low-graphics .grinder-panel,
html.low-graphics .item-upgrade-panel,
html.low-graphics .flow-card,
html.low-graphics .modal-panel,
html.low-graphics .perf-debug {
  background-color: rgba(5, 8, 15, 0.88) !important;
  background-image: none !important;
}

html.low-graphics .webgl-world-layer,
html.low-graphics .offscreen-world-layer,
html.low-graphics .game-overlay-layer,
html.low-graphics .pixi-effects-layer {
  mix-blend-mode: normal;
}

.hud {
  position: absolute;
  z-index: 3;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.hud-left {
  display: none !important;
}

.battle-timer {
  position: absolute;
  z-index: 4;
  top: 15px;
  left: 50%;
  display: grid;
  min-width: 142px;
  padding: 8px 18px 9px;
  border: 1px solid rgba(104, 231, 255, 0.42);
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(104, 231, 255, 0.08), rgba(255, 209, 102, 0.08)),
    rgba(6, 10, 19, 0.8);
  box-shadow:
    0 0 28px rgba(104, 231, 255, 0.14),
    inset 0 0 0 1px rgba(238, 245, 255, 0.05);
  text-align: center;
  transform: translateX(-50%) scale(var(--ui-scale));
  transform-origin: top center;
  pointer-events: none;
}

.battle-timer span {
  color: var(--cyan);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.8px;
}

.battle-timer strong {
  color: var(--ink);
  font-size: 27px;
  font-weight: 950;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(104, 231, 255, 0.42);
}

.boss-hud {
  position: absolute;
  z-index: 5;
  top: var(--boss-hud-top);
  left: 50%;
  display: grid;
  gap: 7px;
  width: min(720px, calc(100vw - 32px));
  padding: 8px 14px 10px;
  border: 1px solid rgba(255, 209, 102, 0.44);
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(255, 79, 139, 0.12), rgba(255, 209, 102, 0.08), rgba(104, 231, 255, 0.08)),
    rgba(5, 8, 15, 0.76);
  box-shadow:
    0 0 34px rgba(255, 79, 139, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  text-align: center;
  transform: translateX(-50%) scale(var(--ui-scale));
  transform-origin: top center;
  pointer-events: none;
}

.boss-hud-list {
  display: grid;
  gap: 8px;
}

.boss-hud-row {
  display: grid;
  gap: 5px;
}

.boss-hud-top {
  display: grid;
  gap: 1px;
}

.boss-hud-top span {
  color: var(--amber);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 2px;
}

.boss-hud-top strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(255, 79, 139, 0.48);
}

.boss-health-track {
  overflow: hidden;
  height: 13px;
  border: 1px solid rgba(255, 209, 102, 0.5);
  border-radius: 2px;
  background: rgba(2, 4, 10, 0.9);
}

.boss-health-track span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #ff4f8b, #ff8a66, #ffd166);
  box-shadow: 0 0 18px rgba(255, 79, 139, 0.48);
  transition: width 120ms ease;
}

.boss-hud small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.stat-line:has(#legacyTimer) {
  display: none;
}

.right-stack {
  position: absolute;
  z-index: 3;
  top: 16px;
  right: 16px;
  display: grid;
  gap: 8px;
  width: min(240px, calc(50vw - 24px));
  transform: scale(var(--ui-scale));
  transform-origin: top right;
  pointer-events: none;
}

.hud-right {
  position: relative;
  top: auto;
  right: auto;
  width: 100%;
  transform: none;
  transform-origin: top right;
  pointer-events: auto;
}

.minimap-panel {
  position: relative;
  z-index: auto;
  top: auto;
  right: auto;
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(13, 17, 28, 0.72);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
  transform: none;
  transform-origin: top right;
  pointer-events: none;
}

.minimap-orbit {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  border: 1px solid rgba(104, 231, 255, 0.28);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(104, 231, 255, 0.1), transparent 54%),
    linear-gradient(rgba(104, 231, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(104, 231, 255, 0.07) 1px, transparent 1px),
    rgba(3, 6, 12, 0.76);
  background-size: auto, 22px 22px, 22px 22px, auto;
}

.minimap-ring {
  position: absolute;
  inset: 28px;
  border: 1px solid rgba(167, 129, 255, 0.2);
  border-radius: 50%;
}

.minimap-ring.ring-b {
  inset: 52px;
  border-color: rgba(255, 209, 102, 0.18);
}

.minimap-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.player-dot {
  z-index: 4;
  width: 10px;
  height: 10px;
  background: var(--amber);
  box-shadow: 0 0 14px rgba(255, 209, 102, 0.86);
}

.portal-dot {
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(104, 231, 255, 0.72);
}

.enemy-dot {
  z-index: 3;
  width: 7px;
  height: 7px;
  background: var(--danger);
  box-shadow: 0 0 9px rgba(255, 99, 125, 0.78);
}

.mine-dot {
  z-index: 3;
  width: 6px;
  height: 6px;
  background: var(--violet);
  box-shadow: 0 0 9px rgba(167, 129, 255, 0.78);
}

.loot-dot {
  z-index: 3;
}

.gold-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffd166;
  box-shadow: 0 0 10px rgba(255, 209, 102, 0.86);
}

.item-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: #68e7ff;
  box-shadow: 0 0 10px rgba(104, 231, 255, 0.82);
  transform: translate(-50%, -50%) rotate(45deg);
}

.life-dot {
  width: 10px;
  height: 10px;
  border: 1px solid rgba(137, 255, 115, 0.94);
  border-radius: 3px;
  background: rgba(137, 255, 115, 0.18);
  box-shadow: 0 0 10px rgba(137, 255, 115, 0.72);
}

.life-dot::before,
.life-dot::after {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: 6px;
  height: 2px;
  border-radius: 2px;
  background: #dcffd7;
  content: "";
  transform: translate(-50%, -50%);
}

.life-dot::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.chest-dot {
  width: 11px;
  height: 8px;
  border: 1px solid rgba(255, 209, 102, 0.94);
  border-radius: 2px;
  background:
    linear-gradient(90deg, transparent 44%, rgba(255, 244, 188, 0.92) 45% 55%, transparent 56%),
    linear-gradient(#91601b, #40290f);
  box-shadow: 0 0 11px rgba(255, 209, 102, 0.78);
}

.minimap-panel strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-kill-counter {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(104, 231, 255, 0.34);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(13, 17, 28, 0.86), rgba(15, 42, 56, 0.68));
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.24),
    inset 0 0 18px rgba(104, 231, 255, 0.06);
  pointer-events: none;
}

.battle-kill-counter[hidden] {
  display: none;
}

.battle-kill-counter span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.4px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.battle-kill-counter strong {
  min-width: 42px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  text-align: right;
  text-shadow: 0 0 12px rgba(104, 231, 255, 0.35);
}

.upgrade-hud {
  top: 50%;
  left: 14px;
  width: min(294px, calc(50vw - 24px));
  max-height: min(560px, calc(100vh - 150px));
  overflow: visible;
  transform: translateY(-50%) scale(var(--ui-scale));
  transform-origin: left center;
  pointer-events: auto;
}

.passive-effects {
  position: absolute;
  z-index: 4;
  top: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: scale(var(--ui-scale));
  transform-origin: top left;
  pointer-events: auto;
}

.hub-ad-left {
  position: absolute;
  z-index: 2;
  top: 42%;
  width: min(320px, 23vw);
  min-width: 250px;
  min-height: 280px;
  padding: 10px;
  border: 1px solid rgba(104, 231, 255, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(13, 17, 28, 0.42), rgba(5, 8, 15, 0.3));
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.2),
    inset 0 0 0 1px rgba(238, 245, 255, 0.04);
  transform: translateY(-50%) scale(var(--ui-scale));
  transform-origin: left center;
  pointer-events: auto;
}

.hub-ad-left[hidden] {
  display: none;
}

.hub-ad-left .adsbygoogle {
  display: block;
  width: 100%;
  min-height: 250px;
}

.passive-effect-icon {
  --passive-a: var(--amber);
  --passive-b: var(--green);
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 1px solid rgba(255, 209, 102, 0.62);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 209, 102, 0.22), transparent 54%),
    linear-gradient(180deg, rgba(13, 17, 28, 0.92), rgba(5, 8, 15, 0.96));
  box-shadow:
    0 0 18px rgba(255, 209, 102, 0.18),
    inset 0 0 0 1px rgba(238, 245, 255, 0.06);
  color: var(--ink);
  cursor: default;
}

.passive-effect-icon::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 209, 102, 0.2);
  border-radius: 6px;
  background:
    linear-gradient(90deg, transparent 0 48%, rgba(255, 209, 102, 0.18) 48% 52%, transparent 52%),
    linear-gradient(180deg, transparent 0 48%, rgba(255, 209, 102, 0.18) 48% 52%, transparent 52%);
  pointer-events: none;
}

.passive-effect-icon .passive-glyph {
  position: relative;
  display: block;
  width: 31px;
  height: 31px;
  image-rendering: pixelated;
}

.passive-effect-icon .passive-glyph::before,
.passive-effect-icon .passive-glyph::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.passive-effect-icon.drop-rate .passive-glyph::before {
  left: 9px;
  top: 0;
  width: 13px;
  height: 13px;
  clip-path: polygon(50% 0, 100% 45%, 70% 100%, 30% 100%, 0 45%);
  background: linear-gradient(180deg, #fff4b8, var(--amber) 48%, #f2a84e);
  box-shadow:
    -8px 11px 0 -3px rgba(158, 227, 125, 0.92),
    8px 11px 0 -3px rgba(104, 231, 255, 0.88),
    0 0 12px rgba(255, 209, 102, 0.72);
}

.passive-effect-icon.drop-rate .passive-glyph::after {
  left: 5px;
  right: 5px;
  bottom: 1px;
  height: 14px;
  border: 2px solid var(--green);
  border-top-color: rgba(158, 227, 125, 0.36);
  border-radius: 3px;
  background:
    linear-gradient(90deg, transparent 0 42%, rgba(158, 227, 125, 0.55) 42% 58%, transparent 58%),
    linear-gradient(180deg, rgba(158, 227, 125, 0.24), rgba(17, 36, 22, 0.96));
  box-shadow: 0 0 12px rgba(158, 227, 125, 0.38);
}

.passive-effect-icon strong {
  position: absolute;
  right: -5px;
  bottom: -5px;
  display: grid;
  place-items: center;
  min-width: 29px;
  height: 18px;
  padding: 0 4px;
  border: 1px solid rgba(255, 209, 102, 0.75);
  border-radius: 5px;
  background: rgba(5, 8, 15, 0.96);
  color: var(--amber);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 10px rgba(255, 209, 102, 0.28);
}

.passive-tooltip {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 8;
  display: grid;
  gap: 3px;
  width: 188px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 209, 102, 0.44);
  border-radius: 6px;
  background: rgba(6, 10, 18, 0.96);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
  pointer-events: none;
}

.passive-tooltip b,
.passive-tooltip small {
  display: block;
  text-align: left;
}

.passive-tooltip b {
  color: var(--amber);
  font-size: 12px;
  line-height: 1.1;
}

.passive-tooltip small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.passive-effect-icon:hover .passive-tooltip,
.passive-effect-icon:focus-visible .passive-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.hud-kicker {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
}

.stat-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 25px;
  color: var(--muted);
  font-size: 13px;
}

.stat-line strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: board;
}

.leaderboard li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 24px;
  padding: 3px 0;
  color: var(--muted);
  font-size: 12px;
}

.leaderboard li::before {
  counter-increment: board;
  content: counter(board);
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 800;
}

.leaderboard .you {
  color: var(--ink);
}

.leaderboard span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard .leader-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.leaderboard .flag-badge {
  flex: 0 0 20px;
  width: 22px;
  height: 15px;
}

.leaderboard b {
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.team-list {
  gap: 7px;
}

.team-list li {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 30px;
  padding: 5px 0;
}

.team-list li::before {
  display: none;
  content: none;
}

.team-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.team-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: normal;
}

.team-actions {
  display: flex;
  gap: 5px;
}

.team-list button {
  min-height: 24px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(104, 231, 255, 0.09);
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.team-list button:hover {
  border-color: rgba(104, 231, 255, 0.62);
  background: rgba(104, 231, 255, 0.18);
}

.team-list button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

.party-invite {
  border-bottom: 1px solid rgba(104, 231, 255, 0.14);
}

.trade-request {
  border-bottom: 1px solid rgba(255, 111, 188, 0.2);
}

.trade-request .team-copy strong {
  color: var(--pink);
}

.trade-request.outgoing .team-copy strong {
  color: var(--amber);
}

.friend-request {
  border-bottom: 1px solid rgba(104, 231, 255, 0.2);
}

.friend-request .team-copy strong {
  color: var(--cyan);
}

.friend-request.outgoing .team-copy strong {
  color: var(--amber);
}

.mission-return-request {
  border-bottom: 1px solid rgba(255, 209, 102, 0.28);
}

.mission-return-request .team-copy strong {
  color: var(--amber);
}

.mission-return-request button {
  border-color: rgba(255, 209, 102, 0.72);
  background: rgba(255, 209, 102, 0.16);
  color: #fff4c6;
  animation: mission-return-pulse 0.82s ease-in-out infinite;
}

@keyframes mission-return-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(255, 209, 102, 0);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 0 14px rgba(255, 209, 102, 0.48);
    transform: translateY(-1px);
  }
}

.team-status {
  border-bottom: 1px solid rgba(255, 209, 102, 0.18);
}

.team-member {
  color: var(--muted);
}

.team-member b {
  color: var(--cyan);
  font-size: 10px;
}

.team-empty {
  color: var(--muted);
}

.party-context-menu {
  position: absolute;
  z-index: 7;
  display: grid;
  gap: 7px;
  min-width: 168px;
  padding: 9px;
  border: 1px solid rgba(104, 231, 255, 0.42);
  border-radius: 6px;
  background: rgba(8, 12, 21, 0.94);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.36);
  pointer-events: auto;
}

.party-context-menu strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.party-context-menu button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 209, 102, 0.55);
  border-radius: 4px;
  background: rgba(255, 209, 102, 0.12);
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.party-context-menu button:hover {
  background: rgba(255, 209, 102, 0.22);
}

.party-context-menu button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.chat-panel {
  --chat-alpha: 0.74;
  position: absolute;
  z-index: 4;
  left: max(16px, calc(50% - 260px));
  bottom: 116px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  width: min(520px, calc(100vw - 320px));
  height: 260px;
  min-width: 320px;
  min-height: 210px;
  max-width: calc(100vw - 80px);
  max-height: calc(100vh - 170px);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(13, 17, 28, var(--chat-alpha));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  resize: both;
  overflow: auto;
  transform: scale(var(--ui-scale));
  transform-origin: bottom left;
  pointer-events: auto;
}

.chat-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 22px;
}

.chat-head .hud-kicker {
  margin: 0;
}

.chat-opacity-control {
  display: grid;
  grid-template-columns: auto 82px;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.chat-opacity-control input {
  width: 82px;
  accent-color: var(--cyan);
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 92px;
  overflow: auto;
  padding-right: 3px;
}

.chat-message {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.chat-message .flag-badge {
  width: 20px;
  height: 14px;
  margin-top: 1px;
}

.chat-message strong {
  color: var(--cyan);
  font-size: 11px;
}

.chat-message span {
  overflow-wrap: anywhere;
}

.chat-message.you strong {
  color: var(--amber);
}

.chat-message.private {
  padding: 5px 6px;
  border: 1px solid rgba(167, 129, 255, 0.22);
  border-radius: 5px;
  background: rgba(167, 129, 255, 0.08);
}

.chat-message.private strong {
  color: var(--violet);
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.chat-form input,
.chat-form button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(3, 6, 12, 0.62);
  color: var(--ink);
}

.chat-form input {
  width: 100%;
  padding: 0 9px;
  outline: none;
}

.chat-form input:focus {
  border-color: rgba(104, 231, 255, 0.72);
}

.chat-form button {
  padding: 0 10px;
  background: rgba(104, 231, 255, 0.12);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.chat-form button:hover {
  background: rgba(104, 231, 255, 0.22);
}

.power-panel {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
  align-items: center;
  width: 100%;
  min-height: 118px;
  padding: 0;
  transform: none;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, transparent, rgba(3, 6, 12, 0.2) 58%, rgba(3, 6, 12, 0.46));
  box-shadow: none;
  backdrop-filter: none;
  pointer-events: none;
}

.mmo-actionbar {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: var(--action-bottom);
  display: grid;
  grid-template-columns: repeat(4, var(--action-slot)) var(--action-orb) repeat(4, var(--action-slot));
  align-items: center;
  gap: var(--action-gap);
  padding: 0;
  transform: translateX(-50%) scale(var(--ui-scale));
  transform-origin: bottom center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: auto;
}

.skill-slot,
.quick-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--action-slot);
  height: var(--action-slot);
  border: 1px solid rgba(104, 231, 255, 0.34);
  border-radius: 6px;
  background:
    radial-gradient(circle at 50% 34%, rgba(104, 231, 255, 0.14), transparent 54%),
    rgba(4, 8, 16, 0.88);
  color: var(--ink);
  font-weight: 900;
  cursor: default;
}

.skill-slot.primary {
  border-color: rgba(255, 111, 188, 0.62);
  box-shadow: 0 0 16px rgba(255, 111, 188, 0.14);
}

.skill-slot.locked {
  opacity: 0.54;
}

.skill-slot span,
.quick-icon span {
  font-size: 13px;
}

.skill-slot {
  overflow: hidden;
  cursor: pointer;
}

.skill-slot.has-skill {
  cursor: grab;
}

.skill-slot.has-skill:active,
.skill-slot.has-skill.dragging {
  cursor: grabbing;
}

.skill-slot .slot-key {
  position: relative;
  z-index: 2;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.skill-slot.has-skill .slot-key {
  opacity: 0.24;
  transform: translateY(10px) scale(0.86);
}

.slot-skill-icon {
  position: absolute;
  z-index: 1;
  inset: 5px;
  display: grid;
  place-items: center;
  color: var(--skill-color, var(--cyan));
  pointer-events: none;
}

.slot-skill-icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 9px var(--skill-color, rgba(104, 231, 255, 0.76)));
}

.slot-cooldown {
  position: absolute;
  z-index: 4;
  inset: 2px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: conic-gradient(rgba(1, 4, 10, 0.86) var(--cooldown-deg, 0deg), transparent 0deg);
  opacity: 0;
  pointer-events: none;
}

.slot-cooldown::after {
  content: attr(data-seconds);
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.92);
}

.skill-slot.cooling .slot-cooldown {
  opacity: 1;
}

.skill-slot::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: rgba(255, 209, 102, 0.72);
}

.cosmic-level-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--action-orb);
  height: var(--action-orb);
  margin: -24px 0 -10px;
  border: 2px solid rgba(255, 209, 102, 0.7);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 209, 102, 0.34), rgba(104, 231, 255, 0.12) 42%, rgba(3, 6, 12, 0.95) 68%),
    conic-gradient(from 45deg, rgba(104, 231, 255, 0.34), rgba(255, 209, 102, 0.62), rgba(167, 129, 255, 0.34), rgba(104, 231, 255, 0.34));
  box-shadow:
    0 0 20px rgba(255, 209, 102, 0.22),
    inset 0 0 18px rgba(3, 6, 12, 0.75);
  color: var(--ink);
  text-align: center;
  pointer-events: none;
}

.cosmic-level-orb small,
.cosmic-level-orb strong {
  position: relative;
  z-index: 1;
  display: block;
  line-height: 1;
}

.cosmic-level-orb small {
  align-self: end;
  color: var(--cyan);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.cosmic-level-orb strong {
  align-self: start;
  margin-top: 2px;
  color: var(--amber);
  font-size: 27px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(255, 209, 102, 0.35);
}

.quick-menu {
  position: absolute;
  z-index: 4;
  right: 16px;
  bottom: 16px;
  display: grid;
  grid-template-columns: repeat(7, 48px);
  gap: 9px;
  padding: 0;
  transform: scale(var(--ui-scale));
  transform-origin: bottom right;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: auto;
}

.quick-icon {
  --quick-a: var(--cyan);
  --quick-b: var(--violet);
  --quick-c: var(--amber);
  width: 48px;
  height: 48px;
  background: transparent;
  cursor: pointer;
  isolation: isolate;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    filter 120ms ease;
}

.quick-icon:hover,
.quick-icon:focus-visible,
.quick-icon.active {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--quick-a), white 22%);
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--quick-a), transparent 40%));
  outline: none;
}

.quick-icon::before {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: -1;
  border-radius: 8px;
  background: radial-gradient(circle, color-mix(in srgb, var(--quick-a), transparent 20%), transparent 68%);
  opacity: 0.18;
  filter: blur(7px);
}

.quick-icon span {
  position: relative;
  display: block;
  width: 28px;
  height: 28px;
  font-size: 0;
  transform: scale(1.12);
  image-rendering: pixelated;
}

.quick-icon span::before,
.quick-icon span::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.quick-tooltip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 9px);
  z-index: 8;
  display: grid;
  gap: 3px;
  width: 178px;
  padding: 9px 10px;
  border: 1px solid rgba(104, 231, 255, 0.44);
  border-radius: 6px;
  background: rgba(6, 10, 18, 0.96);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
  pointer-events: none;
}

.quick-tooltip b,
.quick-tooltip small {
  display: block;
  text-align: left;
}

.quick-tooltip b {
  color: var(--cyan);
  font-size: 12px;
  font-style: normal;
  line-height: 1.1;
}

.quick-tooltip small {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.35;
}

.quick-icon:hover .quick-tooltip,
.quick-icon:focus-visible .quick-tooltip,
.attack-toggle:hover .quick-tooltip,
.attack-toggle:focus-visible .quick-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.quick-icon.inventory {
  --quick-a: var(--pink);
  --quick-b: var(--cyan);
  --quick-c: var(--amber);
}

.quick-icon.inventory::after {
  content: "B";
  position: absolute;
  right: 4px;
  bottom: 3px;
  color: var(--amber);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 8px rgba(255, 209, 102, 0.72);
}

.quick-icon.inventory span {
  width: 28px;
  height: 24px;
  border: 2px solid var(--pink);
  border-radius: 5px;
  background:
    linear-gradient(90deg, transparent 0 42%, rgba(104, 231, 255, 0.42) 42% 58%, transparent 58%),
    linear-gradient(180deg, rgba(255, 111, 188, 0.42) 0 28%, rgba(18, 12, 32, 0.96) 29% 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 0 12px rgba(255, 111, 188, 0.34);
}

.quick-icon.inventory span::before {
  left: 5px;
  right: 5px;
  top: -5px;
  height: 8px;
  border: 2px solid var(--amber);
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
}

.quick-icon.inventory span::after {
  left: 9px;
  top: 8px;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(238, 245, 255, 0.74);
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(104, 231, 255, 0.72);
}

.quick-icon.friends {
  --quick-a: var(--green);
  --quick-b: var(--cyan);
  --quick-c: var(--amber);
}

.quick-icon.friends span {
  width: 30px;
  height: 25px;
}

.quick-icon.friends span::before {
  left: 9px;
  top: 0;
  width: 12px;
  height: 12px;
  border: 2px solid var(--green);
  border-radius: 50%;
  background: radial-gradient(circle at 42% 34%, rgba(238, 245, 255, 0.75), rgba(104, 231, 255, 0.16) 42%, rgba(10, 22, 20, 0.98) 43%);
  box-shadow:
    -10px 7px 0 -2px rgba(158, 227, 125, 0.92),
    10px 7px 0 -2px rgba(104, 231, 255, 0.9),
    0 0 12px rgba(158, 227, 125, 0.46);
}

.quick-icon.friends span::after {
  left: 3px;
  bottom: 1px;
  width: 24px;
  height: 11px;
  border: 2px solid var(--green);
  border-top: 0;
  border-radius: 0 0 13px 13px;
  background:
    linear-gradient(90deg, rgba(158, 227, 125, 0.22), rgba(104, 231, 255, 0.18)),
    rgba(5, 12, 14, 0.84);
}

.quick-icon.skill-tree {
  --quick-a: var(--violet);
  --quick-b: var(--pink);
  --quick-c: var(--cyan);
}

.quick-icon.skill-tree span {
  width: 28px;
  height: 28px;
  border: 2px solid var(--violet);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(167, 129, 255, 0.34) 0 22%, transparent 23%),
    radial-gradient(circle at 50% 50%, rgba(4, 8, 16, 0.98), rgba(35, 18, 58, 0.94));
  box-shadow:
    0 0 0 5px rgba(167, 129, 255, 0.1),
    0 0 14px rgba(167, 129, 255, 0.36);
}

.quick-icon.skill-tree span::before {
  left: 6px;
  top: 13px;
  width: 17px;
  height: 2px;
  background: var(--violet);
  box-shadow:
    0 -6px 0 -1px var(--cyan),
    0 6px 0 -1px var(--pink),
    0 0 10px rgba(167, 129, 255, 0.74);
  transform: rotate(-33deg);
  transform-origin: center;
}

.quick-icon.skill-tree span::after {
  left: 10px;
  top: 7px;
  width: 9px;
  height: 14px;
  clip-path: polygon(50% 0, 100% 32%, 100% 68%, 50% 100%, 0 68%, 0 32%);
  background: linear-gradient(180deg, var(--cyan), var(--violet) 58%, var(--pink));
  box-shadow: 0 0 12px rgba(104, 231, 255, 0.62);
}

.quick-icon.settings {
  --quick-a: var(--cyan);
  --quick-b: var(--violet);
  --quick-c: var(--ink);
}

.quick-icon.settings span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(3, 6, 12, 0.98) 0 31%, transparent 32%),
    radial-gradient(circle, rgba(104, 231, 255, 0.46) 35%, transparent 38%),
    conic-gradient(
      from 9deg,
      var(--cyan) 0 12deg,
      transparent 12deg 45deg,
      var(--cyan) 45deg 57deg,
      transparent 57deg 90deg,
      var(--cyan) 90deg 102deg,
      transparent 102deg 135deg,
      var(--cyan) 135deg 147deg,
      transparent 147deg 180deg,
      var(--cyan) 180deg 192deg,
      transparent 192deg 225deg,
      var(--cyan) 225deg 237deg,
      transparent 237deg 270deg,
      var(--cyan) 270deg 282deg,
      transparent 282deg 315deg,
      var(--cyan) 315deg 327deg,
      transparent 327deg 360deg
    );
  box-shadow: 0 0 14px rgba(104, 231, 255, 0.42);
}

.quick-icon.settings span::before {
  inset: 6px;
  border: 2px solid rgba(238, 245, 255, 0.9);
  border-radius: 50%;
}

.quick-icon.settings span::after {
  left: 12px;
  top: 12px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 9px rgba(104, 231, 255, 0.9);
}

.quick-icon.market {
  --quick-a: var(--amber);
  --quick-b: var(--pink);
  --quick-c: var(--cyan);
}

.quick-icon.market span {
  width: 28px;
  height: 24px;
  border: 2px solid var(--amber);
  border-radius: 4px;
  background:
    linear-gradient(90deg, transparent 0 39%, rgba(255, 209, 102, 0.54) 39% 61%, transparent 61%),
    linear-gradient(180deg, rgba(255, 209, 102, 0.92) 0 28%, rgba(92, 55, 16, 0.95) 29% 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.07) inset,
    0 0 14px rgba(255, 209, 102, 0.35);
}

.quick-icon.market span::before {
  left: 3px;
  top: 5px;
  bottom: 3px;
  width: 6px;
  border-right: 2px solid rgba(255, 209, 102, 0.72);
  border-left: 2px solid rgba(255, 209, 102, 0.2);
  box-shadow: 14px 0 0 rgba(255, 209, 102, 0.12);
}

.quick-icon.market span::after {
  left: 10px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--cyan);
  box-shadow:
    0 0 0 1px rgba(238, 245, 255, 0.62),
    0 0 12px rgba(104, 231, 255, 0.62);
}

.quick-icon.stats {
  --quick-a: var(--cyan);
  --quick-b: var(--green);
  --quick-c: var(--amber);
}

.quick-icon.stats::after {
  content: "C";
  position: absolute;
  right: 4px;
  bottom: 3px;
  color: var(--amber);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 8px rgba(255, 209, 102, 0.72);
}

.quick-icon.stats span {
  width: 28px;
  height: 28px;
  border: 2px solid var(--cyan);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(104, 231, 255, 0.18), rgba(4, 8, 16, 0.96)),
    rgba(4, 8, 16, 0.98);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.07) inset,
    0 0 14px rgba(104, 231, 255, 0.34);
}

.quick-icon.stats span::before {
  left: 5px;
  bottom: 5px;
  width: 4px;
  height: 8px;
  background: var(--green);
  box-shadow:
    7px -5px 0 var(--cyan),
    14px -11px 0 var(--amber),
    0 0 10px rgba(158, 227, 125, 0.58);
}

.quick-icon.stats span::after {
  left: 5px;
  right: 5px;
  top: 5px;
  height: 2px;
  background: rgba(238, 245, 255, 0.74);
  box-shadow:
    0 6px 0 rgba(104, 231, 255, 0.42),
    0 12px 0 rgba(255, 209, 102, 0.32);
}

.quick-icon.guide {
  --quick-a: var(--cyan);
  --quick-b: var(--amber);
  --quick-c: var(--green);
}

.quick-icon.guide::after {
  content: "G";
  position: absolute;
  right: 4px;
  bottom: 3px;
  color: var(--amber);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 8px rgba(255, 209, 102, 0.72);
}

.quick-icon.guide span {
  width: 28px;
  height: 28px;
  border: 2px solid var(--cyan);
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(104, 231, 255, 0.18) 0 48%, rgba(255, 209, 102, 0.24) 49% 52%, rgba(104, 231, 255, 0.08) 53% 100%),
    linear-gradient(180deg, rgba(14, 32, 48, 0.98), rgba(4, 8, 16, 0.98));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.07) inset,
    0 0 14px rgba(104, 231, 255, 0.34);
}

.quick-icon.guide span::before {
  left: 5px;
  top: 7px;
  width: 18px;
  height: 2px;
  background: var(--amber);
  box-shadow:
    0 6px 0 rgba(158, 227, 125, 0.92),
    0 12px 0 rgba(104, 231, 255, 0.82);
}

.quick-icon.guide span::after {
  right: 5px;
  top: 6px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--amber);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 209, 102, 0.68);
}

.friends-panel {
  position: absolute;
  z-index: 8;
  right: 16px;
  bottom: 74px;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - 110px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  transform: scale(var(--ui-scale));
  transform-origin: bottom right;
  pointer-events: auto;
}

.friends-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.friends-head p {
  margin: 0 0 4px;
}

.friends-head strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
}

.friends-head button,
.friend-add-form button,
.friend-actions button {
  min-height: 32px;
  border: 1px solid rgba(104, 231, 255, 0.46);
  border-radius: 5px;
  background: rgba(104, 231, 255, 0.12);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.friends-head button {
  width: 34px;
}

.friend-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.friend-add-form input {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(3, 6, 12, 0.62);
  color: var(--ink);
  outline: none;
}

.friend-add-form input:focus {
  border-color: rgba(104, 231, 255, 0.72);
}

.friends-list {
  display: grid;
  gap: 8px;
  overflow: auto;
  max-height: 360px;
  padding-right: 3px;
}

.stats-panel {
  position: absolute;
  z-index: 8;
  right: 16px;
  bottom: 74px;
  display: grid;
  gap: 12px;
  width: min(430px, calc(100vw - 32px));
  max-height: min(660px, calc(100vh - 110px));
  padding: 15px;
  overflow: hidden;
  border: 1px solid rgba(104, 231, 255, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(11, 17, 30, 0.96), rgba(5, 8, 15, 0.94)),
    var(--panel-strong);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.44);
  transform: scale(var(--ui-scale));
  transform-origin: bottom right;
  pointer-events: auto;
}

.stats-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  cursor: grab;
}

.stats-head p {
  margin: 0 0 4px;
}

.stats-head strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-head button {
  min-width: 42px;
  min-height: 34px;
  border: 1px solid rgba(255, 209, 102, 0.62);
  border-radius: 5px;
  background: rgba(255, 209, 102, 0.12);
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.stats-body {
  display: grid;
  gap: 10px;
  max-height: min(560px, calc(100vh - 190px));
  overflow: auto;
  padding-right: 4px;
}

.stats-identity {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stats-chip {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(104, 231, 255, 0.2);
  border-radius: 7px;
  background: rgba(8, 14, 25, 0.72);
}

.stats-chip span,
.stats-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.stats-chip strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-section {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(104, 231, 255, 0.18);
  border-radius: 7px;
  background: rgba(4, 8, 16, 0.52);
}

.stats-section h3 {
  margin: 0 0 2px;
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.stats-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 23px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.stats-row:last-child {
  border-bottom: 0;
}

.stats-row strong {
  color: var(--ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.stats-row.good strong {
  color: var(--green);
}

.stats-row.warn strong {
  color: var(--amber);
}

.stats-power-list {
  display: grid;
  gap: 6px;
}

.stats-power {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 5px 6px;
  border: 1px solid rgba(104, 231, 255, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
}

.stats-power .upgrade-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 5px;
  justify-self: center;
  overflow: hidden;
}

.stats-power .upgrade-icon svg {
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 0 4px currentColor);
}

.stats-power strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-power small {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.guide-panel {
  position: absolute;
  z-index: 8;
  right: 16px;
  bottom: 74px;
  display: grid;
  gap: 12px;
  width: min(920px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 110px));
  padding: 15px;
  overflow: hidden;
  border: 1px solid rgba(255, 209, 102, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(12, 16, 28, 0.97), rgba(5, 8, 15, 0.95)),
    var(--panel-strong);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
  transform: scale(var(--ui-scale));
  transform-origin: bottom right;
  pointer-events: auto;
}

.skills-panel {
  position: absolute;
  z-index: 8;
  right: 88px;
  bottom: 74px;
  display: grid;
  gap: 12px;
  width: min(900px, calc(100vw - 34px));
  max-height: min(720px, calc(100vh - 110px));
  padding: 15px;
  overflow: hidden;
  border: 1px solid rgba(104, 231, 255, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(10, 16, 30, 0.98), rgba(5, 8, 15, 0.95)),
    var(--panel-strong);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
  transform: scale(var(--ui-scale));
  transform-origin: bottom right;
  pointer-events: auto;
}

.skills-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  cursor: grab;
}

.skills-head p {
  margin: 0 0 4px;
}

.skills-head strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skills-head button {
  min-width: 42px;
  min-height: 34px;
  border: 1px solid rgba(104, 231, 255, 0.62);
  border-radius: 5px;
  background: rgba(104, 231, 255, 0.12);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.skills-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.skills-summary span {
  display: grid;
  gap: 2px;
  min-height: 52px;
  padding: 9px 10px;
  border: 1px solid rgba(104, 231, 255, 0.18);
  border-radius: 7px;
  background:
    radial-gradient(circle at 50% 0, rgba(104, 231, 255, 0.14), transparent 64%),
    rgba(8, 14, 25, 0.72);
}

.skills-summary b {
  color: var(--amber);
  font-size: 19px;
  line-height: 1;
}

.skills-summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.skills-body {
  display: grid;
  gap: 12px;
  max-height: min(560px, calc(100vh - 245px));
  overflow: auto;
  padding-right: 4px;
}

.skills-section {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(104, 231, 255, 0.16);
  border-radius: 8px;
  background: rgba(4, 8, 16, 0.48);
}

.skills-section h3 {
  margin: 0;
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 9px;
}

.skill-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 8px 10px;
  min-height: 116px;
  padding: 10px;
  border: 1px solid rgba(104, 231, 255, 0.16);
  border-radius: 8px;
  background:
    radial-gradient(circle at 16% 18%, color-mix(in srgb, var(--skill-color, #68e7ff) 22%, transparent), transparent 48%),
    linear-gradient(145deg, rgba(9, 16, 28, 0.94), rgba(3, 7, 14, 0.92));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.skill-card.owned {
  border-color: color-mix(in srgb, var(--skill-color, #68e7ff) 62%, rgba(255, 255, 255, 0.08));
}

.skill-card.locked {
  opacity: 0.48;
}

.skill-card .skill-icon {
  grid-row: 1 / span 2;
  align-self: start;
  width: 42px;
  height: 42px;
  color: var(--skill-color, var(--cyan));
  filter: drop-shadow(0 0 10px var(--skill-color, rgba(104, 231, 255, 0.6)));
}

.skill-card .skill-icon svg {
  width: 100%;
  height: 100%;
}

.skill-card .skill-icon.draggable {
  cursor: grab;
}

.skill-card .skill-icon.draggable:active,
.skill-card .skill-icon.dragging {
  cursor: grabbing;
}

.skill-card small {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.skill-card strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.skill-stats {
  display: grid;
  gap: 6px;
  margin-top: 9px;
}

.skill-stat-heading {
  color: var(--amber);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.skill-stat-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.skill-stat-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  min-height: 25px;
  padding: 4px 7px;
  border: 1px solid rgba(104, 231, 255, 0.16);
  border-radius: 5px;
  background: rgba(2, 7, 14, 0.62);
}

.skill-stat-row small {
  display: block;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.skill-stat-row strong {
  display: inline;
  overflow: visible;
  color: var(--ink);
  font-size: 10px;
  white-space: nowrap;
}

.skill-stat-row em {
  grid-column: 1 / -1;
  color: var(--amber);
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  text-align: right;
  white-space: nowrap;
}

.skill-stats.compact .skill-stat-list {
  grid-template-columns: minmax(0, 1fr);
}

.skill-card-controls {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.skill-card-controls button,
.skill-level-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--skill-color, #68e7ff) 60%, rgba(255, 255, 255, 0.1));
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 44%),
    color-mix(in srgb, var(--skill-color, #68e7ff) 18%, rgba(4, 8, 16, 0.94));
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 14px color-mix(in srgb, var(--skill-color, #68e7ff) 18%, transparent);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.skill-level-pill {
  min-width: 74px;
  cursor: default;
}

.skill-point-button {
  min-width: 30px;
  padding: 0;
  font-size: 17px;
  line-height: 1;
}

.skill-point-plus {
  color: #06101c;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.72), transparent 54%),
    color-mix(in srgb, var(--skill-color, #68e7ff) 78%, #ffd96a 18%);
}

.skill-point-minus {
  color: #ffd8d8;
  border-color: rgba(255, 111, 132, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 44%),
    rgba(72, 15, 30, 0.82);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    0 0 14px rgba(255, 82, 116, 0.18);
}

.skill-card-controls button:not(:disabled):hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--skill-color, #68e7ff) 86%, #ffffff 10%);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 44%),
    color-mix(in srgb, var(--skill-color, #68e7ff) 26%, rgba(4, 8, 16, 0.94));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.13),
    0 0 18px color-mix(in srgb, var(--skill-color, #68e7ff) 30%, transparent);
}

.skill-card-controls button:not(:disabled):active {
  transform: translateY(1px) scale(0.98);
  box-shadow:
    inset 0 0 12px rgba(0, 0, 0, 0.35),
    0 0 10px color-mix(in srgb, var(--skill-color, #68e7ff) 18%, transparent);
}

.skill-card-controls button:disabled {
  cursor: default;
  opacity: 0.46;
}

.skill-card-controls button:disabled::after {
  opacity: 0.35;
}

.guide-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  cursor: grab;
}

.guide-head p {
  margin: 0 0 4px;
}

.guide-head strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guide-head button {
  min-width: 42px;
  min-height: 34px;
  border: 1px solid rgba(255, 209, 102, 0.62);
  border-radius: 5px;
  background: rgba(255, 209, 102, 0.12);
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.guide-body {
  display: grid;
  gap: 12px;
  max-height: min(620px, calc(100vh - 190px));
  overflow: auto;
  padding-right: 4px;
}

.guide-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.guide-summary span {
  display: grid;
  gap: 2px;
  min-height: 54px;
  padding: 9px 10px;
  border: 1px solid rgba(104, 231, 255, 0.18);
  border-radius: 7px;
  background:
    radial-gradient(circle at 50% 0, rgba(104, 231, 255, 0.14), transparent 64%),
    rgba(8, 14, 25, 0.72);
}

.guide-summary b {
  color: var(--amber);
  font-size: 19px;
  line-height: 1;
}

.guide-summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.guide-section {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(104, 231, 255, 0.16);
  border-radius: 8px;
  background: rgba(4, 8, 16, 0.48);
}

.guide-section.combos {
  border-color: rgba(255, 209, 102, 0.23);
  background:
    linear-gradient(135deg, rgba(255, 209, 102, 0.055), transparent 42%),
    rgba(4, 8, 16, 0.52);
}

.guide-section-head {
  display: grid;
  gap: 3px;
}

.guide-section-head h3 {
  margin: 0;
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.guide-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 9px;
}

.guide-section.combos .guide-grid {
  grid-template-columns: 1fr;
}

.guide-combo-card,
.guide-power-card {
  min-width: 0;
  border: 1px solid rgba(104, 231, 255, 0.12);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(104, 231, 255, 0.045), rgba(255, 255, 255, 0.012)),
    rgba(8, 14, 25, 0.7);
}

.guide-combo-card {
  display: grid;
  gap: 8px;
  padding: 9px;
}

.guide-combo-card.ready {
  border-color: rgba(255, 209, 102, 0.42);
}

.guide-combo-card.owned {
  border-color: rgba(255, 111, 188, 0.45);
  background:
    linear-gradient(135deg, rgba(255, 111, 188, 0.12), rgba(255, 209, 102, 0.045)),
    rgba(8, 14, 25, 0.78);
}

.guide-combo-formula {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr) 22px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}

.guide-combo-symbol {
  display: grid;
  place-items: center;
  color: var(--amber);
  font-size: 18px;
  line-height: 1;
  text-shadow: 0 0 10px rgba(255, 209, 102, 0.45);
}

.guide-combo-card p,
.guide-power-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.guide-power-node {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 46px;
  padding: 6px 7px;
  border: 1px solid color-mix(in srgb, var(--guide-color, var(--cyan)), transparent 54%);
  border-radius: 6px;
  background:
    radial-gradient(circle at 18px 20px, color-mix(in srgb, var(--guide-color, var(--cyan)), transparent 78%), transparent 58%),
    rgba(4, 8, 16, 0.58);
}

.guide-power-node.evolved {
  border-color: rgba(255, 111, 188, 0.42);
  background:
    radial-gradient(circle at 18px 20px, rgba(255, 111, 188, 0.2), transparent 60%),
    linear-gradient(135deg, rgba(80, 14, 34, 0.78), rgba(4, 8, 16, 0.7));
}

.guide-power-node .upgrade-icon,
.guide-power-card .upgrade-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 6px;
  justify-self: center;
  overflow: hidden;
}

.guide-power-node .upgrade-icon svg,
.guide-power-card .upgrade-icon svg {
  width: 29px;
  height: 29px;
  filter: drop-shadow(0 0 5px currentColor);
}

.guide-power-node span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.guide-power-node small,
.guide-power-card small {
  color: var(--cyan);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.guide-power-node strong,
.guide-power-card strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guide-power-node em {
  position: absolute;
  right: 6px;
  bottom: 4px;
  color: var(--amber);
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
}

.guide-power-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 9px;
  border-color: color-mix(in srgb, var(--guide-color, var(--cyan)), transparent 68%);
}

.guide-power-card.owned {
  border-color: color-mix(in srgb, var(--guide-color, var(--cyan)), white 14%);
}

.guide-power-card > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.guide-power-card em {
  grid-column: 1 / -1;
  color: var(--amber);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.25;
}

.friend-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 9px;
  border: 1px solid rgba(162, 190, 225, 0.16);
  border-radius: 7px;
  background: rgba(4, 8, 16, 0.42);
}

.friend-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.friend-copy strong,
.friend-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-copy strong {
  color: var(--ink);
  font-size: 13px;
}

.friend-copy small {
  color: var(--muted);
  font-size: 11px;
}

.friend-status {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.friend-row.online .friend-status {
  color: var(--green);
}

.friend-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 5px;
}

.friend-actions button {
  min-height: 25px;
  padding: 0 8px;
  border: 1px solid rgba(104, 231, 255, 0.38);
  border-radius: 5px;
  background: rgba(104, 231, 255, 0.1);
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.friend-actions button:hover:not(:disabled) {
  border-color: rgba(104, 231, 255, 0.66);
  background: rgba(104, 231, 255, 0.18);
}

.friend-actions button.danger {
  border-color: rgba(255, 99, 125, 0.45);
  background: rgba(255, 99, 125, 0.1);
}

.friend-actions button.danger:hover:not(:disabled) {
  background: rgba(255, 99, 125, 0.2);
}

.friend-actions button:disabled {
  opacity: 0.48;
  cursor: default;
}

.power-copy {
  position: fixed;
  left: 24px;
  bottom: 38px;
  z-index: 1;
  width: min(230px, calc(50vw - 250px));
  min-width: 160px;
}

.power-copy span,
.power-copy strong,
.power-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.power-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.power-copy strong {
  margin-top: 2px;
  color: var(--ink);
  font-size: 15px;
}

.power-copy small {
  margin-top: 3px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
}

.bars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.resource-bars {
  position: fixed;
  left: 50%;
  bottom: var(--action-bottom);
  z-index: 4;
  width: var(--action-total-width);
  height: 104px;
  transform: translateX(-50%) scale(var(--ui-scale));
  transform-origin: bottom center;
  pointer-events: none;
}

.bar,
.health,
.dash {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 10px;
  border: 1px solid rgba(126, 157, 190, 0.3);
  border-radius: 4px;
  background: rgba(4, 8, 16, 0.8);
}

.bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  width: 100vw;
  height: 4px;
  border-top: 1px solid rgba(238, 245, 255, 0.34);
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  background:
    repeating-linear-gradient(90deg, rgba(238, 245, 255, 0.24) 0 18px, transparent 18px 22px),
    rgba(2, 5, 11, 0.92);
}

.health,
.dash {
  position: absolute;
  bottom: 62px;
  box-sizing: border-box;
  height: 12px;
  padding: 1px;
  border-color: rgba(238, 245, 255, 0.36);
  background: rgba(3, 6, 12, 0.84);
  box-shadow:
    0 0 0 1px rgba(4, 8, 16, 0.74),
    inset 0 0 0 1px rgba(238, 245, 255, 0.05);
}

.health {
  left: 0;
  width: var(--action-side-width);
  box-shadow:
    0 0 0 1px rgba(4, 8, 16, 0.74),
    0 0 12px rgba(255, 99, 125, 0.14),
    inset 0 0 0 1px rgba(238, 245, 255, 0.05);
}

.dash {
  right: 0;
  width: var(--action-side-width);
  box-shadow:
    0 0 0 1px rgba(4, 8, 16, 0.74),
    0 0 12px rgba(104, 231, 255, 0.14),
    inset 0 0 0 1px rgba(238, 245, 255, 0.05);
}

.bar span,
.health span,
.dash span {
  display: block;
  width: 0%;
  height: 100%;
  transition: width 120ms linear;
}

.bar span {
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--pink));
}

.health span {
  background: linear-gradient(90deg, var(--danger), var(--amber));
}

.dash span {
  margin-left: auto;
  background: linear-gradient(90deg, var(--cyan), #ffffff);
}

.resource-value {
  position: absolute;
  top: 50%;
  z-index: 2;
  color: rgba(238, 245, 255, 0.94);
  font-size: 9px;
  font-weight: 950;
  line-height: 1;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.8),
    0 0 7px rgba(4, 8, 16, 0.9);
  transform: translateY(-50%);
  pointer-events: none;
}

.health .resource-value {
  right: 7px;
}

.dash .resource-value {
  left: 7px;
}

.attack-toggle {
  --attack-color: var(--green);
  --attack-glow: rgba(158, 227, 125, 0.18);
  position: absolute;
  bottom: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  width: var(--action-slot);
  height: var(--action-slot);
  border: 1px solid color-mix(in srgb, var(--attack-color) 68%, transparent);
  border-radius: 6px;
  background:
    radial-gradient(circle at 50% 36%, color-mix(in srgb, var(--attack-color) 22%, transparent), transparent 58%),
    rgba(4, 8, 16, 0.9);
  box-shadow:
    0 0 14px var(--attack-glow),
    inset 0 0 0 1px rgba(238, 245, 255, 0.06);
  cursor: pointer;
  pointer-events: auto;
}

.look-attack-toggle {
  left: calc((var(--action-slot) + var(--action-gap)) * -1);
}

.auto-attack-toggle {
  --attack-color: var(--amber);
  --attack-glow: rgba(255, 209, 102, 0.18);
  right: calc((var(--action-slot) + var(--action-gap)) * -1);
}

.attack-toggle:not(.active) {
  --attack-color: var(--muted);
  --attack-glow: rgba(143, 160, 184, 0.08);
  border-color: rgba(143, 160, 184, 0.42);
  opacity: 0.72;
  box-shadow: inset 0 0 0 1px rgba(238, 245, 255, 0.04);
}

.attack-toggle span {
  position: relative;
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  color: var(--attack-color);
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--attack-color) 58%, transparent));
}

.attack-toggle svg {
  width: 33px;
  height: 33px;
  overflow: visible;
}

.attack-ring {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
}

.attack-ring.outer {
  stroke-width: 3;
}

.attack-ring.inner {
  stroke-width: 2;
  opacity: 0.82;
}

.attack-mark,
.attack-arrow,
.attack-barrel,
.attack-burst {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.attack-mark {
  stroke-width: 3;
}

.attack-arrow,
.attack-barrel {
  stroke-width: 3.4;
}

.attack-burst {
  stroke-width: 2.6;
  opacity: 0.9;
}

.attack-cone {
  fill: color-mix(in srgb, var(--attack-color) 36%, rgba(4, 8, 16, 0.78));
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.attack-core {
  fill: #f8fbff;
  stroke: currentColor;
  stroke-width: 1.5;
}

.attack-toggle.active::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: rgba(255, 209, 102, 0.84);
}

.room-select,
.ship-select-screen,
.channel-select-screen,
.inventory-screen,
.trade-screen,
.storage-screen,
.market-screen,
.grinder-screen,
.item-upgrade-screen,
.chest-reward-screen,
.upgrade-screen,
.match-end {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 5, 11, 0.62);
  backdrop-filter: blur(5px);
}

.upgrade-screen.upgrade-screen-clear {
  background: rgba(2, 5, 11, 0.08);
  backdrop-filter: none;
}

.room-panel,
.loadout-panel,
.ship-select-panel,
.channel-select-panel,
.inventory-panel,
.trade-panel,
.storage-panel,
.market-panel,
.grinder-panel,
.item-upgrade-panel,
.chest-reward-panel,
.upgrade-panel,
.match-panel {
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.match-panel {
  transform: scale(var(--ui-scale));
  transform-origin: center;
}

.ship-select-panel,
.channel-select-panel {
  position: relative;
  display: grid;
  gap: 16px;
  width: min(780px, calc(100vw - 32px));
  text-align: left;
  transform: scale(var(--ui-scale));
  transform-origin: center;
}

.ship-select-panel {
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr);
  width: min(1040px, calc(100vw - 32px));
  padding: 28px 30px;
  border-color: rgba(104, 231, 255, 0.3);
  background:
    radial-gradient(circle at 22% 12%, rgba(104, 231, 255, 0.13), transparent 28%),
    radial-gradient(circle at 82% 84%, rgba(255, 209, 102, 0.1), transparent 26%),
    linear-gradient(135deg, rgba(12, 19, 34, 0.96), rgba(3, 6, 13, 0.92));
}

.ship-select-panel::before {
  content: "";
  position: absolute;
  inset: 92px 28px 94px;
  pointer-events: none;
  opacity: 0.46;
  background:
    linear-gradient(90deg, transparent 0 12%, rgba(104, 231, 255, 0.1) 12% 12.3%, transparent 12.4% 87.6%, rgba(104, 231, 255, 0.1) 87.7% 88%, transparent 88%),
    repeating-linear-gradient(90deg, rgba(126, 157, 190, 0.1) 0 1px, transparent 1px 86px),
    linear-gradient(180deg, rgba(104, 231, 255, 0.1), transparent 28%, transparent 72%, rgba(255, 209, 102, 0.1));
  border: 1px solid rgba(104, 231, 255, 0.12);
  border-radius: 10px;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.ship-select-panel > * {
  position: relative;
  z-index: 1;
}

.channel-select-panel {
  width: min(880px, calc(100vw - 32px));
}

.flow-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
}

.flow-logo {
  display: block;
  width: min(520px, 100%);
  height: auto;
  margin: -4px auto 2px;
  object-fit: contain;
  filter:
    drop-shadow(0 0 16px rgba(104, 231, 255, 0.26))
    drop-shadow(0 0 26px rgba(255, 255, 255, 0.08));
}

.flow-head p {
  margin: 0 0 6px;
}

.flow-head h1 {
  margin: 0;
  color: var(--ink);
  font-size: 42px;
  line-height: 0.98;
}

.secondary-action.compact {
  min-width: 82px;
  min-height: 36px;
  padding: 0 14px;
}

.ship-slot-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ship-slot-card {
  position: relative;
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  overflow: hidden;
  min-height: 184px;
  padding: 18px;
  border: 1px solid rgba(104, 231, 255, 0.24);
  border-radius: 10px;
  background:
    radial-gradient(circle at 18% 50%, rgba(104, 231, 255, 0.16), transparent 34%),
    linear-gradient(145deg, rgba(8, 15, 28, 0.92), rgba(3, 7, 15, 0.86));
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    0 18px 44px rgba(0, 0, 0, 0.24);
}

.ship-slot-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  border: 1px solid rgba(126, 157, 190, 0.12);
  border-radius: 8px;
}

.ship-slot-card::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: 16px;
  width: 116px;
  height: 28px;
  pointer-events: none;
  opacity: 0.4;
  background: repeating-linear-gradient(90deg, rgba(104, 231, 255, 0.28) 0 18px, transparent 18px 28px);
  transform: skewX(-18deg);
}

.ship-slot-card.empty {
  grid-template-columns: 1fr;
  place-items: center;
  min-height: 184px;
  color: var(--muted);
  text-align: center;
  background:
    linear-gradient(135deg, rgba(8, 13, 24, 0.58), rgba(2, 5, 11, 0.62)),
    repeating-linear-gradient(135deg, rgba(126, 157, 190, 0.12) 0 1px, transparent 1px 14px);
}

.ship-slot-card:hover,
.ship-slot-card.selected {
  border-color: rgba(104, 231, 255, 0.66);
  background:
    radial-gradient(circle at 18% 50%, rgba(104, 231, 255, 0.22), transparent 34%),
    linear-gradient(145deg, rgba(12, 22, 40, 0.98), rgba(4, 9, 18, 0.94));
  box-shadow:
    inset 0 0 0 1px rgba(104, 231, 255, 0.16),
    0 0 32px rgba(104, 231, 255, 0.1),
    0 18px 44px rgba(0, 0, 0, 0.24);
}

.ship-slot-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 122px;
  height: 132px;
  border: 1px solid rgba(104, 231, 255, 0.34);
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 42%, rgba(104, 231, 255, 0.2), transparent 46%),
    linear-gradient(180deg, rgba(15, 27, 45, 0.84), rgba(2, 5, 11, 0.9));
}

.ship-slot-avatar::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  height: 4px;
  border-radius: 999px;
  background: rgba(104, 231, 255, 0.72);
  box-shadow: 0 0 14px rgba(104, 231, 255, 0.36);
}

.ship-slot-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.ship-slot-copy strong,
.ship-slot-copy span,
.ship-slot-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ship-slot-copy strong {
  font-size: 27px;
  line-height: 1;
}

.ship-slot-copy span {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 900;
}

.ship-slot-copy small {
  color: var(--muted);
  font-size: 11px;
}

.single-ship-panel {
  width: min(980px, calc(100vw - 32px));
  min-height: min(650px, calc(100vh - 40px));
  align-content: start;
  justify-items: stretch;
  gap: 18px;
  padding: 30px 36px 34px;
}

.single-ship-panel .flow-logo {
  width: min(560px, 88%);
  margin-bottom: 8px;
}

.single-ship-panel .flow-head {
  align-items: center;
}

.single-ship-panel .ship-slot-list {
  grid-template-columns: minmax(0, 660px);
  justify-content: center;
  margin-top: 2px;
}

.single-ship-panel .ship-slot-card {
  grid-template-columns: 150px minmax(0, 1fr);
  min-height: 222px;
  padding: 22px;
}

.single-ship-panel .ship-slot-card.empty {
  grid-template-columns: 120px minmax(0, 1fr);
  place-items: center stretch;
  text-align: left;
}

.single-ship-panel .ship-slot-avatar {
  width: 142px;
  height: 156px;
}

.single-ship-panel .ship-slot-avatar .ship-sprite.image-sprite {
  width: 108px;
  height: 144px;
}

.empty-ship-avatar::before {
  content: "";
  display: block;
  width: 54px;
  height: 54px;
  border: 2px solid rgba(104, 231, 255, 0.72);
  border-radius: 14px;
  background:
    linear-gradient(rgba(104, 231, 255, 0.78), rgba(104, 231, 255, 0.78)) center / 28px 4px no-repeat,
    linear-gradient(90deg, rgba(104, 231, 255, 0.78), rgba(104, 231, 255, 0.78)) center / 4px 28px no-repeat,
    radial-gradient(circle, rgba(104, 231, 255, 0.18), transparent 62%);
  box-shadow:
    0 0 18px rgba(104, 231, 255, 0.22),
    inset 0 0 16px rgba(104, 231, 255, 0.12);
}

.single-ship-panel .ship-slot-copy strong {
  font-size: 34px;
  text-transform: uppercase;
}

.single-ship-panel .ship-slot-copy span {
  font-size: 14px;
}

.single-ship-panel .ship-slot-copy small {
  font-size: 12px;
}

.single-ship-panel .ship-create-box {
  width: min(860px, 100%);
  justify-self: center;
}

.single-ship-panel .ship-create-box.selected-ship-mode {
  width: min(760px, 100%);
  justify-self: center;
  padding: 18px;
}

.single-ship-panel .flow-actions {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
}

.ship-create-box {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(162, 190, 225, 0.2);
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(255, 79, 100, 0.06), transparent 36%, rgba(104, 231, 255, 0.07)),
    rgba(2, 5, 11, 0.44);
}

.ship-create-box.selected-ship-mode {
  border-color: rgba(255, 99, 125, 0.24);
  background: rgba(2, 5, 11, 0.25);
}

.ship-body-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ship-body-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(8, 13, 24, 0.82);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.ship-body-card:hover,
.ship-body-card.selected {
  border-color: rgba(104, 231, 255, 0.62);
  background: rgba(12, 20, 34, 0.94);
}

.ship-body-swatch {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: rgba(2, 5, 11, 0.72);
}

.ship-body-swatch span {
  width: 24px;
  height: 13px;
}

.ship-body-card strong,
.ship-body-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ship-body-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.flow-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.flow-actions button,
.channel-card {
  min-height: 44px;
  border: 1px solid rgba(104, 231, 255, 0.58);
  border-radius: 7px;
  background: rgba(104, 231, 255, 0.12);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.flow-actions button:hover,
.channel-card:hover,
.channel-card.selected {
  background: rgba(104, 231, 255, 0.22);
}

.flow-actions .danger-action,
.confirm-actions .danger-action {
  border-color: rgba(255, 99, 125, 0.58);
  background: rgba(255, 99, 125, 0.12);
  color: var(--danger);
}

.flow-actions .danger-action:hover,
.confirm-actions .danger-action:hover {
  border-color: rgba(255, 99, 125, 0.84);
  background: rgba(255, 99, 125, 0.22);
}

.flow-actions button:disabled {
  border-color: rgba(162, 190, 225, 0.18);
  background: rgba(8, 13, 24, 0.56);
  color: rgba(238, 245, 255, 0.42);
  cursor: default;
}

.channel-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.channel-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 13px;
  text-align: left;
}

.channel-card strong {
  font-size: 22px;
  line-height: 1;
}

.channel-card span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.channel-card .density-meter {
  width: 100%;
}

.inventory-screen {
  z-index: 6;
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}

.trade-screen {
  z-index: 7;
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}

.storage-screen {
  z-index: 7;
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}

.market-screen {
  z-index: 8;
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}

.grinder-screen {
  z-index: 8;
  padding: clamp(22px, 3vw, 36px);
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}

.inventory-screen.trade-docked {
  place-items: center start;
  background: transparent;
  pointer-events: none;
}

.inventory-screen.storage-docked {
  place-items: center;
  background: transparent;
  pointer-events: none;
}

.inventory-screen.market-docked {
  place-items: center;
  background: transparent;
  pointer-events: none;
}

.inventory-screen.grinder-docked {
  place-items: center;
  background: transparent;
  pointer-events: none;
}

.trade-screen.trade-docked {
  place-items: center end;
  background: transparent;
}

.storage-screen.storage-docked {
  place-items: center;
  background: transparent;
}

.market-screen.market-docked {
  place-items: center;
  background: transparent;
}

.grinder-screen.grinder-docked {
  place-items: center;
  background: transparent;
}

.trade-panel {
  display: grid;
  gap: 14px;
  width: min(560px, calc(var(--ui-safe-width) - 32px));
  max-height: calc(var(--ui-safe-height) - 32px);
  overflow: auto;
  text-align: left;
  pointer-events: auto;
}

.storage-panel {
  display: grid;
  gap: 12px;
  width: min(640px, calc(var(--ui-safe-width) - 32px));
  max-height: calc(var(--ui-safe-height) - 32px);
  overflow: auto;
  text-align: left;
  pointer-events: auto;
}

.market-panel {
  display: grid;
  gap: 13px;
  width: min(880px, calc(var(--ui-safe-width) - 32px));
  max-height: calc(var(--ui-safe-height) - 32px);
  overflow: auto;
  text-align: left;
  pointer-events: auto;
  border-color: rgba(104, 231, 255, 0.34);
  background:
    radial-gradient(circle at 12% 12%, rgba(104, 231, 255, 0.12), transparent 34%),
    radial-gradient(circle at 88% 86%, rgba(255, 209, 102, 0.09), transparent 30%),
    var(--panel-strong);
}

.grinder-panel {
  display: grid;
  gap: 12px;
  box-sizing: border-box;
  width: min(500px, calc(var(--ui-safe-width) - 72px));
  max-height: calc(var(--ui-safe-height) - 56px);
  overflow: auto;
  text-align: left;
  pointer-events: auto;
  border-color: rgba(255, 209, 102, 0.58);
  outline: 1px solid rgba(255, 244, 214, 0.08);
  outline-offset: -4px;
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 209, 102, 0.12), transparent 34%),
    radial-gradient(circle at 82% 88%, rgba(104, 231, 255, 0.09), transparent 30%),
    var(--panel-strong);
  box-shadow:
    inset 0 0 0 1px rgba(255, 209, 102, 0.08),
    0 22px 64px rgba(0, 0, 0, 0.42),
    0 0 26px rgba(255, 209, 102, 0.08);
}

.inventory-panel {
  pointer-events: auto;
}

.draggable-window {
  will-change: transform;
}

.inventory-panel.draggable-window,
.trade-panel.draggable-window,
.storage-panel.draggable-window,
.market-panel.draggable-window,
.grinder-panel.draggable-window,
.item-upgrade-panel.draggable-window {
  transform: translate(var(--window-x, 0), var(--window-y, 0)) scale(var(--ui-scale));
  transform-origin: center;
}

.window-drag-handle {
  cursor: move;
  user-select: none;
}

.draggable-window.is-dragging {
  box-shadow: 0 30px 84px rgba(0, 0, 0, 0.46);
}

.inventory-screen.trade-docked .inventory-panel {
  width: min(620px, calc(var(--ui-safe-half-width) - 32px));
}

.inventory-screen.storage-docked .inventory-panel {
  width: min(620px, calc(var(--ui-safe-half-width) - 32px));
}

.inventory-screen.market-docked .inventory-panel {
  width: min(600px, calc(var(--ui-safe-half-width) - 32px));
}

.inventory-screen.grinder-docked .inventory-panel {
  width: min(600px, calc(var(--ui-safe-half-width) - 32px));
}

.inventory-screen.item-upgrade-docked .inventory-panel {
  width: min(600px, calc(var(--ui-safe-half-width) - 32px));
}

.storage-screen.storage-docked .storage-panel {
  width: min(640px, calc(var(--ui-safe-half-width) - 32px));
}

.market-screen.market-docked .market-panel {
  width: min(720px, calc(var(--ui-safe-half-width) - 32px));
}

.grinder-screen.grinder-docked .grinder-panel {
  width: min(500px, calc(var(--ui-safe-half-width) - 32px));
}

.item-upgrade-screen.item-upgrade-docked .item-upgrade-panel {
  width: min(500px, calc(var(--ui-safe-half-width) - 32px));
}

.trade-head,
.market-head,
.grinder-head,
.item-upgrade-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.storage-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.trade-head p,
.market-head p,
.grinder-head p,
.item-upgrade-head p {
  margin: 0 0 5px;
}

.storage-head p {
  margin: 0 0 5px;
}

.trade-head strong,
.market-head strong,
.grinder-head strong,
.item-upgrade-head strong {
  display: block;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.storage-head strong {
  display: block;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.trade-head button,
.market-head button,
.grinder-head button,
.item-upgrade-head button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 32px;
  border: 1px solid rgba(255, 209, 102, 0.58);
  border-radius: 6px;
  background: rgba(255, 209, 102, 0.12);
  color: var(--amber);
  font-weight: 900;
  cursor: pointer;
}

.storage-head button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 32px;
  border: 1px solid rgba(255, 209, 102, 0.58);
  border-radius: 6px;
  background: rgba(255, 209, 102, 0.12);
  color: var(--amber);
  font-weight: 900;
  cursor: pointer;
}

.trade-head button:hover,
.market-head button:hover,
.grinder-head button:hover,
.item-upgrade-head button:hover {
  background: rgba(255, 209, 102, 0.22);
}

.storage-head button:hover {
  background: rgba(255, 209, 102, 0.22);
}

.trade-panel > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.storage-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.grinder-hint,
.grinder-status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.grinder-status[data-tone="error"] {
  color: var(--pink);
}

.grinder-items {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.grinder-slot {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 116px;
  padding: 9px;
  border: 1px dashed rgba(162, 190, 225, 0.3);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(104, 231, 255, 0.06), transparent 44%),
    rgba(4, 8, 16, 0.54);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.grinder-slot.filled {
  border-style: solid;
  border-color: rgba(255, 209, 102, 0.56);
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 209, 102, 0.18), transparent 36%),
    rgba(5, 9, 18, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(104, 231, 255, 0.1),
    0 0 18px rgba(255, 209, 102, 0.12);
}

.grinder-item {
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.grinder-item strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grinder-item small {
  color: var(--amber);
  font-weight: 950;
}

.grinder-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 99, 125, 0.5);
  border-radius: 5px;
  background: rgba(255, 99, 125, 0.12);
  color: var(--pink);
  font-size: 11px;
  font-weight: 950;
  cursor: pointer;
}

.grinder-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 209, 102, 0.28);
  border-radius: 7px;
  background: rgba(255, 209, 102, 0.08);
}

.grinder-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.grinder-summary strong {
  color: var(--gold);
  font-size: 18px;
  font-weight: 950;
}

.grinder-action {
  min-height: 40px;
  border: 1px solid rgba(255, 209, 102, 0.62);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(255, 209, 102, 0.22), rgba(104, 231, 255, 0.1)),
    rgba(6, 12, 22, 0.72);
  color: var(--ink);
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}

.grinder-action:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.inventory-item.queued-grinder,
.storage-item.queued-grinder {
  border-color: rgba(255, 209, 102, 0.86);
  box-shadow:
    inset 0 0 0 1px rgba(255, 209, 102, 0.16),
    0 0 18px rgba(255, 209, 102, 0.22);
}

.item-upgrade-panel {
  display: grid;
  gap: 12px;
  box-sizing: border-box;
  width: min(500px, calc(var(--ui-safe-width) - 72px));
  max-height: calc(var(--ui-safe-height) - 56px);
  overflow: auto;
  text-align: left;
  pointer-events: auto;
  border-color: rgba(104, 231, 255, 0.62);
  outline: 1px solid rgba(210, 248, 255, 0.08);
  outline-offset: -4px;
  background:
    radial-gradient(circle at 20% 16%, rgba(104, 231, 255, 0.14), transparent 36%),
    radial-gradient(circle at 82% 82%, rgba(255, 99, 125, 0.1), transparent 32%),
    var(--panel-strong);
  box-shadow:
    inset 0 0 0 1px rgba(104, 231, 255, 0.08),
    0 22px 64px rgba(0, 0, 0, 0.42),
    0 0 26px rgba(104, 231, 255, 0.08);
}

.item-upgrade-hint,
.item-upgrade-status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.item-upgrade-status[data-tone="error"] {
  color: var(--pink);
}

.item-upgrade-status[data-tone="warn"] {
  color: var(--amber);
}

.item-upgrade-target {
  display: grid;
}

.item-upgrade-target-slot {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 136px;
  padding: 12px;
  border: 1px dashed rgba(162, 190, 225, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(104, 231, 255, 0.08), transparent 48%),
    rgba(4, 8, 16, 0.56);
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-align: center;
}

.item-upgrade-target-slot.filled {
  border-style: solid;
  border-color: rgba(104, 231, 255, 0.66);
  background:
    radial-gradient(circle at 50% 30%, rgba(104, 231, 255, 0.18), transparent 40%),
    rgba(5, 9, 18, 0.76);
  box-shadow:
    inset 0 0 0 1px rgba(255, 209, 102, 0.12),
    0 0 20px rgba(104, 231, 255, 0.16);
}

.item-upgrade-card {
  display: grid;
  justify-items: center;
  gap: 7px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.item-upgrade-card strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-upgrade-card small {
  color: var(--gold);
  font-size: 11px;
  font-weight: 950;
}

.item-upgrade-remove {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 99, 125, 0.5);
  border-radius: 5px;
  background: rgba(255, 99, 125, 0.12);
  color: var(--pink);
  font-size: 11px;
  font-weight: 950;
  cursor: pointer;
}

.item-upgrade-requirement {
  display: grid;
  gap: 8px;
  min-height: 46px;
  padding: 10px;
  border: 1px solid rgba(104, 231, 255, 0.24);
  border-radius: 7px;
  background: rgba(4, 8, 16, 0.58);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.upgrade-material-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.upgrade-material-row span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.upgrade-material-row strong {
  color: var(--gold);
  font-size: 12px;
  white-space: nowrap;
}

.upgrade-material-row.missing strong,
.upgrade-material-row.missing span {
  color: var(--pink);
}

.item-upgrade-protector {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 209, 102, 0.22);
  border-radius: 7px;
  background: rgba(255, 209, 102, 0.06);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.item-upgrade-protector input {
  accent-color: var(--amber);
}

.item-upgrade-protector .missing {
  color: var(--muted);
}

.item-upgrade-action {
  min-height: 42px;
  border: 1px solid rgba(104, 231, 255, 0.62);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(104, 231, 255, 0.22), rgba(255, 99, 125, 0.1)),
    rgba(6, 12, 22, 0.72);
  color: var(--ink);
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}

.item-upgrade-action:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.inventory-item.queued-upgrade,
.storage-item.queued-upgrade {
  border-color: rgba(104, 231, 255, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(104, 231, 255, 0.18),
    0 0 18px rgba(104, 231, 255, 0.24);
}

.storage-items {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  min-height: 304px;
  padding: 12px;
  border: 1px solid rgba(162, 190, 225, 0.18);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(255, 209, 102, 0.08), transparent 34%),
    rgba(4, 8, 16, 0.54);
}

.storage-item {
  width: 100%;
  min-height: 54px;
}

.storage-items .storage-item.square-slot {
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 1;
}

.market-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.market-tabs button,
.market-filters button,
.market-pager button,
.market-buy-button,
.market-remove-button,
#marketSaveSellButton {
  min-height: 38px;
  border: 1px solid rgba(104, 231, 255, 0.42);
  border-radius: 6px;
  background: rgba(104, 231, 255, 0.1);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.market-tabs button.selected,
#marketSaveSellButton {
  border-color: rgba(255, 209, 102, 0.7);
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.2), rgba(104, 231, 255, 0.12));
}

.market-view {
  display: grid;
  gap: 12px;
}

.market-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 8px;
  align-items: end;
  padding: 11px;
  border: 1px solid rgba(162, 190, 225, 0.15);
  border-radius: 7px;
  background: rgba(3, 6, 12, 0.34);
}

.market-filters label {
  display: grid;
  gap: 5px;
}

.market-filters span,
.market-status,
.market-hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.market-filters select,
.market-price-input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(3, 6, 12, 0.72);
  color: var(--ink);
  font-weight: 900;
  outline: none;
}

.market-filters select {
  padding: 0 9px;
}

.market-buy-list {
  display: grid;
  gap: 8px;
  min-height: 430px;
}

.market-buy-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 92px 120px;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 10px;
  border: 1px solid rgba(162, 190, 225, 0.18);
  border-radius: 7px;
  background:
    linear-gradient(90deg, rgba(104, 231, 255, 0.07), transparent 42%),
    rgba(4, 8, 16, 0.55);
}

.market-buy-row.own {
  opacity: 0.72;
}

.market-buy-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.market-buy-copy strong,
.market-buy-copy small,
.market-buy-price {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-buy-copy strong {
  color: var(--ink);
  font-size: 16px;
}

.market-buy-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.market-buy-price {
  color: var(--amber);
  font-size: 16px;
  font-weight: 900;
  text-align: right;
}

.market-buy-button:disabled,
.market-pager button:disabled,
#marketSaveSellButton:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.market-empty {
  display: grid;
  place-items: center;
  min-height: 190px;
  border: 1px dashed rgba(162, 190, 225, 0.2);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 900;
}

.market-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.market-pager span {
  min-width: 72px;
  color: var(--ink);
  font-weight: 900;
  text-align: center;
}

.market-hint,
.market-status {
  margin: 0;
}

.market-status[data-tone="error"] {
  color: var(--pink);
}

.market-sell-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.market-sell-slot {
  display: grid;
  grid-template-rows: 94px auto auto;
  gap: 8px;
  min-height: 182px;
  padding: 10px;
  border: 1px dashed rgba(162, 190, 225, 0.3);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 209, 102, 0.07), transparent 42%),
    rgba(4, 8, 16, 0.52);
}

.market-sell-slot.filled {
  border-style: solid;
  border-color: rgba(255, 209, 102, 0.48);
}

.market-sell-slot.sold {
  border-color: rgba(255, 99, 125, 0.86);
  background:
    linear-gradient(135deg, rgba(255, 99, 125, 0.17), rgba(255, 209, 102, 0.08)),
    rgba(4, 8, 16, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 209, 102, 0.16),
    0 0 24px rgba(255, 99, 125, 0.13);
}

.market-sell-drop {
  display: grid;
  place-items: center;
  min-height: 92px;
  border: 1px solid rgba(104, 231, 255, 0.16);
  border-radius: 7px;
  background: rgba(3, 6, 12, 0.46);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.market-sell-item {
  display: grid;
  place-items: center;
  gap: 4px;
}

.market-sell-item strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-sold-badge {
  display: inline-flex;
  justify-content: center;
  width: 100%;
  padding: 5px 7px;
  border: 1px solid rgba(255, 209, 102, 0.42);
  border-radius: 7px;
  background: rgba(255, 99, 125, 0.18);
  color: var(--gold);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-shadow: 0 0 10px rgba(255, 99, 125, 0.45);
}

.market-price-input {
  width: 100%;
  padding: 0 9px;
}

.market-remove-button {
  min-height: 30px;
  border-color: rgba(255, 99, 125, 0.48);
  background: rgba(255, 99, 125, 0.11);
  color: var(--pink);
}

.trade-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.trade-side {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(162, 190, 225, 0.18);
  border-radius: 7px;
  background: rgba(4, 8, 16, 0.48);
}

.trade-side-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.trade-side-title strong {
  overflow: hidden;
  max-width: 100%;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-side-title small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.trade-side-title small.accepted {
  color: var(--green);
}

.trade-slot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  width: 100%;
}

.trade-offer-slot {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1;
  border: 1px solid rgba(104, 231, 255, 0.36);
  border-radius: 7px;
  background: rgba(8, 13, 24, 0.88);
  color: var(--ink);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 8px 18px rgba(0, 0, 0, 0.24);
}

.trade-offer-slot.empty {
  border-style: dashed;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.trade-offer-slot.accepted {
  border-color: rgba(158, 227, 125, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(158, 227, 125, 0.16),
    0 0 18px rgba(158, 227, 125, 0.12);
}

.trade-offer-slot small {
  position: absolute;
  right: 5px;
  bottom: 5px;
  left: 5px;
  overflow: hidden;
  color: var(--ink);
  font-size: 9px;
  font-weight: 900;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-slot-clear {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(255, 111, 188, 0.62);
  border-radius: 4px;
  background: rgba(255, 111, 188, 0.16);
  color: var(--pink);
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.trade-gold-field,
.trade-gold-readonly {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 209, 102, 0.22);
  border-radius: 6px;
  background: rgba(255, 209, 102, 0.08);
}

.trade-gold-field span,
.trade-gold-readonly span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.trade-gold-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--amber);
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  text-align: right;
}

.trade-gold-readonly strong {
  overflow: hidden;
  color: var(--amber);
  font-size: 14px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.trade-actions button {
  min-height: 38px;
  border: 1px solid rgba(104, 231, 255, 0.58);
  border-radius: 6px;
  background: rgba(104, 231, 255, 0.12);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.trade-actions button:hover:not(:disabled) {
  background: rgba(104, 231, 255, 0.22);
}

.trade-actions button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.inventory-panel {
  display: grid;
  gap: 14px;
  width: min(640px, calc(var(--ui-safe-width) - 32px));
  max-height: calc(var(--ui-safe-height) - 32px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  text-align: left;
}

.inventory-panel::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.inventory-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.inventory-head p {
  margin: 0 0 5px;
}

.inventory-head strong {
  display: block;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.inventory-head button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 34px;
  border: 1px solid rgba(255, 209, 102, 0.58);
  border-radius: 6px;
  background: rgba(255, 209, 102, 0.12);
  color: var(--amber);
  font-weight: 900;
  cursor: pointer;
}

.inventory-head button:hover {
  background: rgba(255, 209, 102, 0.22);
}

.inventory-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.inventory-tabs button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(4, 8, 16, 0.72);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.inventory-tabs button.selected,
.inventory-tabs button:hover {
  border-color: rgba(104, 231, 255, 0.62);
  background: rgba(104, 231, 255, 0.14);
}

.inventory-view {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.equipment-slots {
  display: grid;
  grid-template-columns: repeat(4, 72px);
  justify-content: center;
  gap: 10px;
}

.equipment-slot,
.inventory-item,
.cosmetic-card {
  display: grid;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(8, 13, 24, 0.82);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.equipment-slot {
  grid-template-columns: 1fr;
  min-height: 72px;
  padding: 0;
}

.equipment-slot:hover,
.equipment-slot.equipped,
.inventory-item:hover,
.inventory-item.equipped,
.cosmetic-card:hover,
.cosmetic-card.selected {
  border-color: rgba(255, 209, 102, 0.66);
  background: rgba(14, 22, 36, 0.95);
}

.equipment-slot.offered,
.inventory-item.offered {
  border-color: rgba(158, 227, 125, 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(158, 227, 125, 0.14),
    0 0 16px rgba(158, 227, 125, 0.12);
}

.equipment-slot.targeted {
  border-color: rgba(255, 209, 102, 0.96);
  background: rgba(45, 35, 12, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 209, 102, 0.34),
    0 0 22px rgba(255, 209, 102, 0.28);
}

.equipment-slot span:not(.equipment-icon),
.inventory-item span:not(.equipment-icon),
.cosmetic-card span:not(.ship-swatch) {
  min-width: 0;
}

.equipment-slot small,
.equipment-slot strong,
.inventory-item small,
.inventory-item strong,
.cosmetic-card small,
.cosmetic-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equipment-slot small,
.inventory-item small,
.cosmetic-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.equipment-slot strong,
.inventory-item strong,
.cosmetic-card strong {
  margin-top: 2px;
  color: var(--ink);
  font-size: 13px;
}

.equipment-slot b {
  color: var(--cyan);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.inventory-bag {
  display: grid;
  align-content: start;
  gap: 9px;
  padding-top: 12px;
  border-top: 1px solid rgba(162, 190, 225, 0.16);
}

.inventory-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 22px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.inventory-section-title strong {
  color: var(--ink);
  letter-spacing: 0.8px;
}

.inventory-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, 64px);
  justify-content: center;
  gap: 10px;
}

.inventory-item {
  grid-template-columns: 1fr;
  min-height: 64px;
  padding: 0;
}

.square-slot {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 72px;
  height: 72px;
  min-height: 0;
  aspect-ratio: 1;
  padding: 0;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 8px 18px rgba(0, 0, 0, 0.24);
}

.inventory-item.square-slot {
  width: 64px;
  height: 64px;
}

.square-slot.empty {
  border-style: dashed;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent 42%),
    rgba(143, 160, 184, 0.08);
  cursor: default;
}

.square-slot.empty::before {
  content: "";
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(143, 160, 184, 0.14);
  box-shadow: inset 0 0 0 1px rgba(143, 160, 184, 0.18);
}

.square-slot.equipped {
  border-color: rgba(104, 231, 255, 0.58);
}

.square-slot.dragging {
  opacity: 0.52;
  transform: scale(0.94);
}

.equipment-icon {
  --item-color: var(--cyan);
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid currentColor;
  border-radius: 7px;
  background: rgba(3, 6, 12, 0.78);
  box-shadow: 0 0 14px color-mix(in srgb, var(--item-color) 28%, transparent);
  color: var(--item-color);
}

.inventory-item .equipment-icon {
  width: 42px;
  height: 42px;
}

.equipment-icon.image-icon {
  overflow: hidden;
  border-color: transparent;
  background: rgba(3, 6, 12, 0.32);
  box-shadow: 0 0 16px color-mix(in srgb, var(--item-color) 38%, transparent);
}

.equipment-icon.image-icon::before,
.equipment-icon.image-icon::after {
  display: none;
}

.equipment-icon.image-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--item-color) 52%, transparent));
  pointer-events: none;
}

.equipment-icon.cosmic-equipment-icon[data-tier="1"] {
  background:
    radial-gradient(circle at 50% 34%, rgba(244, 248, 255, 0.34), transparent 58%),
    linear-gradient(135deg, rgba(232, 238, 248, 0.24), rgba(12, 18, 28, 0.92));
  border-color: rgba(226, 234, 246, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 0 16px rgba(226, 234, 246, 0.24);
}

.equipment-icon[data-tier="15"] {
  background:
    radial-gradient(circle at 50% 35%, color-mix(in srgb, #62f28f 30%, transparent), transparent 58%),
    linear-gradient(135deg, rgba(15, 55, 34, 0.92), rgba(3, 6, 12, 0.9));
  border-color: rgba(98, 242, 143, 0.68);
  box-shadow:
    inset 0 0 0 1px rgba(210, 255, 222, 0.12),
    0 0 18px rgba(98, 242, 143, 0.28);
}

.equipment-icon[data-tier="30"] {
  background:
    radial-gradient(circle at 50% 35%, color-mix(in srgb, #ffd166 34%, transparent), transparent 58%),
    linear-gradient(135deg, rgba(68, 52, 12, 0.92), rgba(3, 6, 12, 0.9));
  border-color: rgba(255, 209, 102, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 236, 178, 0.14),
    0 0 18px rgba(255, 209, 102, 0.3);
}

.equipment-icon[data-tier="50"] {
  background:
    radial-gradient(circle at 50% 35%, color-mix(in srgb, #ff9a3c 36%, transparent), transparent 58%),
    linear-gradient(135deg, rgba(80, 40, 13, 0.92), rgba(3, 6, 12, 0.9));
  border-color: rgba(255, 154, 60, 0.74);
  box-shadow:
    inset 0 0 0 1px rgba(255, 215, 174, 0.14),
    0 0 18px rgba(255, 154, 60, 0.32);
}

.equipment-icon[data-tier="70"] {
  background:
    radial-gradient(circle at 50% 35%, color-mix(in srgb, #b270ff 38%, transparent), transparent 58%),
    linear-gradient(135deg, rgba(48, 25, 86, 0.92), rgba(3, 6, 12, 0.9));
  border-color: rgba(178, 112, 255, 0.76);
  box-shadow:
    inset 0 0 0 1px rgba(226, 202, 255, 0.14),
    0 0 19px rgba(178, 112, 255, 0.34);
}

.equipment-icon[data-tier="80"] {
  background:
    radial-gradient(circle at 50% 35%, color-mix(in srgb, #ff405d 40%, transparent), transparent 58%),
    linear-gradient(135deg, rgba(88, 18, 31, 0.92), rgba(3, 6, 12, 0.9));
  border-color: rgba(255, 64, 93, 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(255, 198, 207, 0.16),
    0 0 20px rgba(255, 64, 93, 0.36);
}

.equipment-icon.image-icon[data-tier] {
  border-color: color-mix(in srgb, var(--tier-color, currentColor) 72%, transparent);
}

.slot-code,
.item-level-badge,
.item-count,
.item-equipped-mark {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(238, 245, 255, 0.22);
  background: rgba(3, 6, 12, 0.82);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.24);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.slot-code {
  left: 4px;
  bottom: 4px;
  min-width: 24px;
  height: 14px;
  padding: 0 3px;
  border-color: rgba(104, 231, 255, 0.28);
  color: rgba(238, 245, 255, 0.78);
}

.item-level-badge {
  top: 4px;
  left: 4px;
  min-width: 18px;
  height: 18px;
  border-radius: 4px;
  border-color: rgba(255, 99, 125, 0.58);
  background: rgba(91, 22, 34, 0.9);
  color: #ffd9df;
}

.item-count,
.item-equipped-mark {
  right: 4px;
  bottom: 4px;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  border-color: rgba(158, 227, 125, 0.75);
  background: rgba(45, 120, 40, 0.9);
  color: #d8ffc9;
}

.item-equipped-mark {
  font-size: 10px;
}

.equipment-icon::before,
.equipment-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.equipment-icon.core::before {
  width: 20px;
  height: 20px;
  border: 2px solid currentColor;
}

.equipment-icon.core::after {
  width: 8px;
  height: 8px;
  background: #ffffff;
  box-shadow: 0 0 10px currentColor;
}

.equipment-icon.weapon::before {
  width: 22px;
  height: 4px;
  background: currentColor;
  box-shadow: 0 -8px 0 currentColor, 0 8px 0 currentColor;
}

.equipment-icon.weapon::after {
  right: 6px;
  width: 8px;
  height: 14px;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  background: #ffffff;
}

.equipment-icon.engine::before {
  width: 19px;
  height: 22px;
  clip-path: polygon(50% 0, 82% 38%, 64% 100%, 50% 76%, 36% 100%, 18% 38%);
  background: currentColor;
}

.equipment-icon.engine::after {
  bottom: 6px;
  width: 7px;
  height: 10px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: #ffffff;
}

.equipment-icon.shield::before {
  width: 20px;
  height: 24px;
  clip-path: polygon(50% 0, 91% 18%, 80% 78%, 50% 100%, 20% 78%, 9% 18%);
  border: 2px solid currentColor;
}

.equipment-icon.shield::after {
  width: 10px;
  height: 14px;
  border-left: 2px solid currentColor;
  opacity: 0.72;
}

.equipment-icon.hull::before {
  width: 23px;
  height: 18px;
  border: 3px solid currentColor;
}

.equipment-icon.hull::after {
  width: 15px;
  height: 2px;
  background: #ffffff;
  box-shadow: 0 -6px 0 rgba(255, 255, 255, 0.62), 0 6px 0 rgba(255, 255, 255, 0.62);
}

.equipment-icon.wing::before {
  width: 26px;
  height: 17px;
  clip-path: polygon(50% 0, 100% 100%, 58% 70%, 42% 70%, 0 100%);
  background: currentColor;
}

.equipment-icon.wing::after {
  width: 5px;
  height: 17px;
  background: #ffffff;
}

.equipment-icon.chip::before {
  width: 20px;
  height: 20px;
  border: 2px solid currentColor;
  background: rgba(255, 255, 255, 0.08);
}

.equipment-icon.chip::after {
  width: 3px;
  height: 3px;
  background: #ffffff;
  box-shadow: -8px -8px 0 currentColor, 8px -8px 0 currentColor, -8px 8px 0 currentColor, 8px 8px 0 currentColor;
}

.equipment-icon.booster::before {
  width: 22px;
  height: 10px;
  clip-path: polygon(0 50%, 24% 0, 100% 0, 78% 50%, 100% 100%, 24% 100%);
  background: currentColor;
}

.equipment-icon.booster::after {
  left: 6px;
  width: 4px;
  height: 18px;
  transform: rotate(90deg);
  background: #ffffff;
  box-shadow: -7px 0 0 rgba(255, 255, 255, 0.56);
}

.equipment-icon.effect-seed::before {
  width: 22px;
  height: 22px;
  border: 2px solid currentColor;
  transform: rotate(45deg);
  background: color-mix(in srgb, currentColor 18%, transparent);
}

.equipment-icon.effect-seed::after {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background:
    linear-gradient(currentColor, currentColor) center / 4px 16px no-repeat,
    linear-gradient(currentColor, currentColor) center / 16px 4px no-repeat;
  box-shadow: 0 0 10px currentColor;
}

.equipment-icon.chaos-calibrator::before {
  width: 27px;
  height: 27px;
  border: 3px solid currentColor;
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  transform: rotate(28deg);
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.06);
}

.equipment-icon.chaos-calibrator::after {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.78);
  border-right-color: transparent;
  border-top-color: transparent;
  border-radius: 50%;
  transform: rotate(28deg);
  box-shadow: 0 0 10px currentColor;
}

.equipment-icon.upgrade-material::before {
  width: 23px;
  height: 23px;
  border: 2px solid currentColor;
  border-radius: 5px;
  transform: rotate(45deg);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.86) 0 3px, transparent 4px),
    linear-gradient(135deg, color-mix(in srgb, currentColor 28%, transparent), rgba(255, 209, 102, 0.14));
  box-shadow:
    0 0 10px currentColor,
    inset 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.equipment-icon.upgrade-material::after {
  width: 7px;
  height: 25px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    -9px 0 0 color-mix(in srgb, currentColor 74%, transparent),
    9px 0 0 color-mix(in srgb, currentColor 74%, transparent);
}

.equipment-icon.protector-scroll::before {
  width: 25px;
  height: 22px;
  border: 2px solid currentColor;
  border-radius: 4px 10px 4px 10px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.14), transparent 48%),
    color-mix(in srgb, currentColor 18%, transparent);
  box-shadow:
    0 0 10px currentColor,
    inset 0 -5px 0 rgba(255, 255, 255, 0.14);
}

.equipment-icon.protector-scroll::after {
  width: 13px;
  height: 16px;
  clip-path: polygon(50% 0, 91% 18%, 80% 74%, 50% 100%, 20% 74%, 9% 18%);
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: color-mix(in srgb, currentColor 34%, transparent);
}

.cosmetic-view {
  grid-template-columns: 1fr;
}

.cosmetic-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.cosmetic-card {
  grid-template-columns: 42px minmax(0, 1fr);
  min-height: 66px;
  padding: 10px;
}

.item-tooltip {
  position: fixed;
  z-index: 10000;
  display: grid;
  gap: 5px;
  width: 312px;
  padding: 10px;
  border: 1px solid rgba(104, 231, 255, 0.5);
  border-radius: 6px;
  background: rgba(4, 8, 16, 0.96);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.item-tooltip[hidden] {
  display: none !important;
}

.item-tooltip.comparison {
  width: min(624px, calc(100vw - 16px));
  padding: 12px;
}

.item-tooltip.skill-tooltip {
  width: min(350px, calc(100vw - 16px));
}

.item-tooltip.skill-tooltip .skill-stats {
  margin-top: 6px;
}

.item-tooltip.skill-tooltip .skill-stat-list {
  grid-template-columns: minmax(0, 1fr);
}

.item-tooltip.skill-tooltip .skill-tooltip-ready {
  color: var(--green);
  font-weight: 950;
}

.item-tooltip.skill-tooltip .skill-tooltip-cooldown {
  color: var(--amber);
  font-weight: 950;
}

.tooltip-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.tooltip-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(162, 190, 225, 0.18);
  border-radius: 5px;
  background: rgba(10, 15, 26, 0.7);
}

.tooltip-card-label {
  color: var(--amber);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.item-tooltip strong {
  color: var(--ink);
  font-size: 13px;
}

.item-tooltip span,
.item-tooltip small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.item-tooltip span:last-of-type {
  color: var(--cyan);
}

.item-tooltip .tooltip-grind {
  color: var(--amber);
  font-weight: 900;
}

.tooltip-base-effect {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 28px;
  margin-top: 3px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 209, 102, 0.58);
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 209, 102, 0.14), rgba(104, 231, 255, 0.07));
  box-shadow: inset 0 0 14px rgba(255, 209, 102, 0.08);
}

.tooltip-base-effect i {
  color: var(--amber);
  font-style: normal;
  font-weight: 900;
  font-size: 10px;
  text-transform: uppercase;
}

.tooltip-base-effect b {
  color: var(--cyan);
  font-size: 11px;
  line-height: 1.2;
}

.tooltip-effect-slots {
  display: grid;
  gap: 4px;
  margin-top: 4px;
}

.tooltip-effect-slot {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 24px;
  padding: 4px 7px;
  border: 1px solid rgba(104, 231, 255, 0.24);
  border-radius: 5px;
  background: rgba(104, 231, 255, 0.06);
}

.tooltip-effect-slot i {
  color: var(--amber);
  font-style: normal;
  font-weight: 900;
  font-size: 10px;
  text-transform: uppercase;
}

.tooltip-effect-slot b {
  color: var(--cyan);
  font-size: 11px;
  line-height: 1.2;
}

.tooltip-effect-slot.empty {
  border-color: rgba(143, 160, 184, 0.18);
  background: rgba(143, 160, 184, 0.05);
}

.tooltip-effect-slot.empty i,
.tooltip-effect-slot.empty b {
  color: rgba(162, 177, 204, 0.66);
}

.item-tooltip .tooltip-equipped {
  color: var(--amber);
}

.item-tooltip .tooltip-compare {
  display: block;
  color: var(--green);
  font-weight: 900;
}

.inventory-footer {
  display: flex;
  justify-content: flex-end;
  min-height: 34px;
}

.gold-wallet {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 118px;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 209, 102, 0.48);
  border-radius: 6px;
  background: rgba(4, 8, 16, 0.62);
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.gold-wallet i {
  display: block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.62);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff0a8 0 18%, transparent 20%),
    linear-gradient(135deg, #ffdf6b, #b97812);
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.38);
}

.gold-wallet strong {
  color: var(--amber);
  font-size: 14px;
  font-weight: 900;
}

.room-panel {
  width: auto;
  text-align: left;
  overflow: hidden;
}

.mission-lead {
  max-width: 560px;
  margin: -6px 0 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.upgrade-panel {
  display: grid;
  justify-items: center;
  gap: 18px;
  width: min(1040px, calc(100vw - 32px));
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
  transform: translateY(calc(-42px * var(--ui-scale))) scale(var(--ui-scale));
  transform-origin: center;
}

.lobby-panel {
  display: grid;
  grid-template-columns: minmax(480px, 780px) minmax(310px, 380px);
  gap: 18px;
  width: min(1160px, calc(100vw - 32px));
  align-items: stretch;
  transform: scale(var(--ui-scale));
  transform-origin: center;
}

.loadout-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: auto;
  text-align: left;
}

.auth-card,
.pilot-form {
  display: grid;
  gap: 12px;
}

.pilot-form {
  margin-top: auto;
}

.auth-card {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.auth-logo {
  display: none;
  width: min(360px, 100%);
  height: auto;
  margin: -4px auto 0;
  object-fit: contain;
  filter:
    drop-shadow(0 0 14px rgba(104, 231, 255, 0.28))
    drop-shadow(0 0 24px rgba(255, 255, 255, 0.08));
}

.room-select.auth-only .lobby-panel {
  grid-template-columns: minmax(280px, 430px);
  width: min(460px, calc(100vw - 32px));
}

.room-select.auth-only .room-panel,
.room-select.auth-only .pilot-form,
.room-select.auth-only .mission-brief {
  display: none;
}

.room-select.auth-only .loadout-panel {
  gap: 0;
}

.room-select.auth-only .auth-card {
  padding-bottom: 0;
  border-bottom: 0;
}

.room-select.auth-only .auth-logo {
  display: block;
}

.room-select.auth-only .auth-status {
  text-align: center;
}

.room-select.account-ready .auth-card {
  display: none;
}

.google-auth-panel {
  display: grid;
  gap: 14px;
}

.google-auth-panel .hud-kicker {
  text-align: center;
}

.google-auth-button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 14px 8px 8px;
  border: 1px solid rgba(104, 231, 255, 0.62);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  background:
    radial-gradient(circle at 18% 0%, rgba(104, 231, 255, 0.24), transparent 38%),
    linear-gradient(135deg, rgba(104, 231, 255, 0.18), rgba(255, 209, 102, 0.08) 52%, rgba(255, 79, 100, 0.12));
  box-shadow:
    0 0 28px rgba(104, 231, 255, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.google-auth-button:hover {
  border-color: rgba(255, 209, 102, 0.78);
  background:
    radial-gradient(circle at 18% 0%, rgba(104, 231, 255, 0.34), transparent 38%),
    linear-gradient(135deg, rgba(104, 231, 255, 0.24), rgba(255, 209, 102, 0.13) 52%, rgba(255, 79, 100, 0.16));
}

.google-auth-button strong {
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 950;
}

.google-auth-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #fff;
  font-size: 23px;
  font-weight: 950;
  background:
    conic-gradient(from -35deg, #4285f4 0 25%, #34a853 0 50%, #fbbc05 0 75%, #ea4335 0 100%);
  box-shadow:
    0 0 18px rgba(104, 231, 255, 0.22),
    inset 0 0 0 5px rgba(4, 8, 16, 0.86);
}

.mission-brief {
  display: grid;
  gap: 13px;
  min-height: 232px;
  padding: 18px;
  border: 1px solid rgba(104, 231, 255, 0.24);
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 0%, rgba(104, 231, 255, 0.12), transparent 34%),
    linear-gradient(145deg, rgba(14, 22, 38, 0.92), rgba(5, 8, 15, 0.82));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    0 18px 42px rgba(0, 0, 0, 0.24);
}

.mission-brief h2 {
  margin: -6px 0 0;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.mission-brief p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.mission-brief-grid {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.mission-brief-grid span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid rgba(126, 157, 190, 0.18);
  border-radius: 6px;
  background: rgba(3, 6, 12, 0.46);
}

.mission-brief-grid small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.mission-brief-grid strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.mission-brief-stars-row strong {
  display: flex;
  justify-content: flex-end;
  min-width: 96px;
}

.mission-brief .difficulty-stars {
  justify-content: flex-end;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  min-height: 36px;
}

.auth-tabs button,
.auth-action,
.account-row button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(4, 8, 16, 0.72);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.auth-tabs button.selected,
.auth-action {
  border-color: rgba(104, 231, 255, 0.58);
  background: rgba(104, 231, 255, 0.14);
}

.auth-tabs button:hover,
.auth-action:hover,
.account-row button:hover {
  background: rgba(104, 231, 255, 0.22);
}

.auth-form {
  display: grid;
  gap: 10px;
}

.account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.account-row small,
.account-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-row small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.account-row strong {
  color: var(--ink);
  font-size: 16px;
}

.account-summary,
.auth-status {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.auth-status[data-tone="ok"] {
  color: var(--cyan);
}

.auth-status[data-tone="warn"] {
  color: var(--amber);
}

.auth-status[data-tone="error"] {
  color: var(--danger);
}

.auth-popup {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 5, 11, 0.68);
  backdrop-filter: blur(6px);
  pointer-events: auto;
}

.auth-popup-panel {
  display: grid;
  gap: 12px;
  width: min(360px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid rgba(255, 99, 125, 0.46);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  transform: scale(var(--ui-scale));
  transform-origin: center;
}

.auth-popup-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}

.auth-popup-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.auth-popup-panel ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
}

.auth-popup-panel button {
  min-height: 38px;
  border: 1px solid rgba(104, 231, 255, 0.58);
  border-radius: 6px;
  background: rgba(104, 231, 255, 0.14);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.auth-popup-panel button:hover {
  background: rgba(104, 231, 255, 0.24);
}

.notice-popup {
  position: absolute;
  inset: 0;
  z-index: 13;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 5, 11, 0.42);
  pointer-events: auto;
}

.notice-popup-panel {
  display: grid;
  gap: 12px;
  width: min(360px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid rgba(104, 231, 255, 0.5);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  transform: scale(var(--ui-scale));
  transform-origin: center;
}

.notice-popup[data-tone="ok"] .notice-popup-panel {
  border-color: rgba(158, 227, 125, 0.56);
}

.notice-popup[data-tone="error"] .notice-popup-panel {
  border-color: rgba(255, 99, 125, 0.58);
}

.notice-popup[data-tone="warn"] .notice-popup-panel,
.confirm-popup .notice-popup-panel {
  border-color: rgba(255, 209, 102, 0.58);
}

.notice-popup-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}

.notice-popup-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.notice-popup-panel button {
  min-height: 38px;
  border: 1px solid rgba(104, 231, 255, 0.58);
  border-radius: 6px;
  background: rgba(104, 231, 255, 0.14);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.notice-popup-panel button:hover {
  background: rgba(104, 231, 255, 0.24);
}

.confirm-quantity {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(104, 231, 255, 0.22);
  border-radius: 7px;
  background: rgba(2, 7, 14, 0.46);
}

.confirm-quantity[hidden] {
  display: none;
}

.confirm-quantity label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.confirm-quantity-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.confirm-quantity-row input {
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(104, 231, 255, 0.34);
  border-radius: 6px;
  background: rgba(5, 10, 20, 0.78);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
}

.confirm-quantity-row button {
  min-width: 72px;
}

.trade-invite-popup {
  z-index: 14;
  background: rgba(2, 5, 11, 0.5);
}

.trade-invite-popup .notice-popup-panel {
  border-color: rgba(255, 111, 188, 0.54);
}

.trade-invite-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.trade-invite-actions button:last-child {
  border-color: rgba(255, 99, 125, 0.54);
  background: rgba(255, 99, 125, 0.1);
}

.trade-invite-actions button:last-child:hover {
  background: rgba(255, 99, 125, 0.2);
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.room-panel h1,
.upgrade-panel h1,
.match-panel h1 {
  margin: 4px 0 10px;
  font-size: clamp(30px, 8vw, 52px);
  line-height: 1;
}

.room-panel h1 {
  margin-bottom: 18px;
}

.upgrade-panel h1 {
  margin-bottom: 0;
  color: #fff4d6;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 6vw, 58px);
  letter-spacing: 0;
  text-transform: uppercase;
  transform: translateY(-22px);
  text-shadow:
    0 0 14px rgba(255, 209, 102, 0.28),
    0 3px 0 rgba(0, 0, 0, 0.34);
}

.upgrade-toolbar {
  display: flex;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: -2px;
  margin-bottom: 0;
}

.upgrade-refresh-button,
.upgrade-tab-button {
  min-width: 132px;
  min-height: 36px;
  padding: 0 18px;
  border: 1px solid rgba(255, 209, 102, 0.58);
  border-radius: 999px;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 244, 214, 0.24), transparent 26%),
    linear-gradient(135deg, rgba(255, 209, 102, 0.18), rgba(104, 231, 255, 0.08)),
    rgba(5, 9, 18, 0.84);
  color: #fff2d2;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: 0 0 10px rgba(255, 209, 102, 0.32);
  box-shadow:
    0 0 18px rgba(255, 209, 102, 0.12),
    inset 0 0 0 1px rgba(238, 245, 255, 0.06);
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease, opacity 140ms ease;
}

.upgrade-tab-button {
  min-width: 188px;
  color: #dff8ff;
  border-color: rgba(104, 231, 255, 0.52);
  background:
    radial-gradient(circle at 28% 22%, rgba(104, 231, 255, 0.24), transparent 26%),
    linear-gradient(135deg, rgba(104, 231, 255, 0.15), rgba(255, 209, 102, 0.08)),
    rgba(5, 9, 18, 0.84);
}

.upgrade-tab-button.active {
  color: #07121b;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.34), transparent 26%),
    linear-gradient(135deg, #68e7ff, #ffd166);
  border-color: rgba(255, 244, 214, 0.78);
  text-shadow: none;
}

.upgrade-refresh-button:hover:not(:disabled),
.upgrade-tab-button:hover:not(:disabled) {
  filter: brightness(1.14);
  transform: translateY(-1px);
}

.upgrade-refresh-button:disabled,
.upgrade-tab-button:disabled {
  cursor: default;
  opacity: 0.46;
}

.upgrade-choices.refreshing .upgrade-card {
  animation: upgradeChoiceRefresh 240ms ease-out both;
}

@keyframes upgradeChoiceRefresh {
  0% {
    opacity: 0;
    filter: blur(4px) brightness(1.25);
    transform: translateY(10px) scale(0.96);
  }
  100% {
    opacity: 1;
    filter: blur(0) brightness(1);
    transform: translateY(0) scale(1);
  }
}

.upgrade-choices.refreshing .upgrade-card:nth-child(2) {
  animation-name: upgradeChoiceRefreshMiddle;
}

@keyframes upgradeChoiceRefreshMiddle {
  0% {
    opacity: 0;
    filter: blur(4px) brightness(1.25);
    transform: translateY(-2px) scale(0.96);
  }
  100% {
    opacity: 1;
    filter: blur(0) brightness(1);
    transform: translateY(-12px) scale(1);
  }
}

.chest-reward-screen {
  z-index: 7;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 209, 102, 0.13), transparent 34%),
    rgba(2, 5, 11, 0.72);
}

.chest-reward-panel {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(980px, calc(100vw - 32px));
  border: 0;
  background: transparent;
  box-shadow: none;
}

.chest-reward-panel h1 {
  margin: 0;
  color: #fff4d6;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 5vw, 50px);
  line-height: 1;
  text-transform: uppercase;
  text-shadow:
    0 0 14px rgba(255, 209, 102, 0.28),
    0 3px 0 rgba(0, 0, 0, 0.34);
}

.chest-reward-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(960px, 100%);
  min-height: 390px;
}

.chest-reward-box {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 118px;
  height: 90px;
  transform: translate(-50%, -50%);
  filter:
    drop-shadow(0 0 18px rgba(255, 209, 102, 0.34))
    drop-shadow(0 0 28px rgba(104, 231, 255, 0.12));
  animation: chestBoxPulse 720ms ease-in-out infinite alternate;
}

.chest-reward-screen.reward-ready .chest-reward-box {
  animation: chestBoxOpen 420ms ease forwards;
}

.chest-lid,
.chest-body,
.chest-core,
.chest-light,
.chest-question {
  position: absolute;
  left: 50%;
  box-sizing: border-box;
}

.chest-lid {
  top: 4px;
  width: 104px;
  height: 30px;
  z-index: 5;
  transform: translateX(-50%);
  transform-origin: 50% 100%;
  border: 2px solid rgba(255, 209, 102, 0.9);
  border-radius: 8px 8px 2px 2px;
  background:
    linear-gradient(90deg, rgba(255, 111, 188, 0.22), rgba(104, 231, 255, 0.2)),
    #151e2e;
}

.chest-body {
  bottom: 8px;
  width: 118px;
  height: 58px;
  z-index: 4;
  transform: translateX(-50%);
  border: 2px solid rgba(255, 209, 102, 0.9);
  border-radius: 4px 4px 10px 10px;
  background:
    linear-gradient(180deg, rgba(255, 209, 102, 0.16), transparent 42%),
    #0d1626;
}

.chest-core {
  top: 42px;
  width: 26px;
  height: 26px;
  z-index: 6;
  transform: translateX(-50%);
  border: 2px solid rgba(255, 244, 214, 0.92);
  border-radius: 6px;
  background:
    radial-gradient(circle, #fff4d6 0 22%, #ffd166 24% 58%, rgba(255, 111, 188, 0.86) 60%);
}

.chest-light {
  bottom: 42px;
  width: 116px;
  height: 150px;
  z-index: 1;
  opacity: 0;
  transform: translateX(-50%) scaleY(0.12);
  transform-origin: 50% 100%;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background:
    radial-gradient(circle at 50% 74%, rgba(255, 244, 214, 0.9), rgba(255, 209, 102, 0.4) 24%, transparent 58%),
    linear-gradient(180deg, rgba(255, 244, 214, 0.72), rgba(104, 231, 255, 0.2) 54%, transparent);
  filter: blur(0.3px) drop-shadow(0 0 18px rgba(255, 209, 102, 0.7));
}

.chest-question {
  bottom: 58px;
  z-index: 7;
  opacity: 0;
  color: #fff4d6;
  font: 900 25px Georgia, "Times New Roman", serif;
  text-shadow:
    0 0 10px rgba(255, 209, 102, 0.8),
    0 0 18px rgba(104, 231, 255, 0.4);
}

.chest-question-1 {
  transform: translateX(-50%);
}

.chest-question-2 {
  transform: translateX(-92%);
}

.chest-question-3 {
  transform: translateX(-6%);
}

.chest-reward-screen.chest-opening .chest-lid {
  animation: chestLidOpen 720ms cubic-bezier(0.18, 0.9, 0.2, 1) forwards;
}

.chest-reward-screen.chest-opening .chest-light {
  animation: chestLightRise 980ms ease-out 360ms forwards;
}

.chest-reward-screen.chest-opening .chest-question-1 {
  animation: chestQuestionRise 900ms ease-out 470ms forwards;
}

.chest-reward-screen.chest-opening .chest-question-2 {
  animation: chestQuestionRiseLeft 900ms ease-out 570ms forwards;
}

.chest-reward-screen.chest-opening .chest-question-3 {
  animation: chestQuestionRiseRight 900ms ease-out 650ms forwards;
}

.chest-reward-card {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 4vw, 54px);
  width: 100%;
  animation: chestRewardReveal 340ms cubic-bezier(0.17, 0.9, 0.2, 1) both;
}

.chest-reward-card .upgrade-card {
  width: clamp(206px, 21vw, 254px);
}

.chest-reward-card .upgrade-card:hover,
.chest-reward-card .upgrade-card:nth-child(2):hover {
  transform: translateY(-8px) scale(1.02);
}

.chest-reward-card .chest-reward-claimed {
  filter: saturate(0.55) brightness(0.82);
  pointer-events: none;
}

@keyframes chestBoxPulse {
  from {
    transform: translate(-50%, -50%) scale(0.98);
  }
  to {
    transform: translate(-50%, -50%) scale(1.04);
  }
}

@keyframes chestBoxOpen {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  52% {
    opacity: 1;
    transform: translate(-50%, -54%) scale(1.12);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -66%) scale(0.78);
  }
}

@keyframes chestLidOpen {
  0% {
    transform: translateX(-50%) translateY(0) rotate(0);
  }
  42% {
    transform: translateX(-50%) translateY(-12px) rotate(-7deg);
  }
  100% {
    transform: translateX(-50%) translateY(-28px) rotate(-16deg);
  }
}

@keyframes chestLightRise {
  0% {
    opacity: 0;
    transform: translateX(-50%) scaleY(0.12);
  }
  24% {
    opacity: 1;
    transform: translateX(-50%) scaleY(0.85);
  }
  100% {
    opacity: 0.62;
    transform: translateX(-50%) translateY(-12px) scaleY(1);
  }
}

@keyframes chestQuestionRise {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(10px) scale(0.64);
  }
  28% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-76px) scale(1.12) rotate(8deg);
  }
}

@keyframes chestQuestionRiseLeft {
  0% {
    opacity: 0;
    transform: translateX(-92%) translateY(10px) scale(0.62);
  }
  28% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(-132%) translateY(-68px) scale(1.05) rotate(-12deg);
  }
}

@keyframes chestQuestionRiseRight {
  0% {
    opacity: 0;
    transform: translateX(-6%) translateY(10px) scale(0.62);
  }
  28% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(34%) translateY(-72px) scale(1.08) rotate(14deg);
  }
}

@keyframes chestRewardReveal {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.84);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.upgrade-panel .hud-kicker {
  transform: translateY(-22px);
}

.upgrade-choices {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(22px, 5vw, 76px);
  width: 100%;
  min-height: 330px;
  margin-top: 12px;
}

.upgrade-card {
  --offer-shape: polygon(50% 0, 100% 16%, 100% 84%, 50% 100%, 0 84%, 0 16%);
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  width: clamp(208px, 22vw, 262px);
  min-height: 326px;
  padding: 42px 24px 36px;
  appearance: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease;
}

.upgrade-card:nth-child(2) {
  transform: translateY(-12px);
}

.upgrade-card:hover {
  filter: brightness(1.12);
  transform: translateY(-10px);
}

.upgrade-card:nth-child(2):hover {
  transform: translateY(-22px);
}

.upgrade-card::before,
.upgrade-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
  clip-path: var(--offer-shape);
}

.upgrade-card::before {
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(255, 232, 166, 0.95), rgba(255, 209, 102, 0.86) 48%, rgba(113, 83, 33, 0.95)),
    rgba(255, 209, 102, 0.72);
  filter:
    drop-shadow(0 22px 26px rgba(0, 0, 0, 0.34))
    drop-shadow(0 0 8px rgba(255, 209, 102, 0.22))
    drop-shadow(0 0 18px rgba(104, 231, 255, 0.1));
}

.upgrade-card::after {
  inset: 2px;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 28%, rgba(104, 231, 255, 0.16), transparent 38%),
    linear-gradient(180deg, rgba(24, 32, 47, 0.98), rgba(8, 13, 24, 0.96));
}

.upgrade-card-evolved::before {
  background:
    linear-gradient(180deg, rgba(255, 210, 210, 0.96), rgba(255, 79, 100, 0.86) 48%, rgba(88, 12, 24, 0.98)),
    rgba(255, 79, 100, 0.8);
  filter:
    drop-shadow(0 22px 26px rgba(0, 0, 0, 0.34))
    drop-shadow(0 0 14px rgba(255, 79, 100, 0.32));
}

.upgrade-card-evolved::after {
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 79, 100, 0.25), transparent 38%),
    linear-gradient(180deg, rgba(36, 16, 26, 0.99), rgba(9, 8, 16, 0.98));
}

.upgrade-card > * {
  position: relative;
  z-index: 2;
}

.upgrade-card:disabled {
  cursor: default;
  pointer-events: none;
}

.upgrade-card-picked {
  animation: upgradeCardPicked 520ms ease-out forwards;
}

.upgrade-card-shatter {
  animation: upgradeCardShatter 420ms ease-out forwards;
}

.upgrade-card-shatter > :not(.upgrade-card-shard) {
  animation: upgradeCardContentBreak 260ms ease-out forwards;
}

.upgrade-card-shard {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 209, 102, 0.78);
  border-radius: 3px;
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 244, 214, 0.9), transparent 34%),
    linear-gradient(135deg, rgba(104, 231, 255, 0.34), rgba(255, 209, 102, 0.26)),
    rgba(8, 13, 24, 0.92);
  box-shadow:
    0 0 10px rgba(255, 209, 102, 0.32),
    0 0 18px rgba(104, 231, 255, 0.18);
  clip-path: polygon(50% 0, 100% 26%, 82% 100%, 16% 78%, 0 20%);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.36) rotate(0deg);
  animation: upgradeCardShardBurst 430ms cubic-bezier(0.16, 0.82, 0.22, 1) forwards;
  animation-delay: var(--delay, 0ms);
}

@keyframes upgradeCardPicked {
  0% {
    opacity: 1;
    filter: brightness(1);
  }
  52% {
    opacity: 1;
    filter: brightness(1.24) drop-shadow(0 0 24px rgba(255, 209, 102, 0.28));
    transform: translateY(-18px) scale(1.04);
  }
  100% {
    opacity: 0;
    filter: brightness(1.08);
    transform: translateY(-28px) scale(0.92);
  }
}

@keyframes upgradeCardShatter {
  0% {
    opacity: 1;
    filter: brightness(1);
  }
  38% {
    opacity: 0.92;
    filter: brightness(1.32) saturate(1.25);
  }
  100% {
    opacity: 0;
    filter: brightness(0.7) blur(2px);
    transform: translateY(18px) scale(0.78) rotate(2deg);
  }
}

@keyframes upgradeCardContentBreak {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-14px) scale(0.84);
  }
}

@keyframes upgradeCardShardBurst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.24) rotate(0deg);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--sx)), calc(-50% + var(--sy))) scale(0.18) rotate(var(--rot));
  }
}

.upgrade-card-title {
  display: grid;
  justify-items: center;
  gap: 14px;
  min-width: 0;
}

.upgrade-card strong {
  display: block;
  color: #fff2d2;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}

.upgrade-description {
  color: var(--muted);
  max-width: 190px;
  min-height: 46px;
  font-size: 12px;
  line-height: 1.35;
}

.upgrade-rank {
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--amber);
  font-size: 11px;
  font-weight: 900;
}

.upgrade-rank-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 14px;
}

.upgrade-rank-dots span {
  content: "";
  width: 8px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: rgba(5, 9, 18, 0.86);
  box-shadow: 0 0 7px rgba(255, 209, 102, 0.16);
}

.upgrade-rank-dots span.filled {
  background: currentColor;
  box-shadow:
    0 0 7px rgba(255, 209, 102, 0.55),
    0 0 14px rgba(255, 209, 102, 0.22);
}

.upgrade-card .upgrade-icon {
  width: 68px;
  height: 68px;
  flex-basis: 68px;
  border-color: rgba(255, 209, 102, 0.72);
  box-shadow:
    0 0 28px rgba(104, 231, 255, 0.22),
    inset 0 0 0 1px rgba(238, 245, 255, 0.08);
}

.upgrade-card .upgrade-icon svg {
  width: 58px;
  height: 58px;
}

.upgrade-card-evo-hint {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: fit-content;
  max-width: 92%;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 209, 102, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 209, 102, 0.13), rgba(104, 231, 255, 0.06)),
    rgba(5, 9, 18, 0.56);
  box-shadow:
    inset 0 0 0 1px rgba(238, 245, 255, 0.04),
    0 0 12px rgba(255, 209, 102, 0.08);
}

.upgrade-card-evo-hint.owned {
  border-color: rgba(158, 227, 125, 0.42);
  background:
    linear-gradient(90deg, rgba(158, 227, 125, 0.13), rgba(104, 231, 255, 0.06)),
    rgba(5, 9, 18, 0.56);
}

.upgrade-card-evo-hint.ready {
  box-shadow:
    inset 0 0 0 1px rgba(238, 245, 255, 0.06),
    0 0 18px rgba(158, 227, 125, 0.18);
}

.upgrade-card-evo-hint.missing {
  border-color: rgba(255, 99, 125, 0.34);
}

.upgrade-card-evo-hint b {
  color: var(--amber);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: 0 0 8px rgba(255, 209, 102, 0.28);
}

.upgrade-card-evo-icons {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.upgrade-card-evo-hint small {
  min-width: 0;
  overflow: hidden;
  color: #d7e5ff;
  font-size: 9px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upgrade-card-evo-hint .upgrade-icon {
  width: 26px;
  height: 26px;
  flex-basis: 26px;
  border-radius: 6px;
  border-color: rgba(255, 209, 102, 0.42);
  box-shadow:
    0 0 10px color-mix(in srgb, var(--icon-color, #68e7ff) 36%, transparent),
    inset 0 0 0 1px rgba(238, 245, 255, 0.07);
}

.upgrade-card-evo-hint .upgrade-icon.owned {
  border-color: rgba(158, 227, 125, 0.62);
  box-shadow:
    0 0 13px rgba(158, 227, 125, 0.28),
    inset 0 0 0 1px rgba(238, 245, 255, 0.08);
}

.upgrade-card-evo-hint .upgrade-icon.missing {
  opacity: 0.72;
  border-color: rgba(255, 99, 125, 0.42);
  filter: saturate(0.78);
}

.upgrade-card-evo-hint .upgrade-icon svg {
  width: 21px;
  height: 21px;
}

.upgrade-pickup-flyer {
  position: fixed;
  z-index: 80;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  pointer-events: none;
  filter:
    drop-shadow(0 0 18px rgba(255, 209, 102, 0.44))
    drop-shadow(0 0 34px rgba(104, 231, 255, 0.28));
}

.upgrade-pickup-flyer .upgrade-icon {
  width: 76px;
  height: 76px;
  border-color: rgba(255, 209, 102, 0.86);
  box-shadow:
    0 0 28px rgba(255, 209, 102, 0.32),
    inset 0 0 0 1px rgba(238, 245, 255, 0.12);
}

.upgrade-pickup-flyer .upgrade-icon svg {
  width: 64px;
  height: 64px;
}

.upgrade-pickup-card-flyer {
  position: fixed;
  z-index: 80;
  display: grid;
  place-items: stretch;
  pointer-events: none;
  filter:
    drop-shadow(0 24px 34px rgba(0, 0, 0, 0.46))
    drop-shadow(0 0 28px rgba(255, 209, 102, 0.24))
    drop-shadow(0 0 42px rgba(104, 231, 255, 0.14));
}

.upgrade-pickup-card-flyer .upgrade-card {
  width: 100%;
  min-height: 100%;
  opacity: 1;
  transform: none;
  cursor: default;
  transition: none;
}

.upgrade-pickup-card-flyer .upgrade-card,
.upgrade-pickup-card-flyer .upgrade-card * {
  opacity: 1;
}

.upgrade-pickup-card-flyer .upgrade-card:hover,
.upgrade-pickup-card-flyer .upgrade-card:nth-child(2):hover {
  filter: none;
  transform: none;
}

.upgrade-pickup-card-flyer .upgrade-card::before {
  filter:
    drop-shadow(0 0 14px rgba(255, 209, 102, 0.32))
    drop-shadow(0 0 28px rgba(104, 231, 255, 0.16));
}

.upgrade-pickup-card-flyer .upgrade-card::after {
  background:
    radial-gradient(circle at 50% 28%, rgba(104, 231, 255, 0.24), transparent 40%),
    linear-gradient(180deg, rgba(26, 36, 54, 0.99), rgba(8, 13, 24, 0.98));
}

.upgrade-item.upgrade-landing {
  z-index: 14;
  animation: upgradeLandingPulse 620ms ease-out;
}

@keyframes upgradeLandingPulse {
  0% {
    transform: scale(1);
    box-shadow: inset 0 0 0 1px rgba(104, 231, 255, 0.08), 0 0 0 rgba(255, 209, 102, 0);
  }
  42% {
    transform: scale(1.08);
    box-shadow: inset 0 0 0 1px rgba(255, 209, 102, 0.74), 0 0 24px rgba(255, 209, 102, 0.34);
  }
  100% {
    transform: scale(1);
    box-shadow: inset 0 0 0 1px rgba(104, 231, 255, 0.08), 0 0 0 rgba(255, 209, 102, 0);
  }
}

.upgrade-icon {
  --icon-color: var(--cyan);
  position: relative;
  display: inline-grid;
  flex: 0 0 34px;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid currentColor;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
    rgba(4, 8, 16, 0.86);
  box-shadow: 0 0 13px rgba(104, 231, 255, 0.12);
  color: var(--icon-color);
}

.upgrade-icon.evolved {
  border-color: rgba(255, 99, 125, 0.95);
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 209, 102, 0.2), transparent 44%),
    linear-gradient(135deg, rgba(255, 99, 125, 0.52), rgba(113, 8, 28, 0.88)),
    rgba(22, 4, 10, 0.96);
  color: #ffd166;
  box-shadow:
    0 0 18px rgba(255, 79, 100, 0.42),
    inset 0 0 0 1px rgba(255, 244, 214, 0.12);
}

.upgrade-icon::before,
.upgrade-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.upgrade-icon.svg-upgrade-icon::before,
.upgrade-icon.svg-upgrade-icon::after {
  display: none;
}

.upgrade-icon svg {
  width: 30px;
  height: 30px;
  color: var(--icon-color);
  filter: drop-shadow(0 0 6px currentColor);
  shape-rendering: crispEdges;
}

.upgrade-icon.plasma-core::before {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.upgrade-icon.plasma-core::after {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.upgrade-icon.rapid-trigger::before {
  width: 20px;
  height: 3px;
  background: currentColor;
  box-shadow: 0 -7px 0 currentColor, 0 7px 0 currentColor;
}

.upgrade-icon.rapid-trigger::after {
  right: 7px;
  width: 7px;
  height: 12px;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  background: currentColor;
}

.upgrade-icon.range-coil::before {
  width: 21px;
  height: 21px;
  border: 3px solid currentColor;
  border-radius: 50%;
}

.upgrade-icon.range-coil::after {
  right: 6px;
  width: 13px;
  height: 2px;
  background: currentColor;
}

.upgrade-icon.ion-accelerator::before {
  width: 23px;
  height: 12px;
  clip-path: polygon(0 35%, 62% 35%, 62% 0, 100% 50%, 62% 100%, 62% 65%, 0 65%);
  background: currentColor;
}

.upgrade-icon.ion-accelerator::after {
  left: 6px;
  width: 3px;
  height: 18px;
  background: currentColor;
  opacity: 0.62;
}

.upgrade-icon.splitter::before {
  width: 18px;
  height: 3px;
  background: currentColor;
  box-shadow: 4px -7px 0 currentColor, 4px 7px 0 currentColor;
}

.upgrade-icon.splitter::after {
  right: 7px;
  width: 5px;
  height: 5px;
  background: #ffffff;
  box-shadow: 0 -7px 0 #ffffff, 0 7px 0 #ffffff;
}

.upgrade-icon.orbit-shield::before {
  width: 23px;
  height: 23px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.upgrade-icon.orbit-shield::after {
  top: 5px;
  right: 8px;
  width: 5px;
  height: 5px;
  background: #ffffff;
  box-shadow: 0 0 8px currentColor;
}

.upgrade-icon.shatter-shot::before {
  width: 8px;
  height: 8px;
  background: currentColor;
  box-shadow: -8px -6px 0 currentColor, 8px -4px 0 currentColor, -3px 9px 0 currentColor, 10px 8px 0 currentColor;
}

.upgrade-icon.shatter-shot::after {
  width: 18px;
  height: 2px;
  transform: rotate(-25deg);
  background: rgba(255, 255, 255, 0.86);
}

.upgrade-icon.nova-burst::before {
  width: 23px;
  height: 23px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.upgrade-icon.nova-burst::after {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 11px currentColor;
}

.upgrade-icon.drone-wing::before {
  width: 18px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 10px;
}

.upgrade-icon.drone-wing::after {
  width: 4px;
  height: 4px;
  background: #ffffff;
  box-shadow: -10px -6px 0 currentColor, 10px -6px 0 currentColor, -10px 6px 0 currentColor, 10px 6px 0 currentColor;
}

.upgrade-icon.chain-lightning::before {
  width: 18px;
  height: 24px;
  clip-path: polygon(58% 0, 20% 48%, 48% 48%, 36% 100%, 82% 38%, 54% 38%);
  background: currentColor;
}

.upgrade-icon.chain-lightning::after {
  width: 24px;
  height: 2px;
  transform: rotate(25deg);
  background: rgba(255, 255, 255, 0.74);
}

.upgrade-icon.dash-trail::before {
  width: 23px;
  height: 8px;
  clip-path: polygon(0 50%, 25% 0, 100% 0, 76% 50%, 100% 100%, 25% 100%);
  background: currentColor;
}

.upgrade-icon.dash-trail::after {
  left: 6px;
  width: 4px;
  height: 18px;
  transform: rotate(90deg);
  background: #ffffff;
  box-shadow: -7px 0 0 rgba(255, 255, 255, 0.58);
}

.upgrade-icon.gravity-well::before {
  width: 24px;
  height: 24px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 0 5px rgba(167, 129, 255, 0.18);
}

.upgrade-icon.gravity-well::after {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.upgrade-icon.magnet-net::before {
  width: 20px;
  height: 18px;
  border: 4px solid currentColor;
  border-top: 0;
  border-radius: 0 0 12px 12px;
}

.upgrade-icon.magnet-net::after {
  width: 5px;
  height: 5px;
  background: #ffffff;
  box-shadow: -9px -1px 0 #ffffff, 9px -1px 0 #ffffff;
}

.upgrade-icon.afterburner::before {
  width: 18px;
  height: 22px;
  clip-path: polygon(50% 0, 80% 34%, 66% 100%, 50% 74%, 34% 100%, 20% 34%);
  background: currentColor;
}

.upgrade-icon.afterburner::after {
  bottom: 7px;
  width: 7px;
  height: 10px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: #ffffff;
}

.upgrade-icon.armor-plate::before {
  width: 19px;
  height: 23px;
  clip-path: polygon(50% 0, 92% 18%, 82% 76%, 50% 100%, 18% 76%, 8% 18%);
  background: currentColor;
}

.upgrade-icon.armor-plate::after {
  width: 9px;
  height: 15px;
  border-left: 2px solid rgba(3, 6, 12, 0.72);
  border-right: 2px solid rgba(3, 6, 12, 0.72);
}

.upgrade-icon.dash-capacitor::before {
  width: 17px;
  height: 24px;
  clip-path: polygon(56% 0, 18% 52%, 48% 52%, 34% 100%, 82% 38%, 52% 38%);
  background: currentColor;
}

.upgrade-icon.dash-capacitor::after {
  width: 24px;
  height: 2px;
  transform: rotate(-18deg);
  background: rgba(255, 255, 255, 0.66);
}

.upgrade-icon.wide-bore::before {
  width: 21px;
  height: 13px;
  border: 3px solid currentColor;
  border-radius: 10px;
}

.upgrade-icon.wide-bore::after {
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.upgrade-icon.xp-antenna::before {
  width: 3px;
  height: 22px;
  background: currentColor;
  box-shadow: -7px 7px 0 -1px currentColor, 7px 7px 0 -1px currentColor;
}

.upgrade-icon.xp-antenna::after {
  top: 6px;
  width: 22px;
  height: 12px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
}

.upgrade-icon.nano-repair::before {
  width: 20px;
  height: 6px;
  background: currentColor;
}

.upgrade-icon.nano-repair::after {
  width: 6px;
  height: 20px;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.upgrade-icon.phase-armor::before {
  width: 21px;
  height: 24px;
  clip-path: polygon(50% 0, 90% 18%, 78% 78%, 50% 100%, 22% 78%, 10% 18%);
  border: 2px solid currentColor;
  background: rgba(167, 129, 255, 0.15);
}

.upgrade-icon.phase-armor::after {
  width: 14px;
  height: 2px;
  transform: rotate(-28deg);
  background: #ffffff;
  box-shadow: 0 7px 0 rgba(255, 255, 255, 0.6);
}

.upgrade-icon.orb-refinery::before {
  width: 18px;
  height: 18px;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background: currentColor;
}

.upgrade-icon.orb-refinery::after {
  width: 8px;
  height: 8px;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background: #ffffff;
}

.upgrade-inventory {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 316px);
  overflow: visible;
}

.upgrade-slot-group {
  display: grid;
  gap: 6px;
}

.upgrade-slot-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 16px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.upgrade-slot-title strong {
  color: var(--ink);
  letter-spacing: 0.9px;
}

.upgrade-slot-title span {
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}

.upgrade-slots {
  display: grid;
  gap: 5px;
}

.upgrade-item {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 3px 6px;
  border: 1px solid rgba(162, 190, 225, 0.14);
  border-radius: 6px;
  background: rgba(4, 8, 16, 0.48);
  outline: none;
  overflow: visible;
}

.upgrade-item:hover,
.upgrade-item:focus-visible,
.upgrade-item:focus-within {
  z-index: 12;
}

.upgrade-item .upgrade-icon {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
  border-radius: 5px;
}

.upgrade-item .upgrade-icon svg {
  width: 22px;
  height: 22px;
}

.upgrade-item.empty {
  border-style: dashed;
  background: rgba(4, 8, 16, 0.25);
  color: rgba(143, 160, 184, 0.72);
}

.upgrade-empty-icon {
  display: block;
  width: 24px;
  height: 24px;
  border: 1px dashed rgba(143, 160, 184, 0.42);
  border-radius: 5px;
  background:
    linear-gradient(135deg, transparent 44%, rgba(143, 160, 184, 0.26) 45%, rgba(143, 160, 184, 0.26) 55%, transparent 56%),
    rgba(4, 8, 16, 0.36);
}

.upgrade-item-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.upgrade-item-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upgrade-item.empty .upgrade-item-copy strong {
  color: rgba(143, 160, 184, 0.72);
}

.upgrade-item b {
  color: var(--cyan);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.upgrade-item.empty b {
  color: rgba(143, 160, 184, 0.72);
}

.upgrade-pips {
  display: flex;
  gap: 2px;
}

.upgrade-pips i {
  display: block;
  width: 6px;
  height: 3px;
  border-radius: 2px;
  background: rgba(143, 160, 184, 0.24);
}

.upgrade-pips i.active {
  background: var(--amber);
  box-shadow: 0 0 6px rgba(255, 209, 102, 0.5);
}

.upgrade-tooltip {
  position: absolute;
  left: 36px;
  top: 50%;
  z-index: 30;
  display: grid;
  gap: 4px;
  width: 226px;
  max-width: min(226px, calc(100vw - 72px));
  padding: 9px 10px;
  border: 1px solid rgba(104, 231, 255, 0.42);
  border-radius: 6px;
  background: rgba(5, 8, 15, 0.97);
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.44),
    inset 0 0 0 1px rgba(238, 245, 255, 0.04);
  opacity: 0;
  pointer-events: none;
  transform: translate(0, -50%) scale(0.98);
  transform-origin: left center;
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.upgrade-tooltip strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.15;
}

.upgrade-tooltip small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.28;
}

.upgrade-tooltip small:first-of-type {
  color: var(--amber);
}

.upgrade-item:hover .upgrade-tooltip,
.upgrade-item:focus-visible .upgrade-tooltip,
.upgrade-item:focus-within .upgrade-tooltip {
  opacity: 1;
  transform: translate(8px, -50%) scale(1);
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(4, 8, 16, 0.82);
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
  outline: none;
}

.field input:focus {
  border-color: rgba(104, 231, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(104, 231, 255, 0.12);
}

.field.invalid {
  color: var(--danger);
}

.field.invalid input {
  border-color: rgba(255, 99, 125, 0.78);
  box-shadow: 0 0 0 3px rgba(255, 99, 125, 0.12);
}

.country-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.country-list.clan-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.clan-list .country-card {
  grid-template-columns: 46px minmax(0, 1fr);
  min-height: 62px;
}

.clan-list .flag-badge {
  width: 42px;
  height: 28px;
}

.country-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(8, 13, 24, 0.82);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.country-card:hover,
.country-card.selected {
  border-color: rgba(255, 209, 102, 0.7);
  background: rgba(18, 23, 36, 0.96);
}

.country-card strong,
.country-card small {
  display: block;
  overflow: hidden;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.country-card strong {
  color: var(--ink);
  font-size: 12px;
}

.country-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.flag-badge {
  --flag-a: #e30a17;
  --flag-b: #ffffff;
  --flag-c: #101827;
  position: relative;
  display: block;
  overflow: hidden;
  width: 34px;
  height: 23px;
  border: 1px solid rgba(238, 245, 255, 0.58);
  border-radius: 2px;
  background: var(--flag-a);
  box-shadow: 0 0 8px rgba(104, 231, 255, 0.14);
  object-fit: cover;
  image-rendering: auto;
}

img.flag-badge {
  background: #050812;
  border-color: rgba(238, 245, 255, 0.78);
}

.flag-badge.horizontal {
  background: linear-gradient(180deg, var(--flag-a) 0 33%, var(--flag-b) 33% 66%, var(--flag-c) 66% 100%);
}

.flag-badge.vertical {
  background: linear-gradient(90deg, var(--flag-a) 0 33%, var(--flag-b) 33% 66%, var(--flag-c) 66% 100%);
}

.flag-badge.emblem,
.flag-badge.solid {
  background: var(--flag-a);
}

.flag-badge.emblem::before,
.flag-badge.solid::before {
  content: "";
  position: absolute;
  inset: 3px 6px;
  background: var(--flag-b);
}

.flag-badge.emblem::after,
.flag-badge.solid::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 8px;
  width: 5px;
  height: 4px;
  background: var(--flag-c);
}

.flag-badge.cross {
  background: var(--flag-a);
}

.flag-badge.cross::before,
.flag-badge.cross::after {
  content: "";
  position: absolute;
  background: var(--flag-b);
}

.flag-badge.cross::before {
  top: 0;
  left: 7px;
  width: 4px;
  height: 100%;
}

.flag-badge.cross::after {
  top: 4px;
  left: 0;
  width: 100%;
  height: 4px;
  box-shadow: inset 0 1px 0 var(--flag-c), inset 0 -1px 0 var(--flag-c);
}

.flag-badge.flag-tr {
  background: #e30a17;
}

.flag-badge.flag-tr::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffffff;
}

.flag-badge.flag-tr::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 10px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e30a17;
  box-shadow: 8px 2px 0 -2px #ffffff;
}

.flag-badge.flag-us {
  background:
    linear-gradient(90deg, #3c3b6e 0 44%, transparent 44% 100%),
    repeating-linear-gradient(180deg, #b22234 0 8%, #ffffff 8% 15.5%);
}

.flag-badge.flag-us::before,
.flag-badge.flag-us::after {
  content: "";
  position: absolute;
  background: #ffffff;
}

.flag-badge.flag-us::before {
  top: 3px;
  left: 3px;
  width: 2px;
  height: 2px;
  box-shadow: 4px 0 0 #ffffff, 8px 0 0 #ffffff, 0 4px 0 #ffffff, 4px 4px 0 #ffffff, 8px 4px 0 #ffffff;
}

.flag-badge.flag-us::after {
  display: none;
}

.flag-badge.flag-de {
  background: linear-gradient(180deg, #101010 0 33.3%, #dd0000 33.3% 66.6%, #ffce00 66.6% 100%);
}

.flag-badge.flag-jp {
  background: radial-gradient(circle at 50% 50%, #bc002d 0 27%, transparent 28%), #ffffff;
}

.flag-badge.flag-jp::before,
.flag-badge.flag-jp::after {
  display: none;
}

.flag-badge.flag-br {
  background: #009b3a;
}

.flag-badge.flag-br::before {
  content: "";
  position: absolute;
  inset: 3px 5px;
  background: #ffdf00;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.flag-badge.flag-br::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 11px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #002776;
}

.flag-badge.flag-gb {
  background:
    linear-gradient(90deg, transparent 0 42%, #ffffff 42% 58%, transparent 58% 100%),
    linear-gradient(180deg, transparent 0 38%, #ffffff 38% 62%, transparent 62% 100%),
    linear-gradient(90deg, transparent 0 46%, #c8102e 46% 54%, transparent 54% 100%),
    linear-gradient(180deg, transparent 0 44%, #c8102e 44% 56%, transparent 56% 100%),
    #012169;
}

.flag-badge.flag-gb::before,
.flag-badge.flag-gb::after {
  display: none;
}

.flag-badge.flag-fr {
  background: linear-gradient(90deg, #0055a4 0 33.3%, #ffffff 33.3% 66.6%, #ef4135 66.6% 100%);
}

.flag-badge.flag-kr {
  background: radial-gradient(circle at 50% 50%, #c60c30 0 18%, #003478 19% 30%, transparent 31%), #ffffff;
}

.flag-badge.flag-kr::before,
.flag-badge.flag-kr::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 2px;
  background: #101010;
}

.flag-badge.flag-kr::before {
  top: 3px;
  left: 4px;
  box-shadow: 15px 10px 0 #101010;
}

.flag-badge.flag-kr::after {
  right: 4px;
  top: 3px;
  box-shadow: -15px 10px 0 #101010;
}

.ship-type-list {
  display: grid;
  gap: 8px;
}

.ship-type-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(8, 13, 24, 0.82);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.ship-type-card:hover,
.ship-type-card.selected {
  border-color: rgba(104, 231, 255, 0.62);
  background: rgba(12, 20, 34, 0.94);
}

.ship-swatch {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: rgba(2, 5, 11, 0.72);
}

.ship-sprite {
  --ship-color: #68e7ff;
  --ship-accent: #eef5ff;
  position: relative;
  display: block;
  width: 28px;
  height: 18px;
  color: var(--ship-color);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.9) 4%, transparent 5% 100%),
    linear-gradient(90deg, rgba(2, 5, 11, 0.82), var(--ship-color) 58%, rgba(255, 255, 255, 0.94));
  clip-path: polygon(100% 50%, 48% 12%, 16% 4%, 29% 50%, 16% 96%, 48% 88%);
  box-shadow:
    0 0 12px color-mix(in srgb, var(--ship-color) 58%, transparent),
    inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  filter: saturate(1.14);
}

.ship-sprite::before,
.ship-sprite::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
  pointer-events: none;
}

.ship-sprite::before {
  left: 47%;
  top: 30%;
  width: 24%;
  height: 40%;
  border: 1px solid rgba(238, 245, 255, 0.9);
  border-radius: 2px;
  background: color-mix(in srgb, var(--ship-accent) 70%, rgba(8, 13, 24, 0.6));
  box-shadow: 0 0 8px color-mix(in srgb, var(--ship-accent) 48%, transparent);
}

.ship-sprite::after {
  left: -9%;
  top: 34%;
  width: 22%;
  height: 32%;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--ship-color) 82%, #ffffff), transparent);
  clip-path: polygon(0 50%, 100% 0, 76% 50%, 100% 100%);
  opacity: 0.9;
  filter: blur(0.2px);
}

.ship-slot-avatar .ship-sprite {
  width: 86px;
  height: 56px;
}

.ship-body-swatch .ship-sprite,
.ship-swatch .ship-sprite {
  width: 27px;
  height: 18px;
}

.ship-sprite.wide {
  clip-path: polygon(100% 50%, 48% 16%, 4% 0, 24% 50%, 4% 100%, 48% 84%);
}

.ship-sprite.wide::before {
  left: 41%;
  top: 34%;
  width: 30%;
  height: 32%;
}

.ship-sprite.wide::after {
  left: -11%;
  width: 24%;
  background:
    linear-gradient(90deg, #ffd166, transparent),
    linear-gradient(90deg, var(--ship-color), transparent);
}

.ship-sprite.blade {
  clip-path: polygon(100% 50%, 55% 5%, 18% 20%, 4% 50%, 18% 80%, 55% 95%);
}

.ship-sprite.blade::before {
  left: 46%;
  top: 26%;
  width: 18%;
  height: 48%;
  border-color: color-mix(in srgb, var(--ship-accent) 84%, #ffffff);
}

.ship-sprite.blade::after {
  left: -6%;
  top: 18%;
  width: 24%;
  height: 64%;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--ship-accent) 84%, #ffffff), transparent);
}

.ship-sprite.image-sprite {
  width: 28px;
  height: 38px;
  clip-path: none;
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  box-shadow: none;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--ship-color) 58%, transparent));
}

.ship-sprite.image-sprite::before,
.ship-sprite.image-sprite::after {
  display: none;
}

.ship-slot-avatar .ship-sprite.image-sprite {
  width: 82px;
  height: 112px;
}

.ship-body-swatch .ship-sprite.image-sprite,
.ship-swatch .ship-sprite.image-sprite {
  width: 28px;
  height: 38px;
}

.ship-type-card strong,
.ship-type-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ship-type-card strong {
  font-size: 14px;
}

.ship-type-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.selected-room {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.selected-room strong {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

#joinRoomButton,
.secondary-action {
  min-height: 44px;
  border: 1px solid rgba(104, 231, 255, 0.58);
  border-radius: 6px;
  background: rgba(104, 231, 255, 0.12);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

#joinRoomButton:hover,
.secondary-action:hover {
  background: rgba(104, 231, 255, 0.22);
}

.secondary-action {
  border-color: rgba(162, 190, 225, 0.28);
  background: rgba(4, 8, 16, 0.48);
  color: var(--muted);
}

#closeRoomSelectButton {
  min-height: 52px;
  font-size: 18px;
  font-weight: 950;
  text-transform: uppercase;
}

.room-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  max-height: min(610px, calc(100vh - 330px));
  overflow-y: auto;
  padding-right: 4px;
}

.room-card {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  min-height: 106px;
  padding: 10px 14px;
  border: 1px solid rgba(104, 231, 255, 0.28);
  border-radius: 10px;
  background:
    radial-gradient(circle at 85% 12%, rgba(255, 79, 100, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(10, 16, 28, 0.96), rgba(4, 8, 16, 0.88));
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    0 18px 46px rgba(0, 0, 0, 0.24);
}

.room-card:hover:not(:disabled) {
  border-color: rgba(104, 231, 255, 0.56);
  background:
    radial-gradient(circle at 85% 12%, rgba(255, 79, 100, 0.24), transparent 30%),
    linear-gradient(135deg, rgba(13, 22, 38, 0.98), rgba(4, 8, 16, 0.92));
}

.room-card.selected {
  border-color: rgba(255, 209, 102, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 209, 102, 0.3),
    0 0 28px rgba(255, 209, 102, 0.12),
    0 18px 46px rgba(0, 0, 0, 0.24);
}

.room-card.mission-tiered {
  border-color: color-mix(in srgb, var(--mission-tier-color, #68e7ff) 58%, rgba(104, 231, 255, 0.24));
  background:
    radial-gradient(circle at 88% 14%, color-mix(in srgb, var(--mission-tier-color, #68e7ff) 24%, transparent), transparent 31%),
    linear-gradient(135deg, rgba(10, 16, 28, 0.96), color-mix(in srgb, var(--mission-tier-color, #68e7ff) 10%, rgba(4, 8, 16, 0.88)));
}

.room-card.mission-tiered.selected {
  border-color: color-mix(in srgb, var(--mission-tier-color, #68e7ff) 70%, #ffd166);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--mission-tier-color, #68e7ff) 32%, transparent),
    0 0 28px color-mix(in srgb, var(--mission-tier-color, #68e7ff) 22%, transparent),
    0 18px 46px rgba(0, 0, 0, 0.24);
}

.room-card.locked {
  opacity: 0.58;
  filter: saturate(0.72);
}

.room-card.locked .mission-card-frame::after {
  content: "KILITLI";
  position: absolute;
  right: 12px;
  top: 10px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 64, 93, 0.58);
  border-radius: 4px;
  background: rgba(68, 12, 24, 0.78);
  color: #ffd7de;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.room-card.theme-frost {
  border-color: rgba(104, 231, 255, 0.42);
  background:
    radial-gradient(circle at 84% 16%, rgba(104, 231, 255, 0.2), transparent 32%),
    radial-gradient(circle at 15% 82%, rgba(79, 143, 255, 0.14), transparent 34%),
    linear-gradient(135deg, rgba(9, 20, 34, 0.98), rgba(5, 12, 24, 0.92));
}

.room-card.theme-frost:hover:not(:disabled) {
  border-color: rgba(137, 244, 255, 0.68);
  background:
    radial-gradient(circle at 84% 16%, rgba(104, 231, 255, 0.28), transparent 32%),
    radial-gradient(circle at 15% 82%, rgba(79, 143, 255, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(12, 28, 46, 0.98), rgba(5, 12, 24, 0.94));
}

.room-card.theme-poison {
  border-color: rgba(125, 255, 111, 0.42);
  background:
    radial-gradient(circle at 84% 16%, rgba(90, 255, 120, 0.18), transparent 32%),
    radial-gradient(circle at 15% 82%, rgba(180, 255, 86, 0.12), transparent 34%),
    linear-gradient(135deg, rgba(8, 27, 19, 0.98), rgba(5, 14, 13, 0.92));
}

.room-card.theme-poison:hover:not(:disabled) {
  border-color: rgba(184, 255, 116, 0.68);
  background:
    radial-gradient(circle at 84% 16%, rgba(90, 255, 120, 0.26), transparent 32%),
    radial-gradient(circle at 15% 82%, rgba(184, 255, 116, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(11, 38, 25, 0.98), rgba(5, 18, 14, 0.94));
}

.room-card.theme-chaos {
  border-color: rgba(182, 84, 255, 0.46);
  background:
    radial-gradient(circle at 84% 16%, rgba(182, 84, 255, 0.22), transparent 32%),
    radial-gradient(circle at 14% 80%, rgba(255, 105, 214, 0.13), transparent 34%),
    linear-gradient(135deg, rgba(22, 10, 45, 0.98), rgba(10, 6, 24, 0.93));
}

.room-card.theme-chaos:hover:not(:disabled) {
  border-color: rgba(215, 165, 255, 0.72);
  background:
    radial-gradient(circle at 84% 16%, rgba(182, 84, 255, 0.3), transparent 32%),
    radial-gradient(circle at 14% 80%, rgba(255, 105, 214, 0.2), transparent 34%),
    linear-gradient(135deg, rgba(31, 13, 61, 0.98), rgba(12, 7, 29, 0.96));
}

.room-card:disabled {
  color: rgba(238, 245, 255, 0.42);
  cursor: not-allowed;
}

.room-card strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 21px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mission-card-frame {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 82px;
}

.mission-emblem {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 74px;
  height: 74px;
  border: 1px solid rgba(255, 209, 102, 0.48);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 209, 102, 0.28) 0 10%, transparent 11%),
    radial-gradient(circle at 50% 50%, rgba(255, 79, 100, 0.52) 0 24%, transparent 25%),
    linear-gradient(180deg, rgba(12, 19, 34, 0.98), rgba(56, 13, 25, 0.84));
  box-shadow:
    0 0 28px rgba(255, 79, 100, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.055),
    inset 0 -34px 44px rgba(0, 0, 0, 0.32);
}

.mission-emblem::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  width: 39px;
  height: 39px;
  border: 1px solid rgba(255, 209, 102, 0.82);
  border-radius: 6px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.46) 0 8%, transparent 9%),
    linear-gradient(180deg, rgba(255, 209, 102, 0.96), rgba(255, 79, 100, 0.9));
  clip-path: polygon(50% 0%, 61% 34%, 98% 34%, 68% 55%, 79% 91%, 50% 70%, 21% 91%, 32% 55%, 2% 34%, 39% 34%);
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 18px rgba(255, 209, 102, 0.42),
    0 0 28px rgba(255, 79, 100, 0.28);
}

.mission-emblem::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(255, 209, 102, 0.38);
  border-radius: 50%;
  background: radial-gradient(circle, transparent 0 54%, rgba(255, 209, 102, 0.12) 55% 58%, transparent 59%);
  transform: translate(-50%, -50%) rotate(45deg);
  box-shadow:
    inset 0 0 18px rgba(255, 209, 102, 0.08),
    0 0 18px rgba(255, 79, 100, 0.18);
}

.room-card.theme-frost .mission-emblem {
  border-color: rgba(137, 244, 255, 0.64);
  background:
    radial-gradient(circle at 50% 52%, rgba(226, 252, 255, 0.42) 0 8%, transparent 9%),
    radial-gradient(circle at 50% 50%, rgba(74, 185, 255, 0.46) 0 27%, transparent 28%),
    linear-gradient(180deg, rgba(11, 27, 45, 0.98), rgba(9, 38, 67, 0.86));
  box-shadow:
    0 0 30px rgba(104, 231, 255, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 -34px 44px rgba(0, 0, 0, 0.28);
}

.room-card.theme-frost .mission-emblem::before {
  border-color: rgba(226, 252, 255, 0.88);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.7) 0 8%, transparent 9%),
    linear-gradient(180deg, rgba(226, 252, 255, 0.98), rgba(74, 185, 255, 0.92));
  clip-path: polygon(50% 0%, 61% 34%, 98% 34%, 68% 55%, 79% 91%, 50% 70%, 21% 91%, 32% 55%, 2% 34%, 39% 34%);
  box-shadow:
    0 0 18px rgba(137, 244, 255, 0.48),
    0 0 28px rgba(79, 143, 255, 0.3);
}

.room-card.theme-frost .mission-emblem::after {
  border-color: rgba(137, 244, 255, 0.46);
  background: radial-gradient(circle, transparent 0 54%, rgba(137, 244, 255, 0.14) 55% 58%, transparent 59%);
  box-shadow:
    inset 0 0 18px rgba(104, 231, 255, 0.1),
    0 0 18px rgba(74, 185, 255, 0.2);
}

.room-card.theme-poison .mission-emblem {
  border-color: rgba(184, 255, 116, 0.6);
  background:
    radial-gradient(circle at 50% 52%, rgba(218, 255, 164, 0.36) 0 8%, transparent 9%),
    radial-gradient(circle at 50% 50%, rgba(42, 190, 86, 0.52) 0 27%, transparent 28%),
    linear-gradient(180deg, rgba(9, 33, 23, 0.98), rgba(16, 60, 35, 0.84));
  box-shadow:
    0 0 30px rgba(90, 255, 120, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.055),
    inset 0 -34px 44px rgba(0, 0, 0, 0.3);
}

.room-card.theme-poison .mission-emblem::before {
  border-color: rgba(218, 255, 164, 0.88);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.58) 0 8%, transparent 9%),
    linear-gradient(180deg, rgba(184, 255, 116, 0.98), rgba(49, 200, 106, 0.9));
  clip-path: polygon(50% 0%, 61% 34%, 98% 34%, 68% 55%, 79% 91%, 50% 70%, 21% 91%, 32% 55%, 2% 34%, 39% 34%);
  box-shadow:
    0 0 18px rgba(184, 255, 116, 0.46),
    0 0 28px rgba(49, 200, 106, 0.32);
}

.room-card.theme-poison .mission-emblem::after {
  border-color: rgba(184, 255, 116, 0.44);
  background: radial-gradient(circle, transparent 0 54%, rgba(184, 255, 116, 0.14) 55% 58%, transparent 59%);
  box-shadow:
    inset 0 0 18px rgba(90, 255, 120, 0.1),
    0 0 18px rgba(49, 200, 106, 0.2);
}

.room-card.theme-chaos .mission-emblem {
  border-color: rgba(215, 165, 255, 0.66);
  background:
    radial-gradient(circle at 50% 52%, rgba(244, 215, 255, 0.34) 0 8%, transparent 9%),
    radial-gradient(circle at 50% 50%, rgba(126, 70, 210, 0.58) 0 29%, transparent 30%),
    linear-gradient(180deg, rgba(20, 8, 44, 0.98), rgba(54, 17, 84, 0.88));
  box-shadow:
    0 0 30px rgba(182, 84, 255, 0.22),
    0 0 18px rgba(255, 105, 214, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 -34px 44px rgba(0, 0, 0, 0.32);
}

.room-card.theme-chaos .mission-emblem::before {
  border-color: rgba(244, 215, 255, 0.9);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.64) 0 8%, transparent 9%),
    linear-gradient(180deg, rgba(215, 165, 255, 0.98), rgba(182, 84, 255, 0.92) 58%, rgba(255, 105, 214, 0.86));
  clip-path: polygon(50% 0%, 60% 30%, 91% 20%, 72% 50%, 96% 75%, 62% 70%, 50% 100%, 38% 70%, 4% 75%, 28% 50%, 9% 20%, 40% 30%);
  box-shadow:
    0 0 18px rgba(215, 165, 255, 0.5),
    0 0 30px rgba(255, 105, 214, 0.34);
}

.room-card.theme-chaos .mission-emblem::after {
  border-color: rgba(215, 165, 255, 0.48);
  background:
    conic-gradient(from 12deg, transparent 0 9%, rgba(215, 165, 255, 0.18) 10% 12%, transparent 13% 27%, rgba(255, 105, 214, 0.18) 28% 30%, transparent 31% 100%),
    radial-gradient(circle, transparent 0 50%, rgba(182, 84, 255, 0.14) 51% 57%, transparent 58%);
  box-shadow:
    inset 0 0 18px rgba(182, 84, 255, 0.12),
    0 0 18px rgba(182, 84, 255, 0.22);
}

.mission-copy {
  display: grid;
  gap: 6px;
}

.mission-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
}

.mission-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.78fr) minmax(124px, 0.52fr);
  gap: 7px;
}

.mission-meta > span {
  display: grid;
  align-content: center;
  gap: 2px;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid rgba(126, 157, 190, 0.18);
  border-radius: 6px;
  background: rgba(3, 6, 12, 0.48);
}

.mission-meta > span.locked {
  border-color: rgba(255, 64, 93, 0.44);
  background:
    radial-gradient(circle at 90% 12%, rgba(255, 64, 93, 0.2), transparent 38%),
    rgba(41, 8, 18, 0.56);
}

.mission-meta small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 950;
  text-transform: uppercase;
}

.mission-meta b {
  color: var(--ink);
  font-size: 10px;
  font-weight: 950;
}

.difficulty-stars {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  margin-top: 1px;
  max-width: 100%;
  color: rgba(126, 157, 190, 0.5);
  line-height: 1;
}

.difficulty-stars i {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  border: 1px solid rgba(126, 157, 190, 0.22);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(16, 25, 41, 0.86), rgba(4, 8, 16, 0.92));
  font-style: normal;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.5));
}

.difficulty-stars i::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  transform: translate(-50%, -50%);
  background: currentColor;
  clip-path: polygon(50% 0%, 61% 34%, 97% 34%, 68% 55%, 79% 91%, 50% 70%, 21% 91%, 32% 55%, 3% 34%, 39% 34%);
  filter: drop-shadow(0 0 5px currentColor);
}

.difficulty-stars i::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 2px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 0 7px rgba(255, 255, 255, 0.72);
}

.difficulty-stars i.filled {
  color: #ffd166;
  border-color: rgba(255, 209, 102, 0.76);
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.18), transparent 32%),
    linear-gradient(180deg, rgba(84, 55, 14, 0.92), rgba(19, 11, 4, 0.96));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 12px rgba(255, 209, 102, 0.34);
  text-shadow: 0 0 8px rgba(255, 209, 102, 0.52);
}

.difficulty-stars i:not(.filled) {
  opacity: 0.48;
}

.density-meter {
  overflow: hidden;
  width: 100%;
  height: 9px;
  border: 1px solid rgba(126, 157, 190, 0.3);
  border-radius: 4px;
  background: rgba(4, 8, 16, 0.8);
}

.density-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--amber), var(--danger));
}

.match-panel p {
  margin: 0 0 18px;
  color: var(--muted);
}

.match-panel button {
  min-width: 148px;
  min-height: 42px;
  border: 1px solid rgba(104, 231, 255, 0.58);
  border-radius: 6px;
  background: rgba(104, 231, 255, 0.12);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.match-panel button:hover {
  background: rgba(104, 231, 255, 0.22);
}

.result-screen {
  z-index: 8;
}

.result-panel {
  display: grid;
  gap: 15px;
  width: min(860px, calc(100vw - 40px));
  padding: 26px;
  border-color: rgba(255, 209, 102, 0.42);
  background:
    radial-gradient(circle at 18% 10%, rgba(104, 231, 255, 0.16), transparent 32%),
    radial-gradient(circle at 82% 92%, rgba(255, 209, 102, 0.12), transparent 30%),
    linear-gradient(145deg, rgba(13, 19, 34, 0.98), rgba(4, 7, 14, 0.96));
  text-align: left;
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.58),
    inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.result-panel h1 {
  margin: -6px 0 0;
  color: #fff3d2;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 0.95;
  letter-spacing: 0;
  text-shadow: 0 0 22px rgba(255, 209, 102, 0.28);
}

.result-summary {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.result-stat {
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 12px;
  border: 1px solid rgba(104, 231, 255, 0.18);
  border-radius: 7px;
  background:
    radial-gradient(circle at 50% 0, rgba(104, 231, 255, 0.12), transparent 68%),
    rgba(4, 8, 16, 0.72);
}

.result-stat small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.result-stat strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  white-space: nowrap;
}

.result-cosmic {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  align-items: center;
  gap: 14px;
  min-height: 66px;
  padding: 12px 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 209, 102, 0.42);
  border-radius: 7px;
  background:
    linear-gradient(90deg, rgba(255, 79, 100, 0.16), rgba(255, 209, 102, 0.13), rgba(104, 231, 255, 0.12)),
    rgba(8, 12, 20, 0.78);
}

.result-cosmic small {
  display: block;
  color: var(--amber);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.result-cosmic strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.1;
}

.result-cosmic i {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 209, 102, 0.7);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 209, 102, 0.95) 0 16%, transparent 18%),
    conic-gradient(from 0deg, rgba(104, 231, 255, 0.84), rgba(255, 209, 102, 0.9), rgba(255, 79, 100, 0.78), rgba(104, 231, 255, 0.84));
  box-shadow: 0 0 22px rgba(255, 209, 102, 0.3);
}

.result-items-wrap {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(104, 231, 255, 0.15);
  border-radius: 8px;
  background: rgba(3, 7, 15, 0.54);
}

.result-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.result-section-head strong {
  color: var(--cyan);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.result-section-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.result-items {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 10px;
  max-height: 176px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 2px 6px 2px 2px;
  box-sizing: border-box;
  scrollbar-gutter: stable;
}

.result-item-card {
  display: grid;
  flex: 0 0 92px;
  justify-items: center;
  align-content: center;
  gap: 5px;
  width: 92px;
  min-width: 0;
  min-height: 88px;
  padding: 8px 6px;
  box-sizing: border-box;
  border: 1px solid rgba(104, 231, 255, 0.34);
  border-radius: 7px;
  background:
    radial-gradient(circle at 50% 28%, rgba(104, 231, 255, 0.18), transparent 58%),
    linear-gradient(180deg, rgba(8, 18, 32, 0.92), rgba(4, 9, 18, 0.88));
  color: var(--ink);
  cursor: help;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    0 8px 18px rgba(0, 0, 0, 0.22);
}

.result-item-card .equipment-icon {
  width: 44px;
  height: 44px;
}

.result-item-card strong {
  width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-item-card small {
  color: var(--amber);
  font-size: 13px;
  font-weight: 950;
}

.result-empty {
  padding: 18px;
  border: 1px dashed rgba(143, 160, 184, 0.28);
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.result-return-button {
  justify-self: end;
  min-width: 190px;
  min-height: 48px;
  border-color: rgba(255, 209, 102, 0.68);
  background: rgba(255, 209, 102, 0.13);
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .result-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-section-head {
    display: grid;
    align-items: start;
  }
}

#deathScreen .match-panel h1 {
  margin-bottom: 10px;
  color: #fff4f4;
  font-size: clamp(42px, 5vw, 62px);
  line-height: 1;
  letter-spacing: 2px;
  text-shadow: 0 0 22px rgba(255, 79, 100, 0.38);
}

#deathScreen #deathLine {
  max-width: 480px;
  margin-right: auto;
  margin-left: auto;
  font-size: clamp(15px, 1.7vw, 18px);
  line-height: 1.35;
}

#deathScreen #respawnButton {
  min-width: 180px;
  min-height: 48px;
  padding: 0 24px;
  font-size: 16px;
  font-weight: 950;
  text-transform: uppercase;
}

#deathScreen .death-icon {
  position: relative;
  width: 58px;
  height: 58px;
  margin: 0 auto 12px;
  border: 1px solid rgba(255, 79, 100, 0.74);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 79, 100, 0.34), rgba(255, 79, 100, 0.08) 58%, rgba(2, 4, 10, 0.84) 60%),
    rgba(7, 10, 18, 0.94);
  box-shadow:
    0 0 28px rgba(255, 79, 100, 0.42),
    inset 0 0 0 5px rgba(255, 79, 100, 0.08);
}

#deathScreen .death-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 12px rgba(255, 79, 100, 0.58));
}

#deathScreen .skull-ring {
  fill: rgba(255, 79, 100, 0.1);
  stroke: rgba(255, 79, 100, 0.92);
  stroke-width: 1.7;
}

#deathScreen .skull-head,
#deathScreen .skull-jaw {
  fill: #ff4f64;
  stroke: #ffd6dc;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

#deathScreen .skull-jaw {
  fill: #d92f48;
}

#deathScreen .skull-eye,
#deathScreen .skull-nose {
  fill: #070a12;
  stroke: rgba(255, 214, 220, 0.34);
  stroke-width: 0.6;
}

#deathScreen .skull-crack,
#deathScreen .skull-teeth {
  fill: none;
  stroke: #fff0f3;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

#deathScreen .skull-crack {
  stroke-width: 3;
}

#deathScreen .skull-teeth {
  stroke-width: 1.8;
}

@media (max-width: 1180px), (max-height: 720px) {
  .hub-ad-left {
    display: none !important;
  }
}

@media (max-width: 720px) {
  :root {
    --action-slot: 38px;
    --action-orb: 68px;
    --action-gap: 5px;
    --action-bottom: 24px;
    --action-side-width: 167px;
    --action-total-width: 412px;
  }

  .hud {
    padding: 10px 11px;
  }

  .upgrade-hud {
    top: 50%;
    left: 10px;
    width: min(250px, calc(50vw - 18px));
    max-height: min(440px, calc(100vh - 150px));
  }

  .upgrade-inventory {
    max-height: calc(100vh - 205px);
  }

  .right-stack {
    top: 10px;
    right: 10px;
    width: 166px;
  }

  .hud-right {
    top: auto;
    right: auto;
    width: 100%;
  }

  .minimap-panel {
    top: auto;
    right: auto;
    width: 100%;
    padding: 9px;
  }

  .minimap-orbit {
    width: 100%;
    height: auto;
  }

  .chat-panel {
    bottom: 118px;
    left: 10px;
    width: min(430px, calc(100vw - 210px));
    height: 244px;
    min-width: 290px;
    min-height: 200px;
    max-height: calc(100vh - 156px);
  }

  .chat-messages {
    min-height: 82px;
  }

  .leaderboard li {
    grid-template-columns: 18px minmax(0, 1fr) auto;
    gap: 5px;
    font-size: 11px;
  }

  .team-list li {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .power-panel {
    bottom: 0;
    min-height: 106px;
    padding: 0;
  }

  .power-copy {
    left: 12px;
    bottom: 34px;
    width: 150px;
    min-width: 0;
  }

  .resource-bars {
    bottom: var(--action-bottom);
    width: var(--action-total-width);
    height: 86px;
  }

  .health,
  .dash {
    bottom: 54px;
    width: var(--action-side-width);
  }

  .health {
    left: 0;
  }

  .dash {
    right: 0;
  }

  .mmo-actionbar {
    bottom: var(--action-bottom);
    grid-template-columns: repeat(4, var(--action-slot)) var(--action-orb) repeat(4, var(--action-slot));
    gap: var(--action-gap);
    padding: 0;
  }

  .skill-slot {
    width: var(--action-slot);
    height: var(--action-slot);
  }

  .cosmic-level-orb {
    width: var(--action-orb);
    height: var(--action-orb);
    margin: -18px 0 -8px;
  }

  .cosmic-level-orb strong {
    font-size: 22px;
  }

  .quick-menu {
    right: 10px;
    bottom: 22px;
    grid-template-columns: repeat(5, 39px);
    gap: 6px;
    padding: 0;
  }

  .quick-icon {
    width: 39px;
    height: 39px;
  }

  .room-list {
    grid-template-columns: 1fr;
  }

  .mission-card-frame {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .mission-emblem {
    width: 72px;
    height: 72px;
  }

  .mission-meta,
  .mission-brief-grid {
    grid-template-columns: 1fr;
  }

  .ship-slot-list,
  .ship-body-list,
  .channel-list {
    grid-template-columns: 1fr 1fr;
  }

  .upgrade-panel {
    transform: translateY(-16px);
  }

  .upgrade-choices {
    flex-direction: column;
    gap: 14px;
    min-height: auto;
  }

  .upgrade-card,
  .upgrade-card:nth-child(2) {
    width: min(280px, calc(100vw - 48px));
    min-height: 226px;
    transform: none;
  }

  .upgrade-card:hover,
  .upgrade-card:nth-child(2):hover {
    transform: translateY(-4px);
  }

  .upgrade-choices.refreshing .upgrade-card:nth-child(2) {
    animation-name: upgradeChoiceRefresh;
  }

  .lobby-panel {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 32px);
    overflow: auto;
  }

  .room-panel,
  .loadout-panel,
  .ship-select-panel,
  .channel-select-panel,
  .inventory-panel,
  .trade-panel,
  .storage-panel,
  .market-panel,
  .grinder-panel,
  .item-upgrade-panel {
    padding: 18px;
  }

  .flow-head h1 {
    font-size: 32px;
  }

  .inventory-screen.trade-docked,
  .inventory-screen.storage-docked,
  .inventory-screen.market-docked,
  .inventory-screen.grinder-docked,
  .inventory-screen.item-upgrade-docked {
    place-items: start center;
    padding-bottom: 50vh;
  }

  .trade-screen.trade-docked,
  .storage-screen.storage-docked,
  .market-screen.market-docked,
  .grinder-screen.grinder-docked,
  .item-upgrade-screen.item-upgrade-docked {
    place-items: end center;
    padding-top: 50vh;
  }

.inventory-screen.trade-docked .inventory-panel,
.inventory-screen.storage-docked .inventory-panel,
.inventory-screen.market-docked .inventory-panel,
.inventory-screen.grinder-docked .inventory-panel,
.inventory-screen.item-upgrade-docked .inventory-panel,
.trade-screen.trade-docked .trade-panel,
.storage-screen.storage-docked .storage-panel,
.market-screen.market-docked .market-panel,
.grinder-screen.grinder-docked .grinder-panel,
.item-upgrade-screen.item-upgrade-docked .item-upgrade-panel {
  width: calc(100vw - 20px);
  max-height: calc(var(--ui-safe-half-height) - 22px);
}

  .storage-items {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .market-filters,
  .market-buy-row {
    grid-template-columns: 1fr;
  }

  .market-buy-price {
    text-align: left;
  }

  .market-sell-slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-view {
    grid-template-columns: 1fr;
  }

  .cosmetic-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  :root {
    --action-slot: 38px;
    --action-orb: 60px;
    --action-gap: 5px;
    --action-bottom: 24px;
    --action-side-width: 167px;
    --action-total-width: 404px;
  }

  .passive-effects {
    top: 10px;
    left: 10px;
  }

  .passive-effect-icon {
    width: 48px;
    height: 48px;
  }

  .upgrade-hud {
    top: 50%;
    bottom: auto;
    width: min(220px, calc(100vw - 20px));
    max-height: 190px;
  }

  .upgrade-inventory {
    max-height: 135px;
  }

  .upgrade-item {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    min-height: 36px;
  }

  .upgrade-item .upgrade-icon {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .right-stack {
    width: 138px;
  }

  .hud-right {
    top: auto;
    width: 100%;
  }

  .chat-panel {
    right: 10px;
    bottom: 116px;
    width: calc(100vw - 168px);
    height: 190px;
    min-width: 170px;
    min-height: 158px;
    max-height: 240px;
    padding: 9px;
  }

  .chat-messages {
    min-height: 58px;
  }

  .chat-head {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .chat-opacity-control {
    grid-template-columns: auto minmax(64px, 1fr);
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .leaderboard li {
    grid-template-columns: 18px minmax(0, 1fr);
    font-size: 10px;
  }

  .leaderboard b {
    display: none;
  }

  .team-list li {
    grid-template-columns: minmax(0, 1fr);
  }

  .team-list b {
    display: inline;
  }

  .team-actions {
    flex-wrap: wrap;
  }

  .power-panel {
    left: 0;
    right: 0;
    width: 100%;
    min-height: 96px;
    transform: none;
  }

  .minimap-panel {
    display: grid;
    top: auto;
    right: auto;
    width: 100%;
  }

  .mmo-actionbar {
    left: 10px;
    right: 10px;
    bottom: 24px;
    grid-template-columns: repeat(4, minmax(0, 1fr)) 60px repeat(4, minmax(0, 1fr));
    transform: none;
  }

  .skill-slot {
    width: 100%;
  }

  .cosmic-level-orb {
    width: 60px;
    height: 60px;
    margin: -14px auto -6px;
  }

  .cosmic-level-orb small {
    font-size: 8px;
  }

  .cosmic-level-orb strong {
    font-size: 19px;
  }

  .power-copy {
    display: none;
  }

  .resource-bars {
    left: 10px;
    right: 10px;
    bottom: var(--action-bottom);
    width: auto;
    height: 82px;
    transform: none;
  }

  .health,
  .dash {
    bottom: 56px;
    width: calc((100% - 92px) / 2);
  }

  .health {
    left: 0;
  }

  .dash {
    right: 0;
  }

  .quick-menu {
    display: none;
  }

  .ship-slot-list,
  .ship-body-list,
  .channel-list,
  .flow-actions {
    grid-template-columns: 1fr;
  }

  .ship-slot-card {
    grid-template-columns: 82px minmax(0, 1fr);
    min-height: 126px;
  }

  .ship-slot-avatar {
    width: 78px;
    height: 92px;
  }

  .ship-slot-avatar .ship-sprite.image-sprite {
    width: 58px;
    height: 82px;
  }

  .equipment-slots {
    grid-template-columns: repeat(3, 72px);
  }

  .inventory-items {
    grid-template-columns: repeat(3, 64px);
  }

  .trade-board {
    grid-template-columns: 1fr;
  }

  .cosmetic-choices {
    grid-template-columns: 1fr;
  }

  .inventory-panel,
  .trade-panel,
  .storage-panel {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .inventory-head strong {
    font-size: 20px;
  }
}
