* { margin:0; padding:0; box-sizing:border-box; }

:root {
  /* ─── Cor — paleta semântica ─── */
  --bg: #12002a;
  --tile: #1e0a3a;
  --accent: #ff5dc8;
  --accent-2: #c43bff;
  --danger: #ff3355;
  --green: #7effb2;
  --star: #ffd700;
  --warn: #ffaa44;
  --info: #88ccff;
  --shadow: rgba(255, 93, 200, 0.35);

  /* Texto — escala semântica de opacidades */
  --ink-1: #ffffff;
  --ink-2: rgba(255,255,255,0.78);
  --ink-3: rgba(255,255,255,0.55);
  --ink-4: rgba(255,255,255,0.32);

  /* ─── Spacing — escala de 4px ─── */
  --sp-0: 4px;   --sp-1: 8px;   --sp-2: 12px;
  --sp-3: 16px;  --sp-4: 20px;  --sp-5: 24px;
  --sp-6: 32px;  --sp-7: 40px;  --sp-8: 56px;

  /* ─── Border radius ─── */
  --r-xs: 6px; --r-sm: 10px; --r-md: 14px;
  --r-lg: 18px; --r-xl: 24px; --r-pill: 999px;

  /* ─── Sombras em camadas (Material elevation) ─── */
  --el-1: 0 1px 2px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.04) inset;
  --el-2: 0 4px 10px rgba(0,0,0,0.28), 0 1px 2px rgba(0,0,0,0.22), 0 0 0 1px rgba(255,255,255,0.05) inset;
  --el-3: 0 10px 28px rgba(0,0,0,0.42), 0 4px 8px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.06) inset;
  --el-4: 0 18px 44px rgba(0,0,0,0.5), 0 8px 16px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.07) inset;
  --el-glow: 0 0 24px var(--shadow);

  /* ─── Easing curves ─── */
  --ease-out:    cubic-bezier(.16,1,.3,1);
  --ease-in:     cubic-bezier(.7,0,.84,0);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --ease-std:    cubic-bezier(.4,0,.2,1);

  /* ─── Tipografia ─── */
  --type-display: 'Fredoka One', system-ui, sans-serif;
  --type-body:    'Inter', 'Nunito', system-ui, sans-serif;
  --t-xs:  0.72rem;  --t-sm:  0.85rem;  --t-md:  1rem;
  --t-lg:  1.2rem;   --t-xl:  1.5rem;   --t-2xl: 2rem;
  --t-3xl: 2.8rem;
}

/* ANTI-LAG MOBILE + acessibilidade */
button, .skin-card, .level-card, .profile-card, .ctrl-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Focus rings discretos mas visíveis (apenas para teclado) */
:focus { outline: none; }
button:focus-visible,
.skin-card:focus-visible,
.level-card:focus-visible,
.profile-card:focus-visible,
.light-slot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(255,93,200,0.25);
  border-radius: inherit;
}

/* Respeita preferência de reduzir movimento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

html, body {
  width:100%; height:100%; background: var(--bg);
  font-family: var(--type-body); color: var(--ink-1);
  font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden auto;
  transition: background 1s var(--ease-std);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  font-feature-settings: "kern" 1, "liga" 1, "ss01" 1, "cv01" 1;
  font-variation-settings: "wght" 500;
}
/* Pesos contextuais — display heavy nos botões/títulos, regular em descrições */
.btn, .btn-sm, .btn-md { font-variation-settings: "wght" 700; }
.section-title         { font-variation-settings: "wght" 800; }
.subtitle, .achiev-desc, .skin-cost, .stat-label { font-variation-settings: "wght" 500; }
.profile-name, .achiev-title, .stat-value { font-variation-settings: "wght" 700; }
.hud-moves, .hud-timer { font-variation-settings: "wght" 700; font-feature-settings: "tnum" 1; }
.stars-bank            { font-variation-settings: "wght" 600; font-feature-settings: "tnum" 1; }
/* Números tabulares no painel de stats — alinha colunas naturais */
.stats-grid .stat-value { font-feature-settings: "tnum" 1, "ss01" 1; }
::selection { background: var(--accent); color: #1a0033; }

/* Scrollbar custom — fina, na cor do tema */
* { scrollbar-width: thin; scrollbar-color: var(--accent) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); border-radius: 8px; }
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 8px; border: 2px solid transparent; background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Imagens nativas (emojis) renderizam mais nítido */
canvas { image-rendering: -webkit-optimize-contrast; image-rendering: crisp-edges; }

/* Botões com tipografia legível mesmo em emojis */
button { font-family: var(--type-body); }
.btn, .btn-sm, .btn-md { font-family: var(--type-display); }

body::before {
  content:''; position:fixed; inset:0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, var(--shadow) 0%, transparent 50%),
    radial-gradient(circle at 50% 100%, rgba(255,255,255,0.04) 0%, transparent 60%);
  pointer-events:none; transition: all 1s ease;
}
body::after {
  content:''; position:fixed; inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,0.18) 0%, transparent 30%, transparent 70%, rgba(0,0,0,0.25) 100%);
  pointer-events:none;
}

.screen {
  display:none; flex-direction:column; align-items:center; gap:14px;
  animation: fadeUp 0.3s ease both; padding: 14px; width: 100%; max-width: 460px; z-index: 10;
}
/* Botões finais nunca encolhem mesmo dentro de screens com overflow */
.screen > button.btn,
.screen > button.btn-sm { flex-shrink: 0; }

