:root {
  --bg-top: #050816;
  --bg-bottom: #02030a;
  --panel-bg: rgba(9, 17, 42, 0.72);
  --panel-solid: rgba(11, 18, 44, 0.95);
  --line: rgba(94, 241, 255, 0.26);
  --line-strong: rgba(94, 241, 255, 0.58);
  --text-main: #eef6ff;
  --text-soft: #8da3cb;
  --cyan: #5ef1ff;
  --blue: #47a8ff;
  --magenta: #ff4db8;
  --amber: #ffba3a;
  --lime: #78ff80;
  --danger: #ff5d6c;
  --shadow-panel: 0 24px 56px rgba(0, 0, 0, 0.42);
  --shadow-glow: 0 0 32px rgba(94, 241, 255, 0.16);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text-main);
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  background:
    radial-gradient(circle at 15% 18%, rgba(94, 241, 255, 0.14), transparent 28%),
    radial-gradient(circle at 84% 12%, rgba(255, 77, 184, 0.16), transparent 28%),
    radial-gradient(circle at 52% 100%, rgba(56, 92, 190, 0.28), transparent 34%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent);
}

body::after {
  content: "";
  position: fixed;
  inset: -20%;
  pointer-events: none;
  background:
    conic-gradient(from 120deg at 18% 18%, rgba(94, 241, 255, 0.08), transparent 24%),
    conic-gradient(from 220deg at 82% 74%, rgba(255, 77, 184, 0.08), transparent 28%);
  filter: blur(18px);
  animation: drift 12s ease-in-out infinite alternate;
}

.page-shell {
  width: min(1480px, 94vw);
  margin: 0 auto;
  padding: 32px 0 48px;
}

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

.topbar-logout {
  margin-left: auto;
  color: #ffd5dc;
  border-color: rgba(255, 126, 140, 0.32);
  background: rgba(255, 126, 140, 0.12);
}

.topbar-logout:hover {
  border-color: rgba(255, 126, 140, 0.58);
  box-shadow: 0 0 16px rgba(255, 126, 140, 0.22);
}

.topbar-link {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(94, 241, 255, 0.18);
  color: var(--text-main);
  text-decoration: none;
  background: rgba(4, 10, 26, 0.55);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.topbar-link:hover,
.topbar-link.active {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 0 18px rgba(94, 241, 255, 0.12);
}

.hero-panel,
.panel,
.sub-panel,
.leaderboard-item,
.detail-card,
.result-card,
.roster-item {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.hero-panel {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 32px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(8, 15, 38, 0.84), rgba(9, 17, 42, 0.56));
  box-shadow: var(--shadow-panel), var(--shadow-glow);
  position: relative;
  overflow: hidden;
}

.hero-panel::after {
  content: "";
  position: absolute;
  top: -120%;
  left: -10%;
  width: 42%;
  height: 340%;
  background: linear-gradient(120deg, transparent 20%, rgba(94, 241, 255, 0.18) 48%, transparent 72%);
  transform: rotate(15deg);
  animation: heroSweep 7s linear infinite;
}

.eyebrow,
.section-kicker,
.metric-label,
.leaderboard-head,
.detail-round-head,
.result-table-head,
.result-card label span,
.neon-form label span,
.panel-note {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--cyan);
  font-family: "Orbitron", sans-serif;
  font-size: 12px;
}

h1,
h2,
h3,
.metric-card strong,
.rank-pill,
.leaderboard-name,
.value-badge {
  font-family: "Orbitron", sans-serif;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1;
}

.hero-subtitle {
  margin: 12px 0 0;
  color: var(--text-soft);
  font-size: 15px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(132px, 1fr));
  gap: 14px;
  min-width: min(520px, 100%);
}

.hero-actions {
  min-width: min(660px, 100%);
}

.metric-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: rgba(3, 8, 24, 0.56);
}

.metric-label {
  font-size: 11px;
  color: var(--text-soft);
}

.metric-card strong {
  font-size: 18px;
}

.live-card {
  border-color: rgba(120, 255, 128, 0.34);
  box-shadow: inset 0 0 20px rgba(120, 255, 128, 0.06);
}

