/* =========================================================
   RAÍZES & RUNAS — tema floresta élfica + tradição anã
   ========================================================= */

/* Fontes hospedadas localmente (sem dependência de CDN) */
@import url('fonts.css');

:root {
  --bg-deep:      #0d150f;
  --bg-panel:     #16241a;
  --bg-panel-2:   #1d3022;
  --bark:         #2a3b2c;
  --moss:         #4f7a4d;
  --leaf:         #7fc8a9;
  --gold:         #c9a84a;
  --gold-soft:    #e7d59b;
  --bronze:       #b87333;
  --stone:        #8a948b;
  --text:         #e9efe2;
  --text-dim:     #aebbac;
  --danger:       #c75c4a;

  --radius: 8px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --ring: 0 0 0 1px rgba(201,168,74,.25);
  --font-head: 'Cinzel', serif;
  --font-deco: 'Cinzel Decorative', serif;
  --font-rune: 'MedievalSharp', 'Cinzel Decorative', serif;
  --font-body: 'Spectral', Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1000px 540px at 84% -10%, rgba(127,200,169,.10), transparent 60%),
    radial-gradient(850px 460px at 0% 100%, rgba(184,115,51,.18), transparent 56%),
    linear-gradient(180deg, #0e1810 0%, var(--bg-deep) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
}

/* textura discreta de poeira, chuva e marcas de arquivo */
.background-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .06;
  background-image:
    linear-gradient(115deg, transparent 0 48%, rgba(127,200,169,.28) 49% 50%, transparent 51% 100%),
    radial-gradient(circle at 20% 30%, var(--leaf) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 60%, var(--gold) 0 1.5px, transparent 3px);
  background-size: 220px 220px, 180px 180px, 260px 260px;
}

a { color: var(--leaf); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-soft); }

h1, h2, h3, .logo { font-family: var(--font-head); letter-spacing: .03em; }

/* ============================ NAVBAR ============================ */
body > header { position: sticky; top: 0; z-index: 100; }
.tool-head { position: static; z-index: auto; }

.navbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: .8rem 1.5rem;
  background: linear-gradient(180deg, rgba(22,36,26,.96), rgba(13,21,15,.96));
  border-bottom: 2px solid var(--bark);
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
  backdrop-filter: blur(6px);
}

.logo {
  font-family: var(--font-deco);
  font-size: 1.4rem;
  color: var(--gold);
  white-space: nowrap;
  text-shadow: 0 1px 0 #000, 0 0 18px rgba(201,168,74,.25);
}
.logo:hover { color: var(--gold-soft); }

.nav-links {
  display: flex;
  align-items: center;
  gap: .15rem;
  list-style: none;
  margin-left: auto;
}
.nav-links > li > a,
.dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .5rem .6rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-head);
  font-size: .9rem;
}
.dropdown-trigger {
  border: 0;
  background: transparent;
  cursor: pointer;
}
.nav-links > li > a:hover,
.dropdown-trigger:hover,
.dropdown-trigger:focus-visible,
.nav-links > li > a[aria-current="page"] { background: var(--bg-panel-2); color: var(--gold-soft); }
.nav-links .icon { font-size: 1rem; }

/* dropdown */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: 110%;
  left: 0;
  min-width: 200px;
  list-style: none;
  background: var(--bg-panel);
  border: 1px solid var(--bark);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: .4rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all .18s ease;
}
.dropdown-menu-right { right: 0; left: auto; }
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu,
.dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu li a {
  display: block;
  padding: .55rem .7rem;
  border-radius: 6px;
  color: var(--text);
}
.dropdown-menu li a:hover,
.nav-logout:hover { background: var(--bg-panel-2); color: var(--gold-soft); }
.nav-account { margin-left: .25rem; }

/* Pílula de sistema ativo na navbar */
.nav-system { margin-left: .5rem; }
.sys-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--font-head); font-size: .78rem; letter-spacing: .03em;
  color: var(--gold-soft);
  background: rgba(201,168,74,.08);
  border: 1px solid var(--bark);
  border-radius: 999px;
  padding: .3rem .65rem;
  cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.sys-pill:hover { background: rgba(201,168,74,.18); border-color: var(--gold); color: var(--gold); }
.sys-pill-caret { font-size: .7rem; opacity: .8; }
.sys-dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0,0,0,.35); }
.sys-dot-dnd { background: linear-gradient(135deg, #c9a84a, #6b8e3a); }
.sys-dot-vampiro { background: linear-gradient(135deg, #c0392b, #4a0d10); }
.sys-menu .sys-menu-head { font-family: var(--font-head); font-size: .72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; padding: .35rem .7rem .15rem; }
.sys-menu button[data-sys-switch] {
  display: block; width: 100%; text-align: left;
  background: transparent; border: none; color: var(--text);
  font-family: var(--font-body); font-size: .92rem;
  padding: .45rem .7rem; border-radius: var(--radius-sm); cursor: pointer;
}
.sys-menu button[data-sys-switch]:hover { background: var(--bg-panel-2); color: var(--gold-soft); }
.sys-menu button[aria-current="true"] { color: var(--gold); }
.sys-menu button[aria-current="true"]::after { content: " ✓"; color: var(--gold); }
.nav-logout {
  display: block;
  width: 100%;
  padding: .55rem .7rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.search-container input {
  background: var(--bg-deep);
  border: 1px solid var(--bark);
  color: var(--text);
  padding: .5rem .8rem;
  border-radius: 999px;
  width: 160px;
  font-family: var(--font-body);
  outline: none;
  transition: box-shadow .2s, width .2s;
}
.search-container input:focus { box-shadow: var(--ring); width: 200px; }

.hamburger {
  display: none;
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--bark);
  border-radius: var(--radius-sm);
  font-size: 1.3rem;
  padding: .2rem .6rem;
  cursor: pointer;
}

/* ============================ CARROSSEL / HERO ============================ */
.carousel {
  position: relative;
  max-width: 1100px;
  margin: 2rem auto 0;
  padding: 0 1.5rem;
}
.carousel-container { position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--bark); box-shadow: var(--shadow); }
.carousel-slide { display: none; position: relative; }
.carousel-slide.active { display: block; animation: fade .6s ease; }
.carousel-slide img { width: 100%; height: 360px; object-fit: cover; display: block; filter: saturate(1.05) brightness(.85); }
.carousel-slide p {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  margin: 0;
  padding: 2rem 1.5rem 1rem;
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: var(--gold-soft);
  background: linear-gradient(180deg, transparent, rgba(7,6,8,.92));
}
.carousel button.prev, .carousel button.next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(7,6,8,.64);
  color: var(--gold);
  border: 1px solid var(--bark);
  width: 44px; height: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background .2s;
}
.carousel button.prev { left: 2rem; }
.carousel button.next { right: 2rem; }
.carousel button:hover { background: var(--moss); color: #fff; }

@keyframes fade { from { opacity: .3; } to { opacity: 1; } }

/* ============================ LAYOUT PRINCIPAL ============================ */
.page-content {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.main-area > h1 {
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--bark);
  padding-bottom: .6rem;
}

/* cards/posts */
.post, .modern-post {
  background: linear-gradient(180deg, var(--bg-panel), var(--bg-panel-2));
  border: 1px solid var(--bark);
  border-left: 4px solid var(--bronze);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow);
  transition: transform .2s, border-color .2s;
}
.post:hover { transform: translateY(-3px); border-left-color: var(--danger); }
.post h2 { color: var(--gold-soft); font-size: 1.25rem; margin-bottom: .5rem; }
.post p { color: var(--text-dim); }

/* sidebar */
.side-sections section {
  background: var(--bg-panel);
  border: 1px solid var(--bark);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.2rem;
}
.side-sections h3 { color: var(--gold); font-size: 1.1rem; margin-bottom: .8rem; }
.comment {
  background: var(--bg-deep);
  border-left: 3px solid var(--bronze);
  padding: .6rem .8rem;
  border-radius: 6px;
  margin-bottom: .6rem;
  font-style: italic;
  color: var(--text-dim);
}

/* ============================ FOOTER ============================ */
.footer {
  margin-top: 3rem;
  background: linear-gradient(180deg, rgba(7,6,8,.35), rgba(7,6,8,.96));
  border-top: 2px solid var(--bark);
  padding: 1.5rem;
}
.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  color: var(--text-dim);
}
.footer a { color: var(--text-dim); }
.footer a:hover { color: var(--gold-soft); }
.footer-center { display: flex; gap: 1rem; }
.icon-svg { width: 22px; height: 22px; fill: var(--stone); transition: fill .2s; }
.footer-center a:hover .icon-svg { fill: var(--gold); }

/* ============================ BOTÕES ============================ */
.btn, button[type="submit"], .new-topic-btn {
  font-family: var(--font-head);
  background: linear-gradient(180deg, var(--moss), #3c5e3a);
  color: #fff;
  border: 1px solid var(--bark);
  padding: .6rem 1.1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, filter .2s;
}
.btn:hover, button[type="submit"]:hover, .new-topic-btn:hover { filter: brightness(1.12); box-shadow: 0 6px 18px rgba(184,115,51,.38); transform: translateY(-1px); }
.btn.cancel-btn { background: linear-gradient(180deg, #3a2a2a, #2a1f1f); }
.btn-gold { background: linear-gradient(180deg, var(--gold), #a98a32); color: #1a1405; }
.btn-bronze { background: linear-gradient(180deg, var(--bronze), #8c531f); }

/* ============================ MODAIS ============================ */
.modal, .upload-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5,4,6,.78);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}
.modal-content, .upload-modal-content {
  background: var(--bg-panel);
  border: 1px solid var(--bark);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.6rem;
  width: min(520px, 92vw);
  max-height: 90vh;
  overflow: auto;
  position: relative;
}
.modal-content h2 { color: var(--gold); margin-bottom: 1rem; }
.close, .close-btn, .close-modal {
  position: absolute;
  top: .8rem; right: 1rem;
  font-size: 1.5rem;
  color: var(--text-dim);
  cursor: pointer;
}
.close:hover, .close-btn:hover, .close-modal:hover { color: var(--danger); }

label { display: block; margin: .8rem 0 .3rem; color: var(--gold-soft); font-family: var(--font-head); font-size: .9rem; }
input, textarea, select {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--bark);
  color: var(--text);
  padding: .6rem .7rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  outline: none;
}
input:focus, textarea:focus, select:focus { box-shadow: var(--ring); border-color: var(--moss); }
textarea { min-height: 110px; resize: vertical; }
.formatting-tools { display: flex; gap: .4rem; margin-bottom: .4rem; }
.formatting-tools button { background: var(--bg-panel-2); color: var(--text); border: 1px solid var(--bark); border-radius: 6px; width: 36px; height: 32px; cursor: pointer; }
.modal-actions { display: flex; gap: .6rem; margin-top: 1.2rem; }

/* ============================ FÓRUM / SESSÕES ============================ */
.forum-page, .session-page, .tool-page {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}
.session-header, .section-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.session-page h1, .forum-page h1, .tool-page h1, .section-header h1 { color: var(--gold); font-size: 1.7rem; }
.session-description { color: var(--text-dim); margin: .6rem 0 1.4rem; }

.forum-section-links { display: grid; gap: 1rem; }
.forum-link {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: var(--bg-panel);
  border: 1px solid var(--bark);
  border-left: 4px solid var(--bronze);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  color: var(--text);
}
.forum-link:hover { background: var(--bg-panel-2); border-left-color: var(--gold); transform: translateY(-2px); transition: .2s; }
.forum-link .icon { font-size: 1.8rem; }
.forum-link h3 { color: var(--gold-soft); }
.forum-link p { color: var(--text-dim); font-size: .92rem; }

.topics-list { display: grid; gap: .9rem; }
.topic {
  background: var(--bg-panel);
  border: 1px solid var(--bark);
  border-left: 4px solid var(--moss);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
}
.topic h3 { color: var(--gold-soft); margin-bottom: .4rem; }

/* bolha flutuante */
.floating-bubble, .add-book-float {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  background: linear-gradient(180deg, var(--gold), #a98a32);
  color: #1a1405;
  font-family: var(--font-head);
  border: none;
  border-radius: 999px;
  padding: .9rem 1.3rem;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 500;
}
.add-book-float { width: 58px; height: 58px; padding: 0; font-size: 1.5rem; }
.floating-bubble:hover, .add-book-float:hover { filter: brightness(1.1); transform: scale(1.05); transition: .2s; }

/* ============================ FERRAMENTAS (genérico) ============================ */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 1.2rem; }
.tool-card {
  background: linear-gradient(180deg, var(--bg-panel), var(--bg-panel-2));
  border: 1px solid var(--bark);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
}
.tool-card h2 { color: var(--gold); font-size: 1.2rem; margin-bottom: .6rem; }
.tool-card .tool-icon { font-size: 2rem; display: block; margin-bottom: .5rem; }
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--bark);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.4rem;
}
.muted { color: var(--text-dim); }
.row { display: flex; gap: .8rem; flex-wrap: wrap; align-items: flex-end; }
.row > div { flex: 1; min-width: 120px; }
hr { border: none; border-top: 1px solid var(--bark); margin: 1.2rem 0; }

/* divisor decorativo */
.rune-divider {
  text-align: center;
  color: var(--moss);
  letter-spacing: 1rem;
  margin: 1.5rem 0;
  font-family: var(--font-rune);
  font-size: 1.2rem;
}

/* ============================ ROLADOR DE DADOS ============================ */
.dice-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, .7fr);
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}
.dice-toolbar select {
  min-height: 46px;
}
.dice-mechanic-panel {
  margin-top: 1rem;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(21,45,31,.78), rgba(7,19,13,.82));
  border: 1px solid rgba(184,115,51,.45);
  border-radius: var(--radius-sm);
}
.dice-mechanic-panel[hidden] { display: none; }
.check-inline {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem 1rem;
  align-items: center;
  margin: .9rem 0 1rem;
}
.check-inline label {
  display: inline-flex;
  gap: .45rem;
  align-items: center;
  width: auto;
  color: var(--text-dim);
  font-size: .92rem;
}
.check-inline input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
}
.dice-expression-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: .7rem;
  align-items: end;
}
.dice-buttons { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; margin: 1rem 0; }
.die-btn {
  font-family: var(--font-head);
  font-size: 1.1rem;
  width: 70px; height: 70px;
  background: linear-gradient(160deg, var(--bg-panel-2), var(--bg-deep));
  color: var(--gold-soft);
  border: 1px solid var(--bark);
  border-radius: 14px;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, border-color .2s;
  box-shadow: inset 0 0 12px rgba(0,0,0,.4);
  position: relative;
  overflow: hidden;
}
.die-btn::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(242,221,156,.18);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  pointer-events: none;
}
.die-btn:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: 0 6px 18px rgba(201,168,74,.3); }
.die-btn.rolling { animation: dieRoll .5s ease; }
@keyframes dieRoll { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(200deg) scale(1.15); } 100% { transform: rotate(360deg) scale(1); } }

