/* ============================================================
   Tap Dap — main.css
   Estilos globais, tema cyber/neon, tela inicial
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Paleta neon cyber */
  --color-bg:          #0a0a0f;
  --color-bg-alt:      #0f0f1a;
  --color-surface:     #14141f;
  --color-border:      #1e1e2e;

  --color-primary:     #00f0ff;
  --color-secondary:   #bf00ff;
  --color-accent:      #ff0080;
  --color-success:     #00ff88;
  --color-danger:      #ff3030;
  --color-warning:     #ffcc00;

  --color-text:        #e0e0f0;
  --color-text-muted:  #4a4a6a;

  /* Tipografia */
  --font-display: 'Courier New', 'Lucida Console', monospace;
  --font-body:    'Courier New', monospace;

  /* Sombras neon */
  --glow-primary:   0 0 8px var(--color-primary),  0 0 20px var(--color-primary);
  --glow-secondary: 0 0 8px var(--color-secondary), 0 0 20px var(--color-secondary);
  --glow-success:   0 0 8px var(--color-success),   0 0 20px var(--color-success);
  --glow-danger:    0 0 8px var(--color-danger),    0 0 20px var(--color-danger);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
}

/* ── Screen (container de cada tela) ─────────────────────── */
.screen {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ── Scan lines decorativas ───────────────────────────────── */
.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.18) 3px,
    rgba(0, 0, 0, 0.18) 4px
  );
}

/* ── Tela inicial ─────────────────────────────────────────── */
.screen--home {
  gap: calc(var(--space-lg) + 2px);
  min-height: 100%;
  height: 100%;
  justify-content: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  padding: calc(var(--space-2xl) + var(--space-sm)) var(--space-md) calc(var(--space-2xl) + var(--space-xl));
  background:
    radial-gradient(ellipse at 50% 0%,   rgba(0, 240, 255, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(191, 0, 255, 0.06) 0%, transparent 60%),
    var(--color-bg);
}

.home__hero {
  position: relative;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--space-sm) + 2px);
  width: min(92vw, 520px);
}

.home__brand-logo {
  width: clamp(150px, 35vw, 300px);
  height: auto;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 0 16px rgba(0, 240, 255, 0.42)) drop-shadow(0 0 28px rgba(0, 240, 255, 0.24));
  opacity: 0.96;
}

/* ── Subtítulo ────────────────────────────────────────────── */
.home__subtitle {
  font-size: clamp(0.96rem, 3.2vw, 1.16rem);
  color: rgba(219, 229, 255, 0.82);
  letter-spacing: 0.06em;
  text-align: center;
  line-height: 1.65;
  text-shadow: 0 0 14px rgba(44, 123, 176, 0.14);
}

