/*
 * Area do jogador. Reaproveita a paleta de realm-2026.css para a pagina
 * parecer parte do site, e nao um painel separado.
 */

:root {
  /* Materiais da moldura clássica. */
  --gold-1: #f0d398;
  --gold-2: #b3823f;
  --parchment: #e4d2ad;
  --ink: #302619;
  --gump-edge: #090807;
  --gump-frame: inset 0 0 0 1px #83653e, inset 0 0 0 4px #171410,
    inset 0 0 0 5px rgba(226, 181, 107, .2), inset 0 18px 30px rgba(226, 181, 107, .035),
    0 12px 30px rgba(0, 0, 0, .3);
  --gump-surface: radial-gradient(ellipse at top left, rgba(226, 181, 107, .08), transparent 65%),
    repeating-linear-gradient(112deg, rgba(226, 181, 107, .018) 0 1px, transparent 1px 5px),
    linear-gradient(160deg, #25221e, #141412);
  --bg: #110f14;
  --bg-soft: #18151d;
  --panel: rgba(27, 23, 32, 0.84);
  --panel-strong: rgba(19, 16, 24, 0.94);
  --border: rgba(225, 200, 160, 0.16);
  --border-strong: rgba(225, 200, 160, 0.3);
  --text: #f3eee5;
  --muted: #baa992;
  --accent: #e2b56b;
  --accent-2: #b24a35;
  --success: #74c79a;
  --danger: #dc6b63;
  --radius-lg: 8px;
  --radius-md: 6px;
  --radius-sm: 4px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 50% -8%, rgba(226, 181, 107, 0.09), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  letter-spacing: .2px;
  margin: 0 0 .5rem;
}
h1 { font-size: 2rem; line-height: 1.2; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }

/* ------------------------------------------------------------------ topo */
.topo {
  display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap;
  padding: 1rem 1.6rem;
  background: var(--panel-strong);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(8px);
}
.marca { display: flex; flex-direction: column; line-height: 1.15; }
.marca:hover { text-decoration: none; }
.marca-nome { font-family: "Cormorant Garamond", serif; font-size: 1.25rem; font-weight: 700; color: var(--text); }
.marca-nome em { color: var(--accent); font-style: normal; }
.marca-sub { font-size: .72rem; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); }

.topo nav { display: flex; gap: .3rem; flex-wrap: wrap; margin-left: auto; }
.topo nav a {
  color: var(--muted); padding: .45rem .85rem; border-radius: 999px;
  font-size: .9rem; font-weight: 600; border: 1px solid transparent;
}
.topo nav a:hover { color: var(--text); border-color: var(--border); text-decoration: none; }
.topo nav a.ativo { color: var(--accent); border-color: var(--border-strong); background: rgba(226, 181, 107, .08); }

main { max-width: 1080px; margin: 0 auto; padding: 2rem 1.4rem 4rem; }

.rodape {
  border-top: 1px solid var(--border); padding: 1.4rem;
  text-align: center; color: var(--muted); font-size: .85rem;
}

/* ---------------------------------------------------------------- blocos */
.cartao {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.6rem;
  margin-bottom: 1.2rem;
}
.cartao.estreito { max-width: 460px; margin-inline: auto; }

.cabecalho {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem;
}
.subtitulo { color: var(--muted); margin: 0; }