.dice-presets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  margin: .7rem 0 1rem;
}
.preset-chip {
  min-height: 36px;
  border: 1px solid var(--bronze);
  border-radius: 999px;
  background: rgba(184,115,51,.12);
  color: var(--gold-soft);
  font-family: var(--font-head);
  padding: .35rem .75rem;
  cursor: pointer;
  transition: transform var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.preset-chip:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  background: rgba(201,168,74,.18);
}

.dice-result {
  text-align: center;
  padding: 1.2rem;
  margin-top: 1rem;
  background: var(--bg-deep);
  border: 1px solid var(--bark);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.dice-result .big-total { font-family: var(--font-deco); font-size: 2.8rem; color: var(--gold); line-height: 1; }
.dice-result .result-detail { color: var(--text-dim); font-size: .95rem; }

body[data-dice-skin="moss"] .die-btn,
body[data-dice-skin="moss"] .pill {
  border-color: rgba(127,200,169,.46);
  background: linear-gradient(160deg, rgba(22,74,47,.92), rgba(7,22,15,.96));
}
body[data-dice-skin="forge"] .die-btn,
body[data-dice-skin="forge"] .pill {
  border-color: rgba(198,134,72,.55);
  background: linear-gradient(160deg, rgba(77,55,36,.92), rgba(21,18,14,.96));
}
body[data-dice-skin="blood"] .die-btn,
body[data-dice-skin="blood"] .pill {
  border-color: rgba(176,64,58,.58);
  background: linear-gradient(160deg, rgba(72,18,22,.94), rgba(14,8,10,.96));
}
body[data-dice-skin="arcane"] .die-btn,
body[data-dice-skin="arcane"] .pill {
  border-color: rgba(139,159,214,.58);
  background: linear-gradient(160deg, rgba(39,45,83,.94), rgba(9,13,27,.96));
}

@media (max-width: 720px) {
  .dice-toolbar,
  .dice-expression-row {
    grid-template-columns: 1fr;
  }
  .dice-toolbar .seg,
  #d20mode {
    width: 100%;
    flex-wrap: wrap;
  }
  .dice-toolbar .seg button,
  #d20mode button {
    flex: 1 1 90px;
  }
  .die-btn {
    width: 58px;
    height: 58px;
  }
}

.history-list { list-style: none; max-height: 320px; overflow: auto; }
.history-list li { padding: .5rem .7rem; border-bottom: 1px solid var(--bark); }
.history-list li strong { color: var(--gold-soft); font-family: var(--font-head); margin-right: .5rem; }

/* ============================ FICHA / ATRIBUTOS ============================ */
.attr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: .9rem; }
.attr-box {
  background: var(--bg-deep);
  border: 1px solid var(--bark);
  border-radius: var(--radius-sm);
  padding: .7rem;
  text-align: center;
  position: relative;
}
.attr-box label { text-align: center; }
.attr-box input { text-align: center; font-size: 1.3rem; font-family: var(--font-head); }
.attr-mod {
  display: inline-block;
  margin-top: .4rem;
  font-family: var(--font-deco);
  color: var(--gold);
  background: var(--bg-panel);
  border: 1px solid var(--bark);
  border-radius: 999px;
  padding: .1rem .7rem;
  font-size: .95rem;
}
.tools-quick p { margin: .35rem 0; }

/* ============================ INICIATIVA ============================ */
.combat-list { list-style: none; display: grid; gap: .6rem; }
.combat-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  flex-wrap: wrap;
  background: var(--bg-deep);
  border: 1px solid var(--bark);
  border-left: 4px solid var(--moss);
  border-radius: var(--radius-sm);
  padding: .6rem .8rem;
}
.combat-item.active-turn { border-left-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 18px rgba(201,168,74,.25); background: var(--bg-panel-2); }
.combat-item.downed { opacity: .55; filter: grayscale(.6); border-left-color: var(--danger); }
.init-badge {
  font-family: var(--font-deco);
  color: var(--gold);
  background: var(--bg-panel);
  border: 1px solid var(--bark);
  border-radius: 8px;
  min-width: 42px; text-align: center;
  padding: .3rem .4rem;
}
.combat-name { font-family: var(--font-head); flex: 1; min-width: 100px; color: var(--text); }
.hp-control { display: flex; align-items: center; gap: .3rem; }
.hp-input { width: 64px; text-align: center; }
.hp-btn { width: 30px; height: 30px; background: var(--bg-panel-2); color: var(--gold-soft); border: 1px solid var(--bark); border-radius: 6px; cursor: pointer; font-size: 1.1rem; line-height: 1; }
.hp-btn:hover { border-color: var(--gold); }
.cond-input { width: 180px; flex: 1; min-width: 120px; }
.remove-btn { background: transparent; color: var(--danger); border: 1px solid var(--bark); border-radius: 6px; width: 30px; height: 30px; cursor: pointer; }
.remove-btn:hover { background: var(--danger); color: #fff; }

/* ============================ GERADOR ============================ */
.names-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: .6rem; }
.names-list li {
  font-family: var(--font-head);
  color: var(--gold-soft);
  background: var(--bg-deep);
  border: 1px solid var(--bark);
  border-left: 3px solid var(--leaf);
  border-radius: var(--radius-sm);
  padding: .7rem .9rem;
}
.npc-card { background: var(--bg-deep); border: 1px solid var(--bark); border-radius: var(--radius); padding: 1.2rem; }
.npc-card p { margin: .35rem 0; color: var(--text-dim); }
.npc-card strong { color: var(--gold-soft); }
.npc-card .npc-name { font-family: var(--font-deco); font-size: 1.6rem; color: var(--gold); margin-bottom: .6rem; }