.home__control-panel {
  position: relative;
  z-index: 1;
  width: min(92vw, 430px);
  padding: clamp(14px, 3vw, 20px);
  border: 1px solid rgba(88, 124, 182, 0.24);
  border-radius: 12px;
  background:
    linear-gradient(160deg, rgba(10, 15, 26, 0.9), rgba(10, 10, 20, 0.88)),
    radial-gradient(circle at 50% 0%, rgba(0, 240, 255, 0.06), transparent 62%);
  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.38),
    inset 0 0 22px rgba(0, 218, 255, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

/* ── Ações ────────────────────────────────────────────────── */
  .home__actions {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--space-md) - 2px);
    width: 100%;
    padding-top: calc(var(--space-sm) + 2px);
    border-top: 1px solid rgba(114, 142, 196, 0.22);
  }

  .home__actions .btn--large {
    width: 100%;
    min-width: 0;
  }

  .home__hint-guest {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: rgba(160, 177, 214, 0.8);
    text-align: center;
    margin: 0;
    opacity: 0.95;
  }

  .home__challenge-hint {
    font-size: 0.68rem;
    letter-spacing: 0.10em;
    color: rgba(255, 226, 156, 0.96);
    text-transform: uppercase;
    margin-top: -2px;
    border: 1px solid rgba(255, 206, 112, 0.38);
    background: rgba(82, 54, 20, 0.34);
    border-radius: 6px;
    padding: 6px 8px;
    text-align: center;
    box-shadow: inset 0 0 10px rgba(255, 185, 96, 0.12);
  }

  .home__challenge-block {
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 10px 8px;
    border: 1px solid rgba(255, 176, 88, 0.38);
    border-radius: 10px;
    background:
      linear-gradient(150deg, rgba(56, 30, 12, 0.42), rgba(24, 16, 10, 0.24)),
      radial-gradient(circle at 50% 0%, rgba(255, 176, 88, 0.18), transparent 70%);
    box-shadow:
      inset 0 0 18px rgba(255, 163, 82, 0.08),
      0 0 20px rgba(255, 126, 52, 0.12);
  }

  .home__challenge-block::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 12px;
    right: 12px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 200, 128, 0.75), transparent);
  }

  .btn--one-life {
    color: #ffd27a;
    border-color: rgba(255, 210, 122, 0.78);
    background: linear-gradient(90deg, rgba(255, 120, 45, 0.12), rgba(255, 210, 122, 0.08));
    box-shadow: 0 0 16px rgba(255, 156, 66, 0.26);
  }

  .home__actions .btn--one-life.btn--ghost {
    position: relative;
    color: #ffe7b8;
    border-color: rgba(255, 198, 112, 0.86);
    background:
      linear-gradient(90deg, rgba(255, 126, 48, 0.22), rgba(255, 198, 112, 0.16));
    box-shadow:
      0 0 18px rgba(255, 156, 66, 0.38),
      inset 0 0 18px rgba(255, 173, 95, 0.12);
    animation: one-life-breathe 1.6s ease-in-out infinite;
  }

  .home__actions .btn--one-life.btn--ghost::before {
    content: '◆';
    margin-right: 8px;
    font-size: 0.78em;
    color: #ffd07f;
  }

  .btn--one-life:hover {
    color: #ffe7b5;
    border-color: #ffd27a;
    box-shadow: 0 0 22px rgba(255, 176, 84, 0.4);
  }

  .home__actions .btn--one-life.btn--ghost:hover {
    color: #fff3d2;
    border-color: #ffd896;
    box-shadow:
      0 0 24px rgba(255, 176, 84, 0.58),
      inset 0 0 24px rgba(255, 186, 114, 0.18);
  }

  .btn--one-life--active {
    color: #fff0cd;
    border-color: #ffd27a;
    background: linear-gradient(90deg, rgba(255, 120, 45, 0.2), rgba(255, 210, 122, 0.15));
    box-shadow: 0 0 24px rgba(255, 176, 84, 0.48);
  }

  .home__actions .btn--one-life--active.btn--ghost {
    animation-duration: 1.05s;
    box-shadow:
      0 0 28px rgba(255, 176, 84, 0.72),
      inset 0 0 24px rgba(255, 205, 132, 0.22);
  }

  @keyframes one-life-breathe {
    0%, 100% {
      transform: translateY(0);
      filter: brightness(1);
    }
    50% {
      transform: translateY(-1px);
      filter: brightness(1.08);
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .home__actions .btn--one-life.btn--ghost {
      animation: none;
    }
  }

  /* ── Seleção de dificuldade ───────────────────────────────── */
  .home__difficulty {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-md);
    z-index: 2;
    width: 100%;
  }

  .difficulty__label {
    font-size: 0.74rem;
    letter-spacing: 0.18em;
    color: rgba(156, 184, 232, 0.82);
    margin: 0;
    text-align: center;
  }

  .difficulty__options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-sm);
    width: 100%;
  }

  .btn--diff {
    padding: 8px 8px;
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    color: rgba(190, 202, 232, 0.86);
    background: rgba(10, 16, 34, 0.66);
    border-color: rgba(108, 143, 201, 0.3);
    width: 100%;
    min-width: 0;
    min-height: 48px;
    border-radius: 8px;
    transition: color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  }

  .btn--diff:hover {
    color: var(--color-primary);
    border-color: rgba(0, 240, 255, 0.78);
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.14);
  }

  .btn--diff--selected {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background: linear-gradient(180deg, rgba(0, 240, 255, 0.14), rgba(0, 240, 255, 0.06));
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.34), inset 0 0 18px rgba(0, 240, 255, 0.07);
  }

  .difficulty__current-hint {
    min-height: 1.2em;
    margin: 2px 0 0;
    text-align: center;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: rgba(165, 188, 228, 0.88);
  }

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

    .btn--diff {
      min-height: 52px;
      font-size: 0.8rem;
    }
  }

  /* ── Modal de autenticação ────────────────────────────────── */
  .auth-modal[hidden] { display: none; }

  .auth-modal {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 18, 0.80);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    padding: var(--space-md);
    opacity: 0;
    transition: opacity 0.2s;
  }

  .auth-modal--visible { opacity: 1; }

  .auth-modal__box {
    position: relative;
    width: 100%;
    max-width: 340px;
    background: rgba(12, 12, 30, 0.96);
    border: 1px solid rgba(191, 0, 255, 0.35);
    border-radius: 10px;
    box-shadow: 0 0 48px rgba(191, 0, 255, 0.15);
    padding: var(--space-xl) var(--space-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    text-align: center;
    animation: modalIn 0.22s ease;
  }

  @keyframes modalIn {
    from { transform: translateY(16px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0)    scale(1);    opacity: 1; }
  }

  .auth-modal__icon { font-size: 2rem; margin: 0; }

  .auth-modal__title {
    font-size: 1.1rem;
    letter-spacing: 0.15em;
    color: var(--color-secondary);
    text-shadow: 0 0 16px rgba(191, 0, 255, 0.6);
    margin: 0;
  }

  .auth-modal__body {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    line-height: 1.7;
    letter-spacing: 0.04em;
    margin: 0;
  }

  .auth-modal__actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
  }

  .auth-modal__skip {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    opacity: 0.7;
    margin-top: var(--space-xs);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s;
  }
  .auth-modal__skip:hover { opacity: 1; }

  .auth-modal__close {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    transition: color 0.15s;
  }
  .auth-modal__close:hover { color: var(--color-primary); }

