:root {
  color-scheme: dark;
  --bg: #111418;
  --panel: #1a2028;
  --panel-2: #202936;
  --panel-3: #26343d;
  --line: #405060;
  --text: #f5f7fb;
  --muted: #9eacb9;
  --accent: #5ad0ff;
  --accent-2: #f4c95d;
  --danger: #ff5d73;
  --hit: #ff9f1c;
  --miss: #7f8ea3;
  --plane: #73e2a7;
  --ink: #071018;
  --cell: clamp(18px, 3.5vw, 32px);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 18% 12%, rgba(90, 208, 255, 0.2), transparent 24rem),
    radial-gradient(circle at 86% 4%, rgba(244, 201, 93, 0.16), transparent 21rem),
    linear-gradient(135deg, #111418 0%, #17202a 48%, #14181f 100%);
  background-size:
    42px 42px,
    42px 42px,
    auto,
    auto,
    auto;
  color: var(--text);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    system-ui,
    sans-serif;
}

button {
  border: 1px solid transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

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

.app {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 30px;
}

.auth-screen,
.profile-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.profile-screen {
  align-items: start;
}

.profile-shell {
  width: min(1080px, 100%);
  padding-top: 8px;
}

.auth-card {
  width: min(520px, 100%);
  border: 1px solid rgba(64, 80, 96, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 38%),
    rgba(18, 24, 31, 0.9);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 20px;
}

.auth-brand {
  align-items: flex-start;
  margin-bottom: 18px;
}

.profile-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.profile-actions.compact {
  gap: 8px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.room-display {
  min-width: 132px;
  border: 1px solid rgba(244, 201, 93, 0.36);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(244, 201, 93, 0.09), transparent),
    rgba(26, 32, 40, 0.86);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
  padding: 12px 14px;
}

.room-display span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.room-display strong {
  display: block;
  margin-top: 4px;
  color: var(--accent-2);
  font-size: 24px;
  line-height: 1;
}

.room-display .command {
  width: 100%;
  min-height: 32px;
  margin-top: 10px;
  padding: 0 10px;
}

.plane-emblem {
  display: grid;
  grid-template-columns: repeat(5, 12px);
  grid-template-rows: repeat(4, 12px);
  gap: 3px;
  flex: 0 0 auto;
  border: 1px solid rgba(90, 208, 255, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(90, 208, 255, 0.16), rgba(255, 255, 255, 0.04)),
    rgba(12, 18, 25, 0.7);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.3),
    inset 0 0 28px rgba(90, 208, 255, 0.12);
  padding: 12px;
}

.plane-emblem span {
  border-radius: 3px;
  background: linear-gradient(180deg, #a6f0ff, #5ad0ff 45%, #3388ad);
  box-shadow: 0 0 12px rgba(90, 208, 255, 0.42);
}

.plane-emblem span:nth-child(1) {
  grid-column: 3;
  grid-row: 1;
}

.plane-emblem span:nth-child(n + 2):nth-child(-n + 6) {
  grid-row: 2;
}

.plane-emblem span:nth-child(2) { grid-column: 1; }
.plane-emblem span:nth-child(3) { grid-column: 2; }
.plane-emblem span:nth-child(4) { grid-column: 3; }
.plane-emblem span:nth-child(5) { grid-column: 4; }
.plane-emblem span:nth-child(6) { grid-column: 5; }

.plane-emblem span:nth-child(7) {
  grid-column: 3;
  grid-row: 3;
}

.plane-emblem span:nth-child(8) {
  grid-column: 2;
  grid-row: 4;
}

.plane-emblem span:nth-child(9) {
  grid-column: 3;
  grid-row: 4;
}

.plane-emblem span:nth-child(10) {
  grid-column: 4;
  grid-row: 4;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: 0;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.status {
  min-height: 24px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(96px, 1fr));
  gap: 10px;
}

.scoreboard > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent),
    rgba(26, 32, 40, 0.86);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
  padding: 12px 14px;
}

.scoreboard span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.scoreboard strong {
  display: block;
  margin-top: 2px;
  color: var(--accent);
  font-size: 28px;
  line-height: 1;
}

.stage-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr)) auto;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 16px;
}

.stage,
.legend {
  border: 1px solid rgba(64, 80, 96, 0.88);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent),
    rgba(26, 32, 40, 0.78);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

.stage {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 10px 12px;
  color: var(--muted);
}

.stage span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: inherit;
  font-size: 12px;
  font-weight: 800;
}

.stage strong {
  font-size: 14px;
}

.stage.active {
  border-color: rgba(90, 208, 255, 0.68);
  color: var(--text);
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.24),
    inset 0 -2px 0 rgba(90, 208, 255, 0.66);
}

.stage.active span {
  background: var(--accent);
  color: var(--ink);
}

.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

.legend-item::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.miss-mark::before { background: var(--miss); }
.hit-mark::before {
  background: var(--hit);
  box-shadow: 0 0 12px rgba(255, 159, 28, 0.65);
}
.kill-mark::before {
  background: var(--danger);
  box-shadow: 0 0 14px rgba(255, 93, 115, 0.78);
}

.auth-panel,
.lobby-panel {
  display: grid;
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
  border: 1px solid rgba(64, 80, 96, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent),
    rgba(18, 24, 31, 0.78);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  padding: 12px;
}

.auth-panel {
  grid-template-columns: minmax(120px, auto) repeat(3, minmax(150px, 1fr)) auto;
}

.auth-screen .auth-panel {
  grid-template-columns: 1fr;
  margin-bottom: 0;
}

.support-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.lobby-panel {
  grid-template-columns: minmax(190px, 0.75fr) minmax(280px, 1.2fr) repeat(2, minmax(190px, 0.85fr));
  align-items: start;
  gap: 14px;
}

.lobby-panel > label {
  grid-column: 1;
  grid-row: 1;
}