/* ── LAYOUT DESKTOP (≥ 900px) ── */
/* Aproveita o ecrã do PC: telas mais largas, canvas maior, padding folgado. */
@media (min-width: 900px) {
  .screen { max-width: 920px; padding: 24px; gap: 18px; }
  .game-title { font-size: 4.2rem; }
  .subtitle { max-width: 480px; font-size: 1rem; }

  /* Game screen em duas colunas: canvas grande à esquerda, controles à direita */
  #game-screen { display: none; max-width: 600px; }
  #game-screen.active {
    display: flex; flex-direction: column;
    align-items: center; justify-content: flex-start;
    gap: 14px; padding: 18px 14px;
  }
  #game-screen .hud         { width: 100%; max-width: 480px; }
  #game-screen #game-canvas { max-width: 460px !important; max-height: 460px !important; }
  #game-screen .gadget-bar  { margin-top: 4px; max-width: 480px; }
  #game-screen .ingame-shop { max-width: 480px; width: 100%; }
  #game-screen .btn-row     { flex-wrap: wrap; }

  /* Mapa de níveis em 10 colunas (1 por mundo), ocupa toda a largura */
  .level-grid { grid-template-columns: repeat(10, 1fr); max-height: none; gap: 10px; }
  .level-card { aspect-ratio: 1; }

  /* Loja com cards maiores */
  .skin-grid { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 14px; }
  .skin-card { height: 110px; font-size: 0.85rem; }

  /* Conquistas mais espaçadas */
  #achievements-list .achiev-card { padding: 16px 18px; }

  /* Painel de luzes maior */
  .lights-panel { max-width: 720px; }

  /* Tela de revelação do boss em duas colunas: canvas à esquerda, info à direita.
     A info é uma sub-grelha vertical para evitar sobreposições. */
  #boss-reveal-screen.active {
    display: grid;
    grid-template-columns: 220px minmax(280px, 460px);
    gap: 28px;
    align-items: center; justify-items: center;
    max-width: 760px; padding: 24px;
  }
  #boss-reveal-screen .boss-reveal-tag {
    grid-column: 1 / -1; justify-self: center; margin-top: 0;
  }
  #boss-reveal-screen #boss-reveal-canvas {
    grid-column: 1; justify-self: center;
  }
  #boss-reveal-screen .boss-reveal-name,
  #boss-reveal-screen .boss-reveal-title,
  #boss-reveal-screen .boss-reveal-desc,
  #boss-reveal-screen .boss-reveal-tip {
    grid-column: 2; justify-self: start; text-align: left; width: 100%; max-width: 460px;
  }
  #boss-reveal-screen .boss-reveal-name  { font-size: 2.4rem; line-height: 1.05; }
  #boss-reveal-screen .boss-reveal-title { margin-top: 4px; }
  #boss-reveal-screen .boss-reveal-desc  { margin-top: 10px; }
  #boss-reveal-screen .boss-reveal-tip   { margin-top: 6px; }
  #boss-reveal-screen .btn-row {
    grid-column: 1 / -1; justify-self: center; margin-top: 8px;
  }
}

/* Em PC, esconde o ctrl-pad por defeito (jogador usa teclado), mas mantém disponível */
@media (min-width: 900px) and (hover: hover) {
  .ctrl-pad { opacity: 0.65; }
  .ctrl-pad:hover { opacity: 1; }
}
.screen.active { display:flex; }

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

/* UI TOP & TITLES */
.top-bar { position: absolute; top: 15px; left: 15px; right: 15px; display: flex; justify-content: space-between; z-index: 20; }
.action-btn {
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%; width: 42px; height: 42px;
  font-size: 1.25rem; cursor: pointer;
  filter: grayscale(1) opacity(0.8);
  transition: filter 220ms, background 220ms, transform 220ms var(--ease-spring), border-color 220ms;
  color: white;
}
.action-btn:hover { transform: translateY(-1px); filter: grayscale(0.5) opacity(1); }
.action-btn.on  {
  filter: grayscale(0); background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: rgba(255,255,255,0.3); box-shadow: 0 0 18px var(--shadow);
}
.stars-bank {
  background: linear-gradient(135deg, rgba(0,0,0,0.55), rgba(40,0,80,0.45));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 8px 18px; border-radius: var(--r-pill);
  font-family: var(--type-display); color: var(--star); font-size: 1.15rem;
  border: 1px solid rgba(255,215,0,0.25);
  box-shadow: var(--el-2);
}

