/* =============================================================================
   ShortcutSchool — Core styles
   Theme: deep navy/purple + neon cyan & lime accents
   ============================================================================= */

:root {
  /* Surfaces */
  --bg-deep: #070b14;
  --bg: #0b0f1a;
  --bg-elevated: #12182a;
  --bg-card: rgba(18, 24, 42, 0.72);
  --bg-card-solid: #141b2e;
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.22);

  /* Text */
  --text: #e8eefc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Accents */
  --cyan: #22d3ee;
  --cyan-dim: rgba(34, 211, 238, 0.15);
  --lime: #a3e635;
  --lime-dim: rgba(163, 230, 53, 0.15);
  --violet: #a78bfa;
  --violet-dim: rgba(167, 139, 250, 0.18);
  --pink: #f472b6;
  --danger: #f87171;
  --danger-dim: rgba(248, 113, 113, 0.15);
  --success: #4ade80;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #22d3ee 0%, #a78bfa 50%, #a3e635 100%);
  --grad-btn: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
  --grad-btn-hover: linear-gradient(135deg, #22d3ee 0%, #a78bfa 100%);
  --grad-glow: radial-gradient(ellipse at center, rgba(34, 211, 238, 0.25), transparent 70%);

  /* Effects */
  --shadow-glow-cyan: 0 0 24px rgba(34, 211, 238, 0.35);
  --shadow-glow-lime: 0 0 24px rgba(163, 230, 53, 0.3);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur: 0.25s;
  --dur-slow: 0.45s;

  /* Layout */
  --container: 1120px;
  --header-h: 72px;
  --font: "Outfit", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

/* ---------------------------------------------------------------------------
   Reset & base
   --------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-deep);
  overflow-x: hidden;
  position: relative;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--cyan); text-decoration: none; transition: color var(--dur) var(--ease-out); }
a:hover { color: var(--lime); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--cyan-dim);
  color: var(--cyan);
  padding: 0.15em 0.45em;
  border-radius: 6px;
}

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

/* ---------------------------------------------------------------------------
   Ambient background orbs
   --------------------------------------------------------------------------- */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: orb-float 18s ease-in-out infinite;
}

.orb-1 {
  width: 420px; height: 420px;
  background: #4f46e5;
  top: -10%; left: -5%;
}

.orb-2 {
  width: 360px; height: 360px;
  background: #0891b2;
  bottom: 5%; right: -8%;
  animation-delay: -6s;
}

.orb-3 {
  width: 280px; height: 280px;
  background: #7c3aed;
  top: 40%; left: 50%;
  opacity: 0.25;
  animation-delay: -12s;
}

@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ---------------------------------------------------------------------------
   Header
   --------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(7, 11, 20, 0.75);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.logo:hover { color: var(--text); }

.logo-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--grad-btn);
  box-shadow: var(--shadow-glow-cyan);
  font-size: 1.1rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.5rem 0.85rem;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  transition: color var(--dur), background var(--dur);
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0.25rem;
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--violet-dim);
  color: var(--violet);
  border: 1px solid rgba(167, 139, 250, 0.35);
}

.nav-name {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--dur) var(--ease-out), opacity var(--dur);
}

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition:
    transform var(--dur) var(--ease-bounce),
    box-shadow var(--dur) var(--ease-out),
    background var(--dur),
    border-color var(--dur),
    color var(--dur);
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--grad-btn);
  color: #fff;
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: var(--shadow-glow-cyan);
  background: var(--grad-btn-hover);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  transform: translateY(-2px) scale(1.03);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}

.btn-ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 0.95rem 1.75rem;
  font-size: 1.05rem;
}

.btn-block { width: 100%; }

.btn-icon {
  font-size: 1.15em;
  line-height: 1;
}

/* ---------------------------------------------------------------------------
   Splash / Hero
   --------------------------------------------------------------------------- */
.site-main { min-height: calc(100vh - var(--header-h) - 120px); }

.hero {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 5vw, 4rem);
  text-align: center;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-pill);
  background: var(--cyan-dim);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--cyan);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  animation: fade-up 0.6s var(--ease-out) both;
}

