/* G-PLAYER-GUIDE (D-938): whitepaper no estilo de cartaz western (pergaminho, latão, couro), fonte de títulos do jogo. */

@font-face {
  font-family: 'LF Display';
  font-weight: 400;
  font-display: swap;
  src: url('fonts/alfa-slab-one-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'LF Display';
  font-weight: 400;
  font-display: swap;
  src: url('fonts/alfa-slab-one-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'LF Display';
  font-weight: 400;
  font-display: swap;
  src: url('fonts/bitter-black-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  color-scheme: light;
  --bg: #fbefd6;
  --paper: #fff8ea;
  --card: #f6e3bd;
  --card-edge: #c98a4b;
  --line: #e0c391;
  --line-strong: #c9a46a;
  --ink: #3b2414;
  --text: #4a3020;
  --muted: #7a5a3c;
  --gold: #f2b632;
  --gold-hi: #ffd860;
  --gold-dark: #9a6812;
  --leather: #5a3a22;
  --ok-bg: #eaf3d2;
  --ok-line: #a9c96a;
  --ok-ink: #3f5a1c;
  --table-head: #f1dcb0;
  --table-odd: #f8ead0;
  --table-even: #f3e1bf;
  --display: 'LF Display', 'Rockwell', Georgia, serif;
  --body: ui-rounded, 'Nunito', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  color: var(--text);
  background-color: var(--bg);
  /* Textura leve de papel. */
  background-image: radial-gradient(rgb(122 90 60 / 0.07) 1px, transparent 1px);
  background-size: 6px 6px;
  font: 600 16px/1.7 var(--body);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--gold-dark);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Barra de progresso da leitura. */
.progress {
  position: fixed;
  inset: 0 0 auto;
  height: 4px;
  z-index: 30;
  pointer-events: none;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-hi));
}

/* Barra fixa: logo, idioma e "Jogar". */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 10px 12px 0;
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 10px;
  border: 3px solid var(--ink);
  border-radius: 20px;
  background: linear-gradient(180deg, #fff6e2, #f6dfb5);
  box-shadow: 0 5px 0 var(--ink), 0 10px 24px rgb(59 36 20 / 0.18);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  text-decoration: none;
}

.brand img {
  width: 44px;
  height: 44px;
}

.brand-text {
  font-family: var(--display);
  font-size: 1.15rem;
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--gold);
  -webkit-text-stroke: 1.2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--ink);
}

.lang select {
  min-height: 44px;
  padding: 0 34px 0 14px;
  border: 2px solid var(--leather);
  border-radius: 12px;
  background-color: var(--paper);
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: right 18px center, right 13px center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  box-shadow: 0 3px 0 var(--leather);
  color: var(--ink);
  font: 700 0.875rem var(--body);
  appearance: none;
  cursor: pointer;
}

.play {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--gold-hi), #f5a700);
  box-shadow: 0 4px 0 var(--ink);
  color: var(--ink);
  font-family: var(--display);
  font-size: 0.95rem;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.play:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Abertura: título de cartaz e a cena da batalha. */
.hero {
  display: grid;
  gap: 24px;
  align-items: center;
  padding: 36px 0 28px;
  border-bottom: 2px solid var(--line);
}

.crumb {
  margin: 0 0 12px;
  color: var(--gold-dark);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 16px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 10vw, 4.4rem);
  line-height: 1;
  text-transform: uppercase;
  color: var(--ink);
  overflow-wrap: break-word;
}

.lede {
  margin: 0;
  max-width: 34em;
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: 700;
}

.hero-art {
  margin: 0;
  border: 3px solid var(--ink);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 6px 0 var(--ink);
  transform: rotate(-1deg);
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1.1fr 1fr;
    padding: 48px 0 40px;
  }
}

.layout {
  display: grid;
  gap: 24px;
  padding: 28px 0 48px;
}

.layout > * {
  min-width: 0;
}

@media (min-width: 960px) {
  .layout {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 48px;
  }

  .side {
    position: sticky;
    top: 104px;
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 4px;
  }
}

.side-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 800;
}

.search {
  position: relative;
  margin-bottom: 24px;
}

.search input {
  width: 100%;
  min-height: 46px;
  padding: 0 44px 0 14px;
  border: 2px solid var(--line-strong);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: 700 0.9375rem var(--body);
  -webkit-appearance: none;
  appearance: none;
}

.search input::-webkit-search-cancel-button {
  display: none;
}

.search input:focus {
  outline: 3px solid var(--gold);
  outline-offset: 1px;
}

.search button {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 1.4rem;
  cursor: pointer;
}

.side-title {
  margin: 0 0 10px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.05rem;
  text-transform: uppercase;
  color: var(--ink);
}