.title-blob { width:90px; height:90px; font-size: 4rem; text-align:center; line-height:90px; animation: blobBounce 2.2s ease-in-out infinite; margin-top: 30px; position: relative;}
@keyframes blobBounce { 0%,100% { transform: scaleX(1.12) scaleY(0.88) translateY(0); } 50% { transform: scaleX(0.9) scaleY(1.12) translateY(-18px); } }
.game-title {
  font-family: var(--type-display);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  background: linear-gradient(135deg, var(--accent), #fff 60%, var(--accent-2));
  background-size: 200% auto;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 18px var(--shadow));
  text-align: center; line-height: 1.05; letter-spacing: -0.5px;
  animation: titleShine 8s linear infinite;
}
@keyframes titleShine {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.subtitle {
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  color: var(--ink-2); text-align: center; max-width: 320px;
  line-height: 1.5; letter-spacing: 0.1px;
}

/* PERFIS */
.profiles-list { width: 100%; display: flex; flex-direction: column; gap: 10px; margin: 15px 0; max-height: 40vh; overflow-y: auto; }
.profile-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-md); padding: var(--sp-3);
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; box-shadow: var(--el-2);
  transition: transform 200ms var(--ease-out), border-color 200ms, box-shadow 200ms;
}
.profile-card:hover {
  border-color: var(--accent);
  box-shadow: var(--el-3), 0 0 24px var(--shadow);
  transform: translateY(-2px);
}
.profile-info { display: flex; flex-direction: column; flex-grow: 1; gap: 3px; }
.profile-row  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-name { font-family: 'Fredoka One', cursive; font-size: 1.2rem; color: #fff; }
.profile-title {
  font-family: 'Fredoka One', cursive; font-size: 0.7rem; padding: 2px 8px;
  border-radius: 12px; border: 1px solid; letter-spacing: 1px;
}
.profile-stats { font-size: 0.78rem; color: var(--star); letter-spacing: 0.4px; }
.profile-actions { display: flex; gap: 6px; align-items: center; margin-left: 8px; }
.profile-edit, .profile-delete {
  border: none; color: white; border-radius: 8px; padding: 6px 10px;
  cursor: pointer; font-weight: bold; font-size: 0.95rem;
  transition: filter 0.15s, transform 0.15s;
}
.profile-edit   { background: rgba(255,255,255,0.12); }
.profile-edit:hover { background: var(--accent); filter: brightness(1.1); }
.profile-reset  { background: rgba(255,200,80,0.18); border: 1px solid #ffcc55; }
.profile-reset:hover { background: rgba(255,200,80,0.32); }
.profile-delete { background: var(--danger); }
.profile-delete:hover { filter: brightness(1.1); transform: scale(1.05); }

/* BOTÕES */
.btn {
  padding: 12px 30px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  background-size: 200% 100%;
  border: none; border-radius: var(--r-pill);
  font-family: var(--type-display); font-size: 1.05rem;
  color: #fff; cursor: pointer;
  letter-spacing: 0.4px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.4), 0 12px 28px rgba(0,0,0,0.35), 0 0 22px var(--shadow);
  transition:
    transform 200ms var(--ease-spring),
    box-shadow 200ms var(--ease-out),
    filter 180ms,
    background-position 600ms var(--ease-out);
  margin: 3px; position: relative; overflow: hidden;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.22), transparent 55%);
  pointer-events: none;
}
.btn::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 35%;
  background: linear-gradient(0deg, rgba(0,0,0,0.18), transparent);
  pointer-events: none;
}
.btn:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  background-position: 100% 0;
  box-shadow: 0 8px 0 rgba(0,0,0,0.4), 0 18px 36px rgba(0,0,0,0.4), 0 0 32px var(--shadow);
}
.btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.4), 0 4px 10px rgba(0,0,0,0.3);
  filter: brightness(0.95);
}
.btn-sm {
  padding: 10px 20px; font-size: 0.95rem;
  min-width: 130px; min-height: 44px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.4); border: 2px solid transparent;
  white-space: nowrap; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
@media (min-width: 900px) {
  .btn-sm { min-width: 150px; padding: 11px 22px; font-size: 1rem; }
}
/* Garantir que botões nunca encolhem dentro de containers com overflow */
.btn, .btn-sm, .btn-md { flex-shrink: 0; }
.btn-ghost {
  background: rgba(255,255,255,0.1); box-shadow: 0 5px 0 rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.15);
}
.btn-ghost:hover { background: rgba(255,255,255,0.18); }
.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* CONQUISTAS & LOJA */
.achiev-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(0,0,0,0.3));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-md); padding: 14px; display: flex; align-items: center; gap: 15px;
  transition: opacity 320ms var(--ease-out), filter 320ms, border-color 320ms, box-shadow 320ms;
  opacity: 0.7; filter: grayscale(0.7);
  box-shadow: var(--el-1);
}
.achiev-card.unlocked { border-color: var(--star); opacity: 1; filter: grayscale(0); background: rgba(255,215,0,0.1); }
.achiev-card.claimable { border-color: var(--green); opacity: 1; filter: grayscale(0); background: rgba(126,255,178,0.2); cursor: pointer; animation: pulseGlow 1.5s infinite; }
@keyframes pulseGlow { 0% { box-shadow: 0 0 5px var(--green); } 50% { box-shadow: 0 0 15px var(--green); } 100% { box-shadow: 0 0 5px var(--green); } }
.achiev-title { font-family: 'Fredoka One', cursive; font-size: 1.1rem; color: #fff; }
.achiev-desc { font-size: 0.8rem; color: #ccc; }
.achiev-reward { font-weight: bold; color: var(--green); font-size: 0.85rem; background: rgba(0,0,0,0.5); padding: 4px 8px; border-radius: 8px; white-space: nowrap; }

.section-title {
  font-family: var(--type-display);
  font-size: clamp(1.6rem, 4vw, 2rem);
  color: var(--accent);
  text-shadow: 0 0 18px var(--shadow);
  margin-top: var(--sp-4); text-align: center;
  letter-spacing: -0.3px; line-height: 1.1;
}
.shop-section { width: 100%; text-align: left; font-weight: bold; border-bottom: 2px solid rgba(255,255,255,0.1); padding-bottom: 5px; margin-top: 10px; }

.skin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 10px; width: 100%; }
.skin-card {
  height: 85px;
  background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(0,0,0,0.25));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: var(--r-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; border: 2px solid rgba(255,255,255,0.06);
  box-shadow: var(--el-1);
  transition: transform 180ms var(--ease-out), border-color 180ms, box-shadow 180ms, background 200ms;
  position: relative; gap: 5px; font-size: 0.78rem; font-weight: 700; text-align: center;
}
.skin-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--el-2); }
.skin-card.selected { border-color: var(--green); background: linear-gradient(135deg, rgba(126,255,178,0.18), rgba(126,255,178,0.04)); box-shadow: 0 0 20px rgba(126,255,178,0.3), var(--el-2); }
.skin-card.locked { opacity: 0.55; filter: grayscale(0.8); }
.skin-cost { color: var(--star); font-size: 0.75rem; }
.gadget-qt { color: var(--green); font-size: 0.75rem; }