.hero-title {
  margin: 0 0 1rem;
  font-size: clamp(2.4rem, 6.5vw, 4.25rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  animation: fade-up 0.7s var(--ease-out) 0.05s both;
}

.hero-title .grad {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  margin: 0 auto 2.25rem;
  max-width: 36rem;
  color: var(--text-muted);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  animation: fade-up 0.7s var(--ease-out) 0.12s both;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
  animation: fade-up 0.7s var(--ease-out) 0.18s both;
}

/* Steps strip */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 3.5rem auto 0;
  max-width: 900px;
  animation: fade-up 0.8s var(--ease-out) 0.28s both;
}

.step {
  position: relative;
  padding: 1.35rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  transition: transform var(--dur) var(--ease-out), border-color var(--dur), box-shadow var(--dur);
}

.step:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(34, 211, 238, 0.1);
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 0.75rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--violet-dim);
  color: var(--violet);
  border: 1px solid rgba(167, 139, 250, 0.3);
}

.step h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.step p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.step-arrow {
  display: none;
}

/* Feature cards */
.features {
  padding: 2rem 0 4rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.feature-card {
  padding: 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  transition: transform var(--dur) var(--ease-out), border-color var(--dur), box-shadow var(--dur);
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: rgba(163, 230, 53, 0.3);
  box-shadow: var(--shadow-card);
}

.feature-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 1.4rem;
  margin-bottom: 1rem;
  background: var(--lime-dim);
  border: 1px solid rgba(163, 230, 53, 0.25);
}

.feature-card:nth-child(2) .feature-icon {
  background: var(--cyan-dim);
  border-color: rgba(34, 211, 238, 0.25);
}

.feature-card:nth-child(3) .feature-icon {
  background: var(--violet-dim);
  border-color: rgba(167, 139, 250, 0.25);
}

.feature-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.feature-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Profiles preview */
.profiles-section {
  padding: 1rem 0 5rem;
}

.section-head {
  text-align: center;
  margin-bottom: 2rem;
}

.section-head h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 3vw, 2rem);
  letter-spacing: -0.03em;
}

.section-head p {
  margin: 0;
  color: var(--text-muted);
}

.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.profile-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 1.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text);
  transition:
    transform var(--dur) var(--ease-bounce),
    border-color var(--dur),
    box-shadow var(--dur);
}

.profile-chip:hover {
  transform: translateY(-4px) scale(1.03);
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: var(--shadow-glow-cyan);
  color: var(--text);
}

.profile-chip .icon {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.3));
}

.profile-chip .name {
  font-weight: 650;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.profile-chip .meta {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ---------------------------------------------------------------------------
   Modal / Auth
   --------------------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 12, 0.72);
  backdrop-filter: blur(6px);
  animation: fade-in 0.25s var(--ease-out);
}

.modal-panel {
  position: relative;
  width: min(100%, 420px);
  padding: 2rem 1.75rem 1.75rem;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-strong);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(34, 211, 238, 0.08);
  animation: modal-pop 0.35s var(--ease-bounce);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.85rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.4rem;
  color: var(--text-muted);
  line-height: 1;
  transition: background var(--dur), color var(--dur);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.3rem;
  margin-bottom: 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
}

.auth-tab {
  padding: 0.55rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: background var(--dur), color var(--dur), box-shadow var(--dur);
}

.auth-tab.is-active {
  background: var(--grad-btn);
  color: #fff;
  box-shadow: 0 2px 12px rgba(6, 182, 212, 0.3);
}

.auth-title {
  margin: 0 0 0.35rem;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.auth-sub {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"] {
  width: 100%;
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  transition: border-color var(--dur), box-shadow var(--dur);
}

.field input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-dim);
}

.field-checkbox {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.65rem;
  font-weight: 400;
  color: var(--text-muted);
  cursor: pointer;
}