.toc {
  margin: 0;
  padding: 10px;
  list-style: none;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 8px;
}

@media (min-width: 960px) {
  .toc {
    grid-template-columns: 1fr;
    padding: 0;
    border: 0;
    background: none;
  }
}

.toc a {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 6px 10px;
  border-left: 3px solid transparent;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.8125rem;
  line-height: 1.35;
  text-decoration: none;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.toc a:hover {
  background: rgb(242 182 50 / 0.15);
}

.toc a .n {
  flex: none;
  color: var(--muted);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.toc a[aria-current='true'] {
  border-left-color: var(--gold-dark);
  background: rgb(242 182 50 / 0.28);
  color: var(--ink);
}

.callout {
  margin: 0 0 16px;
  padding: 18px 22px;
  border: 2px solid var(--ok-line);
  border-radius: var(--radius);
  background: var(--ok-bg);
  box-shadow: 0 4px 0 var(--ok-line);
  color: var(--ok-ink);
  font-size: 0.9375rem;
}

.note {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  background: rgb(242 182 50 / 0.16);
  color: var(--text);
  font-size: 0.9375rem;
}

.empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

/* Seções: selo numerado, ícone do jogo e texto. */
.section {
  padding: 32px 0;
  border-top: 2px solid var(--line);
}

.section:first-child {
  border-top: 0;
}

.section h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.4rem, 5vw, 2rem);
  line-height: 1.15;
  color: var(--ink);
}

.badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  box-shadow: 0 3px 0 var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 900;
}

.section h2 .icon {
  flex: none;
  width: 48px;
  height: 48px;
  margin-left: auto;
}

.section p {
  margin: 0 0 14px;
}

.section ul {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.section li {
  position: relative;
  margin: 8px 0;
  padding-left: 26px;
}

/* Marcador de estrela de xerife. */
.section li::before {
  content: '★';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--gold-dark);
}

.section .note {
  margin-top: 4px;
}

/* Cartões (recursos e itens). */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin: 8px 0 16px;
}

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 14px;
  border: 2px solid var(--line-strong);
  border-bottom: 5px solid var(--card-edge);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fbebc9, var(--card));
  text-align: center;
}

.card img {
  width: 64px;
  height: 64px;
  margin: 0 auto 8px;
  object-fit: contain;
}

.card h3 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--ink);
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.prices {
  margin-top: auto;
  padding-top: 6px;
  border-top: 2px dashed var(--line-strong);
}

.price {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--muted);
}

.price strong {
  white-space: nowrap;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* Como usar o item: destaque discreto abaixo do efeito. */
.card .use {
  margin: 8px 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgb(255 255 255 / 0.55);
  color: var(--text);
  font-size: 0.78rem;
  text-align: left;
}

/* Quadro informativo (preço por nível). */
.info {
  margin: 4px 0 16px;
  padding: 16px 18px;
  border: 2px solid var(--line-strong);
  border-left: 6px solid var(--gold-dark);
  border-radius: var(--radius);
  background: var(--paper);
}

.info strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--ink);
}

.info p {
  margin: 0;
  color: var(--text);
  font-size: 0.9375rem;
}

/* Botão do suporte (seção 13). */
.support {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  margin-top: 4px;
  padding: 8px 20px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--gold-hi), #f5a700);
  box-shadow: 0 4px 0 var(--ink);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.support:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

/* Recursos e itens: 2 colunas no celular, 3 a partir de 600 px (sem cartão sozinho na linha). */
.cards.grid3 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 600px) {
  .cards.grid3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.caption {
  margin: -6px 0 16px;
  color: var(--muted);
  font-size: 0.8125rem;
}

/* Imagens de cena. */
.scene {
  margin: 8px 0 18px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 5px 0 var(--ink);
}

.scene img {
  width: 100%;
}

.duel-art {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 520px;
  margin: 8px 0 18px;
}

.duel-art figure {
  position: relative;
  margin: 0;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 5px 0 var(--ink);
  aspect-ratio: 4 / 5;
}

.duel-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.duel-art figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 18px 10px 10px;
  background: linear-gradient(180deg, transparent, rgb(30 18 10 / 0.85));
  color: var(--gold-hi);
  font-family: var(--display);
  font-size: 1.1rem;
  text-align: center;
  text-transform: uppercase;
}

/* Tabelas: cabeçalho em couro, linhas finas, números tabulares. */
.table-wrap {
  margin: 8px 0 18px;
  border: 2px solid var(--leather);
  border-radius: var(--radius);
  background: var(--paper);
  overflow-x: auto;
  box-shadow: 0 4px 0 rgb(59 36 20 / 0.25);
}