.level-grid { display:grid; grid-template-columns: repeat(5, 1fr); gap:8px; width:100%; max-height: 55vh; overflow-y: auto; padding: 10px; }
.level-grid::-webkit-scrollbar { width: 6px; } .level-grid::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 10px; }
.level-card {
  aspect-ratio: 1;
  background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(0,0,0,0.3));
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-radius: var(--r-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; border: 1.5px solid rgba(255,255,255,0.08);
  box-shadow: var(--el-1);
  transition: transform 180ms var(--ease-out), border-color 180ms, box-shadow 180ms;
  position: relative;
}
.level-card:hover:not(.locked) { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--el-2), 0 0 14px var(--shadow); }
.level-card.locked { opacity:0.3; cursor:not-allowed; }
.level-card.boss { background: rgba(255,0,68,0.2); border: 1px solid var(--danger); }
.level-card.miniboss { background: rgba(255,140,0,0.18); border: 1px solid #ff8c00; }
.level-card.bonus    { background: rgba(255,215,0,0.2); border: 1px solid var(--star); }
.level-card.keylevel { background: rgba(255,200,80,0.18); border: 1px solid #ffcc55;
  box-shadow: 0 0 12px rgba(255,200,80,0.35) inset; }
.card-num { font-family:'Fredoka One',cursive; font-size:1.2rem; }
.card-stars { font-size:0.6rem; letter-spacing:1px; color: var(--star); }

/* HUD & GAME — layout vertical com estrelas em destaque no topo */
.hud {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 100%; padding: 0 8px;
}
.hud-line {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; gap: 10px;
}
.hud-side { display: flex; gap: 10px; align-items: center; }
.hud-level {
  font-family: 'Fredoka One', cursive; font-size: 1.5rem;
  background: linear-gradient(135deg, var(--accent), #fff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 6px var(--shadow));
  letter-spacing: 0.3px; line-height: 1.1;
}
.hud-timer {
  font-size: 1rem; color: #ff8888; font-weight: 800; display: none;
  background: rgba(80,0,0,0.4); padding: 4px 12px; border-radius: 14px;
  border: 1px solid rgba(255,80,80,0.4);
}
.hud-moves {
  font-size: 0.95rem; font-weight: 800; opacity: 0.92; letter-spacing: 0.5px;
  background: rgba(0,0,0,0.4); padding: 5px 14px; border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
}
.hud-stars {
  font-size: 2.4rem; letter-spacing: 8px; color: var(--star);
  text-shadow: 0 0 18px rgba(255,215,0,0.65), 0 4px 8px rgba(0,0,0,0.55);
  line-height: 1;
}
@media (min-width: 900px) {
  .hud-stars { font-size: 2.8rem; letter-spacing: 12px; }
  .hud-level { font-size: 1.8rem; }
}

/* ── BOTÕES MÉDIOS DA TELA DE FASE ── */
.btn-md {
  padding: 11px 20px; font-size: 1.0rem; min-width: 130px;
  box-shadow: 0 5px 0 rgba(0,0,0,0.4); border: 2px solid transparent;
  white-space: nowrap;
}
.btn-row-game { gap: 12px; margin-top: 6px; }
@media (min-width: 900px) {
  .btn-md { min-width: 150px; padding: 12px 22px; font-size: 1.05rem; }
}

#game-canvas {
  border-radius: 16px; display: block;
  max-width: clamp(280px, 78vmin, 440px);
  max-height: clamp(280px, 78vmin, 440px);
  width: 100%; height: auto;
  box-shadow:
    0 18px 48px rgba(0,0,0,0.55),
    0 0 0 1px rgba(255,255,255,0.08) inset,
    0 0 28px var(--shadow);
  background: var(--bg);
  /* Projeção 2.5D subtil: ligeira inclinação tipo "tabuleiro de mesa" */
  transform: perspective(1200px) rotateX(7deg);
  transform-origin: center 40%;
  transition:
    background 800ms cubic-bezier(.4,0,.2,1),
    transform 600ms var(--ease-spring);
}
/* Em smartphones em modo retrato evita que a inclinação corte conteúdo */
@media (max-width: 480px) {
  #game-canvas { transform: perspective(1200px) rotateX(4deg); }
}

@keyframes shake { 0% { transform: translate(1px, 1px) rotate(0deg); } 10% { transform: translate(-3px, -2px) rotate(-1deg); } 20% { transform: translate(-3px, 0px) rotate(1deg); } 30% { transform: translate(3px, 2px) rotate(0deg); } 40% { transform: translate(1px, -1px) rotate(1deg); } 50% { transform: translate(-1px, 2px) rotate(-1deg); } 60% { transform: translate(-3px, 1px) rotate(0deg); } 70% { transform: translate(3px, 1px) rotate(-1deg); } 80% { transform: translate(-1px, -1px) rotate(1deg); } 90% { transform: translate(1px, 2px) rotate(0deg); } 100% { transform: translate(1px, -2px) rotate(-1deg); } }
.shake { animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both; }

.gadget-bar {
  display: flex; gap: 14px; justify-content: center; width: 100%;
  margin-top: 5px; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(0,0,0,0.3));
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  padding: 12px 16px; border-radius: var(--r-lg);
  border: 1px solid rgba(255,255,255,0.08);
  max-width: 380px;
  box-shadow: var(--el-2);
}
.gadget-btn.ingame-shop-toggle { background: rgba(255,215,0,0.18); border-color: var(--star); }
.ingame-shop {
  width: 100%; max-width: 360px; max-height: 0; overflow: hidden;
  background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px; transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 10px;
}
.ingame-shop.open { max-height: 200px; padding: 10px; }
.ingame-shop-title {
  font-family: 'Fredoka One', cursive; font-size: 0.85rem;
  color: var(--star); text-align: center; margin-bottom: 8px;
}
.ingame-shop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ingame-shop-card {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px; padding: 8px 4px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-family: inherit; color: white;
}
.ingame-shop-card:hover { background: rgba(255,255,255,0.16); border-color: var(--accent); }
.igs-emoji { font-size: 1.4rem; }
.igs-name  { font-size: 0.72rem; font-weight: 700; }
.igs-cost  { font-size: 0.78rem; color: var(--star); font-weight: 700; }
.gadget-btn {
  background: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.04));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: 50%; width: 54px; height: 54px; font-size: 1.7rem;
  position: relative; cursor: pointer;
  transition:
    transform 200ms var(--ease-spring),
    box-shadow 200ms var(--ease-out),
    background 200ms,
    border-color 180ms;
  box-shadow: var(--el-2);
  display: flex; align-items: center; justify-content: center;
}
.gadget-btn:hover {
  transform: translateY(-2px) scale(1.04);
  background: linear-gradient(135deg, rgba(255,255,255,0.22), rgba(255,255,255,0.08));
  border-color: var(--accent); box-shadow: var(--el-3), 0 0 18px var(--shadow);
}
.gadget-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,0.3); }
.gadget-btn.active-buff { border-color: var(--green); background: rgba(126,255,178,0.2); box-shadow: 0 0 15px var(--green); }
.badge { position: absolute; top: -5px; right: -5px; background: var(--danger); color: white; font-size: 0.7rem; font-weight: bold; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); }

