:root {
  --bg: #05070d;
  --bg-soft: #0a1020;
  --panel: rgba(8, 16, 30, 0.82);
  --panel-solid: #0b1424;
  --line: rgba(112, 196, 224, 0.18);
  --cyan: #4dd8ff;
  --cyan-strong: #16b8e8;
  --violet: #a66bff;
  --orange: #ffb347;
  --red: #ff4d68;
  --text: #eaf6ff;
  --muted: #8fa8bd;
  --font: "Segoe UI", "Inter", Arial, sans-serif;
  --display: "Arial Black", "Segoe UI Black", Impact, var(--font);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-color: #1b3b52 #05070d; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #05070d; }
::-webkit-scrollbar-thumb { background: #1b3b52; border: 2px solid #05070d; }
::selection { background: rgba(77, 216, 255, 0.35); color: #fff; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font);
  line-height: 1.5;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }

.hero-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: var(--bg);
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.9) contrast(1.08);
  opacity: 0.72;
}
.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 7, 13, 0.96) 0%, rgba(5, 7, 13, 0.76) 38%, rgba(5, 7, 13, 0.2) 72%, rgba(5, 7, 13, 0.72) 100%),
    linear-gradient(180deg, rgba(5, 7, 13, 0.55) 0%, rgba(5, 7, 13, 0.08) 42%, var(--bg) 100%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 18px clamp(20px, 4vw, 64px);
  background: linear-gradient(180deg, rgba(5, 7, 13, 0.9), rgba(5, 7, 13, 0.35));
  border-bottom: 1px solid rgba(112, 196, 224, 0.12);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(77, 216, 255, 0.55);
  color: var(--cyan);
  font-family: var(--display);
  font-size: 22px;
  transform: skew(-8deg);
  box-shadow: 0 0 24px rgba(77, 216, 255, 0.18);
}
.brand-copy { display: flex; flex-direction: column; line-height: 0.9; letter-spacing: 0.12em; }
.brand-copy strong { font-family: var(--display); font-size: 17px; }
.brand-copy em { color: var(--cyan); font-style: normal; font-size: 12px; letter-spacing: 0.36em; }
.nav { display: flex; gap: 24px; margin-left: auto; color: var(--muted); font-size: 12px; letter-spacing: 0.16em; }
.nav a { transition: color 0.2s ease; }
.nav a:hover { color: var(--cyan); }
.profile-button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: rgba(8, 16, 30, 0.72);
  color: var(--text);
  font-size: 11px;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.profile-button:hover { border-color: rgba(77, 216, 255, 0.6); background: rgba(14, 32, 52, 0.9); }
.profile-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }

main { position: relative; z-index: 1; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: end;
  min-height: calc(100vh - 75px);
  padding: clamp(50px, 8vw, 110px) clamp(20px, 6vw, 92px) clamp(40px, 6vw, 72px);
}
.hero-copy { max-width: 720px; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(58px, 9vw, 136px);
  line-height: 0.82;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  text-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
}
.hero h1 span { display: block; color: var(--cyan); font-size: 0.52em; letter-spacing: 0.04em; }
.lede { max-width: 590px; margin: 26px 0 0; color: #c3d6e6; font-size: clamp(15px, 1.35vw, 19px); }
.lede strong { color: #fff; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, #0d9ac5, #17c7e8); color: #031019; box-shadow: 0 10px 34px rgba(22, 184, 232, 0.25); }
.btn-primary:hover { box-shadow: 0 14px 42px rgba(22, 184, 232, 0.42); }
.btn-ghost { border-color: rgba(122, 192, 220, 0.28); background: rgba(8, 16, 30, 0.58); color: #d8ecf7; }
.btn-ghost:hover { border-color: rgba(77, 216, 255, 0.65); }
.btn-small { min-height: 38px; padding: 8px 14px; font-size: 10px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 18px 26px; margin-top: 42px; color: var(--muted); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.hero-meta b { color: var(--cyan); font-size: 17px; margin-right: 4px; }

.hero-card {
  align-self: center;
  justify-self: end;
  width: min(100%, 370px);
  padding: 18px;
  border: 1px solid rgba(122, 192, 220, 0.2);
  background: linear-gradient(180deg, rgba(8, 18, 32, 0.84), rgba(5, 9, 18, 0.92));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
}
.hero-card-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; letter-spacing: 0.16em; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #5df2a0; box-shadow: 0 0 10px #5df2a0; }
.version { margin-left: auto; color: var(--cyan); }
.hero-ship { display: block; width: 100%; height: 240px; object-fit: contain; margin: 10px 0 4px; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.45)); }
.hero-card-bottom { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.kicker { margin: 0; color: var(--muted); font-size: 9px; letter-spacing: 0.18em; }
.hero-card-bottom h2 { margin: 2px 0 0; font-family: var(--display); font-size: 25px; letter-spacing: 0.04em; }
.hero-card-bottom a { color: var(--cyan); font-size: 9px; letter-spacing: 0.16em; }

.section { padding: clamp(64px, 8vw, 110px) clamp(20px, 6vw, 92px); border-top: 1px solid rgba(112, 196, 224, 0.1); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.section-head h2 { margin: 0; font-family: var(--display); font-size: clamp(30px, 4vw, 56px); line-height: 0.95; letter-spacing: -0.02em; }
.section-note { max-width: 430px; margin: 0; color: var(--muted); font-size: 13px; }
.ships { background: linear-gradient(180deg, rgba(5, 7, 13, 0.1), rgba(5, 7, 13, 0.7)); }
.ship-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.ship-card { position: relative; min-height: 245px; padding: 14px; overflow: hidden; border: 1px solid rgba(112, 196, 224, 0.14); background: radial-gradient(circle at 50% 28%, rgba(77, 216, 255, 0.13), transparent 62%), rgba(8, 16, 30, 0.58); transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease; }
.ship-card:hover { transform: translateY(-5px); border-color: rgba(77, 216, 255, 0.5); background: radial-gradient(circle at 50% 28%, rgba(77, 216, 255, 0.2), transparent 62%), rgba(10, 22, 40, 0.8); }
.ship-card img { display: block; width: 100%; height: 160px; object-fit: contain; filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.5)); }
.ship-card h3 { margin: 12px 0 2px; font-family: var(--display); font-size: 13px; letter-spacing: 0.08em; }
.ship-card p { margin: 0; color: var(--muted); font-size: 10px; }

.modes { background: linear-gradient(180deg, rgba(8, 16, 30, 0.3), rgba(5, 7, 13, 0.9)); }
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mode-card { position: relative; padding: 30px; border: 1px solid var(--line); background: rgba(8, 16, 30, 0.62); }
.mode-card.featured { border-color: rgba(166, 107, 255, 0.42); background: linear-gradient(135deg, rgba(38, 20, 66, 0.58), rgba(8, 16, 30, 0.8)); }
.mode-index { display: block; margin-bottom: 18px; color: var(--cyan); font-size: 11px; letter-spacing: 0.18em; }
.mode-card.featured .mode-index { color: var(--violet); }
.mode-card h3 { margin: 0; font-family: var(--display); font-size: 30px; }
.mode-card p { max-width: 560px; color: #b9cedd; font-size: 14px; }
.mode-card ul { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 24px 0 0; list-style: none; color: var(--muted); font-size: 11px; }
.mode-card li::before { content: "▸"; margin-right: 7px; color: var(--cyan); }

.ranking { background: linear-gradient(180deg, rgba(5, 7, 13, 0.82), rgba(8, 16, 30, 0.4)); }
.ranking-actions { display: flex; gap: 10px; }
.ranking-panel { border: 1px solid var(--line); background: rgba(7, 14, 26, 0.72); }
.ranking-tabs { display: flex; gap: 4px; padding: 12px; border-bottom: 1px solid var(--line); }
.ranking-tab { padding: 9px 16px; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 10px; letter-spacing: 0.16em; cursor: pointer; }
.ranking-tab.active { border-color: rgba(77, 216, 255, 0.45); background: rgba(77, 216, 255, 0.1); color: var(--cyan); }
.ranking-table-wrap { overflow-x: auto; }
.ranking-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.ranking-table th, .ranking-table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid rgba(112, 196, 224, 0.1); font-size: 12px; }
.ranking-table th { color: var(--muted); font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; }
.ranking-table td:first-child { color: var(--cyan); font-family: var(--display); }
.ranking-table tbody tr:hover { background: rgba(77, 216, 255, 0.04); }
.ranking-table .empty { padding: 36px; text-align: center; color: var(--muted); }
.ranking-note { margin: 0; padding: 14px 18px; color: var(--muted); font-size: 11px; }

.credits { display: grid; grid-template-columns: 1fr 360px; gap: 32px; align-items: start; background: linear-gradient(180deg, rgba(8, 16, 30, 0.35), rgba(5, 7, 13, 0.92)); }
.credits-copy h2 { margin: 0; color: var(--cyan); font-family: var(--display); font-size: clamp(44px, 7vw, 96px); line-height: 0.9; }
.credits-copy p:last-child { max-width: 620px; color: #b9cedd; }
.credits-card { padding: 22px; border: 1px solid var(--line); background: rgba(8, 16, 30, 0.62); }
.credits-card ul { padding: 0; margin: 18px 0 0; list-style: none; }
.credits-card li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(112, 196, 224, 0.1); color: var(--muted); font-size: 11px; }
.credits-card li b { color: var(--text); font-weight: 600; text-align: right; }

.footer { display: flex; flex-wrap: wrap; gap: 14px 30px; justify-content: space-between; padding: 22px clamp(20px, 6vw, 92px); border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.footer strong { color: var(--cyan); }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(2, 5, 10, 0.8); backdrop-filter: blur(8px); }
.modal-backdrop[hidden] { display: none; }
.modal { position: relative; width: min(100%, 460px); padding: 30px; border: 1px solid rgba(77, 216, 255, 0.32); background: linear-gradient(180deg, #0b1729, #060b14); box-shadow: 0 30px 100px rgba(0, 0, 0, 0.65); }
.modal h2 { margin: 0; font-family: var(--display); font-size: 34px; }
.modal-copy { color: var(--muted); font-size: 13px; }
.modal-close { position: absolute; top: 12px; right: 14px; border: 0; background: transparent; color: var(--muted); font-size: 24px; cursor: pointer; }
.modal-close:hover { color: var(--text); }
.google-slot { min-height: 44px; margin: 18px 0 8px; }
.google-slot iframe { margin: 0 auto; }
.google-note { margin: 0 0 18px; color: var(--muted); font-size: 10px; }
.divider { display: flex; align-items: center; gap: 10px; margin: 20px 0 18px; color: var(--muted); font-size: 9px; letter-spacing: 0.16em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.field-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 9px; letter-spacing: 0.16em; }
.field { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid rgba(112, 196, 224, 0.24); background: rgba(4, 10, 20, 0.8); color: var(--text); outline: none; }
.field:focus { border-color: rgba(77, 216, 255, 0.7); }
.field-hint { margin: 7px 0 0; color: var(--muted); font-size: 10px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }
.modal-status { min-height: 18px; margin: 14px 0 0; color: var(--cyan); font-size: 11px; }
.modal-status.error { color: var(--red); }
.oauth-disabled { display: flex; align-items: center; justify-content: center; min-height: 42px; border: 1px dashed rgba(112, 196, 224, 0.22); color: var(--muted); font-size: 10px; letter-spacing: 0.1em; }

@media (max-width: 1100px) {
  .ship-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 70px; }
  .hero-card { justify-self: start; width: min(100%, 360px); }
  .hero-ship { height: 190px; }
}
@media (max-width: 760px) {
  .topbar { gap: 12px; padding: 12px 16px; }
  .nav { display: none; }
  .profile-button { margin-left: auto; }
  .hero { padding: 54px 18px 46px; }
  .hero h1 { font-size: clamp(52px, 16vw, 88px); }
  .section { padding: 56px 18px; }
  .section-head { display: block; }
  .section-note { margin-top: 14px; }
  .ship-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ship-card { min-height: 210px; }
  .ship-card img { height: 130px; }
  .mode-grid, .credits { grid-template-columns: 1fr; }
  .ranking-actions { margin-top: 16px; }
  .footer { padding: 18px; }
}