.field-checkbox input {
  margin-top: 0.2rem;
  accent-color: var(--cyan);
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.auth-hint {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
}

.alert {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.alert-error {
  background: var(--danger-dim);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: var(--danger);
}

.alert-success {
  background: var(--lime-dim);
  border: 1px solid rgba(163, 230, 53, 0.35);
  color: var(--success);
}

/* Flash banner on page */
.flash {
  width: min(100% - 2rem, var(--container));
  margin: 1rem auto 0;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  animation: fade-up 0.4s var(--ease-out);
}

.flash-error {
  background: var(--danger-dim);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: var(--danger);
}

.flash-success {
  background: var(--lime-dim);
  border: 1px solid rgba(163, 230, 53, 0.35);
  color: var(--success);
}

/* ---------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: auto;
  background: rgba(7, 11, 20, 0.6);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-weight: 650;
}

.footer-brand .logo-mark {
  width: 28px;
  height: 28px;
  font-size: 0.9rem;
  box-shadow: none;
}

.footer-copy, .footer-meta {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ---------------------------------------------------------------------------
   Animations
   --------------------------------------------------------------------------- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Keyboard preview strip (decorative on splash) */
.kb-preview {
  margin: 3rem auto 0;
  max-width: 640px;
  padding: 1rem 1.25rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  animation: fade-up 0.8s var(--ease-out) 0.35s both;
}

.kb-preview-row {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.kb-key {
  min-width: 42px;
  height: 42px;
  padding: 0 0.5rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 3px 0 #020617, inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.15s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.kb-key.is-active {
  color: #041016;
  background: linear-gradient(180deg, #67e8f9 0%, #22d3ee 100%);
  border-color: #a5f3fc;
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.55), 0 2px 0 #0891b2;
  animation: key-pulse 1.6s ease-in-out infinite;
}

.kb-key.is-mod {
  min-width: 56px;
  font-size: 0.65rem;
}

@keyframes key-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(34, 211, 238, 0.4), 0 2px 0 #0891b2; }
  50% { box-shadow: 0 0 28px rgba(34, 211, 238, 0.7), 0 2px 0 #0891b2; }
}

.kb-caption {
  margin: 0.85rem 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 720px) {
  .nav-toggle { display: flex; }

  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    padding: 1rem;
    background: rgba(7, 11, 20, 0.96);
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--dur-slow) var(--ease-out), opacity var(--dur);
  }

  .nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav .btn { width: 100%; }

  .nav-user { justify-content: center; margin: 0.5rem 0; }

  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }

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

  .kb-key { min-width: 34px; height: 36px; font-size: 0.65rem; }
  .kb-key.is-mod { min-width: 44px; }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* =============================================================================
   Practice page — wizard + arena
   ============================================================================= */

.practice {
  padding: 2rem 0 4rem;
}

.practice-container {
  max-width: 1100px;
}

.practice-head {
  text-align: center;
  margin-bottom: 2rem;
}

.practice-head h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  letter-spacing: -0.03em;
}

.practice-lead {
  margin: 0 0 1.75rem;
  color: var(--text-muted);
}

.wizard-progress {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
}

.wizard-progress li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: color var(--dur);
}

.wizard-progress li span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  transition: background var(--dur), border-color var(--dur), color var(--dur), box-shadow var(--dur);
}

.wizard-progress li.is-active {
  color: var(--text);
}

.wizard-progress li.is-active span {
  background: var(--grad-btn);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-glow-cyan);
}

.wizard-progress li.is-done {
  color: var(--cyan);
}

.wizard-progress li.is-done span {
  background: var(--cyan-dim);
  border-color: rgba(34, 211, 238, 0.35);
  color: var(--cyan);
}

.wizard-step {
  animation: fade-up 0.4s var(--ease-out);
}

.wizard-step-title {
  text-align: center;
  margin: 0 0 1.5rem;
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.choice-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.choice-grid-2 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 560px;
  margin-inline: auto;
}

.choice-grid-profiles {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.choice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 1.5rem 1rem;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  color: var(--text);
  cursor: pointer;
  transition:
    transform var(--dur) var(--ease-bounce),
    border-color var(--dur),
    box-shadow var(--dur),
    background var(--dur);
}

.choice-card:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.15);
}

.choice-card.is-selected {
  border-color: var(--cyan);
  background: rgba(34, 211, 238, 0.08);
  box-shadow: var(--shadow-glow-cyan);
  transform: translateY(-2px) scale(1.03);
}

.choice-icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.choice-icon.mono {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--cyan);
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: var(--cyan-dim);
  border: 1px solid rgba(34, 211, 238, 0.25);
}

.choice-label {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.choice-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.wizard-back {
  display: block;
  margin: 0.5rem auto 0;
}

/* Arena */
.practice-arena {
  animation: fade-up 0.45s var(--ease-out);
}

.arena-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
}

.arena-profile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.arena-profile-icon {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.35));
}