.ctrl-pad { display:grid; grid-template-columns:repeat(3, 55px); grid-template-rows:repeat(2, 55px); gap:6px; margin-top: 5px; }
.ctrl-btn { width:55px; height:55px; background: rgba(255,255,255,0.08); border: 2px solid rgba(255,255,255,0.1); border-radius:14px; color:#fff; font-size:1.5rem; cursor:pointer; display:flex; align-items:center; justify-content:center; box-shadow: 0 4px 0 rgba(0,0,0,0.3); user-select:none; }
.ctrl-btn:active { transform:translateY(3px); box-shadow:0 1px 0 rgba(0,0,0,0.3); background: rgba(255,255,255,0.2); }
.ctrl-up { grid-column:2; grid-row:1; } .ctrl-left { grid-column:1; grid-row:2; }
.ctrl-down { grid-column:2; grid-row:2; } .ctrl-right { grid-column:3; grid-row:2; }

/* STORY & TOASTS */
.story-text {
  background: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.35));
  padding: 18px 18px; border-radius: 14px; font-size: 1.05rem; line-height: 1.65;
  text-align: center; border: 1px solid var(--accent);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5), inset 0 0 30px rgba(255,255,255,0.03);
  max-width: 420px;
}

.story-header { display: flex; flex-direction: column; align-items: center; gap: 0; margin-top: 20px; text-align: center; }

/* Cabeçalho da tela de história com 3 níveis: capítulo + título principal + mundo */
.story-chapter { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 0.85rem;
  color: rgba(255,255,255,0.55); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 6px; }
.story-mainTitle { font-family: 'Fredoka One', cursive; font-size: 2.1rem;
  background: linear-gradient(135deg, var(--accent), #ffffff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 10px var(--shadow)); line-height: 1.05; padding: 0 8px; }
.story-world { font-size: 0.85rem; color: rgba(255,255,255,0.7); margin-top: 4px; margin-bottom: 4px; }
.story-world i { color: var(--world-light, var(--accent)); font-style: italic; }

/* ── Cabeçalho do MAPA — nome do planeta + subtítulo ── */
#map-title { display: flex; flex-direction: column; align-items: center; gap: 0; }
.map-icon { font-size: 1.8rem; margin-right: 6px; }
.map-world { font-family: 'Fredoka One', cursive; font-size: 1.6rem;
  background: linear-gradient(135deg, var(--world-light, var(--accent)), #fff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 6px var(--shadow)); }
.map-subtitle { font-family: 'Nunito', sans-serif; font-size: 0.8rem; font-weight: 700;
  color: rgba(255,255,255,0.6); margin-top: -4px; letter-spacing: 1px; }

/* ── PAINEL DE LUZES / PLANETAS SALVOS ── */
.lights-panel {
  width: 100%; background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px; padding: 10px 10px 12px;
  margin: 6px auto 4px; max-width: 720px;
}
.lights-title {
  font-family: 'Fredoka One', cursive; font-size: 0.95rem; color: var(--star);
  text-align: center; margin-bottom: 8px; letter-spacing: 1px;
}
.lights-row {
  display: flex; justify-content: center; align-items: stretch;
  gap: 8px; flex-wrap: nowrap; overflow-x: auto;
  padding: 4px 2px;
}
.lights-row::-webkit-scrollbar { height: 4px; }
.lights-row::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }
.light-slot {
  flex: 0 0 60px; min-width: 60px; height: 60px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.04); border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08); padding: 4px;
  transition: transform 0.18s, box-shadow 0.3s;
}
.light-slot.saved { cursor: pointer; }
.light-slot.saved:hover { transform: translateY(-3px) scale(1.05); }
.light-slot .light-emoji { font-size: 1.4rem; opacity: 0.4; line-height: 1; }
.light-slot .light-name {
  font-size: 0.55rem; color: rgba(255,255,255,0.45); margin-top: 3px;
  font-weight: 700; letter-spacing: 0.5px; text-align: center;
}
.light-slot.saved {
  background: rgba(255,255,255,0.06); border-color: var(--light-c, var(--accent));
  box-shadow: 0 0 12px var(--light-c, var(--accent)), inset 0 0 8px rgba(255,255,255,0.08);
  animation: lightPulse 2.4s ease-in-out infinite;
}
.light-slot.saved .light-emoji { opacity: 1; filter: drop-shadow(0 0 5px var(--light-c)); }
.light-slot.saved .light-name { color: var(--light-c); opacity: 0.95; }

/* Tela de história do planeta salvo (gratidão) */
#planet-story-screen .ps-icon {
  font-size: 5rem; line-height: 1; margin-top: 30px;
  filter: drop-shadow(0 0 20px var(--world-light, var(--accent)));
  animation: planetSpin 14s linear infinite;
}
@keyframes planetSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
#planet-story-screen .ps-name {
  font-family: 'Fredoka One', cursive; font-size: 2.2rem;
  background: linear-gradient(135deg, var(--world-light, var(--accent)), #fff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  text-align: center; margin-top: 6px;
}
#planet-story-screen .ps-sub {
  font-size: 0.9rem; color: rgba(255,255,255,0.6); letter-spacing: 1px; margin-top: -4px;
}
#planet-story-screen .ps-text {
  background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.12);
  padding: 16px 18px; border-radius: 14px; max-width: 560px;
  font-size: 1rem; line-height: 1.55; text-align: center; margin-top: 6px;
}
@keyframes lightPulse {
  0%,100% { box-shadow: 0 0 8px var(--light-c, var(--accent)), inset 0 0 8px rgba(255,255,255,0.08); }
  50%     { box-shadow: 0 0 18px var(--light-c, var(--accent)), inset 0 0 14px rgba(255,255,255,0.14); }
}

