@import url("https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;600;700&family=Orbitron:wght@500;700;800&display=swap");

:root {
  color-scheme: dark;
  --bg-deep: #020912;
  --bg-mid: #061724;
  --bg-surface: rgba(4, 17, 27, 0.76);
  --panel: rgba(6, 20, 31, 0.82);
  --panel-strong: rgba(5, 16, 25, 0.92);
  --panel-soft: rgba(10, 31, 45, 0.66);
  --panel-border: rgba(104, 244, 255, 0.2);
  --panel-border-strong: rgba(157, 248, 255, 0.38);
  --text: #f0fdff;
  --muted: #8cbfc7;
  --muted-strong: #b8ebef;
  --cyan: #72f6ff;
  --cyan-strong: #10d8ff;
  --cyan-deep: #3ea3b6;
  --cyan-soft: rgba(114, 246, 255, 0.12);
  --mint: #98ffd8;
  --ink: #04131d;
  --warning: #e7fdff;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(27, 181, 255, 0.2), transparent 30%),
    radial-gradient(circle at top right, rgba(114, 246, 255, 0.12), transparent 22%),
    linear-gradient(145deg, #01050c 0%, #03111c 35%, #020811 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Chakra Petch", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(12, 156, 213, 0.18), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(114, 246, 255, 0.12), transparent 22%),
    linear-gradient(160deg, rgba(2, 7, 12, 0.92), rgba(3, 14, 23, 0.94));
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background-image:
    linear-gradient(rgba(117, 245, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(117, 245, 255, 0.06) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at center, black 36%, transparent 92%);
}

body::after {
  background:
    radial-gradient(circle at 15% 18%, rgba(114, 246, 255, 0.12), transparent 18%),
    radial-gradient(circle at 85% 78%, rgba(114, 246, 255, 0.08), transparent 20%);
  filter: blur(18px);
}

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-content: start;
  min-height: 100vh;
  width: min(1720px, 100%);
  margin: 0 auto;
  padding: 20px 20px 40px;
}

.canvas-frame {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  border: 1px solid var(--panel-border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 24%),
    linear-gradient(160deg, rgba(6, 20, 31, 0.92), rgba(3, 12, 20, 0.88));
  box-shadow:
    var(--shadow),
    inset 0 0 56px rgba(72, 228, 255, 0.08);
  backdrop-filter: blur(22px);
}

.canvas-frame::before,
.brand-block::after,
.profile-card::after,
.tutorial-card::after,
.controls-card::after,
.leaderboard-card::after,
.admin-card::after,
.login-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 26%);
}

.canvas-frame::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 24px;
  pointer-events: none;
  border: 1px solid rgba(114, 246, 255, 0.12);
  box-shadow: inset 0 0 48px rgba(114, 246, 255, 0.06);
}

.stage-headline {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  padding: 8px 8px 0;
}

.stage-copy {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  text-align: right;
}

.hud-panel {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  align-content: start;
}

.support-strip {
  display: grid;
  gap: 14px;
}

.brand-block {
  grid-column: span 12;
  padding: 26px 24px 24px;
}

.profile-card {
  grid-column: span 4;
}

.tutorial-card {
  grid-column: span 5;
}

.controls-card {
  grid-column: span 3;
}

.leaderboard-card {
  grid-column: span 7;
}

.admin-card {
  grid-column: span 5;
}

.brand-block,
.profile-card,
.tutorial-card,
.controls-card,
.leaderboard-card,
.admin-card,
.login-card {
  position: relative;
  border-radius: 26px;
  border: 1px solid rgba(103, 242, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(15, 42, 56, 0.18), transparent 28%),
    var(--panel-strong);
}

.eyebrow,
.login-credit,
.profile-label,
.login-kicker,
.leaderboard-status,
.meta-chip,
.tutorial-status,
.signal-chip,
.tutorial-step-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(114, 246, 255, 0.2);
  background: rgba(114, 246, 255, 0.1);
  color: var(--cyan);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

h1,
h2,
.leaderboard-rank,
.discord-button,
.ghost-button,
.controls-card strong {
  font-family: "Orbitron", "Chakra Petch", sans-serif;
  text-transform: uppercase;
}

h1 {
  margin: 16px 0 0;
  font-size: clamp(3rem, 6vw, 4.9rem);
  line-height: 0.92;
  letter-spacing: 0.06em;
}

.wordmark,
.wordmark-inline {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
}