.auth-modal__actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.auth-modal__skip {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  opacity: 0.7;
  margin-top: var(--space-xs);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}
.auth-modal__skip:hover { opacity: 1; }

.auth-modal__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(191, 0, 255, 0.32);
  background: rgba(26, 18, 44, 0.55);
  color: rgba(194, 152, 255, 0.86);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.1s;
}
.auth-modal__close:hover {
  color: #f4ddff;
  border-color: rgba(220, 148, 255, 0.62);
  background: rgba(58, 24, 78, 0.64);
}

/* ── Stat de dificuldade no Game Over ─────────────────────── */
.stat__value--diff--easy   { color: var(--color-success); }
.stat__value--diff--normal { color: var(--color-primary); }
.stat__value--diff--hard   { color: var(--color-danger);  }
.stat__value--diff--one-life {
  color: #ffd27a;
  text-shadow: 0 0 8px rgba(255, 191, 92, 0.75), 0 0 16px rgba(255, 125, 48, 0.45);
}

/* ── Botões ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  text-decoration: none;
  border: 2px solid currentColor;
  border-radius: 4px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:focus-visible,
.btn--link:focus-visible,
.auth__link:focus-visible,
.lb__name-btn:focus-visible {
  outline: 2px solid rgba(255, 214, 128, 0.95);
  outline-offset: 2px;
  border-radius: 6px;
}

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

.btn--primary {
  color: var(--color-primary);
  background: rgba(0, 240, 255, 0.06);
  box-shadow: var(--glow-primary), inset 0 0 20px rgba(0, 240, 255, 0.04);
}

.btn--primary:hover {
  background: rgba(0, 240, 255, 0.14);
  box-shadow: var(--glow-primary), inset 0 0 30px rgba(0, 240, 255, 0.08);
}

.btn--large {
  padding: var(--space-md) var(--space-2xl);
  font-size: clamp(1rem, 4vw, 1.3rem);
  min-width: 220px;
  min-height: 56px;    /* área de toque confortável no mobile */
}

.btn__label {
  position: relative;
}