/* ============================ IMPRESSÃO (ficha) ============================ */
@media print {
  header, .floating-bubble, .modal-actions, #rollAttrs, .background-overlay, .hamburger { display: none !important; }
  body { background: #fff; color: #000; }
  .panel { border: 1px solid #999; box-shadow: none; background: #fff; }
  input, textarea, select { color: #000; background: #fff; border: 1px solid #aaa; }
  .attr-mod, label, h1, h2 { color: #000 !important; }
}

/* ============================ RESPONSIVO ============================ */
/* navbar colapsa em hambúrguer cedo (cabe a navegação densa com login) */
@media (max-width: 1200px) {
  .hamburger { display: block; order: 3; margin-left: auto; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-panel);
    border-bottom: 2px solid var(--bark);
    padding: .5rem;
    gap: .2rem;
    z-index: var(--z-nav, 100);
  }
  .nav-links.open { display: flex; }
  .nav-links .dropdown-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; padding-left: 1rem; }
  .nav-account.dropdown .dropdown-menu { display: block; }
  .search-container { width: 100%; order: 4; }
  .search-container input { width: 100%; }
}
@media (max-width: 860px) {
  .page-content { grid-template-columns: 1fr; }
  .carousel-slide img { height: 240px; }
  .carousel button.prev { left: .5rem; }
  .carousel button.next { right: .5rem; }
}

/* =========================================================
   UPGRADE DE UI/UX (ui-ux-pro-max) — tokens, acessibilidade,
   microinterações e componentes de landing comunitária.
   ========================================================= */
:root {
  --sp-1: .25rem; --sp-2: .5rem; --sp-3: .75rem; --sp-4: 1rem;
  --sp-6: 1.5rem; --sp-8: 2rem; --sp-12: 3rem; --sp-16: 4rem;
  --t-fast: 150ms cubic-bezier(.2,.6,.3,1);
  --t-base: 240ms cubic-bezier(.2,.6,.3,1);
  --z-nav: 100; --z-float: 500; --z-modal: 1000;
  --focus: 0 0 0 3px rgba(201,168,74,.55);
  --container: 1140px;
}

/* ---- Acessibilidade global ---- */
*:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
a, button, .die-btn, .forum-link, .tool-card, .category-card,
[role="button"], summary { cursor: pointer; }
::selection { background: rgba(201,168,74,.3); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

.skip-link {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--gold); color: #1a1405;
  padding: .6rem 1rem; border-radius: var(--radius-sm);
  font-family: var(--font-head); z-index: var(--z-modal);
  transition: top var(--t-fast);
}
.skip-link:focus { top: 1rem; }

/* ---- Ícones SVG (substituem emojis estruturais) ---- */
.nav-ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.logo-ic { width: 24px; height: 24px; flex: none; color: var(--gold); }
.logo { display: inline-flex; align-items: center; gap: .5rem; }
.feat-ic { width: 30px; height: 30px; color: var(--gold); }
.btn-ic { width: 18px; height: 18px; flex: none; }
.lucide { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Microinterações refinadas ---- */
.btn, button[type="submit"], .new-topic-btn, .btn-gold, .btn-bronze {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  transition: transform var(--t-fast), box-shadow var(--t-base), filter var(--t-fast);
  will-change: transform;
}
.btn:active, button[type="submit"]:active { transform: scale(.97); }
.post, .forum-link, .tool-card, .category-card, .book-item {
  transition: transform var(--t-base), border-color var(--t-base), box-shadow var(--t-base), background var(--t-base);
}

/* ---- Hero ---- */
.hero {
  max-width: var(--container); margin: var(--sp-12) auto var(--sp-8); padding: 0 var(--sp-6);
  display: grid; grid-template-columns: 1.1fr .9fr; gap: var(--sp-12); align-items: center;
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-head); font-size: .82rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--leaf);
  background: rgba(127,200,169,.08); border: 1px solid var(--bark);
  padding: .35rem .8rem; border-radius: 999px; margin-bottom: var(--sp-4);
}
.hero h1 {
  font-family: var(--font-deco); font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.1; color: var(--gold-soft); margin-bottom: var(--sp-4); text-wrap: balance;
}
.hero p.lead { font-size: 1.12rem; color: var(--text-dim); max-width: 52ch; margin-bottom: var(--sp-6); }
.hero-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.btn-lg { padding: .85rem 1.4rem; font-size: 1.05rem; }

.hero-art { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--bark); box-shadow: var(--shadow); aspect-ratio: 4/3; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.05) brightness(.85); }
.hero-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(13,21,15,.65)); }

/* estatísticas / prova social */
.hero-stats { max-width: var(--container); margin: 0 auto var(--sp-12); padding: 0 var(--sp-6);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
.stat { background: linear-gradient(180deg, var(--bg-panel), var(--bg-panel-2)); border: 1px solid var(--bark); border-radius: var(--radius); padding: var(--sp-6) var(--sp-4); text-align: center; }
.stat .num { font-family: var(--font-deco); font-size: 2rem; color: var(--gold); line-height: 1; }
.stat .label { color: var(--text-dim); font-size: .85rem; margin-top: .4rem; display: flex; align-items: center; justify-content: center; gap: .35rem; }
.stat .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--moss); box-shadow: 0 0 8px var(--moss); }

/* seções */
.section { max-width: var(--container); margin: var(--sp-16) auto; padding: 0 var(--sp-6); }
.section-title { display: flex; align-items: center; gap: .6rem; margin-bottom: var(--sp-2); }
.section-title h2 { font-family: var(--font-head); font-size: clamp(1.5rem, 3vw, 2rem); color: var(--gold); }
.section-sub { color: var(--text-dim); margin-bottom: var(--sp-6); max-width: 60ch; }

.category-grid, .tools-feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--sp-4); }
.category-card, .feature-card { background: linear-gradient(180deg, var(--bg-panel), var(--bg-panel-2)); border: 1px solid var(--bark); border-radius: var(--radius); padding: var(--sp-6); color: var(--text); border-top: 3px solid transparent; }
.category-card:hover, .feature-card:hover { transform: translateY(-4px); border-top-color: var(--gold); box-shadow: 0 14px 34px rgba(0,0,0,.5); }
.feature-card .feat-head { display: flex; align-items: center; gap: .7rem; margin-bottom: var(--sp-3); }
.feature-card h3 { font-family: var(--font-head); color: var(--gold-soft); font-size: 1.15rem; }
.feature-card p { color: var(--text-dim); font-size: .94rem; }
.feature-card .feat-link { display: inline-flex; align-items: center; gap: .35rem; margin-top: var(--sp-3); font-family: var(--font-head); font-size: .9rem; }
.feature-card .feat-link .nav-ic { width: 16px; height: 16px; transition: transform var(--t-fast); }
.feature-card:hover .feat-link .nav-ic { transform: translateX(4px); }

/* CTA */
.cta-band { max-width: var(--container); margin: var(--sp-16) auto var(--sp-8); padding: var(--sp-12) var(--sp-6); text-align: center;
  background: radial-gradient(600px 200px at 50% 0%, rgba(201,168,74,.12), transparent 70%), linear-gradient(180deg, var(--bg-panel), var(--bg-panel-2));
  border: 1px solid var(--bark); border-radius: var(--radius); box-shadow: var(--shadow); }
.cta-band h2 { font-family: var(--font-deco); font-size: clamp(1.6rem, 4vw, 2.4rem); color: var(--gold-soft); margin-bottom: var(--sp-3); }
.cta-band p { color: var(--text-dim); max-width: 48ch; margin: 0 auto var(--sp-6); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: var(--sp-6); margin-top: var(--sp-8); }
  .hero-art { order: -1; aspect-ratio: 16/9; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .section, .cta-band { margin-top: var(--sp-12); }
}

@media (max-width: 860px) {
  /* fix navbar wrap mobile */
  .navbar { flex-wrap: wrap; }
  .search-container { order: 5; }
}

/* cabeçalho de página interna (hero compacto) */
.tool-head { margin-bottom: var(--sp-8); padding-bottom: var(--sp-6); border-bottom: 1px solid var(--bark); }
.tool-head .ph-badge { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--bg-panel-2), var(--bg-deep)); border: 1px solid var(--bark);
  color: var(--gold); box-shadow: inset 0 0 14px rgba(0,0,0,.4); margin-bottom: var(--sp-4); }
.tool-head .ph-badge svg { width: 30px; height: 30px; }
.tool-head h1 { font-family: var(--font-deco); font-size: clamp(1.9rem, 4vw, 2.8rem); color: var(--gold-soft); line-height: 1.1; margin: var(--sp-2) 0 var(--sp-3); }
.tool-head .lead { color: var(--text-dim); font-size: 1.08rem; max-width: 62ch; }

/* COMPONENTES INTERATIVOS */
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%) translateY(20px);
  background: var(--bg-panel); color: var(--text); border: 1px solid var(--bark); border-left: 4px solid var(--gold);
  border-radius: var(--radius-sm); padding: .7rem 1.1rem; box-shadow: var(--shadow); z-index: var(--z-modal);
  font-family: var(--font-head); font-size: .92rem; opacity: 0; pointer-events: none; transition: opacity var(--t-base), transform var(--t-base); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.seg { display: inline-flex; background: var(--bg-deep); border: 1px solid var(--bark); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: none; background: transparent; color: var(--text-dim); font-family: var(--font-head); padding: .45rem .9rem; border-radius: 999px; cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.seg button[aria-pressed="true"] { background: linear-gradient(180deg, var(--moss), #3c5e3a); color: #fff; }

.roll-pills { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin-top: .7rem; }
.pill { min-width: 36px; padding: .3rem .55rem; text-align: center; border-radius: 8px; background: var(--bg-panel-2); border: 1px solid var(--bark); font-family: var(--font-head); font-size: .95rem; color: var(--text); animation: pillIn .3s ease backwards; }
.pill.max { border-color: var(--leaf); color: var(--leaf); box-shadow: 0 0 8px rgba(127,200,169,.4); }
.pill.min { border-color: var(--danger); color: var(--danger); }
.pill.dropped { opacity: .35; text-decoration: line-through; }
@keyframes pillIn { from { opacity: 0; transform: translateY(6px) scale(.9); } to { opacity: 1; transform: none; } }

.hp-wrap { display: flex; flex-direction: column; gap: .25rem; align-items: center; }
.hp-bar { width: 84px; height: 7px; border-radius: 999px; background: var(--bg-deep); border: 1px solid var(--bark); overflow: hidden; }
.hp-fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--moss), var(--leaf)); transition: width var(--t-base), background var(--t-base); }
.hp-fill.mid { background: linear-gradient(90deg, #8c7a1f, var(--gold)); }
.hp-fill.low { background: linear-gradient(90deg, #8c531f, var(--danger)); }

.chips { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; padding: .2rem .55rem; border-radius: 999px; background: rgba(184,115,51,.16); border: 1px solid var(--bronze); color: var(--gold-soft); cursor: pointer; font-family: var(--font-head); }
.chip:hover { filter: brightness(1.18); }
.chip .x { font-weight: bold; opacity: .7; }
.chip-add { background: var(--bg-deep); border: 1px dashed var(--bark); color: var(--text-dim); }

.derived-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px,1fr)); gap: .8rem; }
.derived { background: var(--bg-deep); border: 1px solid var(--bark); border-radius: var(--radius-sm); padding: .7rem; text-align: center; }
.derived .dv { font-family: var(--font-deco); font-size: 1.6rem; color: var(--gold); line-height: 1; }
.derived .dl { font-size: .72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; margin-top: .3rem; }

.mini-btn { background: var(--bg-panel-2); border: 1px solid var(--bark); color: var(--text); border-radius: 6px; padding: .4rem .7rem; cursor: pointer; font-size: .82rem; font-family: var(--font-head); display: inline-flex; align-items: center; gap: .35rem; transition: border-color var(--t-fast), transform var(--t-fast); }
.mini-btn:hover:not(:disabled) { border-color: var(--gold); }
.mini-btn:active:not(:disabled) { transform: scale(.96); }
.mini-btn:disabled { opacity: .4; cursor: not-allowed; }

.names-list li { cursor: pointer; position: relative; transition: border-color var(--t-fast), transform var(--t-fast); }
.names-list li:hover { transform: translateX(3px); border-left-color: var(--gold); }
.names-list li::after { content: "⧉ copiar"; position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); font-size: .72rem; color: var(--text-dim); font-family: var(--font-body); opacity: 0; transition: opacity var(--t-fast); }
.names-list li:hover::after { opacity: .85; }

