:root {
  --bg-top: #16345f;
  --bg-bottom: #091525;
  --panel: rgba(8, 17, 31, 0.84);
  --panel-soft: rgba(10, 20, 38, 0.72);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text: #f6f1e8;
  --muted: #c2cfdd;
  --accent: #ffb703;
  --accent-deep: #fb8500;
  --button-text: #11243f;
  --success: #7ee8cc;
  --locked: #70809a;
  --danger: #ff6b6b;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255, 183, 3, 0.18), transparent 34%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

.app {
  width: min(100%, 1080px);
}

.game-shell {
  display: grid;
  gap: 24px;
  padding: 24px;
  border-radius: 28px;
  background: rgba(7, 13, 25, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 26px 60px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.title-block {
  margin-bottom: 4px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.25rem);
  letter-spacing: 0.04em;
}

.tagline {
  margin: 10px auto 0;
  max-width: 36rem;
  color: var(--muted);
  line-height: 1.5;
}

.shell-toolbar {
  display: grid;
  gap: 18px;
  align-items: start;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "identity actions"
    "menu menu";
  padding: 18px 20px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top left, rgba(255, 183, 3, 0.14), transparent 28%),
    rgba(255, 255, 255, 0.035);
}

.identity-block {
  grid-area: identity;
}

.identity-block h2 {
  margin: 0;
  font-size: 1.5rem;
}

.identity-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.identity-block p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.pilot-rank-pill {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 183, 3, 0.12);
  border: 1px solid rgba(255, 183, 3, 0.22);
  color: #ffe5ae;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.pilot-rank-pill.is-muted {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.09);
  color: var(--muted);
}

.menu-bar {
  grid-area: menu;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
  align-items: center;
}

.menu-button,
.ghost-button,
.auth-tab,
.icon-button {
  margin-top: 0;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 120ms ease,
    filter 120ms ease,
    background 120ms ease,
    color 120ms ease;
}

.menu-button {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.menu-button.is-active {
  color: var(--button-text);
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border-color: transparent;
}

.toolbar-actions {
  grid-area: actions;
  display: inline-flex;
  gap: 10px;
  justify-content: end;
  align-self: start;
  flex-wrap: wrap;
}

.ghost-button,
.icon-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ghost-button:hover,
.ghost-button:focus-visible,
.icon-button:hover,
.icon-button:focus-visible,
.menu-button:hover,
.menu-button:focus-visible,
.auth-tab:hover,
.auth-tab:focus-visible,
button:hover,
button:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.hidden-control[hidden] {
  display: none;
}

.view-panel {
  display: grid;
  gap: 18px;
}

.canvas-frame {
  position: relative;
  width: min(100%, 720px);
  margin: 0 auto;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  border-radius: 22px;
  background: #0d1b2a;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 22px 40px rgba(0, 0, 0, 0.35);
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(180deg, rgba(5, 10, 20, 0.1), rgba(5, 10, 20, 0.72));
  opacity: 1;
  transition: opacity 180ms ease;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.panel,
.career-panel,
.collection-panel,
.leaderboard-panel,
.auth-panel {
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top right, rgba(255, 183, 3, 0.12), transparent 34%),
    var(--panel-soft);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 34px rgba(0, 0, 0, 0.24);
}

.panel {
  width: min(100%, 420px);
  padding: 26px 24px;
  text-align: center;
  background: var(--panel);
  border-color: var(--panel-border);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
}

.panel h2,
.auth-header h2 {
  margin: 0 0 12px;
  font-size: 1.8rem;
}

.panel p,
.auth-copy {
  margin: 10px 0;
  line-height: 1.5;
  color: var(--muted);
}

.career-panel,
.collection-panel,
.leaderboard-panel {
  padding: 20px;
}

.hub-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  padding: 0 4px;
  margin-bottom: 18px;
}

.hub-header h2,
.section-head h3 {
  margin: 0;
  font-size: 1.35rem;
}

.hub-copy,
.section-head p {
  margin: 0;
  max-width: 28rem;
  color: var(--muted);
  line-height: 1.5;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 16px;
}

.stats-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.stat-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.stat-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-value {
  display: block;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text);
}

.collection-list,
.leaderboard-list {
  display: grid;
  gap: 12px;
}

#achievementsList {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.collection-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.035);
}

.collection-item.is-unlocked {
  background:
    linear-gradient(135deg, rgba(126, 232, 204, 0.1), rgba(255, 183, 3, 0.06)),
    rgba(255, 255, 255, 0.04);
}