/* ── Seletor de idioma (global) ───────────────────────────── */
.lang-switcher {
  position: absolute;
  top: var(--space-lg);
  left: var(--space-lg);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.lang-switcher__btn {
  color: var(--color-text-muted);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  transition: color 0.15s;
  white-space: nowrap;
}
.lang-switcher__btn:hover { color: var(--color-text); }
.lang-switcher__btn--active {
  color: var(--color-primary);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}
.lang-switcher__sep { color: var(--color-text-muted); }

/* alias home (compatibilidade) */
.home__lang-switcher { display: none; }

/* Nas telas com scroll (leaderboard, auth, profile, gameover)
   o seletor entra no fluxo em vez de sobrepor o conteúdo */
.screen--leaderboard .lang-switcher,
.screen--auth        .lang-switcher,
.screen--profile     .lang-switcher,
.screen--gameover    .lang-switcher {
  position: relative;
  top: auto;
  left: auto;
  justify-content: center;
  padding-bottom: var(--space-sm);
}

/* ── CTA Leaderboard ──────────────────────────────────────── */
.home__leaderboard-cta {
  position: relative;
  z-index: 1;
  width: min(92vw, 430px);
}

.home__leaderboard-btn {
  width: 100%;
  font-size: 0.86rem;
  letter-spacing: 0.10em;
}

/* ── Rodapé ───────────────────────────────────────────────── */
.home__footer {
  position: relative;
  z-index: 1;
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  margin-top: auto;
  padding-bottom: var(--space-sm);
}

/* ── Nav de usuário (home) ────────────────────────────────── */
.home__user-nav {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.btn--link {
  background: none;
  border: none;
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.10em;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
  transition: opacity 0.15s;
}
.btn--link:hover { opacity: 0.75; }

/* ── Botão full width ─────────────────────────────────────── */
.btn--full { width: 100%; }

/* ── Telas de Auth (login / registro) ────────────────────── */
.screen--auth {
  gap: 0;
  padding: var(--space-xl) var(--space-md);
  overflow-y: auto;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(0, 240, 255, 0.06) 0%, transparent 60%),
    var(--color-bg);
}

.auth__content {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

.auth__logo {
  display: flex;
  justify-content: center;
  width: 100%;
}

.auth__brand-logo {
  width: clamp(128px, 32vw, 210px);
  height: auto;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.34));
}

.glitch-logo--sm {
  font-size: clamp(1.2rem, 5vw, 1.6rem);
}

.auth__title {
  font-size: 1.1rem;
  letter-spacing: 0.22em;
  color: var(--color-primary);
  margin: 0;
}

.auth__error {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 48, 48, 0.12);
  border: 1px solid var(--color-danger);
  color: var(--color-danger);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  border-radius: 4px;
  margin: 0;
  text-align: center;
}

.auth__form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.form__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form__label {
  font-size: 0.70rem;
  letter-spacing: 0.18em;
  color: var(--color-text-muted);
}

.form__hint {
  font-size: 0.65rem;
  opacity: 0.7;
  text-transform: none;
  letter-spacing: 0;
}

.form__input {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 4px;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 0.95rem;
  padding: var(--space-sm) var(--space-md);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  box-sizing: border-box;
}

.form__input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.15);
}

.auth__switch {
  font-size: 0.80rem;
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
  margin: 0;
}

.auth__link {
  color: var(--color-primary);
  text-decoration: none;
}
.auth__link:hover { text-decoration: underline; }

/* ── Leaderboard ──────────────────────────────────────────── */
.screen--leaderboard {
  gap: 0;
  padding: var(--space-xl) var(--space-md);
  overflow-y: auto;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(191, 0, 255, 0.08) 0%, transparent 60%),
    var(--color-bg);
}

.leaderboard__content {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

.leaderboard__title {
  font-size: clamp(1.4rem, 6vw, 2rem);
  letter-spacing: 0.22em;
  color: var(--color-secondary);
  text-shadow: 0 0 24px rgba(191, 0, 255, 0.8);
  margin: 0;
}

.leaderboard__mode-tag {
  margin-top: calc(var(--space-sm) * -1);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  color: #ffd89a;
  text-transform: uppercase;
  padding: 3px 10px;
  border: 1px solid rgba(255, 203, 120, 0.45);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 120, 45, 0.08), rgba(255, 208, 132, 0.08));
}

.screen--leaderboard--one-life {
  background:
    radial-gradient(ellipse at 52% 0%, rgba(255, 130, 58, 0.14) 0%, transparent 58%),
    radial-gradient(ellipse at 50% 100%, rgba(255, 208, 120, 0.08) 0%, transparent 62%),
    var(--color-bg);
}