.arena-title {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.arena-meta {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.arena-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.seg-control {
  display: inline-flex;
  padding: 0.25rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  gap: 0.15rem;
}

.seg-btn {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: background var(--dur), color var(--dur), box-shadow var(--dur);
}

.seg-btn:hover {
  color: var(--text);
}

.seg-btn.is-active {
  background: var(--grad-btn);
  color: #fff;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.3);
}

.arena-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.arena-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  padding: 1.15rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  max-height: calc(100vh - var(--header-h) - 2rem);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.sidebar-head h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 22px;
  padding: 0 0.45rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--violet-dim);
  color: var(--violet);
  border: 1px solid rgba(167, 139, 250, 0.3);
}

.sidebar-hint {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.bind-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 211, 238, 0.3) transparent;
}

.bind-item {
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transition: border-color var(--dur), background var(--dur), transform var(--dur);
}

.bind-item:hover,
.bind-item:focus {
  outline: none;
  border-color: rgba(163, 230, 53, 0.45);
  background: rgba(163, 230, 53, 0.06);
  transform: translateX(2px);
}

.bind-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.bind-action {
  font-weight: 650;
  font-size: 0.88rem;
  letter-spacing: -0.01em;
}

.bind-diff {
  font-size: 0.55rem;
  letter-spacing: 1px;
  color: var(--violet);
  opacity: 0.8;
  white-space: nowrap;
}

.bind-combo {
  margin-top: 0.25rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--lime);
}

.bind-desc {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.bind-empty {
  padding: 1rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.sidebar-actions {
  margin-top: auto;
  padding-top: 0.5rem;
}

.btn-soon {
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.7;
  margin-left: 0.25rem;
}

.arena-main {
  min-width: 0;
}

.arena-status {
  margin-bottom: 0.85rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid rgba(34, 211, 238, 0.15);
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

.keyboard-root {
  width: 100%;
}

.practice-error {
  margin-top: 1.25rem;
}

/* =============================================================================
   Game HUD · prompt · countdown · combo · result
   ============================================================================= */

.game-root {
  margin-bottom: 1rem;
  position: relative;
}

.game-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
}

.game-stat {
  display: flex;
  flex-direction: column;
  min-width: 4.5rem;
}

.game-stat-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.game-stat-value {
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}

.game-score {
  color: var(--cyan);
  min-width: 3.5ch;
}

.game-stat-combo .game-stat-value {
  color: var(--lime);
  transition: transform 0.25s var(--ease-bounce), color 0.25s;
}

.game-stat-combo .game-stat-value.is-hot {
  color: #fbbf24;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.55);
}

.game-stat-combo .game-stat-value.is-reset {
  animation: combo-fade 0.4s var(--ease-out);
}

@keyframes combo-fade {
  0% { opacity: 1; transform: scale(1); }
  40% { opacity: 0.3; transform: scale(0.85); color: var(--danger); }
  100% { opacity: 1; transform: scale(1); }
}

.game-hud .btn {
  margin-left: auto;
}

.game-mute {
  margin-left: 0 !important;
}

.game-stage {
  position: relative;
  padding: 1.5rem 1.25rem 1.35rem;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(34, 211, 238, 0.08), transparent 60%),
    var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  overflow: hidden;
  min-height: 160px;
}

.game-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.game-prompt-wrap {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 36rem;
  margin: 0 auto;
  transition: transform 0.2s;
}

.game-prompt-wrap.is-shake {
  animation: prompt-shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.game-prompt-wrap.is-success .game-prompt {
  color: var(--success);
  text-shadow: 0 0 24px rgba(74, 222, 128, 0.45);
}

@keyframes prompt-shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-8px) rotate(-0.5deg); }
  30% { transform: translateX(8px) rotate(0.5deg); }
  45% { transform: translateX(-6px); }
  60% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
  90% { transform: translateX(3px); }
}