/* Separador discreto no mapa quando começa um novo mundo (1ª coluna a cada décima) */
.level-card.world-start { box-shadow: 0 4px 0 rgba(0,0,0,0.4), inset 4px 0 0 var(--accent); }

/* ── TELA DE ESTATÍSTICAS ── */
.stats-grid {
  width: 100%; display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin-top: 6px;
}
.stat-card {
  background: rgba(0,0,0,0.45); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 12px 10px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; min-height: 78px;
  transition: 0.2s;
}
.stat-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.stat-icon { font-size: 1.4rem; margin-bottom: 2px; }
.stat-value {
  font-family: 'Fredoka One', cursive; font-size: 1.5rem; line-height: 1;
  background: linear-gradient(135deg, var(--accent), #fff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-label {
  font-size: 0.72rem; color: rgba(255,255,255,0.7); margin-top: 2px;
  text-align: center; letter-spacing: 0.5px;
}
.stat-card.wide { grid-column: span 2; }

/* ── CINEMÁTICA "LUZ RECOLHIDA" ── */
#light-cinematic {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; opacity: 0;
}
#light-cinematic.active {
  pointer-events: auto;
  animation: lcFadeBg 2.6s ease-out forwards;
}
#light-cinematic .lc-bg {
  position: absolute; inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.25) 0%, rgba(0,0,0,0.7) 60%);
}
#light-cinematic .lc-content {
  display: flex; flex-direction: column; align-items: center; gap: 18px; z-index: 2;
}
#light-cinematic .lc-light {
  font-size: 6rem; line-height: 1;
  animation: lcLight 2.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
#light-cinematic .lc-text {
  font-family: 'Fredoka One', cursive; font-size: 1.8rem;
  background: linear-gradient(135deg, #ffd700, #fff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 16px rgba(255,215,0,0.6));
  animation: lcTextIn 2.6s ease-out forwards; opacity: 0;
  text-align: center; padding: 0 12px;
}
#light-cinematic .lc-text span { color: var(--accent); -webkit-text-fill-color: var(--accent); }
#light-cinematic .lc-sub {
  font-size: 0.9rem; color: rgba(255,255,255,0.75); letter-spacing: 0.5px;
  animation: lcTextIn 2.6s ease-out forwards; opacity: 0;
  animation-delay: 0.15s;
  text-align: center; max-width: 320px;
}
@keyframes lcFadeBg {
  0% { opacity: 0; } 12% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; }
}
@keyframes lcLight {
  0%   { transform: scale(0) rotate(0deg);             opacity: 0; }
  18%  { transform: scale(1.4) rotate(180deg);          opacity: 1; }
  35%  { transform: scale(1.7) rotate(360deg);          opacity: 1; }
  60%  { transform: scale(1.5) rotate(540deg);          opacity: 1; }
  78%  { transform: translate(38vw, -36vh) scale(0.55) rotate(720deg); opacity: 1; }
  100% { transform: translate(42vw, -42vh) scale(0)    rotate(820deg); opacity: 0; }
}
@keyframes lcTextIn {
  0%  { opacity: 0; transform: translateY(10px); }
  20% { opacity: 1; transform: translateY(0); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-6px); }
}

