/* Design system único do backend — todas as telas (home, login, cadastro,
   perfil, dev, admin, jogar) importam este arquivo. Paleta e componentes
   migrados do guia visual feito no Lovable (ver histórico do projeto) —
   trocar aqui reflete em tudo. */

:root {
  color-scheme: dark;

  --bg: #0a0a0d;
  --surface: #15161c;
  --surface-2: #0d0e13;
  --border: #1f2028;
  --border-strong: #26272f;
  --text: #f4f4f6;
  --text-muted: #9b9ba8;
  --text-dim: #6b6c78;
  --link: #8b85f0;
  --link-hover: #a8a2f5;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #22c55e;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }

/* ---------- layout ---------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 14px 32px;
  background: rgba(12, 12, 16, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.app-header .brand {
  display: flex; align-items: center; gap: 8px; cursor: pointer; flex-shrink: 0;
  font-weight: 700; font-size: 18px; letter-spacing: -0.01em; color: var(--text);
}
.app-header .brand .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--primary); }
.app-header .brand .brand-short { display: none; }
.app-header .search-wrap { flex: 1; max-width: 480px; }
.app-header nav { display: flex; align-items: center; gap: var(--space-4); flex-shrink: 0; }
.app-header nav a { font-size: 13.5px; color: var(--text); }
.app-header nav a:hover { color: var(--link); }

/* Ícone de conta compacto (SVG inline, ver ICONS no shared.js) — só no
   mobile; no desktop os botões "Entrar"/"Cadastrar" têm texto normal. */
.icon-btn {
  display: none; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--border-strong); color: var(--text);
  cursor: pointer; flex-shrink: 0;
}

@media (max-width: 720px) {
  .app-header { padding: 10px 14px; gap: 8px; }
  .app-header .brand .brand-full { display: none; }
  .app-header .brand .brand-short { display: inline; }
  .app-header .search-wrap { flex: 1; min-width: 0; } /* continua visível, só encolhe */
  .app-header nav.desktop-actions { display: none; }
  .icon-btn { display: flex; }
}

/* Sugestões da busca — aparece abaixo do campo a partir de 3 letras
   (ver SEARCH_SUGGEST_MIN_CHARS em shared.js). */