.status-card,
.live-card.status-not-started {
  border-color: rgba(255, 126, 140, 0.56);
  box-shadow: inset 0 0 20px rgba(255, 126, 140, 0.16), 0 0 18px rgba(255, 126, 140, 0.2);
}

.status-card.status-not-started strong,
.live-card.status-not-started strong {
  color: #ffb0ba;
}

.status-card.status-racing,
.live-card.status-racing {
  border-color: rgba(120, 255, 128, 0.66);
  box-shadow: inset 0 0 24px rgba(120, 255, 128, 0.2), 0 0 26px rgba(120, 255, 128, 0.3);
}

.status-card.status-racing strong,
.live-card.status-racing strong {
  color: #b7ffbf;
}

.status-card.status-finished,
.live-card.status-finished {
  border-color: rgba(255, 205, 99, 0.64);
  box-shadow: inset 0 0 24px rgba(255, 205, 99, 0.2), 0 0 26px rgba(255, 205, 99, 0.3);
}

.status-card.status-finished strong,
.live-card.status-finished strong {
  color: #ffe49a;
}

.live-dot {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 16px rgba(120, 255, 128, 0.8);
  animation: pulse 1.2s ease-in-out infinite;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 18px;
  margin-top: 20px;
}

.admin-panel {
  grid-column: 1 / -1;
}

.search-panel {
  grid-column: 1 / -1;
  padding: 12px 16px;
}

.admin-layout {
  grid-template-columns: 1fr;
}

.module-stack {
  gap: 18px;
}

.module-panel {
  padding: 20px 24px;
}

.module-head {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.module-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.module-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(94, 241, 255, 0.34);
  background: rgba(94, 241, 255, 0.1);
  color: #89f5ff;
  font-family: "Orbitron", sans-serif;
  font-size: 12px;
  letter-spacing: 0.08em;
}

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

.judge-toolbar {
  margin-top: 12px;
}

.panel,
.sub-panel {
  position: relative;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-bg);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}

.panel::before,
.sub-panel::before,
.leaderboard-item::before,
.detail-card::before,
.result-card::before,
.roster-item::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(94, 241, 255, 0.08), rgba(255, 77, 184, 0.04));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.panel:hover::before,
.sub-panel:hover::before,
.leaderboard-item:hover::before,
.detail-card:hover::before,
.result-card:hover::before,
.roster-item:hover::before {
  opacity: 1;
}

.panel-header,
.sub-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h2,
h3 {
  margin: 0;
}

.panel-note,
.sub-panel-head p {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.leaderboard-head,
.leaderboard-item {
  display: grid;
  grid-template-columns: 88px minmax(0, 1.2fr) 150px 108px 108px;
  gap: 14px;
  align-items: center;
}

.leaderboard-head {
  padding: 0 18px 12px;
  color: var(--text-soft);
  font-size: 12px;
}

.front-search-row {
  display: grid;
  grid-template-columns: auto minmax(260px, 520px);
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(94, 241, 255, 0.2);
  background: rgba(7, 12, 30, 0.44);
}

.compact-search-row {
  grid-template-columns: auto minmax(280px, 1fr) auto;
  margin: 0;
  padding: 10px 12px;
}

.front-search-title {
  color: var(--text-soft);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.compact-search-row input {
  min-width: 0;
}

.front-search-row label {
  color: var(--text-soft);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.front-search-stats {
  justify-self: end;
  color: var(--text-soft);
  font-size: 12px;
  white-space: nowrap;
}

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

.leaderboard-item {
  position: relative;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: rgba(4, 10, 28, 0.72);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.28);
  transition: transform 0.26s ease, border-color 0.26s ease, box-shadow 0.26s ease;
}

.leaderboard-item:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 22px 34px rgba(0, 0, 0, 0.36), 0 0 24px rgba(94, 241, 255, 0.14);
}

.leaderboard-item.rank-up {
  animation: rankUp 0.55s ease;
}

.leaderboard-item.rank-down {
  animation: rankDown 0.55s ease;
}

.leaderboard-item.unclassified {
  opacity: 0.72;
}

.rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  border: 1px solid rgba(94, 241, 255, 0.24);
  background: rgba(94, 241, 255, 0.08);
  color: var(--cyan);
  font-size: 20px;
}