.icon-shell {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.icon-shell svg {
  width: 50px;
  height: 50px;
  display: block;
}

.item-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 6px;
}

.item-title,
.leader-name {
  margin: 0;
  font-size: 1rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-pill.is-unlocked {
  color: #06291f;
  background: linear-gradient(135deg, #7ee8cc, #ffda79);
}

.status-pill.status-tier {
  border: 1px solid transparent;
}

.status-pill.is-locked {
  color: #d5deea;
  background: rgba(112, 128, 154, 0.26);
}

.item-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.item-meta,
.leader-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.meta-pill,
.tier-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tier-pill.is-earned {
  color: #091525;
  font-weight: 700;
}

.tier-pill.tier-bronze {
  color: #f5be87;
  background: rgba(205, 127, 50, 0.16);
  border-color: rgba(245, 190, 135, 0.24);
}

.tier-pill.tier-bronze.is-earned {
  background: #cd7f32;
}

.tier-pill.tier-silver {
  color: #edf4ff;
  background: rgba(192, 199, 209, 0.16);
  border-color: rgba(240, 245, 255, 0.24);
}

.tier-pill.tier-silver.is-earned {
  background: #c0c7d1;
}

.tier-pill.tier-gold {
  color: #fff1bd;
  background: rgba(255, 209, 102, 0.14);
  border-color: rgba(255, 243, 207, 0.24);
}

.tier-pill.tier-gold.is-earned {
  background: #ffd166;
}

.tier-pill.tier-platinum {
  color: #eefbff;
  background: rgba(137, 225, 255, 0.16);
  border-color: rgba(238, 251, 255, 0.22);
}

.tier-pill.tier-platinum.is-earned {
  background: #89e1ff;
}

.tier-pill.tier-diamond {
  color: #efffff;
  background: rgba(143, 248, 255, 0.16);
  border-color: rgba(239, 255, 255, 0.22);
}

.tier-pill.tier-diamond.is-earned {
  background: #8ff8ff;
}

.tier-pill.tier-master {
  color: #ffe6f0;
  background: rgba(255, 138, 179, 0.16);
  border-color: rgba(255, 230, 240, 0.22);
}

.tier-pill.tier-master.is-earned {
  background: #ff8ab3;
}

.tier-pill.tier-grandmaster {
  color: #f5ebff;
  background: rgba(199, 155, 255, 0.16);
  border-color: rgba(245, 235, 255, 0.22);
}

.tier-pill.tier-grandmaster.is-earned {
  background: #c79bff;
}

.progress-meter {
  position: relative;
  height: 10px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--success), var(--accent));
}

.rank-badge-strip {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 16px;
}