.lobby-panel .mode-picker {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.lobby-panel .visibility-picker {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.lobby-panel .spectator-picker {
  grid-column: 4;
  grid-row: 1 / span 2;
}

.lobby-panel .account-chip {
  grid-column: 1 / span 2;
  grid-row: 2;
}

.lobby-panel .lobby-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
  border-top: 1px solid rgba(64, 80, 96, 0.58);
  padding-top: 12px;
}

.lobby-panel .room-chip {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.auth-panel label,
.lobby-panel label,
.mode-picker,
.visibility-picker,
.spectator-picker {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.panel-kicker,
.auth-panel label span,
.lobby-panel label span,
.mode-picker > span,
.visibility-picker > span,
.spectator-picker > span {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
}

.mode-picker > div,
.visibility-picker > div,
.spectator-picker > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.spectator-picker {
  min-width: 0;
}

.mode-option,
.visibility-option,
.spectator-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  height: 40px;
  box-sizing: border-box;
  border: 1px solid rgba(64, 80, 96, 0.95);
  border-radius: 8px;
  background: rgba(8, 15, 22, 0.82);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  padding: 0 10px;
}

.spectator-option {
  text-align: center;
}

.mode-option.active,
.visibility-option.active,
.spectator-option.active {
  border-color: transparent;
  background: linear-gradient(180deg, #82ddff, #45bfe9);
  color: var(--ink);
}

.spectator-option:hover:not(:disabled) {
  border-color: rgba(90, 208, 255, 0.65);
}

.mode-picker small,
.visibility-picker small,
.spectator-picker small {
  color: var(--muted);
  font-size: 12px;
}

.auth-panel h2 {
  font-size: 20px;
}

.auth-panel input,
.lobby-panel input {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(64, 80, 96, 0.95);
  border-radius: 8px;
  outline: none;
  background: rgba(8, 15, 22, 0.82);
  color: var(--text);
  font: inherit;
  padding: 0 12px;
}

.auth-panel input:focus,
.lobby-panel input:focus {
  border-color: rgba(90, 208, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(90, 208, 255, 0.12);
}

.auth-actions,
.lobby-actions,
.account-chip,
.room-chip {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.auth-actions,
.account-chip {
  justify-content: flex-start;
}

.room-chip {
  justify-content: flex-end;
}

.account-chip span,
.room-chip span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid rgba(64, 80, 96, 0.75);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 14px;
  padding: 0 12px;
}

.profile-panel {
  margin-bottom: 16px;
  border: 1px solid rgba(64, 80, 96, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent),
    rgba(18, 24, 31, 0.72);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  padding: 14px;
}

.profile-screen .profile-panel {
  margin-bottom: 0;
}

.profile-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.profile-heading p {
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-heading h2 {
  margin-top: 3px;
  font-size: 20px;
}

.section-heading {
  margin: 14px 0 8px;
}

.section-heading h2 {
  font-size: 17px;
}

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

.stats-grid div {
  border: 1px solid rgba(64, 80, 96, 0.75);
  border-radius: 8px;
  background: rgba(8, 15, 22, 0.45);
  padding: 10px 12px;
}

.stats-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.stats-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--accent);
  font-size: 26px;
  line-height: 1;
}

.match-list {
  display: grid;
  gap: 8px;
  max-height: 128px;
  overflow: auto;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.match-list li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  border: 1px solid rgba(64, 80, 96, 0.68);
  border-radius: 8px;
  background: rgba(8, 15, 22, 0.36);
  color: #c3cbd5;
  padding: 7px 10px;
}

.match-list li.clickable {
  cursor: pointer;
}

.match-list li.clickable:hover {
  border-color: rgba(90, 208, 255, 0.65);
  background: rgba(22, 42, 55, 0.58);
}

.match-list strong {
  display: grid;
  place-items: center;
  width: 28px;
  height: 22px;
  border-radius: 999px;
  background: var(--miss);
  color: var(--ink);
  font-size: 13px;
}

.match-list li.win strong {
  background: var(--plane);
}

.match-list li.loss strong {
  background: var(--danger);
  color: var(--text);
}

.match-list em {
  color: var(--accent);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.cosmetic-panel {
  margin-top: 16px;
  border: 1px solid rgba(64, 80, 96, 0.78);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(244, 201, 93, 0.06), transparent 48%),
    rgba(8, 15, 22, 0.38);
  padding: 14px;
}

.cosmetic-panel > .profile-heading:last-child {
  margin-bottom: 0;
}

.friend-panel {
  margin-top: 16px;
  border: 1px solid rgba(64, 80, 96, 0.78);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(90, 208, 255, 0.06), transparent 48%),
    rgba(8, 15, 22, 0.38);
  padding: 14px;
}

.friend-add {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.friend-add input,
.friend-invite-panel select {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(64, 80, 96, 0.9);
  border-radius: 8px;
  outline: none;
  background: rgba(5, 10, 16, 0.76);
  color: var(--text);
  font: inherit;
  padding: 0 12px;
}

.friend-add input:focus,
.friend-invite-panel select:focus {
  border-color: rgba(90, 208, 255, 0.78);
  box-shadow: 0 0 0 3px rgba(90, 208, 255, 0.14);
}

.friend-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.friend-card,
.empty-friend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  border: 1px solid rgba(64, 80, 96, 0.68);
  border-radius: 8px;
  background: rgba(8, 15, 22, 0.36);
  color: #c3cbd5;
  padding: 8px 10px;
}

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

.friend-card strong {
  color: var(--text);
  font-size: 15px;
}

.friend-card span {
  color: var(--muted);
  font-size: 12px;
}

.empty-friend {
  justify-content: flex-start;
  color: var(--muted);
}

.toolbar.friend-invite-panel {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: fit-content;
  max-width: 100%;
  align-self: flex-start;
  gap: 8px;
  min-height: 0;
  margin-bottom: 14px;
  border: 1px solid rgba(64, 80, 96, 0.78);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(90, 208, 255, 0.05), transparent 54%),
    rgba(8, 15, 22, 0.32);
  padding: 10px;
}

.toolbar.friend-invite-panel .friend-invite-title {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.toolbar.friend-invite-panel .status {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  max-width: 260px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar.friend-invite-panel select {
  width: 150px;
  min-height: 36px;
}

.toolbar.friend-invite-panel .command {
  min-height: 36px;
  white-space: nowrap;
}

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

.cosmetic-field,
.redeem-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.cosmetic-grid select,
.redeem-field input {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(64, 80, 96, 0.9);
  border-radius: 8px;
  outline: none;
  background: rgba(5, 10, 16, 0.76);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  padding: 0 14px;
}

.cosmetic-grid select:focus,
.redeem-field input:focus {
  border-color: rgba(90, 208, 255, 0.78);
  box-shadow: 0 0 0 3px rgba(90, 208, 255, 0.14);
}

.redeem-field {
  margin-top: 8px;
}

.cosmetic-preview-dialog {
  width: min(980px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  border: 1px solid rgba(90, 208, 255, 0.36);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(90, 208, 255, 0.13), transparent 40%),
    rgba(18, 24, 31, 0.97);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
  padding: 16px;
}

.preview-section + .preview-section {
  margin-top: 18px;
}

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

.preview-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 150px;
  border: 1px solid rgba(64, 80, 96, 0.76);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent),
    rgba(8, 15, 22, 0.42);
  padding: 12px;
}

.preview-card.selected {
  border-color: rgba(90, 208, 255, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(90, 208, 255, 0.16),
    0 18px 38px rgba(0, 0, 0, 0.22);
}

.preview-card.clickable {
  cursor: pointer;
}

.preview-card.clickable:hover,
.preview-card.clickable:focus-visible {
  border-color: rgba(90, 208, 255, 0.62);
  box-shadow:
    inset 0 0 0 1px rgba(90, 208, 255, 0.12),
    0 0 0 3px rgba(90, 208, 255, 0.12),
    0 18px 38px rgba(0, 0, 0, 0.2);
}

.preview-card[data-owned="false"] {
  opacity: 0.62;
}

.preview-card .command {
  grid-column: 2;
  justify-self: start;
}

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

.preview-copy strong {
  color: var(--text);
  font-size: 17px;
}

.preview-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.preview-copy em {
  width: fit-content;
  border: 1px solid rgba(90, 208, 255, 0.32);
  border-radius: 999px;
  background: rgba(90, 208, 255, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  padding: 3px 8px;
}

.preview-board-swatch {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(7, 1fr);
  gap: 1px;
  width: 112px;
  height: 112px;
  border: 1px solid rgba(90, 208, 255, 0.26);
  border-radius: 6px;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(90, 208, 255, 0.14), transparent 56%),
    rgba(8, 15, 22, 0.94);
  padding: 4px;
}

.preview-board-swatch span {
  position: relative;
  background: rgba(16, 27, 37, 0.9);
  box-shadow: inset 0 0 0 1px rgba(90, 208, 255, 0.12);
}

.preview-board-swatch .plane {
  background:
    linear-gradient(135deg, rgba(115, 226, 167, 0.38), rgba(90, 208, 255, 0.14)),
    rgba(16, 27, 37, 0.82);
}

.preview-board-swatch .head {
  background:
    linear-gradient(135deg, rgba(90, 208, 255, 0.52), rgba(244, 201, 93, 0.24)),
    rgba(16, 27, 37, 0.82);
}

.preview-board-swatch[data-preview-board="radar"] {
  border-color: rgba(64, 229, 186, 0.48);
  background:
    radial-gradient(circle at 50% 50%, rgba(64, 229, 186, 0.24), transparent 36%),
    repeating-linear-gradient(0deg, transparent 0 15px, rgba(64, 229, 186, 0.12) 15px 16px),
    repeating-linear-gradient(90deg, transparent 0 15px, rgba(90, 208, 255, 0.1) 15px 16px),
    linear-gradient(135deg, rgba(5, 26, 31, 0.98), rgba(8, 14, 24, 0.98));
  box-shadow: inset 0 0 22px rgba(64, 229, 186, 0.16);
}

.preview-board-swatch[data-preview-board="radar"] span {
  background:
    linear-gradient(135deg, rgba(64, 229, 186, 0.045), transparent 54%),
    rgba(7, 24, 30, 0.86);
  box-shadow: inset 0 0 0 1px rgba(64, 229, 186, 0.15);
}

.preview-board-swatch[data-preview-board="radar"] .plane {
  background:
    linear-gradient(135deg, rgba(140, 255, 221, 0.46), rgba(90, 208, 255, 0.12)),
    rgba(8, 30, 33, 0.94);
}

.preview-board-swatch[data-preview-board="radar"] .head {
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 239, 161, 0.34), transparent 42%),
    linear-gradient(135deg, rgba(90, 208, 255, 0.46), rgba(64, 229, 186, 0.2)),
    rgba(8, 30, 33, 0.94);
}

