/* 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: #c084d1;
  --link-hover: #d9a0e5;

  --primary: #a765bd;
  --primary-hover: #8f4fa8;
  --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;
  padding: 14px 32px;
  background: rgba(12, 12, 16, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
/* Conteúdo do header limitado ao MESMO container central do .app-main — a
   faixa de fundo continua full-width, mas logo, busca e ações param de se
   espalhar até o infinito em monitor wide. O .app-main tem max-width 1320px
   com padding horizontal de 32px em cada lado, então o conteúdo de verdade
   dele ocupa 1320 - 64 = 1256px; o header usa o MESMO valor pra logo e ícones
   baterem exatamente com a borda do banner/conteúdo abaixo. Antes o header
   era o próprio flexbox com space-between, então num monitor ultrawide o logo
   ficava no canto esquerdo e os ícones no canto direito, separados por
   centenas de pixels de vazio. */
.app-header-inner {
  max-width: calc(1320px - 64px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.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);
  text-decoration: none;
}
.app-header .brand:hover { color: var(--link); }
.app-header .brand .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--primary); }
.app-header .brand .brand-short { display: none; }
.app-header .brand .brand-logo { max-height: 32px; max-width: 160px; width: auto; object-fit: contain; }
.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; }
  .app-header-inner { 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; }
  .tab-bar button { flex: 0 0 auto; min-width: auto; }
  #profile-head { gap:16px!important; }
}

/* 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); }

/* Botão "Continuar/Criar com Google" — fundo branco com borda (padrão do
   Google), texto escuro fixo pra manter contraste mesmo no tema escuro. */
.btn-google {
  background: #fff; color: #3c4043; border-color: #dadce0;
  box-shadow: 0 0 0 1px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.06);
}
.btn-google:hover { background: #f6f8fa; border-color: #bdc1c6; color: #1a1a1a !important; }
.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); }

