/* GZ Nexus — estética gamer escura original */
:root {
  --bg: #0b0e17;
  --bg2: #111627;
  --card: #151c31;
  --card2: #1a2340;
  --border: #263055;
  --text: #e8ecf8;
  --muted: #9aa3c7;
  --accent: #7c3aed;
  --accent2: #06b6d4;
  --gold: #f5b942;
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: radial-gradient(1200px 600px at 80% -10%, #1b1440 0%, var(--bg) 55%) fixed, var(--bg);
  color: var(--text); font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column;
}
.container { width: min(1120px, 94%); margin: 0 auto; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; }
.group-title {
  margin: 1.6rem 0 .8rem; font-size: 1.05rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1.5px; color: var(--gold);
  border-bottom: 2px solid var(--border); padding-bottom: .4rem;
}
.group-title:first-of-type { margin-top: .6rem; }
/* Miniatura das categorias */
.cat-card { display: flex; gap: 1rem; align-items: center; }
.cat-thumb {
  width: 72px; height: 72px; border-radius: 14px; object-fit: cover;
  border: 1px solid var(--border); flex-shrink: 0; background: var(--bg2);
}
.cat-body { flex: 1; min-width: 0; }

/* Grade de categorias (tiles) */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.cat-tile {
  position: relative; display: block; border-radius: 12px; overflow: hidden;
  aspect-ratio: 304 / 92; border: 1px solid #1e3a6e; text-decoration: none;
  background: linear-gradient(135deg, #0d1b3d 0%, #0a1230 60%, #12245c 100%);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.cat-tile:hover { text-decoration: none; border-color: var(--accent2);
  box-shadow: 0 0 22px rgba(6,182,212,.28); transform: translateY(-2px); }
.cat-tile-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cat-tile-art {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 3.2rem; font-weight: 800; color: rgba(126,164,232,.28);
  background: radial-gradient(circle at 50% 30%, rgba(28,64,150,.55), transparent 70%);
}
.cat-tile-shade { position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(4,8,20,.05) 0%, rgba(4,8,20,.88) 100%); }
.cat-tile-meta { position: absolute; left: 0; right: 0; bottom: 0; padding: .7rem .85rem; }
.cat-tile-meta strong { display: block; color: #fff; font-size: .98rem;
  letter-spacing: 1px; text-transform: uppercase; }
.cat-tile-meta small { color: #7ea4e8; font-size: .7rem;
  text-transform: uppercase; letter-spacing: 1.2px; }
@media (max-width: 900px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .cat-grid { grid-template-columns: 1fr; } }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Topbar */
.topbar { background: rgba(11,14,23,.92); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; backdrop-filter: blur(6px); }
.topbar-inner { display: flex; align-items: center; gap: 1rem; padding: .6rem 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .55rem; }
.brand:hover { text-decoration: none; }
.logo { width: 38px; height: 38px; }
.logo-img { border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.brand-name { font-size: 1.35rem; font-weight: 800; letter-spacing: .5px; color: var(--text); }
.brand-name em { font-style: normal; background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav { display: flex; gap: .9rem; margin-left: .5rem; }
.nav a { color: var(--text); font-weight: 600; font-size: .95rem; }
.nav a:hover { color: var(--accent2); text-decoration: none; }
.nav-admin { color: var(--gold) !important; }
.userbox { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.userlink { font-weight: 700; color: var(--text); }
.points-badge { background: #2a2140; border: 1px solid var(--gold); color: var(--gold); border-radius: 999px; padding: .1rem .6rem; font-size: .8rem; font-weight: 700; }
.searchbox input { background: var(--bg2); border: 1px solid var(--border); color: var(--text); border-radius: 999px; padding: .35rem .8rem; width: 170px; }
.menu-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 8px; font-size: 1.2rem; padding: .2rem .6rem; }

/* Buttons & forms */
.btn { display: inline-block; background: var(--card2); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: .55rem 1rem; font-weight: 600; cursor: pointer; }
.btn:hover { text-decoration: none; border-color: var(--accent); }
.btn-primary { background: linear-gradient(90deg, var(--accent), #5b21b6); border: none; }
.btn-danger { background: #3a1620; border-color: var(--danger); color: #ffb4b4; }
.btn-sm { padding: .3rem .7rem; font-size: .85rem; }
form.inline { display: inline; }
.field { margin-bottom: .9rem; }
.field label { display: block; font-weight: 600; margin-bottom: .3rem; }
.field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=number], .field input[type=date], .field select, .field textarea {
  width: 100%; background: var(--bg2); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: .55rem .7rem; font-size: 1rem;
}
.field textarea { min-height: 130px; resize: vertical; }
.field .errors { color: #ff9d9d; font-size: .85rem; margin: .25rem 0 0; padding: 0; list-style: none; }
.form-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; max-width: 640px; }

/* Cards & lists */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.card h2, .card h3 { margin-top: 0; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stat { text-align: center; }
.stat .num { font-size: 2rem; font-weight: 800; background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.list-row { display: flex; gap: .9rem; align-items: center; padding: .8rem .2rem; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: none; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent2)); display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; flex-shrink: 0; }
.avatar-xs { width: 30px; height: 30px; font-size: .8rem; }

/* Página inicial estilo gamezerlegends (índice clássico + sidebar) */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.2rem; align-items: start; }
.section-title { margin: 0 0 .4rem; padding-bottom: .6rem; border-bottom: 2px solid var(--border);
  font-size: 1.15rem; letter-spacing: .5px; }
.forum-section { padding: 1.1rem 1.2rem; }
.forum-row { display: flex; gap: 1rem; align-items: center; padding: .85rem 0;
  border-bottom: 1px solid var(--border); }
.forum-row:last-child { border-bottom: none; }
.forum-icon-link { flex-shrink: 0; }
.forum-icon { width: 112px; height: 34px; object-fit: cover; border-radius: 8px;
  border: 1px solid #1e3a6e; display: block; background: var(--bg2); }
.forum-icon-fallback { display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem; color: var(--accent2); }
.forum-info { flex: 1; min-width: 0; }
.forum-counts { flex-shrink: 0; text-align: right; min-width: 86px; }
.forum-counts div { white-space: nowrap; }
.forum-latest { flex-shrink: 0; width: 250px; display: flex; gap: .5rem; align-items: center; }
.forum-latest-text { min-width: 0; }
.forum-latest-text a { display: inline-block; max-width: 100%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.home-side { display: flex; flex-direction: column; gap: 1.2rem; }
.side-widget h3 { margin-top: 0; font-size: 1rem; letter-spacing: .5px;
  border-bottom: 1px solid var(--border); padding-bottom: .5rem; }
.contrib-list { list-style: none; margin: 0; padding: 0; counter-reset: contrib; }
.contrib-list li { display: flex; gap: .5rem; align-items: center; padding: .35rem 0; }
.contrib-list li::before { counter-increment: contrib; content: counter(contrib);
  font-weight: 800; color: var(--gold); min-width: 1.2rem; }
.contrib-list .points-badge { margin-left: auto; }
.stat-row { display: flex; justify-content: space-between; padding: .3rem 0;
  border-bottom: 1px dashed var(--border); }
.stat-row:last-child { border-bottom: none; }
@media (max-width: 980px) {
  .home-grid { grid-template-columns: 1fr; }
  .forum-latest { display: none; }
}
.badge { display: inline-block; font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .12rem .6rem; border: 1px solid var(--border); background: var(--bg2); color: var(--muted); }
.badge-upcoming { color: var(--accent2); border-color: var(--accent2); }
.badge-ongoing { color: var(--gold); border-color: var(--gold); }
.badge-finished { color: var(--success); border-color: var(--success); }
.badge-admin { color: #fff; background: var(--accent); border: none; }
.hero { text-align: center; padding: 2.6rem 1rem; }
.hero h1 { font-size: 2.4rem; margin: .4rem 0; }
.hero p { color: var(--muted); max-width: 640px; margin: 0 auto 1.2rem; }
.hero-banner {
  position: relative; overflow: hidden; text-align: left;
  min-height: 360px; display: flex; align-items: center;
  padding: 3rem 2.5rem;
  background: url("/static/img/banner-gznexus.jpg") center/cover no-repeat;
}
.hero-banner::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(11,14,23,.93) 0%, rgba(11,14,23,.6) 55%, rgba(11,14,23,.15) 100%);
}
.hero-content { position: relative; z-index: 1; max-width: 580px; }
.hero-content p { color: #cdd5f0; margin-left: 0; }
.hero-banner .btn { box-shadow: 0 4px 18px rgba(0,0,0,.5); }
.hero h1 .brand-name { font-size: inherit; }

/* Bracket */
.bracket { display: flex; gap: 1.2rem; overflow-x: auto; padding-bottom: .6rem; }
.round { min-width: 230px; }
.round h4 { text-align: center; color: var(--gold); }
.match { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: .6rem .7rem; margin-bottom: .8rem; }
.match .player { display: flex; justify-content: space-between; padding: .25rem 0; }
.match .winner { color: var(--gold); font-weight: 700; }
.match .score { font-weight: 800; }
.match-form { margin-top: .5rem; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.match-form input { width: 64px; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: .3rem .4rem; }

/* Flashes */
.flashes { margin: 1rem 0; }
.flash { border-radius: 10px; padding: .7rem 1rem; margin-bottom: .5rem; border: 1px solid; }
.flash-success { background: #0e2a1c; border-color: var(--success); }
.flash-danger { background: #2a1215; border-color: var(--danger); }
.flash-warning { background: #2a2210; border-color: var(--gold); }
.flash-info { background: #12233a; border-color: var(--accent2); }

/* Pagination */
.pagination { display: flex; gap: .4rem; justify-content: center; margin: 1.2rem 0; flex-wrap: wrap; }
.pagination a, .pagination span { border: 1px solid var(--border); border-radius: 8px; padding: .35rem .7rem; background: var(--card); }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }

/* Tables */
table.table { width: 100%; border-collapse: collapse; }
table.table th, table.table td { padding: .6rem .7rem; border-bottom: 1px solid var(--border); text-align: left; }
table.table th { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .4px; }

/* Post */
.post { display: flex; gap: 1rem; }
.post-side { min-width: 150px; text-align: center; }
.post-body { flex: 1; min-width: 0; }
.post-body .content { white-space: pre-wrap; word-wrap: break-word; }
.post-meta { color: var(--muted); font-size: .8rem; margin-bottom: .4rem; }

/* Footer */
.footer { margin-top: auto; border-top: 1px solid var(--border); padding: 1rem 0; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

main.container { padding: 1.2rem 0 2rem; flex: 1; width: min(1120px, 94%); }

@media (max-width: 760px) {
  .nav, .userbox .searchbox { display: none; }
  body.menu-open .nav { display: flex; flex-direction: column; width: 100%; }
  body.menu-open .userbox .searchbox { display: block; width: 100%; }
  .menu-toggle { display: block; margin-left: auto; }
  .userbox { margin-left: 0; }
  .post { flex-direction: column; }
  .post-side { text-align: left; display: flex; gap: .6rem; align-items: center; }
  .hero h1 { font-size: 1.7rem; }
}