@keyframes turnPulse { 0%,100% { box-shadow: 0 0 0 1px var(--gold), 0 0 16px rgba(201,168,74,.22); } 50% { box-shadow: 0 0 0 1px var(--gold), 0 0 26px rgba(201,168,74,.5); } }
.combat-item.active-turn { animation: turnPulse 2.4s ease-in-out infinite; }
.turn-banner { display: flex; align-items: center; gap: .5rem; background: rgba(201,168,74,.1); border: 1px solid var(--bark); border-left: 3px solid var(--gold); border-radius: var(--radius-sm); padding: .6rem .9rem; margin-bottom: .9rem; font-family: var(--font-head); color: var(--gold-soft); }
.fav-empty { color: var(--text-dim); font-style: italic; }
.count-roll { animation: rollNum .5s ease; }
@keyframes rollNum { 0% { opacity: .2; transform: scale(.7) rotate(-8deg); } 100% { opacity: 1; transform: none; } }

/* GERADOR favoritos */
#namesList li, #favList li { padding-right: 4.6rem; }
#namesList li::after { content: none; }
.fav-star { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); background: transparent; border: none; color: var(--text-dim); font-size: 1.15rem; line-height: 1; cursor: pointer; padding: .2rem; transition: color var(--t-fast), transform var(--t-fast); }
.fav-star:hover { color: var(--gold-soft); transform: translateY(-50%) scale(1.2); }
.fav-star.on { color: var(--gold); }
.fav-remove { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); background: transparent; border: none; color: var(--danger); font-size: 1.05rem; cursor: pointer; padding: .2rem; }
.fav-remove:hover { filter: brightness(1.2); }

/* HISTÓRIAS & CENÁRIOS */
.story-control-panel { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-8); }
.story-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.story-section { margin-top: var(--sp-10); }
.story-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--sp-4); }
.story-hub-card, .prompt-card {
  background: linear-gradient(180deg, var(--bg-panel), var(--bg-panel-2));
  border: 1px solid var(--bark);
  border-top: 3px solid var(--moss);
  border-radius: var(--radius);
  padding: var(--sp-5);
  box-shadow: 0 10px 26px rgba(0,0,0,.26);
}
.story-hub-card.vampiro { border-top-color: var(--bronze); }
.story-card-head, .story-card-actions, .story-tags { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.story-card-head { margin-bottom: var(--sp-3); }
.story-hub-card h3, .prompt-card h3 { color: var(--gold-soft); font-family: var(--font-head); font-size: 1.18rem; margin-bottom: .45rem; }
.story-hub-card p, .prompt-card p { color: var(--text-dim); }
.story-hub-card ul { margin: var(--sp-3) 0; padding-left: 1.1rem; color: var(--text); }
.story-hub-card li { margin-bottom: .35rem; }
.story-tags { margin-bottom: var(--sp-4); }
.story-tags span {
  border: 1px solid var(--bark);
  border-radius: 999px;
  color: var(--leaf);
  background: rgba(127,200,169,.08);
  padding: .16rem .55rem;
  font-family: var(--font-head);
  font-size: .75rem;
}
.prompt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--sp-4); }
.prompt-card { display: flex; flex-direction: column; gap: .55rem; }
.prompt-card .mini-btn { align-self: flex-start; margin-top: auto; }

/* INSPIRADO NO RPGUI (recriado no tema élfico, sem pixel-art) */
/* molduras ornamentais: cantos dourados em L */
.rr-framed { position: relative; }
.rr-framed::after {
  content: ''; position: absolute; inset: 6px; pointer-events: none; z-index: 2; opacity: .75;
  background:
    linear-gradient(var(--gold),var(--gold)) top left/18px 2px no-repeat,
    linear-gradient(var(--gold),var(--gold)) top left/2px 18px no-repeat,
    linear-gradient(var(--gold),var(--gold)) top right/18px 2px no-repeat,
    linear-gradient(var(--gold),var(--gold)) top right/2px 18px no-repeat,
    linear-gradient(var(--gold),var(--gold)) bottom left/18px 2px no-repeat,
    linear-gradient(var(--gold),var(--gold)) bottom left/2px 18px no-repeat,
    linear-gradient(var(--gold),var(--gold)) bottom right/18px 2px no-repeat,
    linear-gradient(var(--gold),var(--gold)) bottom right/2px 18px no-repeat;
}

/* barra de recurso (PV/mana) estilo RPGUI, no nosso tema */
.resource-bar { position: relative; height: 16px; border-radius: 999px; background: var(--bg-deep); border: 1px solid var(--bark); overflow: hidden; box-shadow: inset 0 1px 4px rgba(0,0,0,.5); }
.rb-fill { height: 100%; width: 100%; position: relative; background: linear-gradient(90deg, var(--moss), var(--leaf)); transition: width var(--t-base), background var(--t-base); }
.rb-fill.mid { background: linear-gradient(90deg, #8c7a1f, var(--gold)); }
.rb-fill.low { background: linear-gradient(90deg, #8c531f, var(--danger)); }
.rb-fill::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.28), transparent 55%); }
.rb-label { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-head); font-size: .74rem; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.8); z-index: 1; }

/* arrastar para reordenar (iniciativa) */
.drag-handle { cursor: grab; color: var(--text-dim); background: transparent; border: none; display: inline-flex; align-items: center; padding: .2rem; flex: none; }
.drag-handle:hover { color: var(--gold-soft); }
.drag-handle:active { cursor: grabbing; }
.combat-item.dragging { opacity: .45; }
.combat-item.drag-over { box-shadow: 0 -3px 0 var(--gold); }

/* COMUNIDADE (perfil + mesas) */
.profile-head { display: flex; gap: var(--sp-6); align-items: center; flex-wrap: wrap; }
.avatar { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-deco); font-size: 2.4rem; color: var(--gold); background: linear-gradient(160deg, var(--bg-panel-2), var(--bg-deep)); border: 2px solid var(--gold); box-shadow: inset 0 0 18px rgba(0,0,0,.5); flex: none; }
.profile-head h1 { margin: 0 0 .2rem; }
.linhagem-badge { display: inline-flex; align-items: center; gap: .4rem; font-family: var(--font-head); font-size: .82rem; color: var(--leaf); background: rgba(127,200,169,.1); border: 1px solid var(--bark); padding: .25rem .7rem; border-radius: 999px; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.empty-note { color: var(--text-dim); font-style: italic; }
.char-line { display: flex; justify-content: space-between; padding: .4rem 0; border-bottom: 1px solid var(--bark); }
.char-line:last-child { border-bottom: none; }
.char-line .k { color: var(--text-dim); }
.char-line .v { font-family: var(--font-head); color: var(--gold-soft); }

.mesa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-4); }
.mesa-card { background: linear-gradient(180deg, var(--bg-panel), var(--bg-panel-2)); border: 1px solid var(--bark); border-top: 3px solid var(--moss); border-radius: var(--radius); padding: 0 var(--sp-6) var(--sp-6); display: flex; flex-direction: column; gap: .6rem; overflow: hidden; transition: transform var(--t-base), border-color var(--t-base), box-shadow var(--t-base); }
.mesa-cover {
  margin: 0 calc(-1 * var(--sp-6)) var(--sp-4);
  height: 90px; position: relative;
  display: flex; align-items: center; justify-content: flex-start;
  padding: 0 var(--sp-6);
  border-bottom: 1px solid var(--bark);
  color: rgba(255,255,255,.85);
}
.mesa-cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.35));
  pointer-events: none;
}
.mesa-cover .cover-ic { color: rgba(255,255,255,.85); margin-right: .6rem; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.mesa-cover-initials {
  font-family: var(--font-deco); font-size: 2rem; color: var(--gold-soft);
  text-shadow: 0 2px 4px rgba(0,0,0,.5); letter-spacing: .04em; z-index: 1;
}

/* Avatares (iniciais em gradiente) */
.rr-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--gold-soft);
  font-family: var(--font-head); font-weight: 600;
  border: 1px solid rgba(201,168,74,.3);
  flex: 0 0 auto;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.mesa-card:hover { transform: translateY(-4px); border-top-color: var(--gold); box-shadow: 0 14px 34px rgba(0,0,0,.5); }
.mesa-card.full { opacity: .7; }
.mesa-card h3 { font-family: var(--font-head); color: var(--gold-soft); font-size: 1.15rem; }
.mesa-meta { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag { font-size: .74rem; font-family: var(--font-head); padding: .2rem .6rem; border-radius: 999px; background: rgba(184,115,51,.16); border: 1px solid var(--bronze); color: var(--gold-soft); }
.mesa-desc { color: var(--text-dim); font-size: .92rem; flex: 1; }
.mesa-foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-top: .4rem; }
.vagas { font-size: .85rem; color: var(--text-dim); display: flex; align-items: center; gap: .4rem; }
.vagas .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--moss); box-shadow: 0 0 8px var(--moss); }
.vagas.cheia .dot { background: var(--danger); box-shadow: none; }
.mesa-perms { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .2rem; }
.mesa-actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.permission-box {
  border: 1px solid var(--bark);
  border-radius: var(--radius-sm);
  padding: var(--sp-4);
  margin-top: var(--sp-4);
  background: var(--bg-deep);
}
.permission-box legend {
  color: var(--gold);
  font-family: var(--font-head);
  padding: 0 .35rem;
}
.check-card {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  color: var(--text-dim);
  font-size: .9rem;
  padding: .45rem 0;
}
.check-card input { width: auto; margin-top: .2rem; accent-color: var(--gold); }
@media (max-width: 700px) { .profile-grid { grid-template-columns: 1fr; } }