.leaderboard-item:nth-child(1) .rank-pill {
  color: #fff3b0;
  border-color: rgba(255, 186, 58, 0.36);
  background: linear-gradient(135deg, rgba(255, 186, 58, 0.18), rgba(255, 77, 184, 0.08));
}

.leaderboard-name {
  font-size: 19px;
}

.leaderboard-meta,
.round-meta,
.roster-meta {
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 13px;
}

.leaderboard-value {
  font-family: "Orbitron", sans-serif;
  font-size: 24px;
  color: var(--lime);
}

.leaderboard-value.pending {
  color: var(--text-soft);
}

.leaderboard-value.dnf {
  color: var(--danger);
}

.value-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 66px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 77, 184, 0.12);
  color: var(--magenta);
  border: 1px solid rgba(255, 77, 184, 0.3);
}

.value-badge.badge-pending {
  color: #9aaed1;
  border-color: rgba(141, 163, 203, 0.34);
  background: rgba(141, 163, 203, 0.12);
  box-shadow: none;
  text-shadow: none;
}

.lap-badge {
  font-weight: 800;
  letter-spacing: 0.04em;
  text-shadow: 0 0 10px currentColor;
}

.lap-badge.laps-0 {
  color: #ff7d88;
  background: rgba(255, 93, 108, 0.2);
  border-color: rgba(255, 93, 108, 0.62);
  box-shadow: 0 0 16px rgba(255, 93, 108, 0.34), inset 0 0 12px rgba(255, 93, 108, 0.2);
}

.lap-badge.laps-1-2 {
  color: #ffe08a;
  background: rgba(255, 186, 58, 0.2);
  border-color: rgba(255, 186, 58, 0.62);
  box-shadow: 0 0 16px rgba(255, 186, 58, 0.34), inset 0 0 12px rgba(255, 186, 58, 0.2);
}

.lap-badge.laps-3 {
  color: #a2ffad;
  background: rgba(120, 255, 128, 0.2);
  border-color: rgba(120, 255, 128, 0.62);
  box-shadow: 0 0 16px rgba(120, 255, 128, 0.34), inset 0 0 12px rgba(120, 255, 128, 0.2);
}

.lap-badge.badge-pending {
  color: #9aaed1;
  border-color: rgba(141, 163, 203, 0.34);
  background: rgba(141, 163, 203, 0.12);
  box-shadow: none;
  text-shadow: none;
}

.detail-cards,
.results-editor,
.pilot-roster {
  display: grid;
  gap: 14px;
}

.detail-card,
.result-card,
.roster-item {
  position: relative;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 11, 30, 0.74);
}

.detail-card-head,
.roster-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.detail-round-grid {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.result-table-head,
.result-input-grid {
  display: grid;
  grid-template-columns: 104px repeat(3, minmax(0, 1fr)) 116px;
  gap: 10px;
  align-items: center;
}

.detail-round-head,
.result-table-head {
  color: var(--text-soft);
  font-size: 11px;
}

.detail-round-row {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

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

.detail-round-laps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 10px;
  margin-top: 8px;
}

.detail-round-laps > :nth-child(1) {
  justify-self: start;
}

.detail-round-laps > :nth-child(2) {
  justify-self: center;
}

.detail-round-laps > :nth-child(3) {
  justify-self: end;
}

.detail-round-row.best-round {
  border: 1px solid rgba(94, 241, 255, 0.34);
  background: linear-gradient(135deg, rgba(94, 241, 255, 0.12), rgba(120, 255, 128, 0.08));
  box-shadow: inset 0 0 16px rgba(94, 241, 255, 0.08), 0 0 18px rgba(94, 241, 255, 0.12);
}

.round-label-text {
  min-width: 0;
  font-weight: 700;
  color: var(--text-main);
}

.round-result-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.detail-round-total {
  font-family: "Orbitron", sans-serif;
  font-size: 18px;
}

.best-round-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 34px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(94, 241, 255, 0.42);
  background: rgba(94, 241, 255, 0.16);
  color: #89f5ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.status-valid {
  color: var(--lime);
}