.game-prompt-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.game-prompt {
  margin: 0 0 0.4rem;
  font-size: clamp(1.45rem, 3.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  transition: color 0.25s, text-shadow 0.25s;
}

.game-prompt-hint {
  margin: 0 0 1.15rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  min-height: 1.3em;
}

/* Countdown bar */
.game-countdown {
  height: 8px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  overflow: hidden;
}

.game-countdown-bar {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(1);
  border-radius: inherit;
  background: linear-gradient(90deg, #22d3ee, #a78bfa, #a3e635);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.4);
  will-change: transform;
}

.game-countdown-bar.is-low {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.45);
}

.game-countdown-bar.is-critical {
  background: linear-gradient(90deg, #f87171, #ef4444);
  box-shadow: 0 0 14px rgba(248, 113, 113, 0.5);
}

/* Combo pop */
.game-combo-pop {
  position: absolute;
  top: 18%;
  left: 50%;
  z-index: 3;
  pointer-events: none;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fbbf24;
  text-shadow:
    0 0 20px rgba(251, 191, 36, 0.7),
    0 4px 0 rgba(0, 0, 0, 0.35);
  transform: translate(-50%, 0) scale(0.4);
  opacity: 0;
}

.game-combo-pop.is-pop {
  animation: combo-pop 0.85s var(--ease-bounce) forwards;
}

@keyframes combo-pop {
  0%   { opacity: 0; transform: translate(-50%, 12px) scale(0.4); }
  35%  { opacity: 1; transform: translate(-50%, 0) scale(1.2); }
  60%  { transform: translate(-50%, -4px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -28px) scale(0.9); }
}

/* Result overlay */
.game-result {
  position: relative;
  z-index: 4;
  padding: 0.5rem 0 0.25rem;
}

.game-result-card {
  text-align: center;
  padding: 1.75rem 1.5rem;
  background: var(--bg-card-solid);
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35), var(--shadow-glow-cyan);
  animation: modal-pop 0.4s var(--ease-bounce);
}

.game-result-title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.game-result-score {
  margin: 0 0 1.25rem;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.game-result-score strong {
  font-family: var(--mono);
  font-size: 1.6rem;
  color: var(--cyan);
}

.game-result-stats {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  max-width: 320px;
  margin-inline: auto;
}

.game-result-stats li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.75rem;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.game-result-stats strong {
  font-family: var(--mono);
  color: var(--text);
}

.game-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
}

/* Playing state tweaks */
.practice-arena.is-playing .bind-list {
  opacity: 0.55;
  pointer-events: none;
}

.practice-arena.is-playing .sidebar-hint {
  visibility: hidden;
}

body.game-active {
  /* prevent accidental text selection while mashing keys */
  user-select: none;
}

@media (max-width: 640px) {
  .game-hud {
    gap: 0.5rem;
  }

  .game-stat {
    min-width: 3.5rem;
  }

  .game-stat-value {
    font-size: 1.05rem;
  }

  .game-hud .btn {
    margin-left: 0;
  }

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

/* =============================================================================
   Dashboard
   ============================================================================= */

.dash {
  padding: 2rem 0 4rem;
}

.dash-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.dash-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
}

.dash-hero h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  letter-spacing: -0.03em;
}

.dash-sub {
  margin: 0;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.role-pill {
  display: inline-flex;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 650;
  background: var(--violet-dim);
  color: var(--violet);
  border: 1px solid rgba(167, 139, 250, 0.3);
}

.role-pill.role-superadmin {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}

.role-pill.role-client_admin {
  background: var(--cyan-dim);
  color: var(--cyan);
  border-color: rgba(34, 211, 238, 0.3);
}

.role-pill.role-guest_member {
  background: var(--lime-dim);
  color: var(--lime);
  border-color: rgba(163, 230, 53, 0.3);
}

.dash-company { color: var(--text-muted); }

.dash-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  padding: 1.15rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  transition: border-color var(--dur), transform var(--dur);
}

.stat-card:hover {
  border-color: rgba(34, 211, 238, 0.25);
  transform: translateY(-2px);
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}

.stat-value {
  font-family: var(--mono);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.accent-cyan { color: var(--cyan); }
.accent-lime { color: var(--lime); }
.accent-gold { color: #fbbf24; }

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  align-items: start;
}

.dash-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.3rem;
  margin-bottom: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  width: fit-content;
  max-width: 100%;
}

.dash-tab {
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: background var(--dur), color var(--dur), box-shadow var(--dur);
}

.dash-tab:hover { color: var(--text); }

.dash-tab.is-active {
  background: var(--grad-btn);
  color: #fff;
  box-shadow: 0 2px 12px rgba(6, 182, 212, 0.3);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: border-color var(--dur), color var(--dur), background var(--dur);
}

.chip:hover {
  color: var(--text);
  border-color: rgba(34, 211, 238, 0.35);
}

.chip.is-active {
  color: var(--cyan);
  border-color: rgba(34, 211, 238, 0.45);
  background: var(--cyan-dim);
}

.board-card,
.side-card {
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
}

.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.board-head h2,
.side-card h2 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.board-empty {
  margin: 0;
  padding: 1.5rem 0.5rem;
  text-align: center;
  color: var(--text-muted);
}

