/* =====================================================================
   DoppelNews: identidade visual do TCC original (preto, laranja e cores
   por seção), reescrita sem Bootstrap, responsiva e acessível.
   ===================================================================== */

@font-face { font-family: "Graduate Local"; src: url("../fonts/Graduate.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Orbitron Local"; src: url("../fonts/Orbitron.ttf") format("truetype"); font-display: swap; }

:root {
    --bg: #000;
    --panel: #131313;
    --panel-2: #191919;
    --line: #2a2a2a;
    --text: #fff;
    --muted: #8c8c96;
    --orange: #ff550a;
    --orange-soft: #ff611a;
    --cyan: #00f8ff;
    --green: #16dc5b;
    --gold: #ffd700;
    --purple: #b46cff;
    --red: #ff4d4d;
    --accent: var(--orange);
    --radius: .5em;
    --pixel: "Press Start 2P", monospace;
    --display: "Graduate", "Graduate Local", Georgia, serif;
    --tech: "Orbitron", "Orbitron Local", "Segoe UI", sans-serif;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --header-h: 76px;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
/* Coluna flexível: em páginas curtas o rodapé fica colado no fim da janela. */
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); font: 16px/1.6 var(--sans); overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
code { font-family: ui-monospace, Consolas, monospace; background: var(--panel-2); color: var(--gold); padding: .1em .4em; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--orange); color: #000; padding: 8px 14px; font-weight: 700; }
.skip-link:focus { top: 12px; }

.container { width: min(1140px, 100% - 32px); margin-inline: auto; }
.container.narrow { width: min(460px, 100% - 32px); }
.narrow-wide { width: min(860px, 100% - 32px); margin-inline: auto; }
main { flex: 1; padding-bottom: 40px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.pixel { font-family: var(--pixel); font-size: 10px; line-height: 1.8; letter-spacing: .02em; }
.eyebrow { color: var(--accent); margin-bottom: .6em; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; font-family: var(--display); }

/* Cores por seção (o mesmo código de cores do menu) */
.accent-orange { --accent: var(--orange); }
.accent-cyan { --accent: var(--cyan); }
.accent-green { --accent: var(--green); }
.accent-gold { --accent: var(--gold); }
.accent-purple { --accent: var(--purple); }

/* ---------- Cabeçalho ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgb(19 19 19 / .6); backdrop-filter: blur(8px); transition: background .3s, box-shadow .3s; }
.site-header.is-scrolled { background: rgb(13 13 13 / .95); box-shadow: 0 6px 18px rgb(0 0 0 / .6); animation: header-in .3s ease; }
@keyframes header-in { from { opacity: .3; } to { opacity: 1; } }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: var(--header-h); }
.brand img { width: 180px; height: auto; }
.menu { display: flex; align-items: center; gap: 24px; flex: 1; }
.main-nav { display: flex; gap: 6px; margin-left: auto; }

.nav-link { --c: var(--orange-soft); position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; color: var(--c); font: 10px/1 var(--pixel); }
.nav-link .icon { width: 24px; height: 24px; }
.nav-link::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; background: var(--c); transform: scaleX(0); transform-origin: left; transition: transform .5s; }
.nav-link:hover { text-decoration: none; }
.nav-link:hover::after, .nav-link[aria-current]::after { transform: scaleX(1); }
.nav-rooms, .nav-games { --c: var(--cyan); }
.nav-heroes, .nav-anime { --c: var(--green); }
.nav-stories { --c: var(--purple); }
.nav-help { --c: var(--gold); }

.account { display: flex; align-items: center; gap: 14px; }
.account-link { display: inline-flex; align-items: center; gap: 8px; color: var(--orange-soft); font: 10px var(--pixel); }
.account-link .icon { width: 30px; height: 30px; }
.dropdown { position: relative; }
.dropdown summary { list-style: none; cursor: pointer; color: var(--orange-soft); padding: 10px 4px; }
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown summary::after { content: " ▾"; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: var(--panel-2); border: 1px solid var(--line); border-top: 2px solid var(--orange); border-radius: 0 0 var(--radius) var(--radius); padding: 8px 0; box-shadow: 0 12px 30px rgb(0 0 0 / .7); }
.dropdown-menu a, .dropdown-menu button { display: block; width: 100%; text-align: left; padding: 9px 16px; color: var(--text); background: none; border: 0; font: inherit; font-size: .95rem; cursor: pointer; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--orange); color: #000; text-decoration: none; }
.dropdown-menu hr { margin: 6px 0; }
.dropdown-menu form { margin: 0; }

.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 6px; padding: 10px; cursor: pointer; }
.nav-toggle span:not(.sr-only) { display: block; width: 22px; height: 2px; background: var(--text); margin: 4px 0; transition: transform .2s, opacity .2s; }
.menu-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
.menu-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.icon { width: 1em; height: 1em; flex: none; vertical-align: -.125em; }

/* ---------- Botões e formulários ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: #000; border: 2px solid var(--accent); border-radius: 4px; padding: .7em 1.4em; font: 700 .95rem var(--sans); cursor: pointer; transition: background .4s, color .4s; }
.btn:hover { background: #000; color: var(--accent); text-decoration: none; }
.btn-small { padding: .45em 1em; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-outline { background: transparent; color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: #000; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--text); color: var(--text); }
.link-button { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; }
.link-button:hover { color: var(--text); }
.link-button.danger:hover, .danger { color: var(--red); }

.form label { display: block; font-weight: 600; margin-bottom: 14px; }
.form small { font-weight: 400; color: var(--muted); }
input, select, textarea { display: block; width: 100%; margin-top: 6px; padding: .65em .8em; font: inherit; color: var(--text); background: #0b0b0b; border: 1px solid #333; border-radius: 4px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
input[type=checkbox] { display: inline; width: auto; margin: 0 6px 0 0; accent-color: var(--orange); }
textarea { resize: vertical; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px 4px; margin: 0 0 16px; }
legend { padding: 0 6px; font-weight: 700; }
.check { display: flex !important; align-items: center; font-weight: 500 !important; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 16px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 8px; }

.flashes { margin-top: 16px; }
.alert { margin: 0 0 10px; padding: 12px 16px; border-radius: 4px; background: var(--panel); border-left: 4px solid var(--muted); }
.alert-success { border-color: var(--green); }
.alert-error { border-color: var(--red); }
.alert-info { border-color: var(--cyan); }

/* ---------- Painéis e títulos ---------- */
.panel { background: var(--panel); border-radius: var(--radius); padding: clamp(18px, 3vw, 32px); margin-top: 24px; border-top: 3px solid var(--accent); }
.panel-title { font-family: var(--display); font-size: 1.5rem; color: var(--accent); }
.form-card { margin-top: 40px; }
.form-card.wide { max-width: 860px; margin-inline: auto; }
.display-title { font-family: var(--display); font-size: clamp(2rem, 6vw, 3.6rem); color: var(--accent); margin: 0 0 .3em; }
.section-head { text-align: center; margin-bottom: 24px; }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.toolbar .category-menu { margin: 0; }

.page-hero { position: relative; display: grid; align-items: end; min-height: clamp(220px, 34vw, 340px); padding: 48px 0 32px; background: linear-gradient(180deg, rgb(0 0 0 / .1), #000), var(--hero-image, none) center / cover no-repeat, #111; }
.page-hero-title { font-family: var(--display); font-size: clamp(2.4rem, 7vw, 4.5rem); color: var(--accent); margin: 0; text-shadow: 0 4px 18px #000; }
.page-hero-subtitle { max-width: 60ch; font-family: var(--display); font-size: 1.1rem; margin: .4em 0 0; text-shadow: 0 2px 10px #000; }

/* Menu de categorias (botões com borda branca; ativo em laranja) */
.category-menu { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 20px; }
.category-menu a { padding: 10px 14px; border: 2px solid #fff; border-radius: 4px; color: #fff; transition: border-color .3s, background .3s; }
.category-menu a:hover { border-color: var(--accent); text-decoration: none; }
.category-menu a[aria-current] { background: var(--accent); border-color: var(--accent); color: #000; }

.badge { display: inline-block; padding: .15em .6em; border-radius: 999px; border: 1px solid var(--line); font-size: .75rem; font-weight: 700; color: var(--muted); vertical-align: middle; }
.badge-open { color: var(--green); border-color: currentColor; }
.badge-full { color: var(--red); border-color: currentColor; }
.badge-victory { color: var(--green); border-color: currentColor; }
.badge-survived { color: var(--gold); border-color: currentColor; }
.badge-defeat { color: var(--red); border-color: currentColor; }

/* ---------- Carrossel de destaques ---------- */
.carousel { position: relative; height: clamp(420px, 78vh, 800px); margin-top: calc(var(--header-h) * -1); background: #000; overflow: hidden; }
.flashes ~ main .carousel, .flashes ~ main .article-cover { margin-top: 0; }
.carousel-slide { position: absolute; inset: 0; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-slide.is-active img { animation: zoom 9s ease-out both; }
@keyframes zoom { from { transform: scale(1.08); } to { transform: scale(1); } }
.carousel-caption { position: absolute; left: 10%; top: 30%; max-width: min(560px, 80%); padding: clamp(24px, 5vw, 64px); border-left: 2px solid var(--orange); background: rgb(0 0 0 / .6); }
.carousel-slide.is-active .carousel-caption { animation: fade-up .8s .2s ease both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.carousel-title { display: inline-block; font-family: var(--display); font-size: clamp(1.5rem, 4vw, 2.35rem); line-height: 1.2; color: #fff; padding-bottom: 8px; border-bottom: 2px solid var(--orange); }
.carousel-title:hover { color: var(--orange); text-decoration: none; }
.carousel-text { font-family: var(--display); font-size: clamp(1rem, 2vw, 1.3rem); color: #fff; margin: 16px 0 0; }
.carousel-next { position: absolute; right: 0; top: 50%; width: 140px; height: 52px; border: 0; background: var(--orange); color: #000; cursor: pointer; transition: background .5s, color .5s; }
.carousel-next:hover { background: #000; color: var(--orange); }
.carousel-dots { position: absolute; left: 50%; bottom: 24px; display: flex; gap: 10px; transform: translateX(-50%); }
.carousel-dots button { width: 34px; height: 4px; border: 0; background: rgb(255 255 255 / .4); cursor: pointer; padding: 0; }
.carousel-dots button[aria-selected="true"] { background: var(--orange); }

/* ---------- Lista de notícias ---------- */
.news-panel { margin-top: 32px; }
.search { display: flex; gap: 8px; max-width: 520px; margin: 0 auto 24px; }
.search input { margin: 0; }
.search-summary { text-align: center; }
.news-list { display: grid; gap: 22px; }
.news-item { display: grid; grid-template-columns: minmax(0, 42%) 1fr; gap: 24px; align-items: start; }
.news-thumb { display: block; height: 266px; overflow: hidden; border-radius: 4px; background: var(--panel-2); }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.news-thumb:hover img { transform: scale(1.1); }
.thumb-fallback { display: grid; place-items: center; height: 100%; color: var(--orange); font-size: 4rem; }
.news-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 6px; font: 600 1.01rem var(--display); letter-spacing: 1.3px; color: var(--muted); }
.news-tag { color: var(--accent); }
.news-title { font: 700 1.35rem/1.3 var(--display); margin: 0 0 .5em; }
.news-title a { color: #fff; background: linear-gradient(var(--orange-soft), var(--orange-soft)) left bottom / 0 2px no-repeat; transition: background-size .5s; }
.news-title a:hover { text-decoration: none; background-size: 100% 2px; }
.news-summary { color: var(--muted); font: 600 1rem var(--display); }

.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; margin-top: 32px; }
.pager-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 2px solid #fff; border-radius: 4px; color: #fff; }
.pager-link:hover { border-color: var(--orange); text-decoration: none; }
.pager-current { padding: 8px 18px; border: 2px solid var(--orange); border-radius: 5px; font-size: 13px; }

.promo { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; margin-top: 24px; padding: clamp(24px, 4vw, 44px); border-radius: var(--radius); border-left: 3px solid var(--purple); background: linear-gradient(135deg, #1b0d24, #131313 60%); }
.promo h2 { font: 2rem var(--display); }
.promo .eyebrow { color: var(--purple); }
.promo .btn { --accent: var(--purple); }
.promo-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.promo-list a { display: grid; padding: 14px 16px; border: 1px solid var(--line); border-radius: 6px; color: #fff; transition: border-color .3s; }
.promo-list a:hover { border-color: var(--purple); text-decoration: none; }
.promo-list span { color: var(--muted); font-size: .85rem; }

/* ---------- Notícia ---------- */
.article-cover { height: clamp(260px, 50vw, 600px); margin-top: calc(var(--header-h) * -1); }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 32px; }
.article-layout.has-cover { margin-top: -80px; position: relative; }
.article { padding-right: 32px; border-right: 1px solid var(--line); }
.article-tag-row { border-bottom: 1px solid #000; margin-bottom: 20px; }
.tag-button { display: inline-block; padding: 14px 44px; background: var(--orange); color: #000; font: 600 1rem var(--display); transition: background .5s, color .5s; }
.tag-button:hover { background: #000; color: var(--orange); text-decoration: none; }
.article-title { font: 700 clamp(1.6rem, 4vw, 2.4rem)/1.25 var(--tech); text-align: center; }
.article-lead { font-size: 1.15rem; color: var(--muted); text-align: center; }
.article-date { text-align: right; font: .95rem var(--tech); color: var(--cyan); padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.prose { font-size: 1.12rem; line-height: 1.8; color: #e9e9ee; }
.prose p { margin: 0 0 1.2em; }
.article-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-top: 40px; padding: 14px 0; border-block: 1px solid var(--line); font-family: var(--tech); }
.article-author { margin: 0; color: var(--gold); }
.share { display: flex; align-items: center; gap: 16px; }
.share p { margin: 0; }
.share a { color: var(--orange-soft); font-size: 1.6rem; }
.related { margin-top: 32px; }
.related h2, .recent-posts h2 { font: 1.1rem var(--tech); color: #fff; padding-bottom: 10px; border-bottom: 2px solid #000; }
.related ul { padding-left: 1.2em; }
.related li { margin-bottom: 8px; }
.recent-posts { display: grid; gap: 16px; align-content: start; }
.recent-post { position: relative; display: block; height: 150px; overflow: hidden; border-radius: 4px; background: var(--panel-2); }
.recent-post img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s, opacity .3s; }
.recent-post-title { position: absolute; inset: auto 0 0; padding: 10px; font: .8rem/1.4 var(--tech); color: #fff; background: linear-gradient(transparent, rgb(0 0 0 / .9)); }
.recent-post:hover img { transform: scale(1.05); opacity: .25; }
.recent-post:hover { text-decoration: none; }

/* ---------- Grades de cards (salas, personagens, regras, aventuras) ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.room-card, .character-card, .rule-card, .story-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; transition: border-color .3s, transform .3s; }
.room-card:hover, .character-card:hover, .story-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.room-card header { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.room-card h2, .character-card h2, .rule-card h2, .story-card h2 { font: 1.25rem var(--display); }
.room-card h2 a, .character-card h2 a, .story-card h2 a { color: #fff; }
.room-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 18px; }
.room-stats dt { font: 8px var(--pixel); color: var(--muted); margin-bottom: 6px; }
.room-stats dd { margin: 0; font-weight: 700; }
.rule-facts { padding-left: 1.1em; color: var(--muted); }
.bonuses { display: flex; flex-wrap: wrap; gap: 6px; }
.bonuses .badge { color: var(--green); border-color: currentColor; }

.story-card { padding: 0; overflow: hidden; }
.story-banner { height: 120px; display: flex; align-items: baseline; justify-content: center; gap: 6px; padding-top: 26px; background: linear-gradient(135deg, #2b1238, #6b2a8a); color: #f2dcff; font-family: var(--display); }
.story-banner span { font-size: 3rem; }
.story-card:nth-child(even) .story-banner { background: linear-gradient(135deg, #3b1a07, #a3410c); color: #ffe2cf; }
.story-body { padding: 20px; }
.story-subtitle { font-style: italic; }
.story-actions { display: flex; align-items: center; gap: 12px; margin: 0; }

/* ---------- Atributos e fichas ---------- */
.attributes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; list-style: none; padding: 0; margin: 12px 0; }
.attributes li { display: grid; justify-items: center; gap: 2px; padding: 8px 2px; border: 1px solid var(--line); border-radius: 6px; background: #0c0c0c; }
.attr-code { font: 8px var(--pixel); color: var(--muted); }
.attr-value { font: 700 1.25rem var(--tech); }
.attr-mod { font-size: .8rem; color: var(--green); }
.vitals { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.vitals div { min-width: 76px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; text-align: center; }
.vitals dt { font: 8px var(--pixel); color: var(--muted); }
.vitals dd { margin: 4px 0 0; font: 700 1.3rem var(--tech); color: var(--accent); }
.sheet-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.sheet-page h2 { font: 1.1rem var(--tech); margin-top: 20px; color: var(--accent); }
.sheet-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.skill-list, .skills ul { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 24px; }
.skill-list li, .skills li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px dashed var(--line); break-inside: avoid; }
.example-sheet { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; }
.example-sheet img { border-radius: var(--radius); aspect-ratio: 4 / 5; object-fit: cover; }
.example-sheet h2 { font: 2rem var(--display); color: var(--green); }

.ranking { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ranking li { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 14px; padding: 12px 16px; background: var(--panel-2); border-radius: 6px; border-left: 3px solid var(--line); }
.ranking li:nth-child(1) { border-color: var(--gold); }
.ranking li:nth-child(2) { border-color: #c0c0c0; }
.ranking li:nth-child(3) { border-color: #cd7f32; }
.rank-pos { font-size: 14px; color: var(--accent); text-align: center; }
.rank-info { display: grid; }
.rank-info a { color: #fff; font: 1.1rem var(--display); }
.rank-score { font-family: var(--tech); color: var(--green); }

/* Criação de personagem: compra de pontos */
.point-buy { display: grid; gap: 8px; }
.point-buy legend { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.points-left { color: var(--green); }
.points-left.is-over { color: var(--red); }
.point-row { display: grid; grid-template-columns: minmax(110px, 1fr) 90px 40px 50px 40px; align-items: center; gap: 10px; padding: 4px 8px; border-radius: 6px; }
.point-row.is-key { background: color-mix(in srgb, var(--green) 10%, transparent); }
.point-row label { margin: 0; }
.point-row input { margin: 0; }
.point-bonus { color: var(--green); font-weight: 700; }
.point-final { font-family: var(--tech); }
.point-mod { color: var(--muted); }

/* ---------- Sala: chat e jogadores ---------- */
.room-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.room-head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.room-head-side form { margin: 0; }
.room-title { font: clamp(1.8rem, 4vw, 2.6rem) var(--display); color: #fff; margin: 0 0 .2em; }
.room-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.room-layout .panel { margin-top: 24px; }
.chat { display: flex; flex-direction: column; background: var(--panel-2); }
.chat-log { list-style: none; margin: 0; padding: 4px; height: min(58vh, 560px); overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.chat-empty { margin: auto; color: var(--muted); font-family: var(--display); }
.chat-msg { align-self: flex-start; max-width: 80%; padding: 10px 14px; border-radius: 10px 10px 10px 2px; background: #2b2b2b; display: grid; gap: 2px; }
.chat-author { font-weight: 700; color: var(--orange); font-size: .85rem; }
.chat-body { overflow-wrap: anywhere; }
.chat-time { font-size: .7rem; color: var(--muted); justify-self: end; }
.chat-mine { align-self: flex-end; border-radius: 10px 10px 2px 10px; background: #3a2414; }
.chat-mine .chat-author { color: var(--gold); }
.chat-roll { border: 1px solid var(--cyan); background: #08262a; }
.chat-roll .chat-body { font-family: var(--tech); color: var(--cyan); }
.chat-roll .chat-body::before { content: "🎲 "; }
.chat-system { align-self: center; max-width: 90%; background: none; border: 1px dashed var(--line); text-align: center; color: var(--muted); font-size: .9rem; }
.chat-form { display: flex; gap: 8px; margin-top: 14px; }
.chat-form input { margin: 0; }
.chat-form .btn { --accent: var(--cyan); font-size: 1.3rem; padding: 0 18px; }
.dice-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.dice-button { padding: 8px 10px; background: transparent; border: 1px solid var(--line); border-radius: 4px; color: var(--cyan); cursor: pointer; }
.dice-button:hover { border-color: var(--cyan); }
.chat-error { color: var(--red); margin: 8px 0 0; }
.sheet h2 { font: 1.3rem var(--display); }
.sheet h2 a { color: #fff; }
.weapon { margin: 8px 0; }
.skills summary { cursor: pointer; color: var(--accent); margin-top: 8px; }
.skills ul { columns: 1; margin-top: 8px; }
.players h2 { font: 1.1rem var(--tech); }
.player-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.player-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.player-info { display: grid; }
.award { display: flex; gap: 4px; margin: 0; }
.award-button { width: 32px; height: 32px; border-radius: 4px; border: 1px solid var(--line); background: #0c0c0c; color: var(--text); font-size: 1.1rem; cursor: pointer; }
.award-button:hover { border-color: var(--green); color: var(--green); }
.award-button.danger:hover { border-color: var(--red); color: var(--red); }

/* Escolha do personagem para entrar na sala */
.pick-list { display: grid; gap: 10px; margin-top: 12px; }
.pick { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); cursor: pointer; transition: border-color .2s; }
.pick:hover, .pick:has(input:checked) { border-color: var(--cyan); }
.pick input { width: auto; flex: none; margin: 6px 0 0; accent-color: var(--cyan); }
.pick-body { display: grid; gap: 2px; flex: 1; }
.pick-body strong { font: 1.2rem var(--display); }
.list-heading { font: 9px var(--pixel); color: var(--muted); margin: 14px 0 8px; }
.table tr.is-inactive td { opacity: .55; }

/* ---------- Aventuras (livro-jogo) ---------- */
.play-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.narrative { margin-bottom: 28px; }
.notice { display: flex; gap: 10px; align-items: center; background: #0c0c0c; border-left: 4px solid var(--purple); padding: 10px 14px; border-radius: 4px; font-weight: 600; }
.choices { display: grid; gap: 10px; }
.choice { display: grid; gap: 4px; text-align: left; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px; font: 500 1rem var(--sans); cursor: pointer; transition: border-color .2s, transform .2s; }
.choice:hover:not(:disabled) { border-color: var(--purple); transform: translateX(4px); }
.choice:disabled { opacity: .5; cursor: not-allowed; }
.choice small { color: var(--muted); }
.choice .risk { color: var(--purple); }
.ending { padding: 24px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--panel-2); }
.ending-victory { border-color: var(--green); }
.ending-survived { border-color: var(--gold); }
.ending-defeat { border-color: var(--red); }
.sheet { position: sticky; top: calc(var(--header-h) + 16px); }
.sheet h3 { font-size: 1rem; margin-top: 18px; }
.stat { margin-bottom: 12px; }
.stat-row { display: flex; justify-content: space-between; font-size: .9rem; }
.bar { height: 6px; background: #2b2b2b; border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); transition: width .3s; }
.stat-list { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; }
.stat-list li { border: 1px solid var(--line); border-radius: 6px; padding: .5em 1em; }

/* ---------- Ajuda ---------- */
.books { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.book { display: grid; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); color: #fff; transition: border-color .3s, transform .3s; }
.book:hover { border-color: var(--gold); transform: translateY(-3px); text-decoration: none; }
.book img { height: 260px; width: 100%; object-fit: contain; margin-bottom: 8px; }
.book strong { font: 1.2rem var(--display); color: var(--gold); }
.book-size { color: var(--muted); }
.help-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.help-columns h3 { font-family: var(--tech); font-size: 1rem; color: var(--gold); }
.faq { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { margin: 10px 0 0; color: #ddd; }

/* ---------- Perfil e painel ---------- */
.profile-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 24px; }
.simple-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.simple-list li { display: grid; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 28px; padding: 10px; background: var(--panel); border-radius: var(--radius); }
.admin-nav a { padding: 10px 12px; color: var(--muted); border-radius: 4px; }
.admin-nav a:hover { color: #fff; text-decoration: none; }
.admin-nav a[aria-current] { background: var(--orange); color: #000; }
.admin .display-title { margin-top: 24px; font-size: 2.2rem; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat-card { display: grid; gap: 8px; margin: 0; text-align: center; }
.stat-card strong { font: 700 2.4rem var(--tech); color: var(--orange); }
.admin-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.admin-split .panel { margin-top: 0; }
.bonus-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.current-image { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.current-image img { width: 160px; height: 90px; object-fit: cover; border-radius: 4px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font: 8px var(--pixel); color: var(--muted); }
.table.compact th, .table.compact td { padding: 6px 8px; text-align: center; }
.table small { display: block; }
/* Ações numa célula de tabela: sem flex na célula, para não quebrar o alinhamento das linhas. */
.actions { text-align: right; white-space: nowrap; }
.actions > * { display: inline-block; margin: 0 0 0 14px; vertical-align: middle; }

/* ---------- Modais de login/cadastro ---------- */
.modal { width: min(440px, 100% - 32px); padding: 28px; border: 0; border-top: 3px solid var(--orange); border-radius: var(--radius); background: var(--panel-2); color: var(--text); }
.modal::backdrop { background: rgb(0 0 0 / .75); backdrop-filter: blur(3px); }
.modal[open] { animation: fade-up .25s ease; }
.modal-title { font: 1.6rem var(--display); color: var(--orange); }
.modal-close-form { position: absolute; top: 10px; right: 14px; margin: 0; }
.modal-close { background: none; border: 0; color: #fff; font-size: 1.8rem; cursor: pointer; line-height: 1; transition: transform .2s; }
.modal-close:hover { transform: scale(1.2); }
.modal-switch { margin: 14px 0 0; text-align: center; color: var(--muted); }

/* ---------- Erros ---------- */
.error-page { text-align: center; padding-top: 64px; }
.error-code { font: 48px var(--pixel); color: var(--orange); margin-bottom: 24px; }
.error-page h1 { font-family: var(--display); }

/* ---------- Rodapé ---------- */
/* Compacto: o rodapé fecha a página sem ocupar a tela inteira. */
.site-footer { background: var(--panel-2); padding: 24px 0 14px; border-top: 2px solid var(--orange); }
.footer-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px 24px; }
.footer-col { --c: var(--orange); display: grid; align-content: start; gap: 7px; }
.footer-col h2 { margin: 0 0 2px; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 1rem; }
.footer-col h2 a { display: inline-flex; align-items: center; gap: 8px; color: #fff; font: 10px var(--pixel); }
.footer-col h2 .icon { width: 20px; height: 20px; color: var(--c); }
.footer-col > a { display: inline-flex; align-items: center; gap: 6px; color: #c9c9d1; font: 9px/1.6 var(--pixel); }
.footer-col a:hover { color: var(--c); text-decoration: none; }
.footer-rooms { --c: var(--cyan); }
.footer-heroes { --c: var(--green); }
.footer-help { --c: var(--gold); }
.footer-contact { --c: var(--purple); }
.footer-credits { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); text-align: center; color: var(--orange); font: 8px/2 var(--pixel); }
.footer-credits p { margin: 0; }

/* ---------- Responsivo ---------- */
@media (max-width: 1080px) {
    .nav-link span { display: none; }
    .nav-link .icon { width: 28px; height: 28px; }
}

@media (max-width: 900px) {
    :root { --header-h: 64px; }
    .brand img { width: 150px; }
    .nav-toggle { display: block; }
    .menu { display: none; position: absolute; inset: 100% 0 auto; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 20px; background: rgb(13 13 13 / .98); border-bottom: 2px solid var(--orange); }
    .menu-open .menu { display: flex; }
    .main-nav { flex-direction: column; margin: 0; }
    .nav-link { padding: 14px 4px; }
    .nav-link span { display: inline; }
    .nav-link::after { left: 4px; right: auto; width: 120px; }
    .account { padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
    .dropdown-menu { position: static; box-shadow: none; }
    .carousel-caption { left: 16px; right: 16px; top: auto; bottom: 64px; max-width: none; }
    .carousel-next { top: auto; bottom: 0; width: 120px; height: 44px; }
    .news-item { grid-template-columns: 1fr; gap: 12px; }
    .news-thumb { height: 210px; }
    .promo { grid-template-columns: 1fr; }
    .article-layout, .room-layout, .play-layout, .admin-split, .help-columns, .sheet-columns { grid-template-columns: 1fr; }
    .article { padding-right: 0; border-right: 0; }
    .recent-posts { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .recent-posts h2 { grid-column: 1 / -1; }
    .sheet { position: static; }
    .room-head-side { align-items: flex-start; }
    .example-sheet { grid-template-columns: 1fr; }
    .example-sheet img { max-width: 320px; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
    .attributes { grid-template-columns: repeat(3, 1fr); }
    .skill-list { columns: 1; }
    .point-row { grid-template-columns: 1fr 80px; }
    .point-row span { grid-row: 2; }
    .footer-grid { grid-template-columns: 1fr; }
    .chat-msg { max-width: 92%; }
    .tag-button { padding: 12px 28px; }
    .search { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