.preview-board-swatch[data-preview-board="aurora"] {
  position: relative;
  border-color: rgba(126, 218, 255, 0.5);
  background:
    linear-gradient(115deg, transparent 0 42%, rgba(103, 244, 197, 0.16) 48%, transparent 56%),
    repeating-linear-gradient(0deg, transparent 0 15px, rgba(126, 218, 255, 0.12) 15px 16px),
    repeating-linear-gradient(90deg, transparent 0 15px, rgba(173, 118, 255, 0.1) 15px 16px),
    radial-gradient(circle at 50% 0%, rgba(103, 244, 197, 0.22), transparent 44%),
    rgba(7, 16, 29, 0.98);
  box-shadow: inset 0 0 24px rgba(126, 218, 255, 0.18);
  animation: auroraBoardFlow 7s ease-in-out infinite;
}

.preview-board-swatch[data-preview-board="aurora"]::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(126, 218, 255, 0.18), transparent);
  transform: translateY(-100%);
  animation: auroraScan 3.8s linear infinite;
}

.preview-board-swatch[data-preview-board="aurora"] span {
  background:
    radial-gradient(circle at 70% 20%, rgba(103, 244, 197, 0.055), transparent 38%),
    rgba(8, 22, 36, 0.86);
  box-shadow: inset 0 0 0 1px rgba(126, 218, 255, 0.14);
}

.preview-board-swatch[data-preview-board="aurora"] .plane {
  background:
    linear-gradient(135deg, rgba(156, 247, 219, 0.48), rgba(126, 218, 255, 0.14)),
    rgba(7, 28, 40, 0.94);
}

.preview-board-swatch[data-preview-board="aurora"] .head {
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 245, 178, 0.38), transparent 42%),
    linear-gradient(135deg, rgba(173, 118, 255, 0.32), rgba(103, 244, 197, 0.24)),
    rgba(7, 28, 40, 0.94);
}

.preview-effect-swatch {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 8px;
  width: 120px;
  min-height: 112px;
  border: 1px solid rgba(90, 208, 255, 0.26);
  border-radius: 6px;
  background:
    radial-gradient(circle at center, rgba(90, 208, 255, 0.12), transparent 58%),
    rgba(8, 15, 22, 0.94);
  padding: 12px 8px;
}

.effect-cell {
  position: relative;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(90, 208, 255, 0.14);
  background: rgba(16, 27, 37, 0.9);
}

.effect-cell::after {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
}