/* Tabela longa (níveis): rolagem própria, cabeçalho fixo; a rolagem passa para a página no fim. */
.table-wrap.scroll {
  max-height: 560px;
  overflow-y: auto;
  /* Sem 'contain': no fim da tabela, o mesmo gesto continua rolando a página (pedido do proprietário). */
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 11px 14px;
  text-align: right;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--leather);
  color: #f6e3bd;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

tbody td {
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
}

tbody tr:first-child td {
  border-top: 0;
}

tbody tr:hover td {
  background: rgb(242 182 50 / 0.12);
}

tbody tr.milestone td {
  background: rgb(242 182 50 / 0.2);
}

th:first-child,
td:first-child,
th.wrap,
td.wrap {
  text-align: left;
}

td.n {
  white-space: nowrap;
}

@media (max-width: 400px) {
  td.range {
    white-space: normal;
  }
}

td.dim {
  color: var(--muted);
}

th,
td.wrap {
  hyphens: auto;
  overflow-wrap: anywhere;
}

/* "Nível" nunca quebra. */
.table-levels th:first-child {
  hyphens: none;
  overflow-wrap: normal;
  white-space: nowrap;
}

/* Selo do nível e moeda do Gold/dia. */
.lvl {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 24px;
  padding: 0 6px;
  border: 1.5px solid var(--gold-dark);
  border-radius: 7px;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 900;
}

.coin {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: -3px;
}

/* Recompensas do Duelo (D-945): chance sob a dificuldade, faixas de Gold numa linha. */
.table-duel-rewards th,
.table-duel-rewards td {
  white-space: nowrap;
  hyphens: none;
  overflow-wrap: normal;
}

.table-duel-rewards .sub {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

.table-duel-rewards thead .sub {
  color: #e2c896;
  white-space: normal;
}

.table-duel-rewards .stars {
  color: var(--gold-dark);
  letter-spacing: 0.08em;
}

@media (max-width: 400px) {
  .table-duel-rewards th,
  .table-duel-rewards td {
    padding: 10px 5px;
  }

  .table-duel-rewards th:first-child,
  .table-duel-rewards td:first-child {
    padding-left: 10px;
  }

  .table-duel-rewards th:last-child,
  .table-duel-rewards td:last-child {
    padding-right: 10px;
  }

  .table-duel-rewards th {
    letter-spacing: 0.02em;
    white-space: normal;
  }

  .table-duel-rewards .sub {
    white-space: nowrap;
  }

  .table-duel-rewards thead .sub:first-of-type {
    white-space: normal;
  }

  .table-duel-rewards td.n {
    font-size: 0.75rem;
  }

  .table-duel-rewards .cell-coin {
    display: none;
  }

  .table-duel-rewards .stars {
    letter-spacing: 0;
  }

  .table-duel-rewards th {
    font-size: 0.65rem;
  }

  .table-duel-rewards .coin {
    width: 14px;
    height: 14px;
    margin-right: 3px;
  }
}

@media (max-width: 340px) {
  .table-duel-rewards td.n {
    font-size: 0.7rem;
  }
}

/* A regra de celular esconde a moeda da tabela de níveis; aqui a do cabeçalho identifica o Gold e fica sempre. Em tela
   estreita, as faixas ficam só com o número para caber numa linha. */
@media (max-width: 480px) {
  .table-duel-rewards thead .coin {
    display: inline-block;
  }
}

@media (min-width: 401px) and (max-width: 480px) {
  .table-duel-rewards .cell-coin {
    display: inline-block;
  }
}

/* XP: tom secundário; o valor de destaque é o Gold/dia. */
.table-levels td:nth-child(2),
.table-levels td:nth-child(3) {
  color: var(--muted);
}

.footer {
  background: var(--leather);
  color: #f3e1bf;
  border-top: 4px solid var(--gold);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}

.footer p {
  margin: 0;
  flex: 1 1 240px;
  font-size: 0.8125rem;
}

.footer a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--gold);
  border-radius: 12px;
  color: var(--gold);
  font-size: 1.2rem;
  text-decoration: none;
}

@media (max-width: 420px) {
  .brand-text {
    display: none;
  }
}

@media (max-width: 480px) {
  .topbar-inner {
    gap: 8px;
    padding: 6px 8px;
  }

  .brand-text {
    font-size: 0.95rem;
  }

  .play {
    padding: 0 12px;
    font-size: 0.8rem;
  }

  th,
  td {
    padding: 9px 6px;
  }

  .coin {
    display: none;
  }

  thead th {
    letter-spacing: 0.02em;
  }

  .lvl {
    min-width: 24px;
    padding: 0 4px;
  }

  .toc a {
    padding: 6px;
  }
}

@media (max-width: 360px) {
  .lang select {
    padding: 0 26px 0 10px;
    background-position: right 14px center, right 9px center;
  }

  .play {
    padding: 0 10px;
  }
}