.rank-badge-card {
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.rank-badge-strip .expedition-note-card {
  grid-column: 1 / -1;
  text-align: left;
}

.rank-badge-card .icon-shell {
  margin: 0 auto 8px;
}

.rank-label,
.rank-owner,
.rank-score,
.leader-rank,
.leader-score-label {
  display: block;
}

.rank-label,
.leader-score-label {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.rank-owner {
  font-weight: 700;
  color: var(--text);
}

.rank-score {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 160px;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.leader-rank {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text);
}

.leader-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.leader-badge {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

.leader-badge svg {
  width: 26px;
  height: 26px;
}

.leader-score {
  text-align: right;
}

.leader-score-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.local-note {
  max-width: 22rem;
}

.name-field {
  display: grid;
  gap: 8px;
  text-align: left;
}

.name-field span {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.name-field input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.name-field input:focus {
  outline: 2px solid rgba(255, 183, 3, 0.45);
  outline-offset: 2px;
}

.progress-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}

.progress-block p,
.progress-note {
  font-size: 0.96rem;
}

.progress-note {
  margin-top: 12px;
}

.ruleset-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}

.mode-toggle,
.filter-bar,
.preset-strip,
.hangar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ruleset-copy {
  margin: 10px 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

#hangarSummary:empty {
  display: none;
}

.ghost-button.is-selected {
  color: var(--button-text);
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border-color: transparent;
}

.status-pill.is-target {
  color: #0b2338;
  background: linear-gradient(135deg, #bde0fe, #8ff8ff);
}

.filter-bar {
  margin-bottom: 16px;
}

.hangar-panel {
  display: grid;
  gap: 22px;
}

.expedition-note-card {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top right, rgba(126, 232, 204, 0.12), transparent 30%),
    rgba(255, 255, 255, 0.04);
}

.expedition-note-card h3 {
  margin: 12px 0 10px;
  font-size: 1.2rem;
}

.expedition-note-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.build-stats-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.hangar-bay {
  display: grid;
  gap: 18px;
  grid-template-columns: 280px minmax(0, 1.45fr) 320px;
  grid-template-areas:
    "frames stage slots"
    "dock dock dock"
    "parts parts parts";
  align-items: start;
}

.frame-showroom {
  grid-area: frames;
}

.hangar-stage-panel {
  grid-area: stage;
  position: relative;
  overflow: hidden;
}

.slot-focus-rail {
  grid-area: slots;
}

.hangar-dock {
  grid-area: dock;
}

.hangar-parts-drawer {
  grid-area: parts;
}

.frame-showroom,
.hangar-stage-panel,
.slot-focus-rail,
.hangar-dock,
.hangar-parts-drawer {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top right, rgba(143, 248, 255, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.025));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 38px rgba(3, 9, 20, 0.22);
}

.hangar-stage-panel::before {
  content: "";
  position: absolute;
  inset: 12px 12px auto;
  height: 110px;
  border-radius: 22px;
  background: radial-gradient(circle at top center, rgba(255, 209, 102, 0.12), transparent 70%);
  z-index: 0;
  pointer-events: none;
}

.hangar-stage-panel > * {
  position: relative;
  z-index: 1;
}

.frame-showroom-list,
.slot-focus-list,
.parts-drawer-list {
  display: grid;
  gap: 12px;
}

.frame-showroom-list {
  align-content: start;
}

.frame-showroom-card,
.slot-focus-card,
.hangar-module-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.03);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.frame-showroom-card:hover,
.slot-focus-card:hover,
.hangar-module-card:hover {
  transform: translateY(-2px);
  border-color: rgba(143, 248, 255, 0.24);
  box-shadow: 0 16px 30px rgba(4, 10, 24, 0.22);
}

.frame-showroom-card.is-selected,
.slot-focus-card.is-selected {
  background:
    linear-gradient(135deg, rgba(255, 183, 3, 0.12), rgba(143, 248, 255, 0.08)),
    rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 209, 102, 0.34);
  box-shadow: 0 18px 34px rgba(7, 16, 34, 0.24);
}

.hangar-actions {
  align-items: center;
}

.hangar-actions button {
  margin-top: 0;
  padding-inline: 16px;
}