.grade { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* ------------------------------------------------------------ personagem */
.chars { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }

.char {
  display: block;
  background: var(--panel-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.2rem;
  transition: border-color .2s ease, transform .2s ease;
}
.char:hover { border-color: var(--border-strong); transform: translateY(-2px); text-decoration: none; }
.char-topo { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.char-nome { font-family: "Cormorant Garamond", serif; font-size: 1.35rem; font-weight: 700; color: var(--text); }
.char-linha { display: flex; justify-content: space-between; gap: .8rem; font-size: .88rem; padding: .25rem 0; }
.char-linha span:first-child { color: var(--muted); }
.char-meta { margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--border); font-size: .82rem; color: var(--muted); }

/* -------------------------------------------------------------- detalhes */
.ficha { display: grid; gap: .1rem; }
.ficha-linha {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .55rem .2rem; border-bottom: 1px solid var(--border);
}
.ficha-linha:last-child { border-bottom: 0; }
.ficha-linha dt { color: var(--muted); margin: 0; font-size: .9rem; }
.ficha-linha dd { margin: 0; font-weight: 600; text-align: right; }

.skills { display: grid; gap: .55rem; }
.skill-nome { display: flex; justify-content: space-between; font-size: .88rem; margin-bottom: .2rem; }
.skill-barra { height: 7px; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.skill-preenchida { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* ---------------------------------------------------------------- selos */
.selo {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .18rem .65rem; border-radius: 999px;
  font-size: .74rem; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
}
.selo.online { background: rgba(116, 199, 154, .16); color: var(--success); }
.selo.offline { background: rgba(186, 169, 146, .14); color: var(--muted); }
.selo.ponto::before { content: "●"; font-size: .7em; }

/* --------------------------------------------------------------- formularios */
label { display: block; margin: 1rem 0 .35rem; font-size: .86rem; color: var(--muted); font-weight: 600; }
input[type=text], input[type=email], input[type=password] {
  width: 100%; padding: .7rem .85rem;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: rgba(0, 0, 0, .28); color: var(--text);
  font: inherit; font-size: .95rem;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

.botao {
  display: inline-block; padding: .7rem 1.4rem; border: 0; cursor: pointer;
  border-radius: 999px; font: inherit; font-weight: 700; font-size: .95rem;
  background: linear-gradient(135deg, var(--accent), #c9974f); color: #241703;
}
.botao:hover { filter: brightness(1.07); text-decoration: none; }
.botao.largo { width: 100%; text-align: center; }
.botao.secundario { background: transparent; color: var(--text); border: 1px solid var(--border-strong); }

.acoes { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin-top: 1.5rem; }

/* ----------------------------------------------------------------- avisos */
.aviso {
  padding: .9rem 1.1rem; border-radius: var(--radius-sm);
  margin-bottom: 1.2rem; border: 1px solid; font-size: .93rem;
}
.aviso.ok { background: rgba(116, 199, 154, .1); border-color: rgba(116, 199, 154, .4); color: #a7e3c3; }
.aviso.erro { background: rgba(220, 107, 99, .1); border-color: rgba(220, 107, 99, .4); color: #f0b0ab; }
.aviso.info { background: rgba(226, 181, 107, .09); border-color: rgba(226, 181, 107, .32); color: #edd3a6; }

.muted { color: var(--muted); }
.pequeno { font-size: .86rem; }
.centro { text-align: center; }
.rolagem { overflow-x: auto; }

.vazio { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.vazio h2 { color: var(--text); }

@media (max-width: 640px) {
  h1 { font-size: 1.6rem; }
  main { padding: 1.4rem 1rem 3rem; }
  .cartao { padding: 1.2rem; border-radius: var(--radius-md); }
  .topo { padding: .9rem 1rem; }
}

/* ------------------------------------------------------ pedra e molduras */
body {
  background: radial-gradient(ellipse at 50% 0, #e2b56b0d, transparent 65%),
    repeating-linear-gradient(112deg, #e2b56b03 0 1px, transparent 1px 5px), var(--bg);
}
h1, h2, h3, .marca-nome {
  font-family: "Cinzel", Georgia, serif; text-transform: uppercase;
  letter-spacing: .045em; text-shadow: 0 2px 1px #000;
}
.marca-nome { color: var(--gold-1); line-height: 1.35; }
.marca-sub { margin-top: 4px; }
.topo { background: #151511f5; border-bottom-color: #83653e; box-shadow: inset 0 -3px #090807, 0 4px 18px #0004; }
.topo nav a { border-radius: 4px; }
.topo nav a:hover { color: var(--gold-1); text-shadow: 0 0 14px #e2b56b55; }
.cartao, .char { min-width: 0; background: var(--gump-surface); border-color: var(--gump-edge); box-shadow: var(--gump-frame); }
.char:hover { border-color: #987447; }
.char-nome { color: var(--gold-1); font-size: 1.5rem; }
.subtitulo { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.25rem; }
.cabecalho { border-bottom: 1px solid #83653e; padding-bottom: 1rem; }
.char-meta { border-color: #83653e66; }
.ficha-linha dd { font-variant-numeric: tabular-nums; }
.skill-barra { height: 8px; border: 1px solid #735a35; background: #0f100d; box-shadow: inset 0 1px 3px #000; }
.skill-preenchida { background: linear-gradient(90deg, var(--gold-2), var(--gold-1)); box-shadow: inset 0 1px #fff4; }
/* Placas biseladas e campos rebaixados. */
.botao {
  border-radius: 4px; border: 1px solid #b99150;
  background: linear-gradient(180deg, var(--gold-1), #dfb66f 48%, var(--gold-2));
  color: var(--ink); text-shadow: 0 1px #fff4;
  box-shadow: inset 0 1px #fff6, inset 0 0 0 2px #49341940, 0 3px 0 #49341e;
  transition: filter .18s ease, box-shadow .18s ease;
}
.botao:hover { box-shadow: inset 0 1px #fff6, 0 3px 0 #49341e, 0 0 18px #e2b56b20; }
.botao.secundario { background: linear-gradient(#343129, #191a17); border-color: #8b6b3e; color: var(--gold-1); text-shadow: 0 1px #000; }
.botao.perigo { background: linear-gradient(#532c25, #2e1b18); border-color: var(--danger); color: #f3bbb4; text-shadow: none; }
input[type=text], input[type=email], input[type=password], textarea, select {
  max-width: 100%; border: 1px solid #6e593a; border-radius: 4px;
  background: #12130f; color: var(--text); color-scheme: dark; font: inherit;
  box-shadow: inset 0 2px 6px #0005;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
/* Gemas de estado e mensagens legíveis. */
.selo { border-radius: 4px; border: 1px solid currentColor; }
.selo.offline { color: var(--danger); background: #dc6b6310; }
.selo.ponto::before { text-shadow: 0 0 7px currentColor; }
.aviso { border-radius: 4px; border-left-width: 3px; box-shadow: inset 0 1px #fff06, 0 4px 12px #0002; }
.rodape { background: #11110f; border-top-color: #83653e; box-shadow: inset 0 3px #090807; }
/* Grades flexíveis, inclusive para nomes longos. */
.grade { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.chars { grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
main, .char-topo > *, .ficha-linha > *, .topo > * { min-width: 0; overflow-wrap: anywhere; }
.char-topo, .char-linha { flex-wrap: wrap; }
@media (max-width: 640px) {
  .topo { position: relative; gap: .8rem; }
  .topo nav { margin-left: 0; width: 100%; }
  .topo nav a { padding: .45rem .65rem; }
  .ficha-linha { flex-wrap: wrap; gap: .3rem .8rem; }
  h1 { font-size: 1.45rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .char:hover { transform: none; }
}

/* "Sair" virou botao (POST + CSRF). Herda a aparencia dos links do menu. */
.topo nav .form-sair { display: contents; }
.topo nav button.sair {
  font: inherit; font-size: .9rem; font-weight: 600; color: var(--muted);
  padding: .45rem .85rem; border-radius: 4px;
  background: none; border: 1px solid transparent; cursor: pointer;
}
.topo nav button.sair:hover { color: var(--gold-1); border-color: var(--border); text-shadow: 0 0 14px #e2b56b55; }