.stat-tile-top {
  position: relative; display: block; overflow: hidden; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px 18px; min-height: 86px; color: #fff; text-decoration: none;
}
.stat-tile-top:hover { border-color: var(--primary); }
.stat-tile-top img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stat-tile-top .top-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(10,10,13,.92) 30%, rgba(10,10,13,.6));
}
.stat-tile-top .top-content { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; height: 100%; }
.stat-tile-top .top-eyebrow { color: var(--link); font-size: 11px; font-weight: 700; letter-spacing: .07em; margin-bottom: 2px; }
.stat-tile-top .top-name { font-size: 16px; font-weight: 800; margin: 0 0 4px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-tile-top .top-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #c7c7d1; flex-wrap: wrap; }
.stat-tile-top .top-meta .stars { gap: 1px; }
.stat-tile-top .top-meta .stars span { font-size: 12px; }
.stat-tile-top .top-meta .stars-count { color: #c7c7d1; font-size: 11px !important; }

.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. Altura enxuta pra deixar o conteúdo da home bem acima da dobra. */
  height: 220px;
  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: 4px;
  padding: 0 32px;
}
.featured-overlay .eyebrow { color: var(--link); font-size: 10px; font-weight: 700; letter-spacing: .07em; }
.featured-overlay h1 { font-size: clamp(18px, 2.6vw, 24px); font-weight: 800; margin: 0; max-width: 480px; line-height: 1.15; color: #fff; }
.featured-overlay p { color: #c7c7d1; font-size: 11px; margin: 0; max-width: 420px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.featured-overlay .row { margin-top: 3px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.featured-overlay .row .btn { padding: 4px 10px; font-size: 11.5px; }
.featured-overlay .row .meta { font-size: 11px; }
@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 { touch-action: pan-y; user-select: none; }
.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 .badge-updated { position: absolute; top: 8px; right: 8px; background: #16a34a; color: #fff; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 6px; letter-spacing: .02em; }
.game-card .badge-beta { position: absolute; top: 8px; left: 8px; background: #facc15; color: #1a1400; font-size: 10px; font-weight: 800; 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; align-items: center; }
.stars span { font-size: 13px; }
.stars-count { color: var(--text-muted); font-size: 12px !important; margin-left: 4px; }

.rail { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.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); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input[type="search"] { border-radius: var(--radius-sm); }
.search-input { flex: 1; max-width: 480px; }
.field { margin-bottom: var(--space-3); }
.field-error { border-color: #ef4444 !important; }
.field-wrap { position: relative; }
.field-wrap .field-error-mark { display: none; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #ef4444; font-weight: 700; font-size: 16px; pointer-events: none; }
.field-wrap.has-error input { padding-right: 26px; }
.field-wrap.has-error .field-error-mark { display: block; }
.field-error-mark-inline { display: none; color: #ef4444; font-weight: 700; font-size: 16px; align-items: center; padding: 0 2px; }
.field-error-mark-inline.show { display: inline-flex; }
.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; }
.impersonation-badge { display:flex;align-items:center;gap:4px;max-width:190px;padding:5px 7px;border:1px solid rgba(245,158,11,.45);border-radius:var(--radius-pill);background:rgba(245,158,11,.12);color:#fbbf24;font-size:11.5px;white-space:nowrap;overflow:hidden; }
.impersonation-badge span { overflow:hidden;text-overflow:ellipsis; }
.impersonation-badge button { border:0;background:transparent;color:#fbbf24;font-size:17px;line-height:1;padding:0 2px;cursor:pointer; }
.impersonation-badge button:hover { color:#fff; }
.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: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tab-bar::-webkit-scrollbar { display: none; }
.tab-bar button { flex: 0 0 auto; min-width: auto; 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; }
.tab-arrow:hover { background: rgba(255,255,255,.1) !important; }

.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; }
.version-rejection { margin:4px 0 7px;padding:7px 10px;border-left:3px solid var(--danger);border-radius:4px;background:rgba(239,68,68,.08);color:#fca5a5;font-size:12.5px;line-height:1.45; }

/* ---------- 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 { display:flex; align-items:center; gap:9px; 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; }
.menu-icon, .ui-icon { display:inline-flex; align-items:center; justify-content:center; width:18px; flex:0 0 18px; color:var(--link); font-size:17px; line-height:1; font-family:Georgia, serif; }
.user-menu .item.danger .menu-icon { color:var(--danger); }
.ui-icon-star { color:#fbbf24; }
.btn .ui-icon { margin-right:7px; }
.ui-icon-link svg { width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round; }
.profile-role-badge { display:inline-flex;align-items:center;width:max-content;padding:3px 8px;border-radius:var(--radius-pill);background:#166534;color:#dcfce7;font-size:11px;font-weight:800;line-height:1;text-transform:uppercase;letter-spacing:.04em; }
.profile-avatar-wrap { position:relative;display:inline-flex;flex:0 0 auto;padding-bottom:2px; }
.profile-avatar-wrap .profile-role-badge { position:absolute;left:50%;bottom:-1px;transform:translateX(-50%);z-index:2; }
@media (max-width: 720px) {
  .tab-bar button { flex:0 0 auto!important;min-width:max-content; }
  #profile-head { align-items:flex-start!important; }
  .app-header .search-dropdown { position:fixed;top:76px;left:2.5vw;right:auto;width:95vw;max-width:none; }
}
.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; bottom: 16px; z-index: 1000;
  max-width: 340px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  font-size: 12.5px; color: var(--text-muted);
}
.cookie-banner a { color: var(--link); }
.cookie-banner button { align-self: flex-end; }
@media (max-width: 420px) {
  .cookie-banner { left: 10px; right: 10px; max-width: none; }
}
.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; margin: 12px 0; max-height: 420px; overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.6;
}
.code-block code {
  background: none; padding: 0; white-space: pre-wrap; word-break: break-word;
  display: block;
}
.tok-keyword { color: #c586c0; }
.tok-string { color: #ce9178; }
.tok-comment { color: #6a9955; font-style: italic; }
.tok-tag { color: #569cd6; }
.tok-number { color: #b5cea8; }

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

.detail-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px; }
.game-actions-row { display:flex;align-items:center;gap:12px;flex-wrap:wrap; }
.game-action-btn { flex:none;white-space:nowrap; }
.game-rating { white-space:nowrap; }
.ranking-details-toggle { padding:2px 8px;font-size:14px;line-height:1.2; }
.ranking-details strong { color:var(--text);font-weight:600; }
@media (max-width: 720px) {
  .game-actions-row { width:100%;gap:8px;flex-wrap:wrap; }
  .game-rating { flex:0 0 100%; }
  .game-action-btn { flex:1 1 0;display:flex;min-width:0;padding-left:8px;padding-right:8px; }
  .btn + .game-action-btn { margin-left:0; }
}

.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; }

/* Tela de fim de jogo (#over-overlay em play.js) — "Resultado final" e
   placar/ranking lado a lado quando cabe (PC, celular na horizontal);
   empilhado em tela estreita/retrato, onde não sobra largura pros dois. */
.over-result-row { display: flex; flex-direction: row; align-items: flex-start; justify-content: center; gap: 24px; width: 100%; }
@media (max-width: 720px) {
  .over-result-row { flex-direction: column; align-items: center; gap: 12px; }
}

.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: 31; width: 26px; height: 40px; padding: 0;
  background: #facc15; color: #111; border: 1px solid #facc15; border-right: 0;
  border-radius: 8px 0 0 8px; cursor: pointer; font-size: 15px; line-height: 1; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
/* O dock é uma fileira flex [caixa, seta] ancorada na direita. O transform
   vai no dock INTEIRO (não na caixa), então a seta desliza junto com o menu
   ao abrir e volta com ele ao fechar — como se o menu empurrasse a seta.
   Fechado: translateX(100% - 26px) esconde a caixa pra fora da tela e deixa
   só os 26px da seta visíveis; aberto: translateX(0) mostra os dois. */
.sandbox-sidebar-dock { position:absolute;top:50%;right:0;z-index:31;display:flex;align-items:center;overflow:visible;transform:translateY(-50%) translateX(calc(100% - 26px));transition:transform .2s ease;touch-action:none;pointer-events:none; }
.sandbox-sidebar-dock.open { transform:translateY(-50%) translateX(0); }
.sandbox-sidebar-dock .sandbox-sidebar-toggle { position:relative;inset:auto;transform:none;flex:0 0 auto;pointer-events:auto;z-index:32; }
.sandbox-sidebar-dock .sandbox-sidebar,
.sandbox-sidebar-dock .sandbox-sidebar.open { position:relative;top:auto;right:auto;transform:none;transition:none;pointer-events:none; }
.sandbox-sidebar-dock.open .sandbox-sidebar { pointer-events:auto; }
/* Destaque da seta da barra lateral a cada Jogar/Continuar (play.js) —
   leve sonar: zoom + brilho que volta sozinho, sem deslocar a seta do lugar
   (o transform do dock continua intacto) e sem bloquear clique. */
.sandbox-sidebar-toggle.hint {
  animation: sidebar-toggle-hint 1.1s ease-out 2;
  contain: paint;
}
@keyframes sidebar-toggle-hint {
  0%   { transform: scale(1);   filter: drop-shadow(0 0 0 rgba(250,204,21,0)); }
  30%  { transform: scale(1.25); filter: drop-shadow(0 0 12px rgba(250,204,21,.95)); }
  70%  { transform: scale(1.15); filter: drop-shadow(0 0 7px rgba(250,204,21,.55)); }
  100% { transform: scale(1);   filter: drop-shadow(0 0 0 rgba(250,204,21,0)); }
}
/* 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: 30; 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-ui-icon { display:inline-flex;width:18px;align-items:center;justify-content:center;color:var(--link);font-size:18px;font-family:Georgia,serif;line-height:1; }
.sandbox-sidebar-danger { border-color: var(--danger); color: var(--danger); margin-top: auto; }
.sandbox-sidebar 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;
}

/* ---------- sliders de som (popup de volume da sandbox) ---------------- */
input[type="range"].sandbox-vol {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 3px;
  background: var(--border-strong); outline: none; cursor: pointer;
}
input[type="range"].sandbox-vol::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--primary); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.5);
}
input[type="range"].sandbox-vol::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: var(--primary);
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.5); cursor: pointer;
}

/* ---------- menu flutuante da área logada (site inteiro, ver shared.js) --- */
/* Mesmo visual da sandbox-sidebar acima, mas position:fixed ancorada no
   canto da PÁGINA (não de um game-stage) — por isso um FAB redondo no
   canto inferior direito, longe do toggle vertical-centralizado do jogo
   (evita sobrepor os dois quando a página de jogo ainda não está em tela
   cheia, já que ambos podem existir juntos ali). */
.floating-sidebar-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 45; }
.floating-sidebar-toggle {
  width: 46px; height: 46px; padding: 0; border-radius: 50%;
  background: #facc15; color: #111; border: 1px solid #facc15;
  cursor: pointer; font-size: 18px; line-height: 1; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
}
.floating-sidebar {
  position: absolute; right: 0; bottom: 56px; width: 220px; max-width: 78vw;
  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-origin: bottom right; transform: translateY(10px) scale(.96); opacity: 0;
  pointer-events: none; transition: transform .15s ease, opacity .15s ease;
}
.floating-sidebar.open { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }
@media (max-width: 420px) {
  .floating-sidebar-wrap { right: 12px; bottom: 12px; }
}

/* ---------- 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; }
}

/* ---------- lightbox de screenshots ---------- */

.lightbox-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  touch-action: pan-y; user-select: none;
}
.lightbox-overlay img {
  max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 6px;
  pointer-events: none; transition: opacity .15s;
}
.lightbox-close {
  position: absolute; top: 14px; right: 16px; background: none; border: none;
  color: #fff; font-size: 28px; cursor: pointer; z-index: 202;
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: background .15s;
}
.lightbox-close:hover { background: rgba(255,255,255,.15); }
.lightbox-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); background: none;
  border: none; color: #fff; font-size: 36px; cursor: pointer; z-index: 202;
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: background .15s; opacity: .7;
}
.lightbox-arrow:hover { background: rgba(255,255,255,.15); opacity: 1; }
.lightbox-arrow.prev { left: 12px; }
.lightbox-arrow.next { right: 12px; }
.lightbox-counter {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 13px; font-weight: 600; background: rgba(0,0,0,.5);
  padding: 4px 12px; border-radius: 10px; pointer-events: none;
}
#screenshots img { width: 100%; }
.ss-dots { display: none; }
@media (max-width: 720px) {
  .lightbox-arrow { display: none; }
  .lightbox-overlay img { max-width: 100vw; max-height: 80vh; border-radius: 0; }
  #screenshots {
    display: flex !important; overflow-x: auto; scroll-snap-type: x mandatory;
    gap: 10px !important; padding: 0 20px 8px; -webkit-overflow-scrolling: touch;
    scroll-padding: 0 20px;
  }
  #screenshots img { min-width: 82vw; scroll-snap-align: center; border-radius: 8px !important; }
  .ss-dots { display:flex; justify-content:center; gap:6px; margin-top:10px; }
  .ss-dot { width:7px; height:7px; border-radius:50%; background:rgba(255,255,255,.25); transition:background .2s; }
  .ss-dot.active { background:#fff; }
}

/* ---- Toggle switch (Security panel) ---- */
.switch {
  position:relative; display:inline-block; width:40px; height:22px; flex-shrink:0;
}
.switch input { opacity:0; width:0; height:0; }
.switch .slider {
  position:absolute; inset:0; cursor:pointer; border-radius:22px;
  background:rgba(255,255,255,.15); transition:background .2s;
}
.switch .slider::before {
  content:''; position:absolute; left:3px; top:3px;
  width:16px; height:16px; border-radius:50%;
  background:#fff; transition:transform .2s;
}
.switch input:checked + .slider { background:var(--primary); }
.switch input:checked + .slider::before { transform:translateX(18px); }