.effect-cell::before {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  bottom: -22px;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.effect-cell.miss::after {
  background: var(--miss);
  transform: scale(0.38);
}

.effect-cell.hit::after {
  background: var(--hit);
  box-shadow: 0 0 0 4px rgba(255, 159, 28, 0.18);
}

.effect-cell.kill::after {
  background: var(--danger);
  box-shadow:
    0 0 0 4px rgba(255, 93, 115, 0.2),
    0 0 22px rgba(255, 93, 115, 0.78);
}

.preview-effect-swatch[data-preview-effect="ion"] {
  border-color: rgba(64, 229, 186, 0.42);
  background:
    radial-gradient(circle at 50% 50%, rgba(64, 229, 186, 0.18), transparent 48%),
    rgba(7, 24, 30, 0.94);
}

.preview-effect-swatch[data-preview-effect="ion"] .effect-cell.miss::after {
  inset: 20%;
  border: 2px solid rgba(122, 183, 201, 0.94);
  background: transparent;
  box-shadow: 0 0 16px rgba(122, 183, 201, 0.34);
}

.preview-effect-swatch[data-preview-effect="ion"] .effect-cell.hit::after {
  inset: 21%;
  border-radius: 2px;
  background: #ffcf5a;
  box-shadow: 0 0 20px rgba(255, 207, 90, 0.66);
  transform: rotate(45deg);
}

.preview-effect-swatch[data-preview-effect="ion"] .effect-cell.kill::after {
  inset: 18%;
  border-radius: 4px;
  background:
    linear-gradient(90deg, transparent 42%, #ff3e66 42% 58%, transparent 58%),
    linear-gradient(0deg, transparent 42%, #ff3e66 42% 58%, transparent 58%);
  box-shadow: 0 0 24px rgba(255, 62, 102, 0.78);
}

.preview-effect-swatch[data-preview-effect="starburst"] {
  border-color: rgba(126, 218, 255, 0.46);
  background:
    radial-gradient(circle at 25% 22%, rgba(103, 244, 197, 0.16), transparent 34%),
    radial-gradient(circle at 78% 18%, rgba(173, 118, 255, 0.15), transparent 34%),
    rgba(7, 16, 29, 0.96);
}

.preview-effect-swatch[data-preview-effect="starburst"] .effect-cell.miss::after {
  inset: 20%;
  border: 2px solid rgba(128, 232, 255, 0.92);
  background:
    radial-gradient(circle, rgba(128, 232, 255, 0.5) 0 12%, transparent 14%),
    transparent;
  box-shadow: 0 0 18px rgba(128, 232, 255, 0.42);
  animation: starProbe 1.6s ease-out infinite;
}

.preview-effect-swatch[data-preview-effect="starburst"] .effect-cell.hit::after {
  inset: 18%;
  border-radius: 4px;
  background:
    linear-gradient(90deg, transparent 40%, #ffd86b 40% 60%, transparent 60%),
    linear-gradient(0deg, transparent 40%, #ffd86b 40% 60%, transparent 60%),
    radial-gradient(circle, #fff4b8 0 24%, #ffb833 26% 45%, transparent 47%);
  box-shadow: 0 0 22px rgba(255, 216, 107, 0.7);
  animation: starImpact 1.4s cubic-bezier(0.2, 0.9, 0.2, 1) infinite;
}

.preview-effect-swatch[data-preview-effect="starburst"] .effect-cell.kill::after {
  inset: 14%;
  border-radius: 50%;
  background:
    conic-gradient(from 18deg, #ff4e88, #7edaff, #fff1a6, #ff4e88),
    radial-gradient(circle, #fff 0 15%, #ff4e88 16% 44%, transparent 46%);
  box-shadow:
    0 0 28px rgba(255, 78, 136, 0.86),
    0 0 42px rgba(126, 218, 255, 0.34);
  animation: starKill 1.7s cubic-bezier(0.15, 0.85, 0.2, 1) infinite;
}

.panel-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(64, 80, 96, 0.75);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 13px;
  padding: 0 10px;
}

.room-browser {
  border: 1px solid rgba(64, 80, 96, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent),
    rgba(18, 24, 31, 0.72);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  padding: 12px;
}

.room-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.room-card,
.empty-room {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(64, 80, 96, 0.68);
  border-radius: 8px;
  background: rgba(8, 15, 22, 0.36);
  color: #c3cbd5;
  padding: 12px;
}

.room-card {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
}

.room-card strong {
  color: var(--text);
  font-size: 18px;
}

.room-card span {
  grid-column: 1;
  color: var(--muted);
  font-size: 13px;
}

.room-card button {
  grid-row: 1 / span 2;
}

.room-card button:nth-of-type(1) {
  grid-column: 2;
}

.room-card button:nth-of-type(2) {
  grid-column: 3;
}

.room-card.busy {
  opacity: 0.68;
}

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

.leaderboard-panel {
  border: 1px solid rgba(64, 80, 96, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent),
    rgba(18, 24, 31, 0.72);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  padding: 12px;
}

.ranking-list {
  display: grid;
  gap: 8px;
  max-height: 560px;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ranking-list li {
  display: grid;
  grid-template-columns: 36px minmax(80px, 1fr) minmax(150px, auto);
  gap: 10px;
  align-items: center;
  min-height: 42px;
  border: 1px solid rgba(64, 80, 96, 0.68);
  border-radius: 8px;
  background: rgba(8, 15, 22, 0.36);
  color: #c3cbd5;
  padding: 8px 10px;
}

.ranking-list strong {
  display: grid;
  place-items: center;
  width: 30px;
  height: 26px;
  border-radius: 999px;
  background: var(--accent-2);
  color: var(--ink);
  font-size: 13px;
}

.ranking-list span {
  color: var(--text);
  font-weight: 800;
}

.ranking-list em {
  color: var(--muted);
  font-style: normal;
  text-align: right;
}

.ranking-list .empty-rank {
  display: block;
  color: var(--muted);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(4, 42px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
}

.direction {
  width: 42px;
  height: 40px;
  border-radius: 0;
  background: rgba(26, 32, 40, 0.92);
  color: var(--muted);
  font-size: 22px;
}

.direction + .direction {
  border-left: 1px solid var(--line);
}

.direction.active {
  background: var(--accent);
  color: var(--ink);
}

.command,
.coin,
.spectator-view {
  min-height: 40px;
  border-radius: 8px;
  border-color: var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent),
    rgba(26, 32, 40, 0.92);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
  padding: 0 14px;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.command:hover:not(:disabled),
.coin:hover:not(:disabled),
.spectator-view:hover:not(:disabled),
.direction:hover:not(:disabled) {
  border-color: rgba(90, 208, 255, 0.65);
  transform: translateY(-1px);
}

.command.primary,
.coin.primary,
.spectator-view.primary,
.spectator-view.active,
.command.active {
  border-color: transparent;
  background: linear-gradient(180deg, #82ddff, #45bfe9);
  color: var(--ink);
  font-weight: 700;
}

.command.danger {
  border-color: rgba(255, 93, 115, 0.58);
  background:
    linear-gradient(180deg, rgba(255, 93, 115, 0.18), transparent),
    rgba(50, 22, 30, 0.9);
  color: #ffd7dd;
}

.boards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.board-panel {
  min-width: 0;
  border: 1px solid rgba(64, 80, 96, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), transparent 36%),
    rgba(18, 24, 31, 0.82);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 12px;
}

.board-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.board-title p {
  margin-bottom: 3px;
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.board-title h2,
.event-log h2 {
  font-size: 17px;
  letter-spacing: 0;
}

.board-title span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(64, 80, 96, 0.75);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 14px;
  padding: 0 10px;
}

.board {
  display: grid;
  grid-template-columns: 28px repeat(20, var(--cell));
  grid-template-rows: 28px repeat(20, var(--cell));
  width: max-content;
  max-width: 100%;
  overflow: auto;
  scrollbar-color: rgba(166, 178, 188, 0.72) rgba(10, 16, 23, 0.98);
  border: 1px solid rgba(90, 208, 255, 0.22);
  border-radius: 6px;
  background:
    radial-gradient(circle at center, rgba(90, 208, 255, 0.12), transparent 58%),
    rgba(8, 15, 22, 0.92);
  box-shadow:
    inset 0 0 34px rgba(90, 208, 255, 0.08),
    0 16px 42px rgba(0, 0, 0, 0.25);
}

.board::-webkit-scrollbar {
  width: 13px;
  height: 13px;
}

.board::-webkit-scrollbar-track {
  background: rgba(10, 16, 23, 0.98);
}

.board::-webkit-scrollbar-thumb {
  border: 3px solid rgba(10, 16, 23, 0.98);
  border-radius: 999px;
  background: rgba(166, 178, 188, 0.78);
}

.header-cell {
  display: grid;
  place-items: center;
  position: sticky;
  z-index: 2;
  background: rgba(32, 41, 54, 0.96);
  color: #c4d0da;
  font-size: 12px;
  font-weight: 800;
  user-select: none;
}

.header-cell.top {
  top: 0;
}

.header-cell.left {
  left: 0;
}

.header-cell.corner {
  left: 0;
  top: 0;
  z-index: 3;
}

.cell {
  position: relative;
  width: var(--cell);
  height: var(--cell);
  border: 0;
  border-left: 1px solid rgba(90, 208, 255, 0.12);
  border-top: 1px solid rgba(90, 208, 255, 0.12);
  border-radius: 0;
  background: rgba(16, 27, 37, 0.78);
  padding: 0;
  transition:
    background 120ms ease,
    box-shadow 120ms ease,
    transform 120ms ease;
}

.cell:hover {
  z-index: 1;
  background: rgba(42, 70, 86, 0.86);
  box-shadow: inset 0 0 0 1px rgba(90, 208, 255, 0.45);
}

.cell::after {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  transform: scale(0);
  opacity: 0;
  transition:
    transform 150ms ease,
    opacity 150ms ease;
}

.cell.plane {
  background:
    linear-gradient(135deg, rgba(115, 226, 167, 0.34), rgba(90, 208, 255, 0.12)),
    rgba(16, 27, 37, 0.78);
  box-shadow: inset 0 0 0 1px rgba(115, 226, 167, 0.24);
}

.cell.head {
  background:
    linear-gradient(135deg, rgba(90, 208, 255, 0.45), rgba(244, 201, 93, 0.16)),
    rgba(16, 27, 37, 0.78);
  box-shadow: inset 0 0 0 1px rgba(90, 208, 255, 0.34);
}

.cell.plane-1 { --plane-a: 115, 226, 167; --plane-b: 90, 208, 255; }
.cell.plane-2 { --plane-a: 244, 201, 93; --plane-b: 255, 159, 28; }
.cell.plane-3 { --plane-a: 173, 118, 255; --plane-b: 126, 218, 255; }
.cell.plane-4 { --plane-a: 255, 122, 162; --plane-b: 255, 209, 102; }
.cell.plane-5 { --plane-a: 93, 214, 255; --plane-b: 122, 255, 210; }

.cell.plane,
.cell.head {
  background:
    linear-gradient(135deg, rgba(var(--plane-a, 115, 226, 167), 0.42), rgba(var(--plane-b, 90, 208, 255), 0.16)),
    rgba(16, 27, 37, 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(var(--plane-a, 115, 226, 167), 0.38),
    inset 0 -10px 18px rgba(var(--plane-b, 90, 208, 255), 0.08);
}

.cell.plane::before,
.cell.head::before {
  content: "";
  position: absolute;
  pointer-events: none;
  inset: 24% 18%;
  border-radius: 2px;
  background: rgba(var(--plane-a, 115, 226, 167), 0.62);
  box-shadow: 0 0 10px rgba(var(--plane-b, 90, 208, 255), 0.28);
  opacity: 0.84;
}

.cell.head::before {
  inset: 17%;
  border-radius: 50% 50% 44% 44%;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.7), transparent 22%),
    rgba(var(--plane-b, 90, 208, 255), 0.72);
}

.cell.part-wing::before {
  inset: 34% 10%;
}

.cell.part-body::before {
  inset: 12% 36%;
}

.cell.part-tail::before {
  inset: 26% 24%;
  clip-path: polygon(50% 0, 100% 100%, 50% 76%, 0 100%);
}

.cell.preview-valid[class*="plane-"] {
  background:
    linear-gradient(135deg, rgba(var(--plane-a, 115, 226, 167), 0.54), rgba(var(--plane-b, 90, 208, 255), 0.24)),
    rgba(115, 226, 167, 0.26);
}

.cell.preview-valid {
  background: rgba(115, 226, 167, 0.46);
  box-shadow: inset 0 0 0 1px rgba(115, 226, 167, 0.72);
}

.cell.preview-invalid {
  background: rgba(255, 93, 115, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 93, 115, 0.78);
}

.cell.preview-valid[class*="plane-"] {
  background:
    linear-gradient(135deg, rgba(var(--plane-a, 115, 226, 167), 0.54), rgba(var(--plane-b, 90, 208, 255), 0.24)),
    rgba(115, 226, 167, 0.26);
  box-shadow:
    inset 0 0 0 1px rgba(var(--plane-a, 115, 226, 167), 0.72),
    0 0 14px rgba(var(--plane-b, 90, 208, 255), 0.18);
}

.cell.miss::after {
  background: var(--miss);
  transform: scale(0.38);
  opacity: 0.95;
}

.cell.hit::after {
  background: var(--hit);
  box-shadow: 0 0 0 4px rgba(255, 159, 28, 0.18);
  transform: scale(0.6);
  opacity: 1;
}

.cell.kill::after {
  background: var(--danger);
  box-shadow:
    0 0 0 4px rgba(255, 93, 115, 0.2),
    0 0 22px rgba(255, 93, 115, 0.78);
  transform: scale(0.74);
  opacity: 1;
}

.cell.ink::before {
  content: "";
  position: absolute;
  inset: 20% 14%;
  border-top: 3px solid rgba(244, 201, 93, 0.92);
  transform: rotate(-28deg);
  pointer-events: none;
}

.cell.ink.ink-alt::before {
  transform: rotate(28deg);
}

.board.pen-active .cell {
  cursor: crosshair;
  touch-action: none;
}

.board.pen-active .cell:hover {
  box-shadow:
    inset 0 0 0 1px rgba(244, 201, 93, 0.7),
    0 0 12px rgba(244, 201, 93, 0.16);
}

body[data-board="radar"] .board-panel {
  border-color: rgba(64, 229, 186, 0.34);
  background:
    linear-gradient(180deg, rgba(64, 229, 186, 0.08), transparent 36%),
    linear-gradient(135deg, rgba(8, 38, 42, 0.82), rgba(12, 22, 34, 0.9));
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(183, 255, 231, 0.09),
    inset 0 0 42px rgba(64, 229, 186, 0.08);
}

body[data-board="radar"] .board-title p {
  color: #8cffdd;
}

body[data-board="radar"] .board {
  border-color: rgba(64, 229, 186, 0.42);
  background:
    radial-gradient(circle at 50% 50%, rgba(64, 229, 186, 0.2), transparent 34%),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(64, 229, 186, 0.08) 31px 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(90, 208, 255, 0.07) 31px 32px),
    linear-gradient(135deg, rgba(5, 26, 31, 0.96), rgba(8, 14, 24, 0.96));
  box-shadow:
    inset 0 0 40px rgba(64, 229, 186, 0.16),
    inset 0 0 0 1px rgba(183, 255, 231, 0.05),
    0 18px 48px rgba(0, 0, 0, 0.32);
}

body[data-board="radar"] .header-cell {
  background:
    linear-gradient(180deg, rgba(64, 229, 186, 0.16), rgba(13, 29, 37, 0.98));
  color: #d9fff4;
  text-shadow: 0 0 10px rgba(64, 229, 186, 0.5);
}

body[data-board="radar"] .cell {
  border-left-color: rgba(64, 229, 186, 0.16);
  border-top-color: rgba(90, 208, 255, 0.13);
  background:
    linear-gradient(135deg, rgba(64, 229, 186, 0.035), transparent 54%),
    rgba(7, 24, 30, 0.82);
}

body[data-board="radar"] .cell:hover {
  background:
    linear-gradient(135deg, rgba(64, 229, 186, 0.18), rgba(90, 208, 255, 0.08)),
    rgba(13, 38, 44, 0.92);
  box-shadow:
    inset 0 0 0 1px rgba(140, 255, 221, 0.55),
    0 0 16px rgba(64, 229, 186, 0.18);
}

body[data-board="radar"] .cell.plane {
  background:
    linear-gradient(135deg, rgba(140, 255, 221, 0.42), rgba(90, 208, 255, 0.1)),
    rgba(8, 30, 33, 0.92);
  box-shadow:
    inset 0 0 0 1px rgba(140, 255, 221, 0.42),
    inset 0 -10px 20px rgba(64, 229, 186, 0.1);
}

body[data-board="radar"] .cell.head {
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 239, 161, 0.32), transparent 42%),
    linear-gradient(135deg, rgba(90, 208, 255, 0.42), rgba(64, 229, 186, 0.18)),
    rgba(8, 30, 33, 0.94);
  box-shadow:
    inset 0 0 0 1px rgba(255, 239, 161, 0.48),
    0 0 16px rgba(90, 208, 255, 0.22);
}

body[data-board="aurora"] .board-panel {
  border-color: rgba(126, 218, 255, 0.38);
  background:
    linear-gradient(115deg, transparent 0 42%, rgba(103, 244, 197, 0.09) 48%, transparent 56%),
    radial-gradient(circle at 12% 0%, rgba(103, 244, 197, 0.16), transparent 35%),
    radial-gradient(circle at 92% 10%, rgba(173, 118, 255, 0.14), transparent 34%),
    linear-gradient(135deg, rgba(7, 20, 35, 0.92), rgba(13, 18, 29, 0.95));
  background-size: 180% 180%, auto, auto, auto;
  animation: auroraPanelFlow 8s ease-in-out infinite;
  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.34),
    inset 0 0 52px rgba(90, 208, 255, 0.08);
}

body[data-board="aurora"] .board-title p {
  color: #9cf7db;
}

body[data-board="aurora"] .board {
  position: relative;
  border-color: rgba(126, 218, 255, 0.42);
  background:
    repeating-linear-gradient(0deg, transparent 0 30px, rgba(126, 218, 255, 0.08) 30px 31px),
    repeating-linear-gradient(90deg, transparent 0 30px, rgba(173, 118, 255, 0.07) 30px 31px),
    radial-gradient(circle at 50% 0%, rgba(103, 244, 197, 0.18), transparent 42%),
    linear-gradient(145deg, rgba(5, 17, 31, 0.98), rgba(12, 14, 24, 0.98));
  box-shadow:
    inset 0 0 44px rgba(126, 218, 255, 0.16),
    inset 0 0 0 1px rgba(220, 245, 255, 0.05),
    0 18px 48px rgba(0, 0, 0, 0.35);
}

body[data-board="aurora"] .board::before {
  content: none;
}

body[data-board="aurora"] .header-cell,
body[data-board="aurora"] .cell {
  position: relative;
}

body[data-board="aurora"] .header-cell {
  background:
    linear-gradient(180deg, rgba(126, 218, 255, 0.18), rgba(13, 24, 42, 0.98));
  color: #e8fbff;
  text-shadow: 0 0 10px rgba(126, 218, 255, 0.46);
}

body[data-board="aurora"] .cell {
  z-index: 2;
  border-left-color: rgba(126, 218, 255, 0.13);
  border-top-color: rgba(173, 118, 255, 0.11);
  background:
    radial-gradient(circle at 70% 20%, rgba(103, 244, 197, 0.045), transparent 38%),
    rgba(8, 22, 36, 0.78);
}

body[data-board="aurora"] .cell:hover {
  background:
    linear-gradient(135deg, rgba(103, 244, 197, 0.2), rgba(173, 118, 255, 0.09)),
    rgba(12, 32, 48, 0.94);
  box-shadow:
    inset 0 0 0 1px rgba(156, 247, 219, 0.56),
    0 0 18px rgba(126, 218, 255, 0.18);
}

body[data-board="aurora"] .cell.plane {
  background:
    linear-gradient(135deg, rgba(156, 247, 219, 0.43), rgba(126, 218, 255, 0.13)),
    rgba(7, 28, 40, 0.92);
  box-shadow:
    inset 0 0 0 1px rgba(156, 247, 219, 0.42),
    inset 0 -10px 18px rgba(103, 244, 197, 0.12);
}

body[data-board="aurora"] .cell.head {
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 245, 178, 0.36), transparent 42%),
    linear-gradient(135deg, rgba(173, 118, 255, 0.3), rgba(103, 244, 197, 0.24)),
    rgba(7, 28, 40, 0.94);
  box-shadow:
    inset 0 0 0 1px rgba(255, 245, 178, 0.52),
    0 0 18px rgba(173, 118, 255, 0.24);
}

body[data-board="radar"] .cell.plane,
body[data-board="radar"] .cell.head {
  background:
    linear-gradient(135deg, rgba(var(--plane-a, 64, 229, 186), 0.34), rgba(var(--plane-b, 90, 208, 255), 0.1)),
    repeating-linear-gradient(90deg, transparent 0 7px, rgba(140, 255, 221, 0.12) 7px 8px),
    rgba(8, 30, 33, 0.92);
  box-shadow:
    inset 0 0 0 1px rgba(var(--plane-a, 64, 229, 186), 0.46),
    inset 0 0 18px rgba(64, 229, 186, 0.12),
    0 0 14px rgba(var(--plane-b, 90, 208, 255), 0.16);
}

body[data-board="radar"] .cell.plane::before,
body[data-board="radar"] .cell.head::before {
  background:
    linear-gradient(90deg, transparent, rgba(216, 255, 244, 0.9), transparent),
    rgba(var(--plane-a, 64, 229, 186), 0.48);
  background-size: 180% 100%, auto;
  animation: radarPlaneSweep 2.2s linear infinite;
  box-shadow: 0 0 12px rgba(64, 229, 186, 0.42);
}

body[data-board="radar"] .cell.head::before {
  border: 1px solid rgba(255, 239, 161, 0.62);
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 239, 161, 0.86), transparent 28%),
    rgba(var(--plane-b, 90, 208, 255), 0.54);
}