.status-dnf {
  color: var(--danger);
}

.status-pending {
  color: var(--text-soft);
}

.admin-columns {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  margin-top: 22px;
}

.status-banner {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 186, 58, 0.34);
  background: rgba(255, 186, 58, 0.08);
  color: #ffe0a3;
}

.status-control-card {
  margin-bottom: 6px;
  padding: 18px;
  border: 1px solid rgba(94, 241, 255, 0.28);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(10, 20, 48, 0.8), rgba(7, 12, 30, 0.82));
}

.status-control-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.status-control-hint {
  margin: 12px 0;
  color: #c6d7f7;
  font-size: 13px;
}

.status-risk-note {
  margin: 10px 0 0;
  color: #ffcb8b;
  font-size: 12px;
}

.pilot-search-bar {
  display: grid;
  grid-template-columns: auto minmax(260px, 420px) 1fr;
  align-items: center;
  gap: 12px;
  margin: 4px 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(94, 241, 255, 0.2);
  background: rgba(7, 12, 30, 0.48);
}

.pilot-search-bar label {
  color: var(--text-soft);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pilot-search-stats {
  justify-self: end;
  color: var(--text-soft);
  font-size: 12px;
}

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

.status-action-button {
  min-height: 56px;
  border: 1px solid rgba(94, 241, 255, 0.32);
  border-radius: 14px;
  background: rgba(8, 14, 36, 0.9);
  color: var(--text-main);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.status-action-button.active {
  border-color: var(--line-strong);
  box-shadow: 0 0 22px rgba(94, 241, 255, 0.2), inset 0 0 16px rgba(94, 241, 255, 0.12);
}

.status-pill-not-started {
  border-color: rgba(255, 126, 140, 0.54);
  color: #ffb0ba;
  background: rgba(255, 126, 140, 0.14);
}

.status-pill-racing {
  border-color: rgba(120, 255, 128, 0.56);
  color: #b7ffbf;
  background: rgba(120, 255, 128, 0.14);
}

.status-pill-finished {
  border-color: rgba(255, 205, 99, 0.56);
  color: #ffe49a;
  background: rgba(255, 205, 99, 0.14);
}

.hidden {
  display: none !important;
}

.admin-guarded[disabled],
.admin-guarded input:disabled,
.admin-guarded button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 60;
}

.auth-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 26px;
  border-radius: 24px;
  border: 1px solid var(--line-strong);
  background: rgba(9, 17, 42, 0.94);
  box-shadow: var(--shadow-panel), 0 0 24px rgba(94, 241, 255, 0.12);
}

.auth-card h2,
.auth-copy {
  margin: 0;
}

.auth-copy {
  color: var(--text-soft);
  font-size: 14px;
}

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

.form-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.stacked-form {
  margin-bottom: 18px;
}

.neon-form label,
.result-card label {
  display: grid;
  gap: 8px;
}

input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 14px;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 14px;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

input:focus {
  outline: none;
  border-color: var(--cyan);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(94, 241, 255, 0.12);
}

select:focus {
  outline: none;
  border-color: var(--cyan);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(94, 241, 255, 0.12);
}

button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-2px);
}

button:disabled {
  transform: none;
  cursor: not-allowed;
  opacity: 0.5;
  filter: saturate(0.7);
}

.primary-button {
  color: #08101e;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 14px 24px rgba(71, 168, 255, 0.24);
}

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

.danger-button {
  color: #fff1f3;
  background: rgba(255, 93, 108, 0.12);
  border: 1px solid rgba(255, 93, 108, 0.34);
}

.mini-button {
  padding: 10px 12px;
  font-size: 13px;
}

.roster-item {
  display: grid;
  gap: 12px;
  cursor: pointer;
}