.frame-showroom-hitbox,
.slot-focus-card {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.frame-showroom-hitbox {
  display: grid;
  gap: 12px;
}

.frame-showroom-art,
.hangar-module-icon {
  width: 100%;
  min-height: 72px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background:
    radial-gradient(circle at center, rgba(143, 248, 255, 0.12), transparent 68%),
    rgba(11, 20, 40, 0.54);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.frame-showroom-art svg,
.hangar-module-icon svg,
.hangar-module-icon img {
  width: min(100%, 140px);
  height: auto;
}

.hangar-module-icon img {
  max-height: 100%;
  object-fit: contain;
  display: block;
  padding: 4px;
  filter: drop-shadow(0 8px 16px rgba(24, 44, 74, 0.16));
}

.frame-showroom-copy,
.hangar-module-copy {
  display: grid;
  gap: 10px;
}

.hangar-stage-copy {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.hangar-stage-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.hangar-stage-canvas-shell {
  position: relative;
  min-height: 420px;
  border-radius: 26px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(13, 28, 56, 0.92), rgba(5, 12, 24, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hangar-stage-canvas-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top center, rgba(255, 255, 255, 0.1), transparent 32%),
    linear-gradient(180deg, rgba(143, 248, 255, 0.05), transparent 26%);
  pointer-events: none;
}

.hangar-stage-readout {
  display: grid;
  gap: 12px;
}

.hangar-delta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hangar-delta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

.hangar-delta-pill.is-better {
  color: #06242c;
  background: linear-gradient(135deg, #efffff, #8ff8ff);
}

.hangar-delta-pill.is-worse {
  color: #30140f;
  background: linear-gradient(135deg, #fff1e7, #ff9f7a);
}

.hangar-delta-pill.is-neutral {
  color: var(--muted);
}

.hangar-build-stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.hangar-stat-chip {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.hangar-stat-chip span,
.slot-focus-head span,
.slot-focus-head strong + span,
.hangar-hover-note,
.frame-showroom-copy .item-copy,
.hangar-module-copy .item-copy {
  color: var(--muted);
}

.hangar-stat-chip strong {
  font-size: 1.08rem;
}

.hangar-stat-chip em {
  font-style: normal;
  font-size: 0.78rem;
}

.hangar-stat-chip.is-better em {
  color: var(--success);
}

.hangar-stat-chip.is-worse em {
  color: #ffd2c1;
}

.slot-focus-head {
  display: flex;
  gap: 12px;
  align-items: start;
}

.slot-index {
  min-width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  font-weight: 800;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.slot-focus-head strong,
.slot-focus-head span {
  display: block;
}

.slot-focus-meta,
.hangar-dock-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hangar-dock {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.hangar-dock-main {
  display: grid;
  gap: 14px;
}

.hangar-preset-tabs {
  align-items: stretch;
}

.parts-drawer-list {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.hangar-module-card {
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: start;
}

.hangar-module-card .hangar-actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.hangar-module-card.is-mounted {
  border-color: rgba(159, 230, 160, 0.3);
  background:
    linear-gradient(135deg, rgba(159, 230, 160, 0.1), rgba(143, 248, 255, 0.04)),
    rgba(255, 255, 255, 0.04);
}

.hangar-module-card.is-locked {
  opacity: 0.9;
}

.hangar-module-icon {
  width: 74px;
  min-height: 74px;
}

.hangar-hover-note {
  margin: 0;
  line-height: 1.5;
}

.compact-hangar-bay {
  grid-template-columns: minmax(0, 1.1fr) 340px;
  grid-template-areas:
    "roster roster"
    "stage parts";
  gap: 16px;
}

.hangar-roster-strip {
  grid-area: roster;
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hangar-roster-strip .section-head,
.hangar-parts-panel .section-head,
.hangar-main-stage .section-head {
  flex-direction: row;
  align-items: end;
}

.hangar-roster-strip .section-head p:last-child,
.hangar-parts-panel .section-head p:last-child {
  margin: 0;
}

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

.compact-frame-card {
  padding: 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.compact-frame-card .frame-showroom-hitbox {
  gap: 8px;
}

.compact-frame-card .frame-showroom-art {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(238, 248, 255, 0.94), rgba(143, 183, 228, 0.84));
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.frame-showroom-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(7, 15, 29, 0.28));
  pointer-events: none;
  user-select: none;
}

.compact-frame-card .item-head {
  display: grid;
  gap: 6px;
}

.compact-frame-card .item-title {
  color: #ff6b57;
}

.compact-frame-card .hangar-actions {
  justify-content: space-between;
}

.compact-frame-card .hangar-actions .ghost-button {
  flex: 1 1 auto;
}

.hangar-main-stage {
  grid-area: stage;
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(255, 214, 102, 0.14), transparent 24%),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

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

.hangar-stage-head h3 {
  margin: 8px 0 0;
}

.hangar-stage-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.hangar-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.hangar-utility-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
}

.prominent-preset-tabs {
  gap: 12px;
}

.prominent-preset-tabs .ghost-button {
  min-width: 96px;
  padding: 12px 18px;
  font-size: 0.98rem;
}

.scrap-bank-card {
  min-width: 176px;
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  display: grid;
  gap: 4px;
  justify-items: end;
}

.scrap-bank-card-header {
  min-width: 220px;
  padding: 14px 18px;
}

.scrap-bank-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.scrap-bank-value {
  font-size: 1.35rem;
  line-height: 1;
  color: #f7fbff;
}

.scrap-bank-card-header .scrap-bank-value {
  font-size: 2rem;
}

.clean-preview-shell {
  position: relative;
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 14px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 20% 18%, rgba(126, 97, 255, 0.28), transparent 18%),
    radial-gradient(circle at 76% 22%, rgba(72, 214, 255, 0.2), transparent 16%),
    radial-gradient(circle at 48% 82%, rgba(52, 98, 255, 0.22), transparent 22%),
    linear-gradient(180deg, rgba(7, 16, 38, 0.98), rgba(2, 6, 16, 0.99));
  border: 1px solid rgba(164, 208, 255, 0.18);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 -34px 58px rgba(24, 51, 108, 0.34);
}

.clean-preview-shell::before {
  content: "";
  position: absolute;
  inset: -8%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 1.2px, transparent 1.9px) 0 0 / 120px 120px,
    radial-gradient(circle, rgba(177, 231, 255, 0.88) 0 1px, transparent 1.7px) 22px 34px / 156px 156px,
    radial-gradient(circle, rgba(255, 220, 170, 0.76) 0 1.3px, transparent 2px) 76px 48px / 210px 210px,
    radial-gradient(circle at 24% 22%, rgba(255, 255, 255, 0.1), transparent 11%),
    radial-gradient(circle at 77% 62%, rgba(120, 195, 255, 0.12), transparent 13%);
  opacity: 0.96;
  animation: hangar-stars-drift 28s linear infinite;
  pointer-events: none;
  z-index: 0;
}

.clean-preview-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 84% 20%, rgba(164, 196, 255, 0.26), transparent 11%),
    radial-gradient(ellipse at 46% 86%, rgba(81, 126, 255, 0.26), transparent 24%),
    radial-gradient(circle at 22% 24%, rgba(200, 128, 255, 0.12), transparent 18%),
    linear-gradient(180deg, rgba(154, 218, 255, 0.04), transparent 28%);
  animation: hangar-nebula-pulse 8s ease-in-out infinite alternate;
  z-index: 1;
  pointer-events: none;
}

.hangar-preview-image {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 2;
  transform-origin: center 62%;
  filter:
    drop-shadow(0 14px 18px rgba(9, 16, 33, 0.4))
    drop-shadow(0 0 28px rgba(89, 190, 255, 0.14));
  animation: hangar-hero-float 6.2s ease-in-out infinite;
  pointer-events: none;
  user-select: none;
}

.hangar-active-art {
  isolation: isolate;
}

.hangar-active-art .hangar-preview-image {
  width: min(94%, 760px);
}

@keyframes hangar-hero-float {
  0% {
    transform: translate3d(0, 6px, 0) rotate(-1.2deg) scale(0.985);
    filter:
      drop-shadow(0 14px 18px rgba(9, 16, 33, 0.36))
      drop-shadow(0 0 24px rgba(89, 190, 255, 0.12));
  }
  25% {
    transform: translate3d(8px, -2px, 0) rotate(0.8deg) scale(1);
  }
  50% {
    transform: translate3d(0, -8px, 0) rotate(1.6deg) scale(1.015);
    filter:
      drop-shadow(0 26px 26px rgba(9, 16, 33, 0.46))
      drop-shadow(0 0 34px rgba(89, 190, 255, 0.18));
  }
  75% {
    transform: translate3d(-8px, -1px, 0) rotate(-0.8deg) scale(1);
  }
  100% {
    transform: translate3d(0, 6px, 0) rotate(-1.2deg) scale(0.985);
    filter:
      drop-shadow(0 14px 18px rgba(9, 16, 33, 0.36))
      drop-shadow(0 0 24px rgba(89, 190, 255, 0.12));
  }
}

@keyframes hangar-stars-drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.86;
  }
  50% {
    transform: translate3d(-18px, 10px, 0) scale(1.03);
    opacity: 1;
  }
  100% {
    transform: translate3d(-36px, 20px, 0) scale(1.05);
    opacity: 0.86;
  }
}

@keyframes hangar-nebula-pulse {
  0% {
    opacity: 0.72;
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 1;
    transform: scale(1.07) translateY(-8px);
  }
}

.hangar-socket-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-socket-tag {
  min-width: 84px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.compact-socket-tag strong {
  color: var(--accent-deep);
}

.compact-socket-tag span {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-socket-tag.is-selected {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.28), rgba(255, 159, 122, 0.18));
  border-color: rgba(255, 183, 3, 0.42);
}

.hangar-stage-note {
  font-size: 0.92rem;
  color: var(--muted);
}

.simple-build-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hangar-stat-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 0.9rem;
}

.hangar-stat-pill.is-better {
  color: #06242c;
  background: linear-gradient(135deg, #efffff, #8ff8ff);
}

.hangar-stat-pill.is-worse {
  color: #30140f;
  background: linear-gradient(135deg, #fff1e7, #ff9f7a);
}

.hangar-parts-panel {
  grid-area: parts;
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.parts-list {
  display: grid;
  gap: 8px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.simple-module-row {
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.simple-module-row .hangar-module-icon {
  width: 52px;
  min-height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.simple-module-row .hangar-module-copy {
  gap: 4px;
}

.simple-module-row .item-copy {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.35;
  color: rgba(226, 238, 252, 0.86);
}

.simple-module-row .hangar-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.simple-module-row .hangar-actions .ghost-button {
  margin-top: 0;
  padding-inline: 14px;
}

.arcade-hangar-bay {
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.3fr) minmax(320px, 1fr);
  grid-template-areas:
    "roster stage tray"
    "dock dock tray";
  gap: 16px;
}

.hangar-roster-panel {
  grid-area: roster;
}

.hangar-tray-panel {
  grid-area: tray;
}

.compact-dock {
  grid-area: dock;
}

.hangar-roster-panel,
.arcade-stage-panel,
.hangar-tray-panel,
.compact-dock {
  border: 3px solid #31486d;
  background:
    radial-gradient(circle at top left, rgba(255, 245, 199, 0.82), transparent 28%),
    linear-gradient(180deg, rgba(224, 242, 255, 0.96), rgba(163, 203, 244, 0.9));
  box-shadow:
    0 12px 0 rgba(34, 58, 95, 0.26),
    0 26px 36px rgba(9, 20, 39, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.hangar-roster-panel .section-head,
.arcade-stage-panel .section-head,
.hangar-tray-panel .section-head,
.compact-dock .section-head {
  margin-bottom: 0;
}

.hangar-roster-panel .section-head,
.hangar-tray-panel .section-head,
.compact-dock .section-head {
  flex-direction: column;
  align-items: start;
}

.hangar-roster-panel .section-head p,
.arcade-stage-panel .section-head p,
.hangar-tray-panel .section-head p,
.compact-dock .section-head p,
.hangar-stage-copy p,
.hangar-hover-note,
.frame-showroom-copy .item-copy,
.hangar-module-copy .item-copy,
.hangar-stat-chip span,
.hangar-stat-chip em,
.stage-socket-name,
.hangar-roster-panel .meta-pill,
.hangar-tray-panel .meta-pill,
.compact-dock .meta-pill {
  color: #2b4468;
}

.hangar-roster-panel h3,
.arcade-stage-panel h3,
.hangar-tray-panel h3,
.compact-dock h3 {
  color: #20324e;
}

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

.frame-showroom-card {
  padding: 10px;
  border: 3px solid #36507a;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(246, 252, 255, 0.94), rgba(205, 225, 246, 0.86));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 10px 16px rgba(37, 56, 86, 0.18);
}

.frame-showroom-card.is-selected {
  border-color: #ff9f1c;
  background:
    radial-gradient(circle at top center, rgba(255, 240, 178, 0.92), transparent 42%),
    linear-gradient(180deg, rgba(255, 252, 237, 0.96), rgba(215, 232, 255, 0.88));
}

.frame-showroom-art {
  min-height: 94px;
  background:
    linear-gradient(180deg, #eaf7ff, #9fd0ff 72%, #79b4ea);
  border: 3px solid #36507a;
  box-shadow:
    inset 0 8px 18px rgba(255, 255, 255, 0.35),
    inset 0 -8px 16px rgba(67, 119, 184, 0.18);
}

.frame-showroom-copy {
  gap: 8px;
}

.frame-showroom-copy .item-title {
  color: #ff5c49;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.frame-showroom-copy .item-copy {
  font-size: 0.84rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.frame-showroom-copy .meta-pill {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(53, 77, 112, 0.18);
}

.arcade-stage-panel {
  background:
    radial-gradient(circle at top center, rgba(255, 229, 132, 0.66), transparent 30%),
    linear-gradient(180deg, rgba(244, 250, 255, 0.96), rgba(179, 213, 248, 0.92));
}

.hangar-stage-copy {
  align-items: start;
}

.hangar-stage-actions .ghost-button,
.hangar-actions .ghost-button,
.compact-dock .ghost-button,
.compact-socket-tag,
.stage-socket-button {
  border: 2px solid #385377;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(219, 232, 247, 0.92));
  color: #223450;
  box-shadow: 0 5px 0 rgba(54, 80, 122, 0.18);
}

.hangar-stage-actions .ghost-button.is-selected,
.hangar-actions .ghost-button.is-selected,
.compact-dock .ghost-button.is-selected {
  background: linear-gradient(180deg, #ffd466, #ff9f1c);
  color: #3f2500;
}

.hangar-stage-canvas-shell {
  min-height: 380px;
  border: 4px solid #35527e;
  border-radius: 30px;
  background: transparent;
  box-shadow:
    inset 0 16px 22px rgba(255, 255, 255, 0.28),
    inset 0 -18px 20px rgba(65, 122, 183, 0.2);
}

.hangar-socket-orbit {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.stage-socket-button {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 104px;
  min-height: 58px;
  margin: 0;
  padding: 8px 10px;
  pointer-events: auto;
  border-radius: 18px;
  display: grid;
  gap: 2px;
  text-align: center;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease;
}

.stage-socket-button:hover {
  transform: translate(-50%, -52%);
}

.stage-socket-button.is-selected {
  border-color: #ff8d24;
  background:
    radial-gradient(circle at top, rgba(255, 248, 204, 0.95), transparent 48%),
    linear-gradient(180deg, #ffd96b, #ffab2f);
  color: #4a2d06;
}

.stage-socket-button.is-mounted {
  background:
    linear-gradient(180deg, rgba(242, 255, 244, 0.96), rgba(204, 232, 212, 0.92));
}

.stage-socket-button.is-empty {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(219, 232, 247, 0.9));
}

.stage-socket-code {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ff5c49;
}

.stage-socket-name {
  display: block;
  font-size: 0.72rem;
  line-height: 1.15;
}

.hangar-stage-readout {
  gap: 10px;
}

.hangar-build-stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.hangar-stat-chip {
  padding: 10px 12px;
  border: 2px solid #385377;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(219, 232, 247, 0.9));
  color: #20324e;
}

.hangar-stat-chip strong {
  color: #15253d;
}

.hangar-tray-panel {
  align-content: start;
  max-height: 760px;
  overflow: hidden;
}

.hangar-tray-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-parts-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
  max-height: 560px;
  overflow: auto;
  padding-right: 6px;
}

.hangar-module-card {
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 3px solid #385377;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(219, 232, 247, 0.92));
}

.hangar-module-card.is-mounted {
  border-color: #72b96d;
  background:
    radial-gradient(circle at top right, rgba(211, 255, 202, 0.96), transparent 42%),
    linear-gradient(180deg, rgba(246, 255, 242, 0.96), rgba(216, 238, 214, 0.94));
}

.hangar-module-card .item-title {
  color: #20324e;
}

.hangar-module-icon {
  width: 60px;
  min-height: 60px;
  border: 3px solid #385377;
  background:
    linear-gradient(180deg, #eef8ff, #a9d3ff);
}

.hangar-module-card .hangar-actions {
  grid-column: 1 / -1;
  justify-content: space-between;
}

.hangar-module-card .item-copy {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hangar-module-card .hangar-actions .ghost-button {
  flex: 1 1 48%;
}

.hangar-module-card .hangar-delta-strip {
  gap: 6px;
}

.hangar-module-card .hangar-delta-pill {
  padding: 6px 9px;
  font-size: 0.74rem;
}

.compact-dock {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.compact-socket-tag {
  margin: 0;
  padding: 8px 12px;
  border-radius: 16px;
  display: inline-grid;
  gap: 2px;
  min-width: 110px;
  text-align: left;
}

.compact-socket-tag strong {
  color: #ff5c49;
}

.compact-socket-tag span {
  color: #223450;
  font-size: 0.82rem;
}

.compact-socket-tag.is-selected {
  border-color: #ff8d24;
  background: linear-gradient(180deg, #ffd86f, #ffad32);
}

.slot-select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.slot-select:focus {
  outline: 2px solid rgba(255, 183, 3, 0.45);
  outline-offset: 2px;
}

.module-group .section-head,
.hangar-column .section-head {
  margin-bottom: 0;
}

.module-group .collection-item {
  grid-template-columns: 52px minmax(0, 1fr);
  padding: 12px;
}

.module-group .icon-shell {
  width: 52px;
  height: 52px;
}

button:disabled,
.ghost-button:disabled,
.menu-button:disabled,
.auth-tab:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none !important;
  filter: none !important;
}

button {
  margin-top: 18px;
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  font: inherit;
  font-weight: 700;
  color: var(--button-text);
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  cursor: pointer;
  transition:
    transform 120ms ease,
    filter 120ms ease;
}

button:focus-visible,
.menu-button:focus-visible,
.ghost-button:focus-visible,
.auth-tab:focus-visible,
.icon-button:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.24);
  outline-offset: 3px;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-shell.hidden {
  pointer-events: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 9, 19, 0.78);
  backdrop-filter: blur(8px);
}

.auth-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  padding: 24px;
}

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

.auth-copy {
  margin-top: 8px;
}

.auth-tabs {
  display: inline-flex;
  gap: 10px;
  margin: 8px 0 18px;
}

.auth-tab {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-tab.is-active {
  color: var(--button-text);
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border-color: transparent;
}

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

.auth-form.hidden {
  display: none;
}

.auth-submit {
  width: 100%;
}

.auth-status {
  min-height: 24px;
  margin: 18px 0 0;
  color: var(--muted);
}

.auth-status.is-error {
  color: #ffd7d7;
}

.auth-status.is-success {
  color: var(--success);
}

.game-shell:fullscreen {
  width: 100%;
  height: 100%;
  display: grid;
  align-content: center;
}

.game-shell:fullscreen .canvas-frame {
  width: min(94vw, calc(94vh * 1.5));
}

@media (max-width: 900px) {
  .shell-toolbar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "identity"
      "menu"
      "actions";
  }

  .menu-bar,
  .toolbar-actions {
    justify-content: start;
  }

  .hangar-bay {
    grid-template-columns: 1fr;
    grid-template-areas:
      "stage"
      "frames"
      "slots"
      "dock"
      "parts";
  }

  .hangar-dock {
    grid-template-columns: 1fr;
  }

  .frame-showroom-list,
  .slot-focus-list {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

@media (max-width: 720px) {
  body {
    padding: 12px;
  }

  .game-shell {
    padding: 16px;
    border-radius: 22px;
  }

  .hub-header,
  .section-head,
  .auth-header {
    flex-direction: column;
    align-items: start;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hangar-overview,
  .hangar-layout {
    grid-template-columns: 1fr;
  }

  .hangar-stage-copy,
  .hangar-stage-actions,
  .hangar-dock-summary {
    flex-direction: column;
    align-items: stretch;
  }

  .hangar-stage-canvas-shell {
    min-height: 320px;
    height: 320px;
  }

  .frame-showroom-list,
  .slot-focus-list,
  .parts-drawer-list {
    grid-template-columns: 1fr;
  }

  .hangar-module-card {
    grid-template-columns: 1fr;
  }

  .hangar-module-icon {
    width: 100%;
  }

  #achievementsList,
  .rank-badge-strip {
    grid-template-columns: 1fr;
  }

  .collection-item {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .leaderboard-row {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .leader-score {
    text-align: left;
  }

  .icon-shell {
    width: 56px;
    height: 56px;
  }

  .panel,
  .auth-panel {
    padding: 22px 18px;
  }

  .menu-bar,
  .toolbar-actions,
  .auth-tabs,
  .mode-toggle,
  .filter-bar,
  .preset-strip,
  .hangar-actions {
    width: 100%;
  }

  .menu-button,
  .ghost-button,
  .auth-tab {
    flex: 1 1 100%;
    text-align: center;
  }

  .identity-heading {
    align-items: flex-start;
  }
}

@media (max-width: 1120px) {
  .compact-hangar-bay {
    grid-template-columns: 1fr;
    grid-template-areas:
      "roster"
      "stage"
      "parts";
  }

  .frame-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hangar-parts-panel {
    max-height: none;
  }

  .parts-list {
    max-height: 420px;
  }

  .arcade-hangar-bay {
    grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.2fr);
    grid-template-areas:
      "roster stage"
      "tray tray"
      "dock dock";
  }

  .compact-parts-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .frame-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .simple-module-row {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .simple-module-row .hangar-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .arcade-hangar-bay {
    grid-template-columns: 1fr;
    grid-template-areas:
      "roster"
      "stage"
      "tray"
      "dock";
  }

  .compact-roster,
  .compact-parts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hangar-build-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .compact-dock {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .frame-strip {
    grid-template-columns: 1fr;
  }

  .hangar-stage-head,
  .hangar-preset-row {
    flex-direction: column;
    align-items: stretch;
  }

  .compact-preset-name {
    min-width: 0;
    flex: 1 1 auto;
  }

  .compact-roster,
  .compact-parts-grid,
  .hangar-build-stats {
    grid-template-columns: 1fr;
  }

  .hangar-stage-actions,
  .hangar-dock-summary {
    justify-content: stretch;
  }

  .stage-socket-button {
    width: 86px;
    min-height: 52px;
    padding: 6px 8px;
  }

  .stage-socket-name {
    font-size: 0.66rem;
  }
}