body[data-board="aurora"] .cell.plane,
body[data-board="aurora"] .cell.head {
  background:
    linear-gradient(135deg, rgba(var(--plane-a, 156, 247, 219), 0.38), rgba(var(--plane-b, 173, 118, 255), 0.18)),
    radial-gradient(circle at 60% 28%, rgba(255, 255, 255, 0.08), transparent 35%),
    rgba(7, 28, 40, 0.92);
  box-shadow:
    inset 0 0 0 1px rgba(var(--plane-a, 156, 247, 219), 0.42),
    0 0 16px rgba(var(--plane-b, 173, 118, 255), 0.18);
}

body[data-board="aurora"] .cell.plane::before,
body[data-board="aurora"] .cell.head::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), transparent 46%),
    rgba(var(--plane-a, 156, 247, 219), 0.58);
  animation: auroraPlanePulse 2.6s ease-in-out infinite;
  box-shadow:
    0 0 12px rgba(var(--plane-a, 156, 247, 219), 0.34),
    0 0 20px rgba(var(--plane-b, 173, 118, 255), 0.2);
}

body[data-board="aurora"] .cell.head::before {
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 245, 178, 0.86), transparent 28%),
    rgba(var(--plane-b, 173, 118, 255), 0.62);
}

body[data-effect="ion"] {
  --hit: #ffcf5a;
  --miss: #7ab7c9;
  --danger: #ff3e66;
}