/* DASHBOARD */
.dashboard-page .tool-head { margin-bottom: var(--sp-6); }
.dashboard-login {
  display: grid;
  gap: var(--sp-4);
  max-width: 720px;
}
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.dash-stat {
  border: 1px solid var(--bark);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--bg-panel), var(--bg-panel-2));
  padding: var(--sp-4);
}
.dash-stat strong {
  display: block;
  color: var(--gold);
  font-family: var(--font-deco);
  font-size: 1.9rem;
  line-height: 1;
}
.dash-stat span {
  display: block;
  margin-top: .4rem;
  color: var(--text-dim);
  font-family: var(--font-head);
  font-size: .86rem;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
}
.dash-card h2 {
  color: var(--gold);
  font-family: var(--font-head);
  font-size: 1rem;
}
.dash-span { grid-column: 1 / -1; }
.dash-list {
  display: grid;
  gap: .55rem;
  margin-top: var(--sp-3);
}
.dash-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  border: 1px solid var(--bark);
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  padding: .7rem .85rem;
}
.dash-row strong,
.dash-row small {
  display: block;
}
.dash-row strong {
  color: var(--gold-soft);
  font-family: var(--font-head);
}
.dash-row small {
  color: var(--text-dim);
  font-size: .82rem;
  margin-top: .18rem;
}
.dash-row-actions,
.dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  justify-content: flex-end;
}
.dash-actions {
  justify-content: flex-start;
  margin-top: var(--sp-3);
}
.master-dashboard {
  margin-top: var(--sp-4);
}
.backup-panel {
  margin-top: var(--sp-4);
}
.backup-actions {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-top: var(--sp-3);
}
.backup-col {
  flex: 1 1 220px;
}
.backup-col h3 {
  font-family: var(--font-head);
  color: var(--gold-soft);
  font-size: 1rem;
  margin-bottom: .4rem;
}
.backup-col .muted { margin-bottom: .8rem; }
.backup-divider {
  width: 1px;
  align-self: stretch;
  background: var(--bark);
  opacity: .5;
}
.backup-file-label { cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; }
@media (max-width: 640px) {
  .backup-divider { width: 100%; height: 1px; align-self: auto; }
}
@media (max-width: 900px) {
  .dashboard-stats, .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .dashboard-stats, .dashboard-grid { grid-template-columns: 1fr; }
  .dash-row { align-items: stretch; flex-direction: column; }
  .dash-row-actions { justify-content: flex-start; }
}

/* ARSENAL (equipamentos + inventário) */
.filter-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.filter-bar .seg { flex-wrap: wrap; }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--sp-4); }
.item-card { position: relative; background: linear-gradient(180deg, var(--bg-panel), var(--bg-panel-2)); border: 1px solid var(--bark); border-left: 4px solid var(--rar, var(--moss)); border-radius: var(--radius); padding: var(--sp-4); display: flex; flex-direction: column; gap: .5rem; transition: transform var(--t-base), box-shadow var(--t-base); }
.item-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,.5); }
.item-head { display: flex; align-items: center; gap: .6rem; }
.item-ic { width: 34px; height: 34px; color: var(--rar, var(--gold)); flex: none; }
.item-card h3 { font-family: var(--font-head); font-size: 1.05rem; color: var(--gold-soft); line-height: 1.15; }
.item-stats { display: flex; flex-wrap: wrap; gap: .4rem; }
.stat-tag { font-size: .74rem; font-family: var(--font-head); padding: .15rem .5rem; border-radius: 6px; background: var(--bg-deep); border: 1px solid var(--bark); color: var(--text-dim); }
.stat-tag.dmg { color: #e6a07a; } .stat-tag.def { color: var(--leaf); }
.item-desc { color: var(--text-dim); font-size: .88rem; flex: 1; }
.rar-badge { font-size: .7rem; font-family: var(--font-head); text-transform: uppercase; letter-spacing: .04em; color: var(--rar, var(--stone)); }
.item-foot { display: flex; align-items: center; justify-content: space-between; margin-top: .3rem; }
.price { font-family: var(--font-head); color: var(--gold); font-size: .9rem; }
/* raridades */
.rar-comum { --rar: #9aa39a; } .rar-incomum { --rar: #4f9a5e; } .rar-raro { --rar: #4a86c7; }
.rar-muito-raro { --rar: #9a6cc7; } .rar-lendario { --rar: #d6a23a; }
.inv-list { list-style: none; display: grid; gap: .5rem; }
.inv-item { display: flex; align-items: center; gap: .6rem; background: var(--bg-deep); border: 1px solid var(--bark); border-left: 3px solid var(--rar, var(--moss)); border-radius: var(--radius-sm); padding: .5rem .7rem; }
.inv-item .inv-ic { width: 22px; height: 22px; color: var(--rar, var(--gold)); flex: none; }
.inv-item .inv-name { flex: 1; font-family: var(--font-head); color: var(--text); font-size: .92rem; }
.inv-item .inv-meta { color: var(--text-dim); font-size: .78rem; }
.inv-summary { display: flex; gap: 1.2rem; margin-top: .8rem; color: var(--text-dim); font-size: .85rem; }
.inv-summary strong { color: var(--gold-soft); font-family: var(--font-head); }

/* SISTEMAS (multi-RPG: dots, atributos, seletor) */
.dots { display: inline-flex; gap: .25rem; flex-wrap: wrap; }
.dot-pip { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--gold); background: transparent; cursor: pointer; padding: 0; transition: background .12s, transform .12s; }
.dot-pip.on { background: var(--gold); }
.dot-pip:hover { transform: scale(1.18); }
.attr-cat { color: var(--gold); font-family: var(--font-head); margin: .9rem 0 .4rem; font-size: .98rem; letter-spacing: .04em; border-bottom: 1px solid var(--bark); padding-bottom: .3rem; }
.attr-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem 1.6rem; }
.attr-row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .3rem 0; }
.attr-row .an { font-family: var(--font-head); color: var(--text); font-size: .95rem; }
.res-row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .45rem 0; border-bottom: 1px solid var(--bark); }
.res-row:last-child { border-bottom: none; }
.res-row .rl { font-family: var(--font-head); color: var(--gold-soft); }
.blood-ctl { display: flex; align-items: center; gap: .4rem; }
.blood-ctl input { width: 70px; text-align: center; }
.sys-note { color: var(--text-dim); font-size: .9rem; margin-top: .5rem; }
.sys-badge { display: inline-flex; align-items: center; gap: .4rem; font-family: var(--font-head); font-size: .82rem; color: var(--gold-soft); background: rgba(201,168,74,.1); border: 1px solid var(--bark); padding: .25rem .7rem; border-radius: 999px; }
@media (max-width: 640px) { .attr-cols { grid-template-columns: 1fr; } }

/* AUTENTICACAO LOCAL */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--sp-8) var(--sp-4);
}
.auth-shell {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: var(--sp-8);
  background: radial-gradient(520px 260px at 12% 0%, rgba(201,168,74,.12), transparent 65%),
              linear-gradient(180deg, rgba(22,36,26,.94), rgba(13,21,15,.96));
  border: 1px solid var(--bark);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--sp-8);
  position: relative;
}
.auth-logo { margin-bottom: var(--sp-6); }
.auth-intro h1 {
  font-family: var(--font-deco);
  color: var(--gold-soft);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  margin-bottom: var(--sp-4);
}
.auth-card {
  background: var(--bg-panel);
  border: 1px solid var(--bark);
  border-radius: var(--radius);
  padding: var(--sp-6);
  box-shadow: inset 0 0 24px rgba(0,0,0,.24);
}
.auth-tabs { margin-bottom: var(--sp-6); }
.auth-form { display: grid; gap: .65rem; }
.auth-form[hidden], .recovery-box[hidden], .auth-status-card[hidden] { display: none; }
.auth-form h2, .recovery-box h2 {
  color: var(--gold);
  font-family: var(--font-head);
  margin-bottom: .2rem;
}
.password-row { display: flex; gap: .5rem; align-items: stretch; }
.password-row input { flex: 1; }
.auth-toggle { flex: 0 0 auto; }
.auth-submit { margin-top: .5rem; width: 100%; min-height: 46px; }
.password-meter { display: grid; gap: .35rem; margin: .2rem 0 .4rem; }
.meter-track {
  height: 9px;
  border-radius: 999px;
  background: var(--bg-deep);
  border: 1px solid var(--bark);
  overflow: hidden;
}
.meter-track span {
  display: block;
  height: 100%;
  width: 8%;
  background: var(--danger);
  transition: width var(--t-base), background var(--t-base);
}
.meter-track span[data-score="3"] { background: #b87333; }
.meter-track span[data-score="4"], .meter-track span[data-score="5"] { background: var(--leaf); }
.password-meter strong {
  color: var(--gold-soft);
  font-family: var(--font-head);
  font-size: .85rem;
}
.password-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: .25rem .7rem;
  list-style: none;
  color: var(--text-dim);
  font-size: .85rem;
}
.password-rules li.ok { color: var(--leaf); }
.auth-message {
  min-height: 1.4rem;
  margin-top: var(--sp-4);
  color: var(--text-dim);
}
.auth-message.ok { color: var(--leaf); }
.auth-message.error { color: var(--danger); }
.recovery-box, .auth-status-card {
  margin-top: var(--sp-4);
  padding: var(--sp-4);
  border: 1px solid var(--bark);
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
}
.recovery-box textarea {
  min-height: 150px;
  margin: .6rem 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .04em;
}
.auth-status-card strong {
  display: block;
  margin-top: .6rem;
  color: var(--gold-soft);
  font-family: var(--font-head);
}
@media (max-width: 780px) {
  .auth-shell { grid-template-columns: 1fr; padding: var(--sp-6); }
  .password-rules { grid-template-columns: 1fr; }
  .password-row { flex-direction: column; }
}

