@font-face {
    font-family: 'JetBrains Mono';
    src: url('/fonts/JetBrainsMono.ttf') format('truetype');
    font-weight: 100 800;
    font-display: swap;
}

:root {
    --bg: #14161a;
    --bg-elevated: #1b1e24;
    --bg-card: #1e2229;
    --border: #2a2f38;
    --text: #e6e8ec;
    --text-muted: #9aa2ae;
    --text-dim: #6b7280;
    --gold: #f8d000;
    --gold-dim: #c9a900;
    --danger: #ef5350;
    --ok: #4caf7d;
    --radius: 10px;
    --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
    --sans: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* Seleção/foco com cor da marca (evita o "quadrado branco" do realce padrão no tema escuro) */
::selection { background: rgba(248, 208, 0, .28); color: var(--text); }
:focus:not(:focus-visible) { outline: none; }
h1:focus, h2:focus, [tabindex="-1"]:focus { outline: none; background: transparent; }

html, body {
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    background-image:
        repeating-linear-gradient(0deg, transparent 0 31px, rgba(255,255,255,.018) 31px 32px),
        repeating-linear-gradient(90deg, transparent 0 31px, rgba(255,255,255,.018) 31px 32px);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4, .brand-font { font-family: var(--mono); font-weight: 700; line-height: 1.25; }

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: 1060px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
    border-bottom: 1px solid var(--border);
    background: rgba(20,22,26,.85);
    backdrop-filter: blur(6px);
    position: sticky; top: 0; z-index: 50;
}
.site-header .bar { display: flex; align-items: center; gap: 20px; height: 64px; }
.site-header .logo img { height: 34px; display: block; }
.site-header nav { display: flex; gap: 18px; margin-left: 8px; }
.site-header nav a { color: var(--text-muted); font-family: var(--mono); font-size: .9rem; }
.site-header nav a:hover { color: var(--text); text-decoration: none; }
.header-spacer { flex: 1; }

.search-box { display: flex; }
.search-box input {
    background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text);
    border-radius: var(--radius) 0 0 var(--radius); padding: 7px 12px; width: 200px; font-size: .9rem;
}
.search-box button {
    background: var(--gold); color: #1a1a1a; border: none; font-weight: 700;
    border-radius: 0 var(--radius) var(--radius) 0; padding: 0 14px; cursor: pointer;
}

.lang-switch { display: flex; gap: 6px; font-family: var(--mono); font-size: .85rem; }
.lang-switch a { color: var(--text-dim); }
.lang-switch a.active { color: var(--gold); font-weight: 700; }

.btn {
    display: inline-block; font-family: var(--mono); font-weight: 700; font-size: .9rem;
    padding: 8px 16px; border-radius: var(--radius); border: 1px solid var(--border);
    background: var(--bg-elevated); color: var(--text); cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--gold-dim); text-decoration: none; }