/* ── PAUSE OVERLAY ── */
#pause-overlay {
  position: fixed; inset: 0; z-index: 9500;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
}
#pause-overlay.show { display: flex; }
.pause-card {
  background: linear-gradient(135deg, rgba(40,0,80,0.9), rgba(20,0,40,0.95));
  border: 1px solid var(--accent); border-radius: 18px; padding: 26px 30px;
  text-align: center; max-width: 420px; width: 90%;
  box-shadow: 0 12px 50px rgba(0,0,0,0.6), 0 0 30px var(--shadow);
}
.pause-title {
  font-family: 'Fredoka One', cursive; font-size: 2rem;
  background: linear-gradient(135deg, var(--accent), #fff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.pause-sub { font-size: 0.95rem; color: rgba(255,255,255,0.75); margin-top: 6px; }

/* ── POPUP DE MISSÃO CUMPRIDA ── */
.mission-popup {
  position: fixed; left: 50%; top: 70px; transform: translate(-50%, -120%);
  z-index: 9000; pointer-events: none;
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  color: #1a1100; padding: 14px 22px; border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 30px rgba(255,215,0,0.5);
  min-width: 280px; max-width: 90vw; text-align: center;
  opacity: 0; transition: transform 0.4s cubic-bezier(.34,1.56,.64,1), opacity 0.3s;
  border: 2px solid rgba(255,255,255,0.4);
}
.mission-popup.show { transform: translate(-50%, 0); opacity: 1; }
.mission-popup .mp-header {
  font-family: 'Fredoka One', cursive; font-size: 0.85rem; letter-spacing: 2px;
  text-transform: uppercase; opacity: 0.8;
}
.mission-popup .mp-title {
  font-family: 'Fredoka One', cursive; font-size: 1.4rem; margin-top: 4px;
}
.mission-popup .mp-desc { font-size: 0.85rem; opacity: 0.85; margin-top: 4px; }
.mission-popup .mp-reward {
  margin-top: 8px; padding: 4px 12px; background: rgba(0,0,0,0.25);
  border-radius: 16px; display: inline-block; font-weight: bold; font-size: 0.95rem;
}

/* ── TOAST DE NOVO MUNDO/TEMA ── */
.theme-toast {
  position: fixed; left: 50%; top: 110px; transform: translate(-50%, -140%);
  z-index: 8500; pointer-events: none;
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, rgba(0,0,0,0.85), rgba(40,0,80,0.85));
  border: 1px solid var(--accent); padding: 12px 20px; border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5), 0 0 22px var(--shadow);
  opacity: 0; transition: transform 0.45s cubic-bezier(.34,1.4,.64,1), opacity 0.35s;
  min-width: 280px;
}
.theme-toast.show { transform: translate(-50%, 0); opacity: 1; }
.theme-toast .tt-icon { font-size: 2.2rem; line-height: 1; }
.theme-toast .tt-body { text-align: left; }
.theme-toast .tt-tag {
  font-family: 'Fredoka One', cursive; font-size: 0.7rem; letter-spacing: 3px;
  text-transform: uppercase; color: var(--accent); opacity: 0.85;
}
.theme-toast .tt-name {
  font-family: 'Fredoka One', cursive; font-size: 1.3rem;
  background: linear-gradient(135deg, var(--world-light, var(--accent)), #fff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.theme-toast .tt-sub { font-size: 0.78rem; color: rgba(255,255,255,0.7); }

/* ── TRANSIÇÃO ENTRE MUNDOS — Yuta atravessa o buraco negro ── */
#world-transition-screen { gap: 6px; }
.wt-tag {
  font-family: 'Fredoka One', cursive; font-size: 0.85rem; letter-spacing: 6px;
  color: rgba(170,68,255,0.9); text-shadow: 0 0 12px rgba(170,68,255,0.6);
  margin-top: 30px; animation: bossTagBlink 1.6s ease-in-out infinite;
  text-align: center; padding: 0 20px;
}
#wt-canvas {
  margin-top: 4px; filter: drop-shadow(0 0 28px rgba(170,68,255,0.45));
  background: radial-gradient(circle at 50% 50%, rgba(20,0,40,0.7) 0%, rgba(0,0,0,0.95) 80%);
  border-radius: 14px;
}
.wt-message {
  font-family: 'Fredoka One', cursive; font-size: 1.1rem;
  color: rgba(255,255,255,0.85); margin-top: 8px; letter-spacing: 1px;
}
.wt-target {
  display: flex; align-items: center; gap: 12px; margin-top: 4px;
}
.wt-icon { font-size: 2.4rem; line-height: 1;
  filter: drop-shadow(0 0 14px var(--world-light, var(--accent))); }
.wt-name {
  font-family: 'Fredoka One', cursive; font-size: 2.2rem;
  background: linear-gradient(135deg, var(--world-light, var(--accent)), #fff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.wt-sub {
  font-size: 0.85rem; color: rgba(255,255,255,0.6);
  letter-spacing: 1px; margin-top: -4px;
}

/* ── PRESSÁGIO — Cinemática ao entrar num mundo novo ── */
#omen-screen { gap: 6px; }
.omen-tag {
  font-family: 'Fredoka One', cursive; font-size: 0.85rem; letter-spacing: 8px;
  color: rgba(170,68,255,0.85); text-shadow: 0 0 12px rgba(170,68,255,0.6);
  margin-top: 30px; animation: bossTagBlink 1.6s ease-in-out infinite;
}
#omen-canvas {
  margin-top: 4px; filter: drop-shadow(0 0 24px rgba(170,68,255,0.4));
  background: radial-gradient(circle at 50% 50%, rgba(20,0,40,0.7) 0%, rgba(0,0,0,0.95) 80%);
  border-radius: 14px;
}
.omen-world {
  font-family: 'Fredoka One', cursive; font-size: 1.6rem;
  background: linear-gradient(135deg, var(--world-light, var(--accent)), #fff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px var(--shadow));
  margin-top: 6px;
}
.omen-subtitle {
  font-size: 0.85rem; color: rgba(255,255,255,0.6);
  letter-spacing: 1.5px; font-weight: 700; margin-top: -2px;
}
.omen-skip-row { margin-top: 4px; }

/* ── TELA FINAL — UNIVERSO RESTAURADO ── */
#final-screen { gap: 6px; }
.final-tag {
  font-family: 'Fredoka One', cursive; font-size: 0.85rem; letter-spacing: 6px;
  color: rgba(255,255,255,0.65); margin-top: 30px;
}
#final-canvas {
  margin-top: 6px;
  filter: drop-shadow(0 0 24px rgba(255,255,255,0.35));
}
.final-title {
  font-family: 'Fredoka One', cursive; font-size: 2.4rem; line-height: 1.05;
  background: linear-gradient(135deg, #ffd700, #ffffff, var(--accent));
  background-size: 200% 200%;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 14px rgba(255,215,0,0.5));
  animation: finalGradient 6s ease-in-out infinite;
  text-align: center; padding: 0 8px;
}
@keyframes finalGradient {
  0%,100% { background-position: 0% 50%; }
  50%     { background-position: 100% 50%; }
}
.final-text {
  background: rgba(0,0,0,0.45); border: 1px solid rgba(255,255,255,0.15);
  padding: 14px 18px; border-radius: 14px; max-width: 380px;
  font-size: 1.0rem; line-height: 1.55; text-align: center;
  margin-top: 4px;
}
.final-credits {
  font-family: 'Fredoka One', cursive; font-size: 0.85rem;
  color: rgba(255,255,255,0.6); letter-spacing: 1px;
  margin-top: 6px;
}

/* ── TELA DE REVELAÇÃO DO BOSS ── */
#boss-reveal-screen { gap: 8px; }
.boss-reveal-tag {
  font-family: 'Fredoka One', cursive; font-size: 0.85rem; letter-spacing: 4px;
  color: #ff5555; background: rgba(255,0,68,0.12); border: 1px solid #ff5555;
  padding: 4px 14px; border-radius: 20px; margin-top: 30px;
  animation: bossTagBlink 1.4s ease-in-out infinite;
}
@keyframes bossTagBlink { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }
.boss-reveal-name {
  display: block;
  font-family: var(--type-display);
  font-size: clamp(1.8rem, 5vw, 2.4rem); line-height: 1.05;
  background: linear-gradient(135deg, #ff5555, var(--accent), #fff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 12px rgba(255,0,68,0.5));
  text-align: center; margin: 6px 0 0; letter-spacing: -0.5px;
}
.boss-reveal-title {
  display: block;
  font-size: 0.92rem; color: var(--ink-2);
  text-align: center; letter-spacing: 1.2px; font-weight: 700;
  margin: 4px 0 0;
}
.bossreveal-icon { font-size: 1.1rem; }
#boss-reveal-canvas {
  margin-top: 8px;
  filter: drop-shadow(0 0 18px var(--world-light, var(--accent)));
}
.boss-reveal-desc {
  display: block;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 12px 16px; border-radius: var(--r-md);
  font-size: 0.95rem; line-height: 1.5; text-align: center;
  border: 1px solid rgba(255,85,85,0.4); max-width: 460px;
  margin: 12px auto 0; box-shadow: var(--el-2);
}
.boss-reveal-tip {
  display: block;
  font-size: 0.85rem; color: var(--ink-2);
  letter-spacing: 0.5px; text-align: center;
  margin: 8px auto 0;
}
.boss-reveal-tip b { color: var(--world-light, var(--accent)); letter-spacing: 1px; }

/* ════════════════════════════════════════════════════════════════
   FLAT DESIGN NEON — silhuetas vetoriais com glow estratégico.
   Aplica-se às camadas de UI (menus/HUD); o canvas mantém detalhe artístico.
   ════════════════════════════════════════════════════════════════ */

/* 1. Cards e botões: contornos finos neon que substituem sombras pesadas em hover */
.skin-card,
.level-card,
.profile-card,
.achiev-card {
  border-width: 1px;
  border-style: solid;
}
.level-card.boss     { box-shadow: 0 0 0 1px var(--danger), 0 0 18px rgba(255,0,68,0.35); }
.level-card.bonus    { box-shadow: 0 0 0 1px var(--star),   0 0 18px rgba(255,215,0,0.30); }
.level-card.miniboss { box-shadow: 0 0 0 1px #ff8c00,        0 0 18px rgba(255,140,0,0.30); }
.level-card.keylevel { box-shadow: 0 0 0 1px #ffcc55,        0 0 18px rgba(255,200,80,0.30); }

/* 2. Highlight neon de seleção */
.skin-card.selected {
  border-color: var(--green);
  box-shadow:
    0 0 0 2px var(--green) inset,
    0 0 24px rgba(126,255,178,0.45),
    0 0 8px rgba(126,255,178,0.6) inset;
}

/* 3. Painéis de boss com bordas neon vibrantes */
.boss-reveal-tag {
  background: linear-gradient(135deg, rgba(255,0,68,0.08), rgba(255,80,160,0.08));
  border-color: rgba(255,80,120,0.7);
  box-shadow: 0 0 22px rgba(255,80,120,0.35);
}

/* 4. Pílulas no HUD com bordas finas neon */
.hud-moves, .hud-timer {
  border: 1px solid rgba(255,255,255,0.12);
}

/* 5. Light slot — neon ring quando salvo, silhueta quando bloqueado */
.light-slot:not(.saved) {
  background: transparent;
  border: 1px dashed rgba(255,255,255,0.12);
}

/* 6. Estrutura geral — reduzir hierarquia decorativa, manter foco */
.shop-section {
  font-family: var(--type-display);
  font-size: 0.95rem; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--ink-2); border-bottom-color: rgba(255,255,255,0.06);
  padding-bottom: 6px;
}

/* 7. Linhas decorativas neon entre secções */
.shop-section::before {
  content: ''; display: inline-block; width: 14px; height: 2px;
  background: var(--accent); margin-right: 10px; vertical-align: middle;
  border-radius: 2px; box-shadow: 0 0 10px var(--accent);
}

/* Pílula de título do jogador no ecrã principal */
.player-title-pill {
  display: inline-block; margin-top: 8px; padding: 4px 14px;
  border-radius: 14px; border: 1px solid; font-family: 'Fredoka One', cursive;
  font-size: 0.8rem; letter-spacing: 1px;
}

/* Luzes recolhidas na tela de título */
.title-lights { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.title-light { font-size: 1.1rem; opacity: 0.25; filter: grayscale(1); transition: 0.4s; }
.title-light.on { opacity: 1; filter: drop-shadow(0 0 6px currentColor); animation: lightPulse 2.4s ease-in-out infinite; }
.title-lights-count { font-size: 0.75rem; color: var(--star); margin-top: 4px;
  font-family: 'Fredoka One', cursive; letter-spacing: 1px; }

#toast-container { position: fixed; top: 60px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 1000; pointer-events: none; }
.toast { background: linear-gradient(135deg, var(--star), #ff8c00); color: #000; padding: 10px 15px; border-radius: 8px; font-weight: bold; font-family: 'Fredoka One', cursive; box-shadow: 0 4px 15px rgba(0,0,0,0.5); animation: slideIn 0.3s ease-out forwards, fadeOut 0.3s ease-in 2s forwards; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }

.win-title { font-family: 'Fredoka One', cursive; font-size: 2.2rem; text-align: center; }
.particle-canvas { position:fixed; inset:0; pointer-events:none; z-index:1; }