.screen--leaderboard--one-life .lb__panel {
  border-color: rgba(255, 194, 109, 0.34);
  box-shadow: 0 0 34px rgba(255, 161, 58, 0.1), inset 0 0 42px rgba(0, 0, 0, 0.22);
}

.leaderboard__item--one-life {
  border-left-color: rgba(255, 184, 92, 0.45);
}

.leaderboard__filter {
  display: flex;
  gap: var(--space-sm);
}

.leaderboard__empty {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-align: center;
  line-height: 1.8;
  padding: var(--space-xl) 0;
}

/* ── Painel ───────────────────────────────────────────────── */
.lb__panel {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(191, 0, 255, 0.25);
  border-radius: 8px;
  box-shadow: 0 0 32px rgba(191, 0, 255, 0.08), inset 0 0 40px rgba(0,0,0,0.2);
  overflow: hidden;
}

/* ── Cabeçalho de colunas ─────────────────────────────────── */
.lb__header {
  display: flex;
  align-items: center;
  padding: var(--space-xs) var(--space-md);
  background: rgba(191, 0, 255, 0.08);
  border-bottom: 1px solid rgba(191, 0, 255, 0.20);
  font-size: 0.70rem;
  letter-spacing: 0.18em;
  color: var(--color-text-muted);
}

/* ── Colunas (compartilhadas entre header e itens) ────────── */
.lb__col { display: flex; align-items: center; }
.lb__col--rank  { width: 44px;  flex-shrink: 0; }
.lb__col--name  { flex: 1;      gap: var(--space-xs); flex-wrap: wrap; }
.lb__col--score { width: 64px;  flex-shrink: 0; justify-content: flex-end; font-weight: 700; color: var(--color-primary); }
.lb__col--combo { width: 54px;  flex-shrink: 0; justify-content: flex-end; color: var(--color-text-muted); font-size: 0.80rem; }
.lb__col--time  { width: 50px;  flex-shrink: 0; justify-content: flex-end; color: var(--color-text-muted); font-size: 0.78rem; }

/* ── Lista ────────────────────────────────────────────────── */
.leaderboard__list {
  width: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.leaderboard__item {
  display: flex;
  align-items: center;
  gap: 0;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.88rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}
.leaderboard__item:last-child { border-bottom: none; }

.leaderboard__item--gold   { background: rgba(255, 204, 0, 0.05);  border-left: 3px solid var(--color-warning); }
.leaderboard__item--silver { background: rgba(180, 180, 210, 0.04); border-left: 3px solid rgba(180,180,210,0.5); }
.leaderboard__item--bronze { background: rgba(200, 130, 60, 0.04);  border-left: 3px solid rgba(200,130,60,0.5); }
.leaderboard__item--me     { background: rgba(0, 240, 255, 0.05); }

/* Cor do score para os tops */
.leaderboard__item--gold   .lb__col--score { color: var(--color-warning); }
.leaderboard__item--silver .lb__col--score { color: #b4b4d2; }
.leaderboard__item--bronze .lb__col--score { color: #c8824a; }

/* ── Medalha e rank ───────────────────────────────────────── */
.lb__medal { font-size: 1.1rem; line-height: 1; }
.lb__rank  { font-size: 0.75rem; color: var(--color-text-muted); }

/* ── Badge VOCÊ ───────────────────────────────────────────── */
.lb__badge--me {
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  border-radius: 3px;
  padding: 1px 4px;
  opacity: 0.85;
}

.lb__badge--revived {
  font-size: 0.72rem;
  opacity: 0.72;
  cursor: default;
  line-height: 1;
}

.leaderboard__actions {
  margin-top: var(--space-sm);
}

/* ── Utilitários ──────────────────────────────────────────── */
.text--muted {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  letter-spacing: 0.08em;
}

/* ── Ad slots (Google AdSense) ────────────────────────────── */
.ad-slot {
  position: relative;
  z-index: 2;
  width: min(100%, 420px);
  min-height: 90px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.22);
}

.ad-slot::before {
  content: 'ANUNCIO';
  position: absolute;
  top: -10px;
  left: 10px;
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  color: var(--color-text-muted);
  background: var(--color-bg);
  padding: 0 6px;
}

.ad-slot--home { margin-top: 4px; }
.ad-slot--leaderboard { margin-top: var(--space-sm); }
.ad-slot--gameover { margin-top: calc(var(--space-sm) * -1); }

.home__control-panel .ad-slot--home {
  width: 100%;
  margin-top: 2px;
}

/* ── Responsividade ───────────────────────────────────────── */
@media (max-width: 400px) {
  .btn--large {
    min-width: 180px;
    padding: var(--space-md) var(--space-xl);
  }
}


/* ── Tela de Game Over ────────────────────────────────────── */
.screen--gameover {
  justify-content: center;
  align-items: center;
  gap: var(--space-xl);
  padding: var(--space-xl) var(--space-md);
  overflow-y: auto;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 0, 128, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(191, 0, 255, 0.05) 0%, transparent 60%),
    var(--color-bg);
}

.screen--gameover--one-life {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 120, 48, 0.11) 0%, transparent 58%),
    radial-gradient(ellipse at 50% 100%, rgba(255, 205, 118, 0.08) 0%, transparent 62%),
    var(--color-bg);
}