.btn-gold { background: var(--gold); color: #1a1a1a; border-color: var(--gold); }
.btn-gold:hover { background: #ffdf33; }

/* Layout */
main { padding: 28px 0 64px; }
.breadcrumb { color: var(--text-dim); font-size: .85rem; font-family: var(--mono); margin-bottom: 16px; }
.breadcrumb a { color: var(--text-muted); }
.page-title { font-size: 1.8rem; margin: 0 0 6px; }
.page-sub { color: var(--text-muted); margin: 0 0 24px; }

/* Hero (home) */
.hero { display: flex; gap: 28px; align-items: center; padding: 12px 0 32px; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.hero-symbol { width: 116px; height: auto; flex-shrink: 0; filter: drop-shadow(0 8px 20px rgba(0,0,0,.5)); }
.hero-title { font-size: 1.9rem; margin: 0 0 12px; }
.hero-text { color: var(--text-muted); max-width: 680px; margin: 0; }
.section-title { font-family: var(--mono); font-size: .95rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 3px; margin: 0 0 16px; }
@media (max-width: 640px) { .hero { flex-direction: column; text-align: center; } }

/* Game cards (home) */
.game-card { display: flex; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; transition: border-color .15s, transform .15s; }
.game-card:hover { border-color: var(--gold-dim); transform: translateY(-2px); text-decoration: none; }
.game-card-accent { width: 5px; background: linear-gradient(var(--gold), var(--gold-dim)); flex-shrink: 0; }
.game-card-body { padding: 18px 20px; }
.game-card-body h3 { margin: 0 0 6px; color: var(--text); font-size: 1.2rem; }
.game-card-body p { margin: 0 0 12px; color: var(--text-muted); font-size: .9rem; }
.game-card-cta { font-family: var(--mono); font-size: .82rem; color: var(--gold); font-weight: 700; }

/* Cards / lists */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px 20px; transition: border-color .15s;
}
.card:hover { border-color: var(--gold-dim); }
.card h3 { margin: 0 0 6px; font-size: 1.1rem; }
.card h3 a { color: var(--text); }
.card p { margin: 0; color: var(--text-muted); font-size: .9rem; }
.card .meta { margin-top: 10px; color: var(--text-dim); font-size: .8rem; font-family: var(--mono); }

.list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.row {
    display: flex; align-items: center; gap: 14px; padding: 14px 18px;
    background: var(--bg-card); border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: none; }
.row:hover { background: var(--bg-elevated); }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 600; color: var(--text); }
.row .title a { color: var(--text); }
.row .sub { color: var(--text-dim); font-size: .82rem; font-family: var(--mono); margin-top: 3px; }
.row .stats { color: var(--text-muted); font-size: .82rem; font-family: var(--mono); text-align: right; white-space: nowrap; }
.row-link { text-decoration: none; color: inherit; cursor: pointer; }
.row-link:hover { text-decoration: none; }
.row-link .title { color: var(--text); }

/* Badges */
.badge { font-family: var(--mono); font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; text-transform: uppercase; }
.badge-open { background: rgba(76,175,125,.15); color: var(--ok); }
.badge-answered { background: rgba(248,208,0,.15); color: var(--gold); }
.badge-closed { background: rgba(155,162,174,.15); color: var(--text-muted); }
.badge-pin { background: rgba(248,208,0,.12); color: var(--gold); }
.badge-lock { background: rgba(239,83,80,.14); color: var(--danger); }

/* Topic / posts */
.post { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; }
.post.solution { border-color: var(--gold-dim); box-shadow: 0 0 0 1px rgba(248,208,0,.25); }
.post-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.post-head .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--bg-elevated); object-fit: cover; }
.post-head .author { font-family: var(--mono); font-weight: 700; font-size: .9rem; }
.post-head .when { color: var(--text-dim); font-size: .78rem; font-family: var(--mono); }
.post-body { padding: 18px; }
.post-body img { max-width: 100%; border-radius: 8px; }
.post-body pre { background: #0d0f12; border: 1px solid var(--border); border-radius: 8px; padding: 14px; overflow-x: auto; font-family: var(--mono); font-size: .88rem; }
.post-body code { font-family: var(--mono); }
.post-body :not(pre) > code { background: #0d0f12; padding: 1px 6px; border-radius: 5px; font-size: .88rem; }
.post-body blockquote { border-left: 3px solid var(--gold-dim); margin: 0; padding: 4px 16px; color: var(--text-muted); }
.post-body a { word-break: break-word; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); color: var(--text-dim); font-size: .82rem; padding: 28px 0; }
.site-footer .bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--text-muted); }

.user-name { font-family: var(--mono); font-size: .9rem; color: var(--gold); font-weight: 700; }
.user-chip { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.user-chip:hover { text-decoration: none; }
.user-chip img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.user-chip span { font-family: var(--mono); font-size: .9rem; color: var(--gold); font-weight: 700; }

/* Profile */
.profile-head { display: flex; align-items: center; gap: 18px; margin-bottom: 8px; }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.profile-avatar-empty { display: flex; align-items: center; justify-content: center; background: var(--bg-elevated); color: var(--gold); font-family: var(--mono); font-size: 2rem; font-weight: 700; }
.profile-name { margin: 0 0 8px; font-size: 1.5rem; }
.profile-roles { display: flex; gap: 6px; }

/* Cookie banner */
.cookie-banner {
    position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
    max-width: 720px; width: calc(100% - 32px);
    display: flex; align-items: center; gap: 16px; justify-content: space-between;
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 12px 16px; font-size: .85rem; color: var(--text-muted); box-shadow: 0 10px 30px rgba(0,0,0,.4); z-index: 100;
}

/* Forms */
.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-family: var(--mono); font-size: .82rem; color: var(--text-muted); margin-bottom: 6px; }
.input, .textarea, .select {
    width: 100%; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text);
    border-radius: var(--radius); padding: 10px 12px; font-family: var(--sans); font-size: .95rem;
}
.textarea { min-height: 160px; resize: vertical; font-family: var(--mono); font-size: .9rem; }
.form-actions { display: flex; gap: 10px; align-items: center; }
.error-msg { color: var(--danger); font-size: .88rem; margin: 8px 0; }
.action-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 24px; }
.action-bar form { display: inline; }
.btn-sm { padding: 5px 11px; font-size: .82rem; }
.btn-danger { color: var(--danger); border-color: rgba(239,83,80,.4); }
.reply-box { margin-top: 24px; }
.reply-box h3 { font-size: 1.1rem; margin-bottom: 12px; }

.empty { color: var(--text-muted); padding: 40px; text-align: center; border: 1px dashed var(--border); border-radius: var(--radius); }

.blazor-error-boundary { background: var(--danger); padding: 1rem; color: white; border-radius: var(--radius); }
.blazor-error-boundary::after { content: "Ocorreu um erro."; }
