@font-face { font-family: Lora; src: url('/fonts/Lora-Variable.woff') format('woff'); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: Lora; src: url('/fonts/Lora-Italic-Variable.woff') format('woff'); font-weight: 400 700; font-style: italic; font-display: swap; }
:root {
  color-scheme: dark;
  --bg: #15120d;
  --band: #17140f;
  --panel: #1d1913;
  --ink: #110e0b;
  --line: #403729;
  --rule: #6b563488;
  --rule-strong: #6b5634;
  --text: #efe6d2;
  --body: #d6cfbd;
  --muted: #b4ab96;
  --faint: #8f8a7a;
  --gold: #e2b86f;
  --gold-soft: #c9ad7a;
  --green: #8fd3a8;
  --serif: Lora, Georgia, 'Times New Roman', serif;
  --frame: inset 0 0 0 4px var(--panel), inset 0 0 0 5px var(--rule);
  font: 17px/1.6 system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
::selection { background: var(--gold); color: #1f160a; }
h1, h2, h3, p, figure { margin: 0; }
img { max-width: 100%; }
.wrap { width: min(1240px, calc(100% - 80px)); margin-inline: auto; }

/* Cabeçalho */
.site-header { position: relative; z-index: 1; background: var(--band); border-bottom: 1px solid var(--rule-strong); box-shadow: 0 3px 0 -2px var(--rule); }
.header-content, .site-header nav, .brand { display: flex; align-items: center; }
.header-content { min-height: 72px; justify-content: space-between; gap: 16px; }
.brand { gap: 12px; width: fit-content; white-space: nowrap; font: italic 700 1.5rem/1 var(--serif); }
.site-header nav { gap: clamp(16px, 3vw, 32px); font-size: .95rem; color: var(--muted); }
.nav-world:hover { color: var(--text); }
.header-entry {
  display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 7px 16px;
  border: 1px solid var(--rule-strong); border-radius: 4px; color: #f0cd8d; background: transparent; font-weight: 600;
}
.header-entry:hover { background: #2a241b; }

/* Botões */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 48px;
  padding: 10px 20px; border: 1px solid transparent; border-radius: 4px; font-weight: 700; font-size: .95rem;
}
.button.primary { color: #1f160a; background: var(--gold); border-color: #f0cd8d; box-shadow: 0 1px 0 #fff3 inset, 0 6px 18px #0006; }
.button.primary:hover { background: #f0cb88; }
.button.ghost { color: var(--text); border-color: var(--rule-strong); }
.button.ghost:hover { background: #2a241b; }

/* Prancha com moldura de diário */
.plate { padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--frame), 0 18px 40px #0009; }
.plate img { display: block; width: 100%; height: auto; border: 1px solid var(--line); image-rendering: pixelated; }

/* Hero */
.hero { border-bottom: 1px solid #3a3125; background: radial-gradient(ellipse at 78% 30%, #231e17, transparent 60%), var(--bg); }
.hero-layout { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(32px, 5vw, 64px); padding-block: 64px 60px; }
.hero-copy { flex: 1 1 380px; min-width: 0; }
.hero h1 { font: 500 clamp(2.9rem, 5.2vw, 4.7rem)/1.02 var(--serif); letter-spacing: -.025em; text-wrap: balance; }
.hero h1 em { display: block; color: var(--gold); font-weight: 500; }
.lead { max-width: 470px; margin-top: 24px; color: var(--body); font-size: 1.12rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-note { margin-top: 18px; color: var(--faint); font-size: .88rem; }
.hero-figure { flex: 0 1 666px; min-width: 0; }
.hero-figure figcaption { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; color: var(--muted); font: italic 500 .98rem var(--serif); }
.hero-figure figcaption span:last-child { color: var(--faint); font: 500 .82rem system-ui, sans-serif; }
.loadout { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.loadout li, .rhythm-idle li > img, .journey-steps img {
  display: grid; place-items: center; width: 46px; height: 46px; flex: none;
  background: var(--ink); border: 1px solid var(--line); border-radius: 3px; box-shadow: inset 0 2px 5px #000a;
}
.loadout img, .rhythm-idle li > img, .journey-steps img { image-rendering: pixelated; }
.rhythm-idle li > img, .journey-steps img { padding: 6px; }

/* Seções */
.section-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 24px; margin-bottom: 28px; }
.section-heading h2, .journey h2, .access h2 { font: 500 clamp(2rem, 3.2vw, 2.8rem)/1.08 var(--serif); letter-spacing: -.02em; text-wrap: balance; }
.section-heading > p { color: var(--muted); max-width: 420px; }

/* Dois ritmos */
.duality { padding-block: 64px 72px; scroll-margin-top: 12px; }
.rhythms { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: stretch; }
.rhythm { position: relative; padding: 28px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); }
.rhythm h3 { font: italic 700 1.6rem/1.15 var(--serif); }
.rhythm > p, .rhythm-body > p { margin-top: 10px; color: var(--body); }
.rhythm ul { display: grid; gap: 16px; margin: 22px 0 0; padding: 0; list-style: none; }
.rhythm li { display: flex; gap: 14px; align-items: flex-start; color: var(--body); font-size: .95rem; line-height: 1.5; }
.rhythm li strong { color: var(--text); }
.rhythm-idle { align-self: start; background: var(--band); }
.rhythm-idle h3 { color: var(--muted); }
.rhythm-active { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; border-color: var(--rule-strong); box-shadow: var(--frame), 0 18px 40px #0007; }
.rhythm-active h3 { color: var(--gold); font-size: 2rem; }
.rhythm-active .plate { padding: 0; border: 0; box-shadow: none; background: none; }
.rhythm-active li { padding-left: 18px; border-left: 1px solid var(--rule-strong); }
.rhythm-note { margin-top: 20px !important; padding-top: 14px; border-top: 1px solid var(--rule); color: var(--faint) !important; font-size: .88rem; }

/* Como funciona */
.journey { padding-block: 60px 68px; border-block: 1px solid #3a3125; background: var(--band); scroll-margin-top: 12px; }
.journey-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.journey-steps { margin: 24px 0 0; padding: 0; list-style: none; }
.journey-steps li { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 18px; padding: 16px 0; border-top: 1px solid var(--rule); }
.journey-steps li:last-child { border-bottom: 1px solid var(--rule); }
.journey-steps h3 { font: italic 700 1.3rem/1.25 var(--serif); }
.journey-steps p { margin-top: 3px; color: var(--body); }
.ledger { padding: 26px 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--frame); }
.ledger h2 { font-size: 1.6rem; font-style: italic; font-weight: 700; }
.ledger dl { margin: 16px 0 0; }
.ledger dl div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.ledger dt { color: var(--muted); }
.ledger dd { margin: 0; color: var(--gold); font: italic 700 1.45rem/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.ledger p { margin-top: 16px; color: var(--muted); font-size: .92rem; }

/* Acesso */
.access { padding-block: 64px 72px; }
.access-layout, .roster-layout { display: grid; grid-template-columns: 1fr minmax(330px, .72fr); gap: clamp(28px, 6vw, 90px); align-items: start; }
.access-copy > p { max-width: 430px; margin-top: 16px; color: var(--body); }
.account-panel { padding: 24px 26px 26px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--frame), 0 18px 40px #0009; }
.auth-options { display: flex; gap: 22px; border-bottom: 1px solid var(--rule); }
.auth-options button { padding: 4px 0 8px; color: var(--faint); background: none; border: 0; border-bottom: 2px solid transparent; font: italic 500 1.2rem var(--serif); }
.auth-options button:hover { color: var(--text); }
.auth-options [aria-pressed='true'] { color: var(--text); border-bottom-color: var(--gold); }
form, #active-session { display: grid; gap: 14px; margin-top: 20px; }
form label { display: grid; gap: 6px; color: var(--muted); font-size: .9rem; font-weight: 600; }
form input, form select { width: 100%; min-height: 44px; padding: 8px 12px; color: var(--text); background: var(--ink); border: 1px solid #4c4131; border-radius: 4px; }
form input:focus, form select:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
form small { margin-top: -8px; color: var(--faint); font-size: .82rem; }
.submit { justify-content: space-between; width: 100%; margin-top: 4px; }
.error { padding: 8px 12px; color: #ffcabd; background: #2b1b18; border: 1px solid #713f32; border-radius: 4px; font-size: .88rem; }

.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; padding-block: 26px; color: var(--faint); font-size: .85rem; }
.site-footer .brand { color: var(--text); font-size: 1.2rem; }

/* Seleção de personagens */
.account-page { min-height: 100vh; background: radial-gradient(ellipse at 80% 0, #231e17, transparent 55%), var(--bg); }
.account-page .site-header nav { color: var(--muted); font-size: .92rem; }
.roster { padding-block: 60px 72px; }
.roster h1 { font: 500 clamp(2.6rem, 5vw, 4.2rem)/1.04 var(--serif); letter-spacing: -.025em; }
.roster-heading > p { margin-top: 12px; color: var(--body); }
.roster-layout { gap: clamp(16px, 3vw, 32px); margin-top: 32px; }
.roster-panel { padding: 24px 26px 26px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--frame), 0 18px 40px #0009; }
.roster-panel h2 { margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); font: italic 700 1.5rem var(--serif); }
.roster > .error { margin-top: 16px; }
.characters { margin: 0; padding: 0; list-style: none; }
.characters li + li { margin-top: 8px; }
.character-link { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 14px; background: var(--band); border: 1px solid var(--line); border-radius: 4px; }
.character-link:hover { border-color: var(--rule-strong); background: #231e16; }
.character-sprite { width: 32px; height: 32px; image-rendering: pixelated; object-fit: contain; }
.character-icon { display: grid; place-items: center; width: 40px; aspect-ratio: 1; color: var(--gold); background: var(--ink); border: 1px solid var(--line); border-radius: 3px; box-shadow: inset 0 2px 5px #000a; }
.character-link strong { display: block; font: italic 700 1.12rem var(--serif); }
.character-link small { display: block; }
.character-link small, .vocation-style, #roster-status { color: var(--muted); font-size: .88rem; }
.character-link .play { color: var(--gold); font-size: .9rem; font-weight: 600; white-space: nowrap; }

@media (max-width: 900px) {
  .rhythms, .journey-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 800px) {
  .wrap { width: calc(100% - 48px); }
  .access-layout, .roster-layout { grid-template-columns: 1fr; }
  .access-layout .account-panel { width: min(480px, 100%); }
}
@media (max-width: 520px) {
  :root { font-size: 16px; }
  .wrap { width: calc(100% - 32px); }
  .header-content { min-height: 62px; }
  .site-header .brand { gap: 8px; font-size: 1.28rem; }
  .site-header .brand img { width: 34px; height: 34px; }
  .site-header nav { gap: 10px; }
  .nav-world { display: none; }
  .hero-layout { padding-block: 40px 44px; gap: 32px; }
  .hero h1 { font-size: clamp(2.5rem, 11vw, 3.2rem); }
  .hero-actions .button { flex: 1 1 auto; padding-inline: 14px; }
  .plate { padding: 8px; }
  .loadout li { width: 40px; height: 40px; }
  .rhythm { padding: 20px; }
  .duality, .journey, .access, .roster { padding-block: 44px; }
  .account-panel, .roster-panel, .ledger { padding: 18px; }
}