.gameover__mode-tag {
  margin-top: calc(var(--space-sm) * -1);
  font-size: 0.66rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #ffd89a;
  padding: 2px 12px;
  border: 1px solid rgba(255, 208, 122, 0.44);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 120, 45, 0.1), rgba(255, 212, 136, 0.08));
}

.gameover__mode-tag--revived {
  color: #ff9090;
  border-color: rgba(255, 100, 80, 0.52);
  background: linear-gradient(90deg, rgba(255, 60, 40, 0.12), rgba(255, 130, 100, 0.07));
  box-shadow: 0 0 12px rgba(255, 60, 40, 0.18);
}

.gameover__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto;
  gap: var(--space-xl);
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.gameover__title {
  position: relative;
  font-size: clamp(2rem, 9vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  text-shadow: var(--glow-danger);
}

.gameover__title::before,
.gameover__title::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}

.gameover__title::before {
  color: var(--color-primary);
  opacity: 0.6;
  animation: glitch-before 4s infinite;
  clip-path: polygon(0 30%, 100% 30%, 100% 55%, 0 55%);
}

.gameover__title::after {
  color: var(--color-secondary);
  opacity: 0.5;
  animation: glitch-after 3.5s infinite;
  clip-path: polygon(0 65%, 100% 65%, 100% 85%, 0 85%);
}

.gameover__stats {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
}

.stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-surface);
}

.stat--highlight {
  border-color: var(--color-warning);
  background: rgba(255, 204, 0, 0.06);
}

.stat__label {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.stat__value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary);
  text-shadow: var(--glow-primary);
}

.stat__value--gold {
  color: var(--color-warning);
  text-shadow: 0 0 8px var(--color-warning);
}

.stat__value--muted {
  color: var(--color-text-muted);
  text-shadow: none;
}

.gameover__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
}

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

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

/* ── Tela de Perfil ───────────────────────────────────────── */
.screen--profile {
  gap: 0;
  padding: var(--space-xl) var(--space-md);
  overflow-y: auto;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(0, 240, 255, 0.06) 0%, transparent 60%),
    var(--color-bg);
}

.profile__content {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.profile__header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 8px;
  position: relative;
}

.profile__avatar {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0,240,255,0.15), rgba(191,0,255,0.15));
  border: 2px solid rgba(0, 240, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary);
  text-shadow: var(--glow-primary);
}

.profile__info { flex: 1; }

.profile__username {
  font-size: clamp(1rem, 4vw, 1.4rem);
  letter-spacing: 0.14em;
  color: var(--color-primary);
  text-shadow: var(--glow-primary);
  margin: 0 0 4px;
}

.profile__meta {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
  margin: 0;
}

.profile__bio {
  font-size: 0.80rem;
  color: var(--color-text-muted);
  margin: var(--space-xs) 0 0;
  line-height: 1.6;
}

.profile__back {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  font-size: 0.70rem;
}

.profile__empty {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  padding: var(--space-xl) 0;
}

.profile__bests {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.profile__best-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
  border-left: 3px solid rgba(255,255,255,0.1);
}