.roster-item:hover {
  border-color: var(--line-strong);
  box-shadow: 0 0 18px rgba(94, 241, 255, 0.16);
}

.roster-head h3,
.result-card-head h3 {
  color: #5ef1ff;
  text-shadow: 0 0 12px rgba(94, 241, 255, 0.35);
}

.roster-actions,
.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.result-card {
  display: grid;
  gap: 14px;
}

.result-card.jump-focus {
  animation: jumpFocusGlow 1s ease;
  border-color: rgba(120, 255, 128, 0.6);
  box-shadow: 0 0 28px rgba(120, 255, 128, 0.22);
}

.result-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.result-card + .result-card {
  margin-top: 0;
}

.result-rounds {
  display: grid;
  gap: 16px;
}

.result-round {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.round-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.round-title-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.dirty-indicator {
  display: inline-flex;
  align-items: center;
  color: #ffd26f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 0 10px rgba(255, 210, 111, 0.45);
}

.round-title strong {
  font-family: "Orbitron", sans-serif;
}

.round-status {
  font-size: 12px;
  color: var(--text-soft);
}

.empty-state {
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(94, 241, 255, 0.22);
  color: var(--text-soft);
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
}

.toast-container {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 50;
}

.toast {
  min-width: 220px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(6, 12, 30, 0.92);
  box-shadow: var(--shadow-panel);
  animation: toastIn 0.24s ease;
}

.toast.success {
  border-color: rgba(120, 255, 128, 0.28);
}

.toast.error {
  border-color: rgba(255, 93, 108, 0.38);
}

@keyframes drift {
  from {
    transform: translate3d(-1.5%, -1%, 0) scale(1);
  }
  to {
    transform: translate3d(1.5%, 1%, 0) scale(1.04);
  }
}

@keyframes heroSweep {
  from {
    transform: rotate(15deg) translateX(-40%);
  }
  to {
    transform: rotate(15deg) translateX(280%);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.18);
    opacity: 1;
  }
}