.wordmark-loop {
  color: var(--cyan);
  text-shadow:
    0 0 18px rgba(114, 246, 255, 0.32),
    0 0 36px rgba(16, 216, 255, 0.18);
}

.wordmark-raze {
  color: var(--cyan-deep);
  text-shadow:
    0 0 12px rgba(43, 140, 160, 0.18),
    0 0 28px rgba(5, 34, 40, 0.22);
}

#login-title .wordmark-inline {
  margin-left: 0.35em;
}

h2 {
  margin: 0;
  font-size: 1.18rem;
  letter-spacing: 0.08em;
}

.lede,
.profile-subtitle,
.login-copy,
.login-note,
.tutorial-phase,
.tutorial-tip {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.98rem;
}

.signal-row,
.profile-meta,
.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.signal-chip {
  background: rgba(114, 246, 255, 0.08);
  color: var(--muted-strong);
}

.profile-card,
.tutorial-card,
.controls-card,
.leaderboard-card {
  padding: 18px;
}

.profile-top {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
}

.profile-avatar {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(223, 255, 255, 0.3);
  background:
    radial-gradient(circle at 30% 20%, #f2ffff 0%, #72f6ff 45%, #127287 100%);
  color: var(--ink);
  font-family: "Orbitron", sans-serif;
  font-size: 1.65rem;
  box-shadow:
    0 0 26px rgba(114, 246, 255, 0.24),
    inset 0 0 12px rgba(255, 255, 255, 0.18);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-subtitle {
  margin-top: 8px;
}

.discord-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid rgba(114, 246, 255, 0.22);
  text-decoration: none;
  letter-spacing: 0.08em;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.discord-button {
  color: #031019;
  background:
    linear-gradient(135deg, #efffff 0%, #72f6ff 46%, #12ccf2 100%);
  box-shadow:
    0 12px 34px rgba(22, 193, 230, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

.ghost-button {
  color: var(--text);
  background: rgba(114, 246, 255, 0.08);
}

.discord-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
  border-color: rgba(184, 252, 255, 0.38);
}

.discord-button.large {
  width: 100%;
  min-height: 58px;
  font-size: 0.98rem;
}

.ghost-button.large {
  width: 100%;
  min-height: 58px;
}

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

.tutorial-phase {
  margin-top: 14px;
  color: var(--text);
  font-size: 1rem;
}

.tutorial-list {
  list-style: none;
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
  padding: 0;
}

.tutorial-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(114, 246, 255, 0.08);
  background: rgba(114, 246, 255, 0.04);
}

.tutorial-step strong,
.leaderboard-name {
  display: block;
  margin: 0;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 600;
}

.tutorial-step p,
.leaderboard-meta {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.88rem;
}

.tutorial-step.is-active {
  border-color: rgba(114, 246, 255, 0.24);
  background:
    linear-gradient(90deg, rgba(114, 246, 255, 0.12), rgba(114, 246, 255, 0.04));
  box-shadow: inset 0 0 24px rgba(114, 246, 255, 0.06);
}

.tutorial-step.is-completed {
  border-color: rgba(152, 255, 216, 0.22);
  background: rgba(152, 255, 216, 0.08);
}

.tutorial-step.is-completed .tutorial-step-state {
  color: var(--mint);
  border-color: rgba(152, 255, 216, 0.24);
  background: rgba(152, 255, 216, 0.12);
}

.tutorial-step.is-upcoming .tutorial-step-state {
  color: var(--muted);
  border-color: rgba(114, 246, 255, 0.12);
  background: rgba(114, 246, 255, 0.04);
}

.tutorial-tip {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(114, 246, 255, 0.08);
  background: rgba(114, 246, 255, 0.05);
}

.controls-card {
  display: grid;
  gap: 12px;
}

.controls-card p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(114, 246, 255, 0.08);
  color: var(--muted);
}

.controls-card p:last-of-type {
  padding-bottom: 0;
  border-bottom: none;
}

.controls-card strong {
  color: var(--cyan);
  font-size: 0.92rem;
}

.leaderboard-head {
  margin-bottom: 12px;
}

.leaderboard-status {
  align-self: center;
}

.leaderboard-list {
  list-style: none;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.leaderboard-seed {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.leaderboard-item,
.leaderboard-empty {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(114, 246, 255, 0.08);
  background:
    linear-gradient(90deg, rgba(114, 246, 255, 0.08), rgba(114, 246, 255, 0.03));
}

.leaderboard-empty {
  grid-template-columns: 1fr;
  color: var(--muted);
}

.leaderboard-rank {
  min-width: 38px;
  color: var(--cyan);
  font-size: 1.1rem;
}

.leaderboard-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(214, 255, 255, 0.28);
  background:
    radial-gradient(circle at 30% 20%, #f2ffff 0%, #72f6ff 45%, #127287 100%);
  color: var(--ink);
}

.leaderboard-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.leaderboard-time {
  text-align: right;
}

.leaderboard-time strong {
  display: block;
  color: var(--mint);
  font-size: 1.08rem;
}

.leaderboard-time span {
  color: var(--muted);
  font-size: 0.8rem;
}

.canvas-frame {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.game-stage {
  position: relative;
  width: min(100%, 1280px);
  aspect-ratio: 16 / 9;
  margin: 0 auto;
}

canvas {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 22px;
  background: #03111a;
  box-shadow:
    inset 0 0 40px rgba(114, 246, 255, 0.08),
    0 16px 50px rgba(0, 0, 0, 0.3);
}

.login-gate {
  display: grid;
  justify-items: center;
}

.login-gate.hidden {
  display: none;
}

.login-card {
  width: min(100%, 980px);
  padding: 28px 30px;
  border-radius: 30px;
  box-shadow:
    0 28px 72px rgba(0, 0, 0, 0.4),
    inset 0 0 64px rgba(114, 246, 255, 0.08);
}

.login-card h2 {
  font-size: clamp(2.1rem, 4.8vw, 3.4rem);
  line-height: 0.94;
  letter-spacing: 0.08em;
  color: var(--cyan);
  text-shadow: 0 0 24px rgba(114, 246, 255, 0.26);
}

.login-credit {
  margin-bottom: 16px;
}

.login-kicker {
  margin: 0 0 10px;
  color: var(--cyan);
}

.login-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.toast-line {
  width: min(100%, 980px);
  margin: 0 auto;
  min-height: 0;
  max-height: 0;
  padding: 0 16px;
  border-radius: 18px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--warning);
  line-height: 1.5;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-6px);
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    max-height 160ms ease,
    padding 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
  pointer-events: none;
}

.toast-line.visible {
  opacity: 1;
  max-height: 120px;
  padding: 14px 16px;
  border-color: rgba(114, 246, 255, 0.16);
  background: rgba(4, 17, 26, 0.92);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  transform: translateY(0);
}

.auth-locked .canvas-frame canvas {
  filter: saturate(0.92) brightness(0.9);
}

.hidden {
  display: none;
}

.admin-card {
  padding: 18px;
}

.admin-label,
.admin-list-title {
  margin: 16px 0 8px;
  color: var(--muted-strong);
  font-size: 0.88rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.admin-input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(114, 246, 255, 0.18);
  background: rgba(114, 246, 255, 0.06);
  color: var(--text);
  font: inherit;
}

.admin-input:focus {
  outline: 2px solid rgba(114, 246, 255, 0.34);
  outline-offset: 2px;
}

.admin-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.admin-action {
  width: 100%;
}

.admin-action.danger {
  color: #041018;
  background:
    linear-gradient(135deg, #fff0f0 0%, #ff9a9a 46%, #ff6262 100%);
  border-color: rgba(255, 120, 120, 0.34);
}

.admin-lists {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.admin-list-block {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(114, 246, 255, 0.08);
  background: rgba(114, 246, 255, 0.04);
}

.admin-list {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.admin-list li {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(114, 246, 255, 0.05);
}

@media (max-width: 1240px) {
  .profile-card,
  .tutorial-card,
  .controls-card,
  .leaderboard-card,
  .admin-card {
    grid-column: span 6;
  }

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

  .stage-copy {
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 14px;
    gap: 14px;
  }

  .canvas-frame {
    border-radius: 24px;
  }

  .hud-panel {
    grid-template-columns: 1fr;
  }

  .brand-block,
  .profile-card,
  .tutorial-card,
  .controls-card,
  .leaderboard-card,
  .admin-card,
  .login-card {
    border-radius: 20px;
  }

  .brand-block,
  .profile-card,
  .tutorial-card,
  .controls-card,
  .leaderboard-card,
  .admin-card {
    grid-column: auto;
  }

  .profile-actions,
  .signal-row {
    flex-direction: column;
  }

  .discord-button,
  .ghost-button {
    width: 100%;
  }

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

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

  .leaderboard-time {
    grid-column: 2;
    text-align: left;
  }

  .tutorial-step {
    grid-template-columns: 1fr;
  }

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