/* AMBIENTE DE MESA */
.table-page { width: min(1500px, calc(100% - 2rem)); margin: 0 auto; padding: calc(var(--nav-h) + var(--sp-6)) 0 var(--sp-8); }
.table-top { display: flex; justify-content: space-between; gap: var(--sp-4); align-items: flex-start; margin-bottom: var(--sp-4); }
.table-top h1 { margin: .3rem 0; }
.table-status { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.table-shell { display: grid; grid-template-columns: 280px minmax(360px, 1fr) 340px; gap: var(--sp-4); align-items: stretch; }
.table-side, .table-chat { min-height: 720px; display: flex; flex-direction: column; gap: var(--sp-4); }
.table-side h2, .table-chat h2, .master-panel h2 { font-family: var(--font-head); color: var(--gold); font-size: 1rem; }
.member-list { display: grid; gap: .6rem; }
.member-row { display: flex; align-items: center; gap: .65rem; padding: .55rem; border: 1px solid var(--bark); border-radius: var(--radius-sm); background: var(--bg-deep); flex-wrap: wrap; }
.member-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 1px solid var(--gold); color: var(--gold-soft); font-family: var(--font-head); background: var(--bg-panel-2); }
.member-row > span:nth-child(2) { flex: 1 1 150px; min-width: 0; }
.member-row strong, .member-row small { display: block; }
.member-row small { color: var(--text-dim); font-size: .78rem; margin-top: .15rem; }
.character-picker, .turn-box, .combat-box, .table-inventory-box { border-top: 1px solid var(--bark); padding-top: var(--sp-4); display: grid; gap: .55rem; }
.resource-tracker {
  display: grid;
  gap: .45rem;
  border: 1px solid var(--bark);
  border-radius: var(--radius-sm);
  background: rgba(13,21,15,.7);
  padding: .65rem;
}
.resource-tracker h3 { color: var(--gold-soft); font-family: var(--font-head); font-size: .9rem; }
.resource-row,
.slot-row,
.selected-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .55rem;
  border: 1px solid var(--bark);
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  padding: .5rem .6rem;
}
.resource-row strong,
.slot-row strong,
.selected-row strong { color: var(--gold-soft); font-family: var(--font-head); }
.resource-row small,
.slot-row small,
.selected-row small { display: block; color: var(--text-dim); font-size: .78rem; }
.resource-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.stepper { display: inline-flex; align-items: center; gap: .35rem; }
.stepper button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  border: 1px solid var(--bark);
  border-radius: 6px;
  background: var(--bg-panel-2);
  color: var(--gold-soft);
  cursor: pointer;
}
.stepper button:hover { border-color: var(--gold); }
.stepper input { width: 62px; min-height: 30px; padding: .25rem .35rem; }
.character-summary { display: grid; gap: .45rem; }
.character-summary-card {
  border: 1px solid var(--bark);
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  padding: .65rem;
}
.character-summary-card strong {
  display: block;
  color: var(--gold-soft);
  font-family: var(--font-head);
}
.character-summary-card small {
  display: block;
  color: var(--text-dim);
  font-size: .82rem;
  margin-top: .2rem;
}
.quick-rolls { margin-top: .8rem; border-top: 1px solid var(--bark); padding-top: .8rem; }
.quick-rolls[hidden] { display: none; }
.quick-rolls h3 { font-family: var(--font-head); color: var(--gold-soft); font-size: .9rem; margin-bottom: .5rem; }
.quick-rolls-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; }
.quick-roll {
  background: var(--bg-deep); border: 1px solid var(--bark); border-radius: var(--radius-sm);
  padding: .45rem .5rem; cursor: pointer; color: var(--text);
  display: flex; flex-direction: column; align-items: flex-start; gap: .1rem;
  font-family: var(--font-body); text-align: left;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.quick-roll:hover { border-color: var(--gold); color: var(--gold); }
.quick-roll strong { font-family: var(--font-head); font-size: .82rem; color: var(--gold-soft); }
.quick-roll span { font-size: .76rem; color: var(--text-dim); }
.quick-rolls-hint { font-size: .76rem; margin-top: .4rem; }
.sheet-preview { display: grid; gap: var(--sp-4); }
.sheet-preview-head {
  display: flex;
  align-items: center;
  gap: .7rem;
  border: 1px solid var(--bark);
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  padding: .7rem;
}
.sheet-preview-head strong,
.sheet-preview-head small { display: block; }
.sheet-preview-head strong { color: var(--gold-soft); font-family: var(--font-head); }
.sheet-preview-head small { color: var(--text-dim); font-size: .84rem; margin-top: .15rem; }
.sheet-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
}
.sheet-preview-grid div,
.sheet-preview section {
  border: 1px solid var(--bark);
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  padding: .6rem;
}
.sheet-preview-grid span,
.sheet-preview section h3 {
  display: block;
  color: var(--text-dim);
  font-size: .78rem;
  margin-bottom: .2rem;
}
.sheet-preview-grid strong,
.sheet-preview section h3 {
  color: var(--gold-soft);
  font-family: var(--font-head);
}
.sheet-preview section p {
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.45;
}
.turn-list { list-style: none; display: grid; gap: .4rem; }
.turn-list li { display: flex; justify-content: space-between; gap: .6rem; padding: .45rem .6rem; border-radius: var(--radius-sm); border: 1px solid var(--bark); background: var(--bg-deep); }
.turn-list li.active { border-color: var(--gold); box-shadow: inset 0 0 12px rgba(201,168,74,.12); }
.combat-list, .table-inventory, .story-list { display: grid; gap: .5rem; }
.combat-card, .inventory-row, .story-card {
  border: 1px solid var(--bark);
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  padding: .6rem;
}
.combat-card header, .story-card header, .inventory-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}
.combat-card strong, .story-card strong { color: var(--gold-soft); }
.combat-card small, .story-card small { color: var(--text-dim); display: block; margin-top: .15rem; }
.combat-actions, .vote-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.combat-actions input { max-width: 80px; min-height: 34px; }
.combat-actions select { min-height: 34px; max-width: 150px; }
.condition-list { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .45rem; }
.condition-chip { border: 1px solid var(--moss); color: var(--text); border-radius: 999px; padding: .1rem .45rem; font-size: .76rem; }
.table-stage { min-height: 720px; padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-4); background: linear-gradient(180deg, rgba(20,34,25,.96), rgba(8,13,10,.96)); }
.scene-bar { display: flex; justify-content: space-between; gap: var(--sp-4); align-items: center; }
.scene-bar h2 { font-family: var(--font-deco); color: var(--gold-soft); font-size: clamp(1.5rem, 3vw, 2.3rem); }
.virtual-table { position: relative; flex: 1; min-height: 420px; border: 1px solid var(--bark); border-radius: var(--radius); overflow: hidden; background: radial-gradient(circle at center, rgba(201,168,74,.14), rgba(27,46,32,.26) 34%, rgba(6,10,8,.72) 70%), linear-gradient(135deg, rgba(127,200,169,.08), rgba(184,115,51,.08)); }
.table-surface { position: absolute; inset: 16% 18%; border-radius: 50%; display: grid; place-items: center; text-align: center; padding: var(--sp-6); color: var(--text); border: 2px solid rgba(201,168,74,.42); background: radial-gradient(circle, rgba(74,45,27,.92), rgba(22,36,26,.94)); box-shadow: inset 0 0 40px rgba(0,0,0,.45), 0 24px 80px rgba(0,0,0,.45); }
.table-surface span { max-width: 48ch; line-height: 1.55; }
.seat-layer { position: absolute; inset: 0; }
.seat-token { position: absolute; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: .25rem; min-width: 92px; pointer-events: none; }
.seat-token span { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--bark); background: var(--bg-panel); color: var(--gold-soft); font-family: var(--font-head); box-shadow: var(--shadow); }
.seat-token small { max-width: 110px; text-align: center; font-size: .78rem; color: var(--text-dim); background: rgba(6,10,8,.72); border: 1px solid var(--bark); border-radius: 999px; padding: .15rem .45rem; }
.seat-token.active span { border-color: var(--gold); box-shadow: 0 0 22px rgba(201,168,74,.45); }
.tactical-map-panel {
  display: grid;
  gap: .75rem;
  border: 1px solid var(--bark);
  border-radius: var(--radius);
  background: rgba(8, 18, 12, .72);
  padding: var(--sp-4);
}
.tactical-map-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--sp-4);
}
.tactical-map-head h2 {
  color: var(--gold-soft);
  font-family: var(--font-head);
  font-size: 1.05rem;
}
.map-controls {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: .5rem;
  flex-wrap: wrap;
}
.map-controls[hidden] { display: none; }
.map-controls label {
  width: auto;
  margin: 0;
  color: var(--text-dim);
  font-size: .78rem;
}
.map-controls select {
  min-height: 38px;
  max-width: 210px;
}
.map-controls input[type="number"] {
  width: 70px;
  min-height: 38px;
  padding: .35rem .5rem;
}
.map-controls .rule-check {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid var(--bark);
  border-radius: 999px;
  padding: .25rem .65rem;
  background: var(--bg-deep);
}
.map-controls input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--gold);
}
.tactical-map {
  position: relative;
  min-height: 360px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid rgba(201,168,74,.34);
  border-radius: var(--radius-sm);
  background-color: var(--bg-deep);
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 36px rgba(0,0,0,.5);
}
.tactical-map::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(242,221,156,.34) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242,221,156,.34) 1px, transparent 1px),
    linear-gradient(rgba(6,10,8,.24) 2px, transparent 2px),
    linear-gradient(90deg, rgba(6,10,8,.24) 2px, transparent 2px);
  background-size: 8.333% 12.5%;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: .78;
}
.tactical-map.no-grid::before { opacity: 0; }
.tactical-map.editable { cursor: crosshair; }
.map-token-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
}
.map-area {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(242,221,156,.72);
  background: rgba(201,168,74,.16);
  color: var(--gold-soft);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: inset 0 0 28px rgba(201,168,74,.18), 0 0 18px rgba(0,0,0,.35);
}
.map-area span {
  border-radius: 999px;
  background: rgba(4,8,6,.72);
  border: 1px solid rgba(242,221,156,.35);
  padding: .12rem .45rem;
  font-size: .7rem;
  font-family: var(--font-head);
}
.map-area.circle { border-radius: 50%; }
.map-area.square { border-radius: 8px; }
.map-area.line {
  border-radius: 999px;
  background: rgba(127,200,169,.18);
  border-color: rgba(127,200,169,.76);
}
.map-area.cone {
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: rgba(184,115,51,.2);
  border-color: rgba(232,180,90,.8);
}
.map-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  border: none;
  background: transparent;
  display: grid;
  justify-items: center;
  gap: .1rem;
  color: var(--text);
  cursor: pointer;
  z-index: 3;
}
.map-marker span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--gold);
  background: rgba(8,13,10,.9);
  color: var(--gold-soft);
  font-family: var(--font-head);
  box-shadow: 0 8px 18px rgba(0,0,0,.5);
}
.map-marker strong {
  border: 1px solid rgba(9,18,12,.8);
  border-radius: 999px;
  background: rgba(4,8,6,.74);
  color: var(--text-dim);
  font-size: .66rem;
  padding: .06rem .36rem;
}
.map-marker.trap span { border-color: var(--danger); color: #f1a19b; }
.map-marker.chest span { border-color: var(--gold); }
.map-marker.door span { border-color: #b87333; }
.map-marker.fire span { border-color: #e87b4a; color: #ffd0a6; }
.map-marker.mist span { border-color: #9ab0c8; color: #d8e4f2; }
.map-marker.light span { border-color: #f2dd9c; color: #fff1b8; }
.map-token {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 68px;
  max-width: 104px;
  border: none;
  background: transparent;
  color: var(--text);
  display: grid;
  justify-items: center;
  gap: .15rem;
  cursor: pointer;
  text-align: center;
  font-family: var(--font-body);
  z-index: 4;
}
.map-token span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: radial-gradient(circle at 35% 28%, rgba(242,221,156,.28), rgba(19,38,25,.95));
  color: var(--gold-soft);
  font-family: var(--font-head);
  box-shadow: 0 10px 22px rgba(0,0,0,.5);
}
.map-token strong,
.map-token small {
  max-width: 104px;
  border: 1px solid rgba(9,18,12,.8);
  border-radius: 999px;
  background: rgba(4,8,6,.74);
  padding: .08rem .4rem;
  line-height: 1.2;
}
.map-token strong {
  color: var(--gold-soft);
  font-size: .72rem;
  font-weight: 700;
}
.map-token small {
  color: var(--text-dim);
  font-size: .66rem;
}
.map-token.monster span {
  border-color: #b87333;
  background: radial-gradient(circle at 35% 28%, rgba(232,180,90,.2), rgba(67,20,18,.96));
}
.map-token.selected span {
  box-shadow: 0 0 0 4px rgba(201,168,74,.18), 0 0 24px rgba(201,168,74,.55);
}
.map-status {
  color: var(--text-dim);
  font-size: .82rem;
  min-height: 1.2em;
}
.story-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.story-board h2 { font-family: var(--font-head); color: var(--gold); font-size: 1rem; margin-bottom: .5rem; }
.master-panel { border: 1px solid var(--bark); border-radius: var(--radius-sm); padding: var(--sp-4); background: var(--bg-deep); display: grid; gap: .65rem; }
.master-panel[hidden] { display: none; }
.master-tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.master-notes { background: rgba(201,168,74,.06); border: 1px solid var(--bark); border-left: 3px solid var(--gold); border-radius: var(--radius-sm); padding: var(--sp-4); display: grid; gap: .5rem; }
.master-notes-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.master-notes h3 { font-family: var(--font-head); color: var(--gold-soft); margin: 0; }
.master-notes #masterNotesStatus { font-size: .78rem; }
.master-notes textarea { width: 100%; min-height: 100px; resize: vertical; }
.master-tools-grid section {
  display: grid;
  gap: .5rem;
  border: 1px solid var(--bark);
  border-radius: var(--radius-sm);
  padding: var(--sp-4);
  background: rgba(20,34,25,.72);
}
.master-tools-grid h3,
.player-requests-box h3 {
  color: var(--gold-soft);
  font-family: var(--font-head);
  font-size: .95rem;
}
.player-requests-box,
.prepared-encounters-box {
  display: grid;
  gap: .5rem;
  border: 1px solid var(--bark);
  border-radius: var(--radius-sm);
  padding: var(--sp-4);
  background: rgba(20,34,25,.72);
}
.prepared-encounter-list { display: grid; gap: .5rem; }
.prepared-encounter-card {
  display: grid;
  gap: .55rem;
  border: 1px solid var(--bark);
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  padding: .65rem;
}
.prepared-encounter-card strong { color: var(--gold-soft); font-family: var(--font-head); }
.prepared-encounter-card small { display: block; color: var(--text-dim); font-size: .78rem; margin-top: .1rem; }
.prepared-encounter-card p { color: var(--text); font-size: .86rem; line-height: 1.45; }
.prepared-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.request-list { display: grid; gap: .5rem; }
.request-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  border: 1px solid var(--bark);
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  padding: .6rem;
}
.request-row strong,
.request-row small { display: block; }
.request-row strong { color: var(--gold-soft); }
.request-row small { color: var(--text-dim); font-size: .78rem; margin-top: .15rem; }
.request-actions { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.narration-timer {
  display: grid;
  gap: .65rem;
  border: 1px solid var(--bark);
  border-radius: var(--radius-sm);
  padding: var(--sp-4);
  background: rgba(20,34,25,.72);
}
.narration-timer h3 {
  color: var(--gold-soft);
  font-family: var(--font-head);
  font-size: .95rem;
}
.timer-display {
  min-height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(201,168,74,.36);
  border-radius: var(--radius-sm);
  color: var(--gold);
  background: var(--bg-deep);
  font-family: var(--font-head);
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
}
.timer-display.warning { color: #e8b45a; border-color: #b87333; }
.timer-display.done { color: var(--danger); border-color: var(--danger); }
.timer-controls {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) minmax(90px, .6fr) auto auto;
  gap: .5rem;
  align-items: end;
}
.timer-controls label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.chat-head select { max-width: 150px; }
.chat-log { flex: 1; min-height: 360px; overflow: auto; display: flex; flex-direction: column; gap: .55rem; padding-right: .2rem; }
.chat-msg { border: 1px solid var(--bark); border-radius: var(--radius-sm); padding: .55rem .65rem; background: var(--bg-deep); }
.chat-msg header { display: flex; justify-content: space-between; gap: .6rem; margin-bottom: .25rem; font-size: .78rem; color: var(--text-dim); }
.chat-msg header strong { color: var(--gold-soft); }
.chat-msg.narracao { border-color: var(--gold); }
.chat-msg.sussurro { border-color: var(--moss); opacity: .92; }
.chat-msg.sistema, .chat-msg.turno { border-style: dashed; }
.chat-form { display: grid; gap: .5rem; }
.chat-form textarea { min-height: 90px; }
.dice-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; }
.dice-strip button { min-height: 38px; border: 1px solid var(--bark); border-radius: 6px; background: var(--bg-panel-2); color: var(--text); font-family: var(--font-head); cursor: pointer; }
.dice-strip button:hover { border-color: var(--gold); }
.dice-rules-panel {
  margin-top: .8rem;
  padding-top: .8rem;
  border-top: 1px solid var(--bark);
}
.dice-rules-panel[hidden],
.dice-rules-grid[hidden] { display: none; }
.dice-rules-panel h3 {
  color: var(--gold-soft);
  font-family: var(--font-head);
  font-size: .92rem;
  margin-bottom: .55rem;
}
.dice-rules-grid {
  display: grid;
  grid-template-columns: minmax(84px, .8fr) minmax(70px, 1fr);
  gap: .5rem;
  align-items: center;
}
.dice-rules-grid label {
  width: auto;
  margin: 0;
  font-size: .78rem;
  color: var(--text-dim);
}
.dice-rules-grid .rule-check {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}
.dice-rules-grid input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--gold);
}
.dice-rules-grid input[type="number"] {
  min-height: 36px;
  padding: .35rem .5rem;
}
@media (max-width: 1100px) {
  .table-shell { grid-template-columns: 1fr; }
  .table-side, .table-chat, .table-stage { min-height: auto; }
  .virtual-table { min-height: 520px; }
  .tactical-map { min-height: 420px; }
  .story-board, .master-tools-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .table-page { width: min(100% - 1rem, 1500px); }
  .table-top, .scene-bar { flex-direction: column; align-items: stretch; }
  .table-surface { inset: 22% 10%; }
  .seat-token { min-width: 74px; }
  .seat-token span { width: 46px; height: 46px; }
  .tactical-map-head { align-items: stretch; flex-direction: column; }
  .map-controls { justify-content: stretch; }
  .map-controls select,
  .map-controls .mini-btn { max-width: none; flex: 1 1 150px; }
  .map-controls input[type="number"] { flex: 0 0 90px; }
  .tactical-map { min-height: 300px; aspect-ratio: 4 / 3; }
  .map-token strong,
  .map-token small,
  .map-marker strong,
  .map-area span { display: none; }
  .map-marker span { width: 30px; height: 30px; }
  .dice-strip { grid-template-columns: repeat(4, 1fr); }
  .timer-controls { grid-template-columns: 1fr 1fr; }
  .sheet-preview-grid { grid-template-columns: 1fr; }
}

/* ONDA 4 — Construtor de encontros */
.encounter-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: var(--sp-4);
  align-items: start;
}
.encounter-builder,
.encounter-summary,
.tracker-panel { display: grid; gap: var(--sp-4); }
.encounter-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
}
.encounter-section-head h2,
.encounter-section-head h3,
.tracker-panel h3 {
  font-family: var(--font-head);
  color: var(--gold-soft);
}
.encounter-section-head h2 { font-size: 1.1rem; }
.encounter-section-head h3,
.tracker-panel h3 { font-size: .95rem; }
.encounter-meter {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .6rem;
}
.encounter-meter > div {
  border: 1px solid var(--bark);
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  padding: .7rem;
}
.encounter-meter span { display: block; color: var(--text-dim); font-size: .78rem; }
.encounter-meter strong { color: var(--gold); font-family: var(--font-head); font-size: 1.25rem; }
.monster-catalog,
.selected-monsters,
.draft-list,
.condition-ref,
.slot-tracker { display: grid; gap: .5rem; }
.monster-card,
.draft-card,
.condition-ref-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  border: 1px solid var(--bark);
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  padding: .7rem;
}
.monster-card strong,
.draft-card strong,
.condition-ref-card strong { color: var(--gold-soft); font-family: var(--font-head); }
.monster-card small,
.draft-card small { display: block; color: var(--text-dim); font-size: .8rem; margin-top: .15rem; }
.condition-ref-card {
  display: block;
  border-left: 3px solid var(--moss);
}
.condition-ref-card p { color: var(--text-dim); font-size: .86rem; line-height: 1.45; margin-top: .2rem; }
.encounter-actions,
.draft-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.tracker-panel { margin-top: var(--sp-4); }
.tracker-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  gap: var(--sp-4);
}
#encDifficulty[data-difficulty="mortal"] { border-color: var(--danger); color: #f2b1a8; }
#encDifficulty[data-difficulty="difícil"] { border-color: var(--bronze); color: #e8b45a; }
#encDifficulty[data-difficulty="médio"] { border-color: var(--gold); color: var(--gold-soft); }
@media (max-width: 980px) {
  .encounter-layout,
  .tracker-grid { grid-template-columns: 1fr; }
  .encounter-meter { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .encounter-section-head,
  .monster-card,
  .draft-card,
  .selected-row,
  .resource-row,
  .slot-row { align-items: stretch; flex-direction: column; }
  .stepper { justify-content: flex-start; }
}

/* garante que o atributo hidden sempre esconda (vence regras de display) */
[hidden] { display: none !important; }

/* aviso de modo local (mesas) */
.local-note { margin: 0 0 var(--sp-6); padding: .7rem 1rem; color: var(--text-dim); background: rgba(127,200,169,.06); border: 1px solid var(--bark); border-left: 3px solid var(--leaf); border-radius: var(--radius-sm); font-size: .9rem; line-height: 1.5; }
.local-note strong { color: var(--gold-soft); }

/* COMPENDIO (magias e disciplinas) */
.comp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-4); }
.comp-card { background: linear-gradient(180deg, var(--bg-panel), var(--bg-panel-2)); border: 1px solid var(--bark); border-left: 3px solid var(--moss); border-radius: var(--radius); padding: var(--sp-4); }
.comp-card:hover { border-left-color: var(--gold); }
.comp-head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; margin-bottom: .4rem; }
.comp-head h3 { font-family: var(--font-head); color: var(--gold-soft); font-size: 1.1rem; }
.comp-tag { font-size: .72rem; font-family: var(--font-head); color: var(--gold); background: var(--bg-deep); border: 1px solid var(--bark); border-radius: 999px; padding: .15rem .55rem; white-space: nowrap; }
.comp-desc { color: var(--text-dim); font-size: .92rem; line-height: 1.5; }
.power-list { list-style: none; margin-top: .6rem; display: grid; gap: .4rem; }
.power-list li { color: var(--text-dim); font-size: .88rem; border-top: 1px solid var(--bark); padding-top: .4rem; line-height: 1.45; }
.power-list strong { color: var(--text); font-family: var(--font-head); }
.pdots { color: var(--gold); letter-spacing: 1px; margin-right: .25rem; font-size: .8rem; }