body[data-effect="ion"] .legend-item::before,
body[data-effect="ion"] .cell::after {
  box-shadow: 0 0 12px currentColor;
}

body[data-effect="ion"] .cell.miss::after {
  inset: 27%;
  border: 2px solid rgba(122, 183, 201, 0.94);
  background: transparent;
  box-shadow:
    0 0 0 3px rgba(122, 183, 201, 0.08),
    0 0 16px rgba(122, 183, 201, 0.34);
  transform: scale(0.9);
  opacity: 1;
}

body[data-effect="ion"] .cell.hit::after {
  inset: 23%;
  border-radius: 2px;
  background: #ffcf5a;
  box-shadow:
    0 0 0 3px rgba(255, 207, 90, 0.18),
    0 0 20px rgba(255, 207, 90, 0.66);
  transform: rotate(45deg) scale(0.72);
  opacity: 1;
}

body[data-effect="ion"] .cell.kill::after {
  inset: 20%;
  border-radius: 4px;
  background:
    linear-gradient(90deg, transparent 42%, #ff3e66 42% 58%, transparent 58%),
    linear-gradient(0deg, transparent 42%, #ff3e66 42% 58%, transparent 58%);
  box-shadow:
    0 0 0 4px rgba(255, 62, 102, 0.14),
    0 0 24px rgba(255, 62, 102, 0.78);
  transform: scale(1);
  opacity: 1;
}

body[data-effect="ion"] .cell.fresh-miss,
body[data-effect="ion"] .cell.fresh-hit,
body[data-effect="ion"] .cell.fresh-kill {
  animation: ionCellPulse 700ms ease;
}

body[data-effect="ion"] .cell.fresh-miss::before,
body[data-effect="ion"] .cell.fresh-hit::before,
body[data-effect="ion"] .cell.fresh-kill::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  pointer-events: none;
  animation: ionShockwave 760ms ease forwards;
}

body[data-effect="ion"] .cell.fresh-miss::before {
  border: 2px solid rgba(122, 183, 201, 0.72);
}

body[data-effect="ion"] .cell.fresh-hit::before {
  border: 2px solid rgba(255, 207, 90, 0.82);
}

body[data-effect="ion"] .cell.fresh-kill::before {
  border: 2px solid rgba(255, 62, 102, 0.94);
  box-shadow: 0 0 24px rgba(255, 62, 102, 0.5);
}

body[data-effect="starburst"] {
  --hit: #ffd86b;
  --miss: #80e8ff;
  --danger: #ff4e88;
}

body[data-effect="starburst"] .cell.miss::after {
  inset: 25%;
  border: 2px solid rgba(128, 232, 255, 0.92);
  background:
    radial-gradient(circle, rgba(128, 232, 255, 0.45) 0 12%, transparent 14%),
    transparent;
  box-shadow:
    0 0 0 3px rgba(128, 232, 255, 0.08),
    0 0 18px rgba(128, 232, 255, 0.42);
  transform: scale(0.86);
  opacity: 1;
}

body[data-effect="starburst"] .cell.hit::after {
  inset: 20%;
  border-radius: 4px;
  background:
    linear-gradient(90deg, transparent 40%, #ffd86b 40% 60%, transparent 60%),
    linear-gradient(0deg, transparent 40%, #ffd86b 40% 60%, transparent 60%),
    radial-gradient(circle, #fff4b8 0 24%, #ffb833 26% 45%, transparent 47%);
  box-shadow:
    0 0 0 3px rgba(255, 216, 107, 0.18),
    0 0 22px rgba(255, 216, 107, 0.7);
  transform: rotate(45deg) scale(0.76);
  opacity: 1;
}

body[data-effect="starburst"] .cell.kill::after {
  inset: 16%;
  border-radius: 50%;
  background:
    conic-gradient(from 18deg, #ff4e88, #7edaff, #fff1a6, #ff4e88),
    radial-gradient(circle, #fff 0 15%, #ff4e88 16% 44%, transparent 46%);
  box-shadow:
    0 0 0 4px rgba(255, 78, 136, 0.18),
    0 0 28px rgba(255, 78, 136, 0.86),
    0 0 42px rgba(126, 218, 255, 0.34);
  transform: scale(0.9);
  opacity: 1;
}

body[data-effect="starburst"] .cell.fresh-miss::after {
  animation: starProbe 820ms ease-out;
}

body[data-effect="starburst"] .cell.fresh-hit::after {
  animation: starImpact 760ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

body[data-effect="starburst"] .cell.fresh-kill::after {
  animation: starKill 980ms cubic-bezier(0.15, 0.85, 0.2, 1);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(5, 8, 12, 0.72);
  padding: 18px;
}

.replay-dialog,
.entry-dialog {
  width: min(1180px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  border: 1px solid rgba(90, 208, 255, 0.36);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(90, 208, 255, 0.12), transparent 42%),
    rgba(18, 24, 31, 0.96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
  padding: 14px;
}

.entry-dialog {
  width: min(480px, 100%);
}

.entry-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.replay-boards {
  --replay-header: 24px;
  --replay-cell: clamp(16px, 1.05vw, 19px);
  display: grid;
  grid-template-columns: repeat(2, max-content);
  justify-content: center;
  gap: 14px;
  overflow-x: auto;
  margin-top: 12px;
  padding-bottom: 4px;
}

.replay-panel {
  width: max-content;
  max-width: none;
  box-shadow: none;
}

.replay-board {
  width: max-content;
  max-width: none;
  max-height: none;
  overflow: visible;
}

.replay-board .header-cell {
  position: static;
  width: var(--replay-header);
  height: var(--replay-header);
}

.replay-board .cell {
  width: var(--replay-cell);
  height: var(--replay-cell);
}

.cell.fresh-miss {
  animation: rippleMiss 620ms ease;
}

.cell.fresh-hit {
  animation: thumpHit 560ms ease;
}

.cell.fresh-kill {
  animation: flareKill 760ms ease;
}

.cell.fresh-hit::before,
.cell.fresh-kill::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  pointer-events: none;
}

.cell.fresh-hit::before {
  border: 2px solid rgba(255, 159, 28, 0.78);
  animation: ring 560ms ease forwards;
}

.cell.fresh-kill::before {
  border: 2px solid rgba(255, 93, 115, 0.85);
  animation: ring 760ms ease forwards;
}

.event-log {
  margin-top: 18px;
  border: 1px solid rgba(64, 80, 96, 0.9);
  border-radius: 8px;
  background: rgba(18, 24, 31, 0.7);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  padding: 12px;
}

.event-log ol {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px 18px;
  max-height: 116px;
  overflow: auto;
  margin: 8px 0 0;
  padding-left: 22px;
  color: #c3cbd5;
  font-size: 14px;
}

.hidden {
  display: none !important;
}

.handoff {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 10, 9, 0.78);
  backdrop-filter: blur(10px);
}

.handoff-panel {
  width: min(420px, 100%);
  border: 1px solid rgba(90, 208, 255, 0.36);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(90, 208, 255, 0.12), transparent 42%),
    var(--panel);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.48);
  padding: 22px;
  text-align: center;
}

.handoff-panel p {
  margin: 10px 0 18px;
  color: var(--muted);
}

@keyframes rippleMiss {
  0% {
    box-shadow: inset 0 0 0 0 rgba(123, 135, 148, 0.9);
  }
  100% {
    box-shadow: inset 0 0 0 16px rgba(123, 135, 148, 0);
  }
}

@keyframes thumpHit {
  0%,
  100% {
    transform: scale(1);
  }
  45% {
    transform: scale(0.92);
  }
}

@keyframes flareKill {
  0% {
    filter: brightness(1);
  }
  45% {
    filter: brightness(1.9);
  }
  100% {
    filter: brightness(1);
  }
}

@keyframes ring {
  from {
    transform: scale(0.2);
    opacity: 1;
  }
  to {
    transform: scale(1.7);
    opacity: 0;
  }
}

@keyframes ionShockwave {
  from {
    transform: scale(0.18);
    opacity: 1;
  }
  to {
    transform: scale(1.9);
    opacity: 0;
  }
}

@keyframes ionCellPulse {
  0%,
  100% {
    filter: brightness(1);
  }
  45% {
    filter: brightness(1.45);
  }
}

@keyframes auroraBoardFlow {
  0%,
  100% {
    background-position: 0 0, 0 0, 0 0, 0 0, 0% 50%;
  }
  50% {
    background-position: 28px 0, 0 0, 0 0, 0 0, 100% 50%;
  }
}

@keyframes auroraPanelFlow {
  0%,
  100% {
    background-position: 0% 50%, 0 0, 0 0, 0 0;
  }
  50% {
    background-position: 100% 50%, 0 0, 0 0, 0 0;
  }
}

@keyframes auroraScan {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(100%);
  }
}

@keyframes radarPlaneSweep {
  from {
    background-position: -120% 0, 0 0;
  }
  to {
    background-position: 120% 0, 0 0;
  }
}

@keyframes auroraPlanePulse {
  0%,
  100% {
    filter: brightness(0.95);
    opacity: 0.74;
    transform: scale(0.92);
  }
  50% {
    filter: brightness(1.45);
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes starProbe {
  0% {
    transform: scale(0.18);
    opacity: 0.35;
  }
  55% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(1.35);
    opacity: 0.2;
  }
}

@keyframes starImpact {
  0% {
    transform: rotate(45deg) scale(0.2);
    filter: brightness(1);
  }
  42% {
    transform: rotate(45deg) scale(0.95);
    filter: brightness(1.85);
  }
  100% {
    transform: rotate(45deg) scale(0.76);
    filter: brightness(1);
  }
}

@keyframes starKill {
  0% {
    transform: rotate(0deg) scale(0.16);
    filter: brightness(1);
  }
  45% {
    transform: rotate(120deg) scale(1.22);
    filter: brightness(2);
  }
  100% {
    transform: rotate(210deg) scale(0.9);
    filter: brightness(1);
  }
}

@media (max-width: 980px) {
  .boards {
    grid-template-columns: 1fr;
  }

  .stage-strip {
    grid-template-columns: repeat(4, 1fr);
  }

  .legend {
    grid-column: 1 / -1;
  }

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

  .lobby-panel > label,
  .lobby-panel .mode-picker,
  .lobby-panel .visibility-picker,
  .lobby-panel .spectator-picker,
  .lobby-panel .account-chip,
  .lobby-panel .lobby-actions,
  .lobby-panel .room-chip {
    grid-column: auto;
    grid-row: auto;
  }

  .lobby-panel .mode-picker,
  .lobby-panel .visibility-picker,
  .lobby-panel .spectator-picker,
  .lobby-panel .lobby-actions,
  .lobby-panel .room-chip {
    grid-column: 1 / -1;
  }

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

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

  .preview-card {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .preview-board-swatch {
    width: 100px;
    height: 100px;
  }

  .leaderboard-grid {
    grid-template-columns: 1fr;
  }

  .toolbar.friend-invite-panel {
    width: 100%;
  }

  .toolbar.friend-invite-panel .status {
    flex: 1 1 160px;
  }

  .room-chip {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .app {
    width: min(100% - 18px, 1480px);
    padding-top: 12px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand {
    align-items: flex-start;
  }

  h1 {
    font-size: 30px;
  }

  .plane-emblem {
    grid-template-columns: repeat(5, 9px);
    grid-template-rows: repeat(4, 9px);
    gap: 2px;
    padding: 9px;
  }

  .scoreboard {
    width: 100%;
  }

  .room-display {
    width: 100%;
  }

  .stage-strip {
    grid-template-columns: 1fr;
  }

  .auth-panel,
  .lobby-panel {
    grid-template-columns: 1fr;
  }

  .lobby-panel > label,
  .lobby-panel .mode-picker,
  .lobby-panel .visibility-picker,
  .lobby-panel .spectator-picker,
  .lobby-panel .account-chip,
  .lobby-panel .lobby-actions,
  .lobby-panel .room-chip {
    grid-column: auto;
    grid-row: auto;
  }

  .lobby-panel .lobby-actions,
  .lobby-panel .room-chip {
    justify-content: flex-start;
  }

  .mode-picker > div,
  .visibility-picker > div,
  .spectator-picker > div {
    grid-template-columns: 1fr;
  }

  .profile-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .friend-add {
    grid-template-columns: 1fr;
  }

  .toolbar.friend-invite-panel {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .toolbar.friend-invite-panel .friend-invite-title {
    min-height: auto;
  }

  .toolbar.friend-invite-panel select {
    width: 100%;
  }

  .toolbar.friend-invite-panel .status {
    max-width: none;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .preview-list {
    grid-template-columns: 1fr;
  }

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

  .preview-card .command {
    grid-column: auto;
  }

  .ranking-list li {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .ranking-list em {
    grid-column: 2;
    text-align: left;
  }

  .match-list {
    max-height: 220px;
  }

  .match-list li,
  .room-card {
    grid-template-columns: 1fr;
  }

  .room-card span,
  .room-card button {
    grid-column: auto;
    grid-row: auto;
  }

  .replay-boards {
    grid-template-columns: max-content;
  }

  .legend {
    grid-column: auto;
    justify-content: space-between;
  }

  .board {
    grid-template-columns: 24px repeat(20, var(--cell));
    grid-template-rows: 24px repeat(20, var(--cell));
  }
}