.search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-md); box-shadow: 0 12px 30px rgba(0,0,0,.45);
  z-index: 60; max-height: 360px; overflow-y: auto; padding: 6px;
}
.search-dropdown-item {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm);
  color: var(--text); cursor: pointer;
}
.search-dropdown-item:hover { background: var(--border); }
.search-dropdown-item .cover {
  width: 40px; height: 40px; border-radius: 8px; overflow: hidden; flex-shrink: 0;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.search-dropdown-item .cover img { width: 100%; height: 100%; object-fit: cover; }
.search-dropdown-item .info { min-width: 0; flex: 1; }
.search-dropdown-item .info .title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-dropdown-item .right { flex: none; text-align: right; margin-left: 8px; }
.search-dropdown-item .right .rating { font-size: 12.5px; font-weight: 700; color: #fbbf24; }
.search-dropdown-item .right .dev { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-dropdown-empty { padding: 14px 8px; font-size: 13px; color: var(--text-muted); text-align: center; }

.app-main { max-width: 1320px; margin: 0 auto; padding: 28px 32px 80px; }
.app-main.narrow { max-width: 420px; }
.app-main.medium { max-width: 1000px; }
@media (max-width: 720px) {
  .app-main { padding: 18px 16px 60px; }
}

.section { margin-bottom: 44px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-head h2 { font-size: 22px; font-weight: 700; margin: 0; }
h2.sub { font-size: 17px; font-weight: 700; margin: 0 0 14px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  background: transparent;
}
.btn + .btn { margin-left: var(--space-2); }
.btn-outline { border-color: var(--border-strong); background: transparent; }
.btn-outline:hover { border-color: var(--primary); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger-outline { border-color: var(--border-strong); color: var(--text); }
.btn-danger-outline:hover { border-color: var(--danger); }
.btn-warning-outline { border-color: var(--warning); color: var(--warning); background: transparent; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); }
.btn-lg { padding: 12px 28px; font-size: 15px; border-radius: var(--radius-sm); }

/* ---------- cards & grid ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.card + .card { margin-top: var(--space-3); }
.card-sm { padding: var(--space-4); border-radius: var(--radius-md); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 18px; }
.stat-tile .value { font-size: 24px; font-weight: 800; }
.stat-tile .label { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.stat-tile-clickable { cursor: pointer; }
.stat-tile-clickable:hover { border-color: var(--primary); }

.featured-banner {
  position: relative; display: block; width: 100%;
  /* Altura fixa (não mais aspect-ratio) — mesma nos dois tamanhos de tela
     de propósito, pra não ficar gigante em monitor largo nem espremido no
     celular. */
  height: 350px;
  border-radius: 18px; overflow: hidden; border: 1px solid var(--border);
  background: var(--surface-2);
}
.featured-banner img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.featured-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(10,10,13,.95) 15%, rgba(10,10,13,.65) 60%, rgba(10,10,13,.25));
  display: flex; flex-direction: column; justify-content: center; gap: 10px;
  padding: 0 44px;
}
.featured-overlay .eyebrow { color: var(--link); font-size: 12px; font-weight: 700; letter-spacing: .07em; }
.featured-overlay h1 { font-size: clamp(22px, 4vw, 32px); font-weight: 800; margin: 0; max-width: 480px; line-height: 1.15; color: #fff; }
.featured-overlay p { color: #c7c7d1; font-size: 14px; margin: 0; max-width: 440px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.featured-overlay .row { margin-top: 8px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
@media (max-width: 720px) {
  .featured-overlay { padding: 0 20px; background: linear-gradient(180deg, rgba(10,10,13,.5) 0%, rgba(10,10,13,.97) 75%); }
  .featured-overlay p { display: none; }
  /* botão e "por Fulano · ★" brigavam pela mesma linha e se sobrepunham —
     empilha em vez de tentar caber lado a lado */
  .featured-overlay .row { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* Banner principal com os jogos mais jogados, em slider — só o slide
   .active fica visível, o resto some (a própria .featured-banner já
   define o tamanho, então a troca não pula o layout). */
.hero-slider .featured-banner { display: none; }
.hero-slider .featured-banner.active { display: block; }
.hero-dots { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.hero-dot { width: 8px; height: 8px; border-radius: 50%; border: 0; background: var(--border-strong); cursor: pointer; padding: 0; }
.hero-dot.active { background: var(--link); width: 22px; border-radius: 4px; transition: width .2s; }

/* Cards do Top 10 jogadores — mesmo estilo visual do game-card: foto do
   jogador, badges "Jogou" pra cada jogo recente, e um placar só aparece se
   ele estiver jogando algo agora (o placar daquele jogo específico — nunca
   um número solto sem contexto de qual jogo ele pertence). */
.leaderboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.player-card { cursor: pointer; position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; display: flex; gap: 12px; align-items: flex-start; }
.player-card:hover { border-color: var(--primary); }
.player-card .rank-badge { position: absolute; top: 10px; right: 12px; font-weight: 800; font-size: 13px; color: var(--text-muted); }
.player-card .rank-badge.gold { color: #fbbf24; } .player-card .rank-badge.silver { color: #cbd5e1; } .player-card .rank-badge.bronze { color: #d97706; }
.player-card .avatar { flex: none; }
.player-card .info { flex: 1; min-width: 0; padding-right: 20px; }
.player-card .name { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 6px; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-card .presence-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex: none; }
.player-card .game-icons { display: flex; flex-wrap: wrap; gap: 8px; }
.player-card .game-icons a { display: block; width: 28px; height: 28px; border-radius: 7px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); flex: none; font-size: 15px; line-height: 26px; text-align: center; }
.player-card .game-icons img { width: 100%; height: 100%; object-fit: cover; display: block; }
.player-card .now-playing { margin-top: 10px; font-size: 12.5px; color: var(--success); font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px; }

.game-card { cursor: pointer; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; color: var(--text); display: block; }
.game-card:hover { border-color: var(--primary); }
.game-card .cover { width: 100%; aspect-ratio: 16/10; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: #444; font-size: 1.6rem; position: relative; }
.game-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.game-card .badge-new { position: absolute; top: 8px; left: 8px; background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 6px; letter-spacing: .02em; }
.game-card .info { padding: 12px 14px; }
.game-card .title { font-weight: 600; font-size: 15px; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-card .meta { color: var(--text-muted); font-size: 13px; }
.stars { display: flex; gap: 2px; }
.stars span { font-size: 13px; }

.rail { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; }
.rail .game-card { flex: 0 0 240px; scroll-snap-align: start; }

.dev-card { cursor: pointer; width: 100%; display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; }
.dev-card:hover { border-color: var(--primary); }
.avatar { border-radius: 50%; background: var(--border-strong); flex-shrink: 0; object-fit: cover; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--text-muted); }

.chip { background: transparent; color: var(--text-muted); border: 1px solid var(--border-strong); padding: 8px 16px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600; cursor: pointer; }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.rank-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.rank-row .rank { width: 22px; text-align: center; font-weight: 800; font-size: 14px; }
.rank-row .rank.gold { color: #fbbf24; } .rank-row .rank.silver { color: #cbd5e1; } .rank-row .rank.bronze { color: #d97706; }
.rank-row .name { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .score { font-weight: 700; font-size: 14px; flex-shrink: 0; }

/* ---------- lists / tables ---------- */

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); font-size: .9rem; }

/* ---------- forms ---------- */

label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); margin-bottom: var(--space-3); }
input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); }
input[type="search"] { border-radius: var(--radius-sm); }
.search-input { flex: 1; max-width: 480px; }
.field { margin-bottom: var(--space-3); }
.hp { position: absolute; left: -9999px; } /* honeypot anti-bot */
.dropzone { background: var(--surface-2); border: 1px dashed var(--border-strong); color: var(--text-muted); padding: 18px; border-radius: var(--radius-sm); font-size: 13px; text-align: center; cursor: pointer; }
.dropzone.dragover { border-color: var(--primary); color: var(--text); }

/* ---------- badges ---------- */

.badge { padding: 4px 12px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.badge-pending, .badge-private { background: rgba(245,158,11,.15); color: var(--warning); }
.badge-approved, .badge-visible, .badge-public { background: rgba(34,197,94,.15); color: var(--success); }
.badge-rejected, .badge-suspended { background: rgba(239,68,68,.15); color: var(--danger); }

/* ---------- feedback ---------- */

.msg { font-size: .85rem; min-height: 1.2em; margin-top: var(--space-2); }
.msg-error { color: #f87171; }
.msg-success { color: #4ade80; }
.empty { color: var(--text-dim); font-size: .9rem; }
/* Texto de ajuda/instrução (não é estado vazio) — precisa de mais contraste
   que .empty pra ser confortável de ler, ex: dicas de tamanho/formato de
   imagem no painel Dev. */
.help-text { color: var(--text-muted); font-size: 12px; line-height: 1.5; }

.banner {
  background: var(--primary);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-5);
}
.banner .btn { background: #fff; color: var(--primary); font-weight: 700; border-color: #fff; }

.sim-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--warning); color: #1a1400;
  padding: 11px 20px; text-align: center; font-size: 13.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 14px;
}
.sim-banner .btn { background: #1a1400; color: var(--warning); border-color: #1a1400; }

/* Sino de avisos (ver buildNoticeBell em shared.js) — sempre visível ao
   lado do avatar, com badge de contagem e dropdown de até 8 avisos. */
.account-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.notice-bell-wrap { position: relative; }
.notice-bell-btn {
  display: flex; align-items: center; justify-content: center; position: relative;
  width: 34px; height: 34px; border-radius: 50%;
  background: transparent; border: 1px solid var(--border-strong); color: var(--text);
  cursor: pointer; flex-shrink: 0;
}
.notice-bell-badge {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 3px;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.notice-dropdown {
  position: absolute; top: 44px; right: 0; width: 300px; max-height: 340px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  padding: 6px; box-shadow: 0 12px 30px rgba(0,0,0,.45); z-index: 60;
}
.notice-dropdown-item { padding: 10px; border-radius: 8px; cursor: pointer; border-bottom: 1px solid var(--border); }
.notice-dropdown-item:last-child { border-bottom: 0; }
.notice-dropdown-item:hover { background: var(--surface-2); }
.notice-dropdown-msg { font-size: 13px; line-height: 1.4; }
.notice-dropdown-time { font-size: 11px; color: var(--text-dim); margin-top: 3px; }

/* Página /avisos — lista lateral com o item em destaque e os não lidos marcados */
.notice-list-item { border: 1px solid transparent; }
.notice-list-item.active { border-color: var(--primary); }
.notice-list-item.unread::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--link); margin-right: 6px; }
@media (max-width: 720px) {
  #notices-layout { grid-template-columns: 1fr !important; }
}

/* Popup interno (ver showAlert() em shared.js) — substitui alert()/confirm()
   do navegador em toda a tela. */
#toast-container {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
}
.toast {
  pointer-events: auto; max-width: 90vw; padding: 12px 18px; border-radius: var(--radius-md);
  font-size: 13.5px; font-weight: 600; box-shadow: 0 12px 30px rgba(0,0,0,.45);
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text);
  opacity: 1; transition: opacity .25s, transform .25s;
}
.toast-success { border-color: var(--success); }
.toast-error { border-color: var(--danger); color: var(--danger); }
.toast-out { opacity: 0; transform: translateY(-8px); }

/* Modal genérico — formulários que antes ficavam abertos inline dentro da
   lista (ex: editar/enviar jogo no painel Dev) agora abrem por cima do
   conteúdo, sem empurrar o resto da página pra baixo. */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(6,7,10,.7); z-index: 150;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-box {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  max-width: 640px; width: 100%; max-height: 88vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,.5);
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close {
  background: none; border: 0; color: var(--text-muted); font-size: 20px; cursor: pointer;
  line-height: 1; padding: 4px 6px; border-radius: 6px;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 18px 20px; }

/* ---------- páginas de auth (login/cadastro) ---------- */

.auth-page { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 65px); padding: 40px 20px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; }
.auth-tabs { display: flex; background: var(--surface-2); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 24px; }
.auth-tabs button { flex: 1; padding: 9px; border-radius: 6px; border: none; font-size: 14px; font-weight: 600; cursor: pointer; background: transparent; color: var(--text-muted); }
.auth-tabs button.active { background: var(--primary); color: #fff; }

/* Abas genéricas — perfil (Dados/Segurança/Histórico), admin, etc. */
.tab-bar { display: flex; gap: 4px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 18px; flex-wrap: wrap; }
.tab-bar button { flex: 1; min-width: 100px; padding: 9px 14px; border-radius: 6px; border: none; font-size: 13.5px; font-weight: 600; cursor: pointer; background: transparent; color: var(--text-muted); white-space: nowrap; }
.tab-bar button.active { background: var(--primary); color: #fff; }

.activity-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.activity-row:last-child { border-bottom: 0; }
.activity-row .activity-time { color: var(--text-dim); font-size: 11.5px; white-space: nowrap; flex: none; width: 128px; }
.activity-row .activity-desc { flex: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.activity-row .activity-badge { background: var(--surface-2); color: var(--text); text-transform: none; letter-spacing: 0; }
.activity-row .activity-actor { color: var(--text-muted); font-size: 11.5px; }

/* ---------- dropdown de usuário ---------- */

.user-menu-wrap { position: relative; }
.user-menu-trigger { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; cursor: pointer; border: 1px solid var(--border-strong); flex-shrink: 0; }
.user-menu { position: absolute; top: 44px; right: 0; width: 220px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md); padding: 8px; box-shadow: 0 12px 30px rgba(0,0,0,.45); z-index: 60; }
.user-menu .head { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-menu .head .name { font-weight: 700; font-size: 13.5px; }
.user-menu .head .email { color: var(--text-muted); font-size: 12px; }
.user-menu .item { padding: 9px 12px; border-radius: 8px; font-size: 13.5px; cursor: pointer; }
.user-menu .item:hover { background: var(--border); }
.user-menu .item.danger { color: #f87171; }
.user-menu .sep { height: 1px; background: var(--border); margin: 6px 0; }

/* ---------- footer ---------- */

.app-footer { border-top: 1px solid var(--border); padding: 28px 32px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; max-width: 1320px; margin: 0 auto; }
.app-footer a { font-size: 13px; margin-right: 20px; }
.app-footer .credit { color: var(--text-dim); font-size: 12.5px; }

/* ---------- página de guia (texto longo) ---------- */

.guide-content h2 { font-size: 19px; font-weight: 700; margin: 36px 0 12px; }
.guide-content h2:first-child { margin-top: 0; }
.guide-content h3 { font-size: 15.5px; font-weight: 700; margin: 22px 0 8px; }

.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 1000;
  max-width: 640px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px;
  padding: 14px 16px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  font-size: 13px; color: var(--text-muted);
}
.cookie-banner a { color: var(--link); }
.cookie-banner button { flex: none; margin-left: auto; }
.guide-content p, .guide-content li { color: var(--text-muted); font-size: 14px; line-height: 1.7; }
.guide-content ul, .guide-content ol { padding-left: 20px; margin: 10px 0; }
.guide-content strong { color: var(--text); }
.guide-content code { background: var(--surface-2); border-radius: 4px; padding: 1px 5px; font-size: 12.5px; }
.code-block {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 16px; overflow-x: auto; margin: 12px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.6;
}
.code-block code { background: none; padding: 0; }

/* ---------- página do jogo ---------- */

.detail-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px; }

.game-stage {
  position: relative; width: 100%;
  /* Altura fixa igual ao banner da home, em vez de ocupar boa parte da
     tela — antes de jogar, isso aqui é só uma "mini-banner" (capa + botão
     Jogar); o jogo de verdade só aparece em tela cheia de verdade, ao
     clicar em Jogar (ver .game-stage:fullscreen / .game-fullscreen-force
     abaixo e launch() em play.js). Mesmo valor em qualquer tamanho de
     tela, de propósito. */
  height: 350px;
  background: var(--surface-2); border-radius: 16px; overflow: hidden; border: 1px solid var(--border);
}
/* Em tela cheia o contêiner passa a ocupar a viewport inteira — sem isso o
   aspect-ratio herdado manteria a caixa do jogo do mesmo tamanho de antes,
   só escondendo a barra de endereço (foi o bug relatado: "não abriu
   fullscreen" — na prática abria, mas o jogo continuava do tamanho de uma
   caixinha 16:9 em vez de preencher a tela). */
/* Banner de "Jogar"/"Continuar" (ver #start-overlay em play.js) — mostra a
   capa do jogo por trás, como se fosse a thumbnail de um vídeo prestes a
   tocar, pra dar a impressão de que o jogo já vai abrir ali dentro. */
.play-mini-banner-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.play-mini-banner-scrim { position: absolute; inset: 0; background: rgba(10,10,13,.72); z-index: 0; }

.game-stage:fullscreen {
  width: 100vw; height: 100vh; border-radius: 0; border: 0;
}

/* Fullscreen "simulado" via CSS — cobre navegadores/situações onde
   Element.requestFullscreen() falha ou não existe em elemento arbitrário
   (ex: Safari no iPhone só suporta fullscreen nativo em <video>). Aplicado
   JUNTO com a tentativa da Fullscreen API de verdade (ver launch() em
   play.js), em QUALQUER dispositivo — todo jogo entra em tela cheia ao dar
   play, não só celular: quando a API funciona, ainda esconde a barra de
   endereço/UI do navegador; quando não funciona, isso aqui sozinho já
   garante que o jogo ocupe a tela toda mesmo assim. */
.game-fullscreen-force {
  position: fixed !important; inset: 0 !important; z-index: 500 !important;
  width: 100vw !important; height: 100vh !important;
  max-height: none !important; max-width: none !important;
  border-radius: 0 !important; border: 0 !important;
}

/* ---------- barra lateral da sandbox (opções: som, reportar bug, sair) --- */

.sandbox-sidebar-toggle {
  position: absolute; top: 50%; right: 0; transform: translateY(-50%);
  z-index: 22; width: 26px; height: 40px; padding: 0;
  background: rgba(10,10,13,.75); color: #fff; border: 1px solid var(--border-strong); border-right: 0;
  border-radius: 8px 0 0 8px; cursor: pointer; font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
/* Altura automática — cresce/encolhe com o conteúdo (ex: form de reportar
   bug abrindo) em vez de ocupar a tela inteira. Centralizada na vertical
   (igual a seta), ancorada logo à esquerda dela — some (translateX) pra
   trás da própria seta quando fechada. */
.sandbox-sidebar {
  position: absolute; top: 50%; right: 26px; width: 220px;
  max-width: 78vw; z-index: 21; padding: 12px;
  background: rgba(15,15,19,.97); border: 1px solid var(--border-strong); border-radius: 10px;
  display: flex; flex-direction: column; gap: 8px;
  transform: translateX(calc(100% + 26px)) translateY(-50%); transition: transform .2s ease;
}
.sandbox-sidebar.open { transform: translateY(-50%); }
.sandbox-sidebar-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: var(--surface-2); color: #fff; border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 10px 12px; font-size: 13.5px; cursor: pointer;
}
.sandbox-sidebar-item:hover { border-color: var(--primary); }
.sandbox-sidebar-danger { border-color: var(--danger); color: var(--danger); margin-top: auto; }
.sandbox-sidebar #sidebar-report-form textarea {
  width: 100%; resize: vertical; background: var(--surface-2); color: #fff;
  border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px; font-size: 13px;
}

/* ---------- ajustes gerais de telas estreitas ---------- */

@media (max-width: 720px) {
  .detail-grid { grid-template-columns: 1fr; }
  .rail .game-card { flex-basis: 200px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .auth-card { padding: 24px; }
  h1 { font-size: 22px !important; }
  .section-head h2 { font-size: 18px; }
}