.profile__best-card--easy   { border-left-color: var(--color-success); }
.profile__best-card--normal { border-left-color: var(--color-primary); }
.profile__best-card--hard   { border-left-color: var(--color-danger); }
.profile__best-card--one-life { border-left-color: #ffb36f; }

.best-card__diff {
  width: 56px;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
}

.best-card__rank {
  font-size: 0.68rem;
  color: var(--color-text-muted);
  width: 70px;
}

.best-card__score {
  flex: 1;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
  text-shadow: var(--glow-primary);
}

.profile__best-card--easy   .best-card__score { color: var(--color-success); text-shadow: var(--glow-success); }
.profile__best-card--hard   .best-card__score { color: var(--color-danger);  text-shadow: var(--glow-danger);  }
.profile__best-card--one-life .best-card__score {
  color: #ffc77a;
  text-shadow: 0 0 8px rgba(255, 201, 127, 0.78), 0 0 18px rgba(255, 137, 53, 0.36);
}

.best-card__details {
  display: flex;
  gap: var(--space-md);
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

.profile__actions {
  display: flex;
  justify-content: center;
}

/* ── Modal de perfil (leaderboard) ───────────────────────── */
.lb__name-btn {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
  letter-spacing: inherit;
  transition: color 0.15s;
  text-align: left;
}
.lb__name-btn:hover { color: var(--color-primary); }

.profile-modal[hidden] { display: none; }

.profile-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 18, 0.82);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: var(--space-md);
  opacity: 0;
  transition: opacity 0.2s;
}

.profile-modal--visible { opacity: 1; }

.profile-modal__box {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: rgba(12, 12, 30, 0.97);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 10px;
  box-shadow: 0 0 48px rgba(0, 240, 255, 0.10);
  padding: var(--space-xl) var(--space-lg);
  animation: modalIn 0.22s ease;
}

.profile-modal__close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  transition: color 0.15s;
}
.profile-modal__close:hover { color: var(--color-primary); }

/* spinner */
.pmodal__loading {
  display: flex;
  justify-content: center;
  padding: var(--space-xl) 0;
}

.pmodal__spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(0,240,255,0.15);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.pmodal__body { display: flex; flex-direction: column; gap: var(--space-md); }

.pmodal__header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.pmodal__avatar {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0,240,255,0.15), rgba(191,0,255,0.15));
  border: 2px solid rgba(0, 240, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
}

.pmodal__username {
  font-size: 1rem;
  letter-spacing: 0.14em;
  color: var(--color-primary);
  margin: 0 0 2px;
}

.pmodal__meta {
  font-size: 0.68rem;
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
  margin: 0;
}

.pmodal__bests {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pmodal__card {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  background: rgba(255,255,255,0.02);
  border-radius: 4px;
  border-left: 2px solid rgba(255,255,255,0.1);
}

.pmodal__card--easy   { border-left-color: var(--color-success); }
.pmodal__card--normal { border-left-color: var(--color-primary); }
.pmodal__card--hard   { border-left-color: var(--color-danger);  }
.pmodal__card--one-life { border-left-color: #ffb36f; }

.pmodal__card-diff   { font-size: 0.65rem; color: var(--color-text-muted); width: 46px; letter-spacing: 0.08em; }
.pmodal__card-rank   { font-size: 0.65rem; color: var(--color-text-muted); width: 40px; }
.pmodal__card-score  { flex: 1; font-weight: 700; font-size: 1rem; color: var(--color-primary); }
.pmodal__card--easy  .pmodal__card-score { color: var(--color-success); }
.pmodal__card--hard  .pmodal__card-score { color: var(--color-danger);  }
.pmodal__card--one-life .pmodal__card-score { color: #ffc77a; }
.pmodal__card-detail { font-size: 0.65rem; color: var(--color-text-muted); }

.pmodal__empty {
  text-align: center;
  font-size: 0.80rem;
  color: var(--color-text-muted);
  padding: var(--space-md) 0;
}

.pmodal__actions { margin-top: var(--space-xs); }

/* ── Transição de página (overlay) ───────────────────────── */
#page-transition {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
}

#page-transition.page-transition--in {
  animation: pt-fade-in 0.3s ease forwards;
}

#page-transition.page-transition--out {
  animation: pt-fade-out 0.35s ease forwards;
}

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