@keyframes rankUp {
  0% {
    transform: translateY(12px);
    box-shadow: 0 0 0 rgba(120, 255, 128, 0);
  }
  60% {
    transform: translateY(-6px);
    box-shadow: 0 0 26px rgba(120, 255, 128, 0.24);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes rankDown {
  0% {
    transform: translateY(-8px);
  }
  60% {
    transform: translateY(4px);
    box-shadow: 0 0 22px rgba(255, 77, 184, 0.2);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes jumpFocusGlow {
  0% {
    transform: translateY(0);
    box-shadow: 0 0 0 rgba(120, 255, 128, 0);
  }
  40% {
    transform: translateY(-2px);
    box-shadow: 0 0 26px rgba(120, 255, 128, 0.3);
  }
  100% {
    transform: translateY(0);
    box-shadow: 0 0 0 rgba(120, 255, 128, 0);
  }
}

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

  .admin-columns,
  .form-grid {
    grid-template-columns: 1fr;
  }

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

  .module-panel {
    padding: 18px;
  }

  .hero-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-metrics {
    min-width: 0;
  }

  .hero-actions {
    min-width: 0;
  }

  .search-panel {
    padding: 10px 12px;
  }

  .pilot-search-bar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .pilot-search-stats {
    justify-self: start;
  }

  .topbar {
    flex-wrap: wrap;
  }
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100%, 100vw);
    padding: 18px 12px 28px;
  }

  .leaderboard-head {
    display: none;
  }

  .leaderboard-item,
  .result-table-head,
  .result-input-grid {
    grid-template-columns: 1fr 1fr;
  }

  .leaderboard-item {
    grid-template-columns: 84px minmax(0, 1fr);
    row-gap: 10px;
  }

  .leaderboard-rank {
    grid-column: 1;
    grid-row: 1;
  }

  .leaderboard-pilot {
    grid-column: 2;
    grid-row: 1;
  }

  .leaderboard-laps {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
  }

  .leaderboard-best {
    grid-column: 2;
    grid-row: 2;
  }

  .leaderboard-round {
    grid-column: 2;
    grid-row: 3;
    justify-self: start;
  }

  .detail-round-top {
    column-gap: 8px;
  }

  .detail-round-laps {
    column-gap: 8px;
  }

  .best-round-badge {
    min-width: 30px;
    height: 20px;
    padding: 0 7px;
    font-size: 10px;
  }

  .leaderboard-value,
  .leaderboard-name,
  .rank-pill {
    justify-self: start;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .front-search-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .compact-search-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  .front-search-title {
    font-size: 11px;
  }

  .front-search-stats {
    justify-self: start;
  }

  .status-control-actions {
    grid-template-columns: 1fr;
  }
}


@media (orientation: portrait) and (max-width: 820px) {
  .panel,
  .sub-panel,
  .module-panel {
    padding: 14px;
  }

  .hero-panel {
    padding: 16px 14px;
  }

  .panel-header,
  .sub-panel-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
  }

  .detail-card-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-card-head .value-badge {
    align-self: flex-end;
  }

  .search-panel {
    padding: 10px 12px;
  }

  .compact-search-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px 10px;
  }

  .front-search-title {
    font-size: 10px;
    letter-spacing: 0.06em;
  }

  .front-search-stats {
    font-size: 11px;
  }

  .leaderboard-head {
    display: none;
  }

  .leaderboard-item {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    row-gap: 8px;
    column-gap: 10px;
    padding: 10px 10px 11px;
  }

  .leaderboard-rank {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .leaderboard-pilot {
    grid-column: 2;
    grid-row: 1;
  }

  .leaderboard-best {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    align-self: start;
    width: fit-content;
  }

  .leaderboard-laps {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
  }

  .leaderboard-round {
    grid-column: 3;
    grid-row: 2;
    justify-self: end;
  }

  .leaderboard-meta {
    margin-top: 3px;
    font-size: 11px;
  }

  .leaderboard-best {
    font-size: 17px;
  }

  .leaderboard-laps,
  .leaderboard-round {
    min-width: 0;
    padding: 8px 10px;
    font-size: 12px;
  }

  .leaderboard-round {
    justify-self: end;
  }

  .leaderboard-laps {
    justify-self: start;
  }

  .leaderboard-pilot {
    min-width: 0;
  }

  .leaderboard-name {
    font-size: 16px;
    line-height: 1.15;
  }

  .leaderboard-best {
    line-height: 1.05;
  }

  .rank-pill {
    width: 44px;
    height: 44px;
    font-size: 16px;
    border-radius: 16px;
  }

  .value-badge {
    min-width: 0;
    padding: 8px 10px;
    font-size: 12px;
  }

  .leaderboard-item:nth-child(1) .rank-pill {
    font-size: 16px;
  }

  .detail-round-head {
    display: none;
  }

  .detail-card {
    padding: 14px;
  }

  .detail-card-head h3 {
    font-size: 18px;
  }

  .detail-card-head .round-meta {
    font-size: 12px;
    line-height: 1.35;
  }

  .detail-round-row {
    padding: 10px 8px;
  }

  .detail-round-top {
    grid-template-columns: minmax(0, 1fr) auto auto;
    column-gap: 8px;
  }

  .detail-round-laps {
    margin-top: 6px;
    column-gap: 8px;
  }

  .detail-round-total {
    font-size: 17px;
  }

  .round-result-cell {
    gap: 6px;
  }

  .best-round-badge {
    min-width: 28px;
    height: 18px;
    padding: 0 6px;
    font-size: 10px;
  }

  .leaderboard-value {
    font-size: 18px;
  }
}

@media (orientation: portrait) and (max-width: 380px) {
  .leaderboard-item {
    grid-template-columns: 54px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
  }

  .leaderboard-rank {
    grid-row: 1;
  }

  .leaderboard-best {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
  }

  .leaderboard-laps {
    grid-column: 1;
    grid-row: 3;
  }

  .leaderboard-round {
    grid-column: 2;
    grid-row: 3;
  }

  .detail-round-top {
    column-gap: 6px;
  }

  .detail-round-total {
    font-size: 16px;
  }

  .detail-round-laps {
    column-gap: 6px;
  }
}