.comp-card-emblem { position: relative; padding-top: var(--sp-4); }
.comp-emblem {
  position: absolute; top: -18px; right: var(--sp-4);
  width: 48px; height: 48px;
  background: var(--bg-deep); border: 1px solid var(--gold); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.comp-emblem svg { width: 26px; height: 26px; }
.comp-card-emblem .comp-head { padding-right: 56px; }

/* MODAL DO CARTÃO DE PERSONAGEM */
.rr-card-modal {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(13,21,15,.88); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 1rem;
}
.rr-card-modal.open { display: flex; }
.rr-card-modal-content {
  background: var(--bg-panel); border: 1px solid var(--gold);
  border-radius: var(--radius); padding: var(--sp-4);
  max-width: 700px; width: 100%; max-height: 95vh; overflow-y: auto;
}
.rr-card-modal-content header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.rr-card-modal-content h2 { font-family: var(--font-head); color: var(--gold); }
.rr-card-modal-content .rr-card-close {
  background: transparent; border: 1px solid var(--bark); color: var(--text-dim);
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 1.2rem;
}
.rr-card-modal-content .rr-card-close:hover { color: var(--gold); border-color: var(--gold); }
.rr-card-preview { background: var(--bg-deep); border-radius: var(--radius-sm); padding: 1rem; display: flex; justify-content: center; margin-bottom: 1rem; }
.rr-card-preview svg { max-width: 100%; height: auto; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.rr-card-actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; }

/* REFERÊNCIA RÁPIDA */
#refContent { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--sp-4); align-items: start; }
.ref-card { border-left: 3px solid var(--moss); }
.ref-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.ref-head h2 { font-family: var(--font-head); color: var(--gold-soft); font-size: 1.15rem; }
.ref-ic { display: inline-flex; flex: 0 0 auto; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 10px; background: var(--bg-deep); border: 1px solid var(--bark); }
.ref-ic .lucide { width: 20px; height: 20px; color: var(--gold); }
.ref-intro { color: var(--text-dim); font-size: .92rem; line-height: 1.5; margin-bottom: .6rem; }
.ref-list { display: grid; gap: 0; }
.ref-row { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: .8rem; padding: .5rem 0; border-top: 1px solid var(--bark); }
.ref-row dt { font-family: var(--font-head); color: var(--text); font-size: .85rem; }
.ref-row dd { color: var(--text-dim); font-size: .85rem; line-height: 1.4; }
@media (max-width: 480px) { .ref-row { grid-template-columns: 1fr; gap: .15rem; } }

/* FICHA DISCIPLINAS (ligadas ao compêndio) */
.disc-block { border-bottom: 1px solid var(--bark); padding: .25rem 0; }
.disc-block:last-child { border-bottom: none; }
.disc-toggle { background: transparent; border: 0; color: var(--gold-soft); font-family: var(--font-head); font-size: .98rem; cursor: pointer; padding: 0; }
.disc-toggle:hover { color: var(--gold); }
.disc-resumo { display: block; font-style: italic; margin-top: .1rem; font-size: .82rem; }
.disc-powers { list-style: none; margin: .4rem 0 .6rem 1.6rem; display: grid; gap: .3rem; }
.disc-powers li { color: var(--text-dim); font-size: .88rem; line-height: 1.45; }
.disc-powers li.owned { color: var(--text); }
.disc-powers li.owned strong { color: var(--gold-soft); }
.disc-powers li.locked { opacity: .55; }
.disc-powers li.locked strong { color: var(--stone); }
.disc-powers .pdots { color: var(--gold); letter-spacing: 1px; margin-right: .3rem; font-size: .8rem; }
.disc-powers li.locked .pdots { color: var(--stone); }

/* MAGIAS PREPARADAS (ficha D&D) */
.spell-list { list-style: none; margin-top: .8rem; display: grid; gap: .5rem; }
.spell-card { background: var(--bg-deep); border: 1px solid var(--bark); border-left: 3px solid var(--moss); border-radius: var(--radius-sm); padding: .7rem .9rem; position: relative; }
.spell-card .spell-head { display: flex; align-items: baseline; gap: .6rem; justify-content: space-between; margin-bottom: .25rem; }
.spell-card strong { color: var(--gold-soft); font-family: var(--font-head); }
.spell-card p { color: var(--text-dim); font-size: .9rem; line-height: 1.45; margin: .15rem 0 .4rem; }
.spell-card [data-rem] { font-size: .78rem; }
.spell-card .comp-tag { background: var(--bg-panel); }

/* FICHA EQUIPAMENTO */
.equip-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: .6rem; margin-top: .9rem; }
.equip-summary > div { background: var(--bg-deep); border: 1px solid var(--bark); border-left: 3px solid var(--gold); border-radius: var(--radius-sm); padding: .6rem .8rem; display: flex; flex-direction: column; gap: .15rem; }
.equip-summary .dl { font-size: .72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; }
.equip-summary strong { color: var(--gold-soft); font-family: var(--font-head); }
.equip-summary small { color: var(--text-dim); font-size: .82rem; }