.table-wrap {
  overflow-x: auto;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
}

.board-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.board-table th {
  text-align: left;
  padding: 0.55rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.board-table td {
  padding: 0.7rem 0.65rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  vertical-align: middle;
}

.board-table tr:last-child td { border-bottom: none; }

.board-table tr.is-me {
  background: rgba(34, 211, 238, 0.06);
}

.board-table tr.is-me td:first-child {
  box-shadow: inset 3px 0 0 var(--cyan);
}

.board-table .num {
  font-family: var(--mono);
  font-weight: 600;
  white-space: nowrap;
}

.board-table .muted,
.muted { color: var(--text-dim); }

.board-table .rank {
  width: 2.5rem;
  font-weight: 700;
  color: var(--text-muted);
}

.cell-profile {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}

.you-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--cyan-dim);
  color: var(--cyan);
  vertical-align: middle;
}

.dash-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}

.side-text {
  margin: 0.55rem 0 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.side-meta {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
}

.share-row {
  display: flex;
  gap: 0.4rem;
}

.share-row input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 0.8rem;
  font-family: var(--mono);
}

.share-row input:focus {
  outline: none;
  border-color: var(--cyan);
}

.btn.is-copied {
  color: var(--success) !important;
  border-color: rgba(74, 222, 128, 0.4) !important;
}

.share-form { margin-top: 0.75rem; }

.recent-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.recent-list li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.6rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
}

.recent-icon { font-size: 1.15rem; line-height: 1; }

.recent-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.recent-body strong {
  font-size: 0.85rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--mono);
}

.recent-time {
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
}

/* Team join page */
.team-join {
  padding: 3rem 0 5rem;
  min-height: calc(100vh - var(--header-h) - 120px);
  display: flex;
  align-items: center;
}

.team-join-inner {
  max-width: 480px;
}

.team-join-card {
  padding: 2rem 1.75rem;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-strong);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(34, 211, 238, 0.08);
  animation: modal-pop 0.4s var(--ease-bounce);
}

.team-join-badge {
  display: inline-flex;
  padding: 0.3rem 0.75rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--lime-dim);
  color: var(--lime);
  border: 1px solid rgba(163, 230, 53, 0.3);
}

.team-join-card h1 {
  margin: 0 0 0.65rem;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.team-join-lead {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.team-join-form .btn { margin-top: 0.25rem; }

.team-join-card .alert { margin-top: 1rem; }

.team-join-card .btn + .btn { margin-left: 0.5rem; margin-top: 0.75rem; }

@media (max-width: 960px) {
  .dash-stats {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .dash-side {
    position: static;
  }
}

@media (max-width: 520px) {
  .dash-stats {
    grid-template-columns: 1fr;
  }

  .dash-hero-actions {
    width: 100%;
  }

  .dash-hero-actions .btn {
    flex: 1;
  }
}

/* =============================================================================
   Admin
   ============================================================================= */

.admin {
  padding: 2rem 0 4rem;
}

/* Admin top nav */
.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.35rem;
  padding: 0.35rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.admin-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: background var(--dur), color var(--dur), box-shadow var(--dur);
}

.admin-nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.admin-nav-link.is-active {
  color: #fff;
  background: var(--grad-btn);
  box-shadow: 0 2px 12px rgba(6, 182, 212, 0.25);
}

.admin-nav-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.admin-stats {
  grid-template-columns: repeat(5, 1fr);
}

.stat-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.stat-card-link:hover {
  color: inherit;
}

.stat-foot {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.admin-overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.admin-logs-card {
  grid-column: 1 / -1;
}

.log-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 320px;
  overflow-y: auto;
}

.log-feed li {
  display: grid;
  grid-template-columns: 5.5rem 10rem 1fr;
  gap: 0.65rem;
  align-items: baseline;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  font-size: 0.82rem;
}

.log-feed time {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.log-action {
  font-size: 0.72rem !important;
  color: var(--violet) !important;
  background: var(--violet-dim) !important;
}

.log-msg {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-filters {
  display: grid;
  grid-template-columns: 1fr 180px auto;
  gap: 0.85rem;
  align-items: end;
  margin-bottom: 1rem;
  padding: 1rem 1.15rem;
}

.admin-filters-actions {
  display: flex;
  gap: 0.4rem;
  padding-bottom: 0.15rem;
}

.input-sm {
  width: 100%;
  max-width: 220px;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 0.85rem;
}

select.input-sm {
  max-width: 160px;
  appearance: auto;
  padding-right: 0.55rem;
  background-image: none;
}

.inline-edit-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.is-superadmin-row {
  background: rgba(251, 191, 36, 0.06);
}

.token-code {
  font-size: 0.72rem;
  word-break: break-all;
}

@media (max-width: 1100px) {
  .admin-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .admin-overview-grid {
    grid-template-columns: 1fr;
  }

  .log-feed li {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

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

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

.admin-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-hero h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.6rem, 3vw, 2rem);
  letter-spacing: -0.03em;
}

.admin-lead {
  margin: 0;
  color: var(--text-muted);
  max-width: 36rem;
  font-size: 0.95rem;
}

.admin-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.admin-narrow {
  max-width: 640px;
}

.crumb {
  color: var(--cyan);
}

.crumb:hover { color: var(--lime); }

.admin-desc {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}

.inline-form {
  display: inline;
  margin: 0;
}

.status-pill {
  display: inline-flex;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 650;
}

.status-pill.is-on {
  background: var(--lime-dim);
  color: var(--success);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.status-pill.is-off {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.board-table tr.is-inactive {
  opacity: 0.55;
}

.btn-danger {
  color: var(--danger) !important;
}

.btn-danger:hover {
  background: var(--danger-dim) !important;
}

.admin-form-title {
  margin: 0 0 1.15rem;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.admin-form .field select,
.field select {
  width: 100%;
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  transition: border-color var(--dur), box-shadow var(--dur);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%2394a3b8'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.2rem;
}

.admin-form .field select:focus,
.field select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-dim);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.25rem;
}

.field-checkbox-block {
  align-items: center;
  margin-top: 1.5rem;
}

.optional {
  font-style: normal;
  font-weight: 400;
  color: var(--text-dim);
  font-size: 0.85em;
}

.admin-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.admin-keybind-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

/* Key capture zone */
.key-capture {
  margin: 1rem 0 0.5rem;
  padding: 1.15rem;
  border-radius: var(--radius);
  border: 2px dashed rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.04);
  cursor: pointer;
  outline: none;
  transition:
    border-color var(--dur),
    background var(--dur),
    box-shadow var(--dur);
}

.key-capture:hover,
.key-capture:focus {
  border-color: rgba(34, 211, 238, 0.65);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.12);
}

.key-capture.is-capturing {
  border-style: solid;
  border-color: var(--cyan);
  background: rgba(34, 211, 238, 0.08);
  box-shadow: var(--shadow-glow-cyan);
  animation: capture-pulse 1.6s ease-in-out infinite;
}

.key-capture.is-locked {
  border-style: solid;
  border-color: rgba(163, 230, 53, 0.55);
  background: rgba(163, 230, 53, 0.06);
  animation: none;
}

.key-capture.has-combo .key-capture-display {
  min-height: 2.5rem;
}

.key-capture.is-shake {
  animation: prompt-shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes capture-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(34, 211, 238, 0.2); }
  50% { box-shadow: 0 0 28px rgba(34, 211, 238, 0.4); }
}

.key-capture-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.key-capture-head strong {
  font-size: 0.95rem;
}

.key-capture-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.key-capture-display {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 3rem;
  padding: 0.75rem;
  margin-bottom: 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
}

.key-capture-placeholder {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.cap-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: #041016;
  background: linear-gradient(180deg, #67e8f9, #22d3ee);
  border: 1px solid #a5f3fc;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.4), 0 2px 0 #0891b2;
}

.cap-plus {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
}

.key-capture-codes {
  text-align: center;
  margin-bottom: 0.65rem;
}

.key-capture-codes code {
  font-size: 0.78rem;
  word-break: break-all;
}

.key-capture-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.key-capture-note {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.4;
}

.admin-bind-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.admin-bind-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
}

.admin-bind-main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.admin-bind-combo {
  font-size: 0.78rem;
  color: var(--lime);
  word-break: break-all;
}

.admin-bind-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.admin-bind-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .admin-keybind-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .arena-body {
    grid-template-columns: 1fr;
  }

  .arena-sidebar {
    position: static;
    max-height: 320px;
  }

  .choice-grid-2 {
    grid-template-columns: 1fr;
    max-width: 360px;
  }
}

@media (max-width: 640px) {
  .arena-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .arena-controls {
    justify-content: center;
  }

  .seg-btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