/* Histórico curto de dano da arma equipada */
.weapon-rolls { list-style: none; margin-top: .4rem; display: grid; gap: .25rem; grid-column: 1 / -1; }
.weapon-rolls li { background: var(--bg-deep); border: 1px solid var(--bark); border-radius: 6px; padding: .35rem .6rem; font-size: .85rem; }
.weapon-rolls li strong { color: var(--gold); font-family: var(--font-head); margin-right: .4rem; }
#rollWeaponBtn { margin-top: .4rem; align-self: flex-start; }

.spell-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .4rem; }

/* FOCO VISUAL GLOBAL — anel dourado consistente */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}
.btn:focus-visible,
.mini-btn:focus-visible,
.fav-star:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(201,168,74,.2);
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 0;
  border-color: var(--gold);
}
.skip-link:focus-visible {
  position: fixed; top: 1rem; left: 1rem; z-index: 10000;
  background: var(--bg-deep); color: var(--gold);
  padding: .6rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--gold);
}

/* PAINEL DE ATALHOS DE TECLADO */
.rr-help-panel {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(13,21,15,.85); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 1rem;
}
.rr-help-panel.open { display: flex; }
.rr-help-card {
  background: var(--bg-panel); border: 1px solid var(--bark);
  border-radius: var(--radius); padding: var(--sp-4);
  max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto;
}
.rr-help-card header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; }
.rr-help-card h2 { font-family: var(--font-head); color: var(--gold); font-size: 1.2rem; }
.rr-help-close { background: transparent; border: 1px solid var(--bark); color: var(--text-dim); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; }
.rr-help-close:hover { color: var(--gold); border-color: var(--gold); }
.rr-help-list, .rr-help-grid { list-style: none; display: grid; gap: .35rem; margin-bottom: .8rem; }
.rr-help-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rr-help-list li, .rr-help-grid li { color: var(--text-dim); font-size: .9rem; padding: .3rem 0; border-bottom: 1px dashed var(--bark); }
.rr-help-sub { font-family: var(--font-head); color: var(--gold-soft); font-size: .9rem; margin: .6rem 0 .4rem; text-transform: uppercase; letter-spacing: .08em; }
.rr-help-foot { color: var(--text-dim); font-size: .8rem; margin-top: .6rem; }
.rr-help-card kbd {
  display: inline-block; font-family: monospace; font-size: .8rem;
  background: var(--bg-deep); color: var(--gold); border: 1px solid var(--bark);
  border-bottom-width: 2px; padding: .1rem .4rem; border-radius: 4px;
  min-width: 1.4em; text-align: center; margin: 0 .15em;
}

/* ONBOARDING DA HOME */
.onboarding {
  background: linear-gradient(180deg, var(--bg-panel), var(--bg-panel-2));
  border: 1px solid var(--bark);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: var(--sp-4);
  margin: var(--sp-4) 0;
  position: relative;
}
.onb-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.onb-head h2 { font-family: var(--font-head); color: var(--gold-soft); font-size: 1.5rem; margin: .3rem 0; }
.onb-close {
  background: transparent; border: 1px solid var(--bark); color: var(--text-dim);
  border-radius: 50%; width: 32px; height: 32px; font-size: 1.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  flex: 0 0 auto;
}
.onb-close:hover { background: var(--bg-deep); color: var(--gold); border-color: var(--gold); }
.onb-steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.onb-step {
  background: var(--bg-deep);
  border: 1px solid var(--bark); border-radius: var(--radius-sm);
  padding: 1rem; display: flex; gap: .8rem; align-items: flex-start;
  transition: border-color var(--t-fast);
}
.onb-step:hover { border-color: var(--moss); }
.onb-num {
  flex: 0 0 auto;
  font-family: var(--font-deco); font-size: 1.8rem;
  color: var(--gold); width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(201,168,74,.08); border: 1px solid var(--gold); border-radius: 50%;
}
.onb-text { flex: 1; }
.onb-text h3 { font-family: var(--font-head); color: var(--gold-soft); font-size: 1.05rem; margin-bottom: .25rem; }
.onb-text p { color: var(--text-dim); font-size: .9rem; line-height: 1.5; margin-bottom: .6rem; }
.onb-cursys { color: var(--gold); font-family: var(--font-head); }
.onb-cta-row { display: flex; gap: .4rem; flex-wrap: wrap; }
@media (max-width: 640px) {
  .onb-head { flex-direction: column; }
  .onb-head h2 { font-size: 1.25rem; }
}
