/* ==========================================================================
   Poke Multi — design system
   Tema: Pokémon Tibia. Dark-only, painéis de pedra escura com bordas
   chanfradas estilo janela do cliente Tibia, dourado como acento,
   roxo como cor da marca.
   ========================================================================== */

@font-face {
  font-family: "Press Start 2P";
  src: url("../fonts/PressStart2P-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  /* Fundos e pedra (cinza-quente Tibia) */
  --bg-0: #14120f;
  --bg-1: #1c1a16;
  --panel: #33302a;
  --panel-2: #3c3831;
  --slot: #171512;

  /* Frame/bevel */
  --frame-hi: #6a6354;
  --frame-mid: #4a453c;
  --frame-lo: #0c0b09;
  --line-strong: #000000;

  /* Texto */
  --text: #ece5d8;
  --text-muted: #a89e8c;

  /* Roxo da marca */
  --brand-300: #c09aff;
  --brand-500: #8326ff;
  --brand-700: #6a2bd9;
  --brand-800: #4a1d99;

  /* Ouro (acento Tibia) */
  --gold-300: #ffd76a;
  --gold-500: #d9a334;
  --gold-700: #7a5a14;

  /* Estados */
  --ok-300: #8fd67e;
  --ok-800: #1e4a18;
  --danger-300: #ff8a7a;
  --danger-500: #c23a2f;
  --focus: #ffd23f;

  --font-pixel: "Press Start 2P", "Courier New", monospace;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

/* ==========================================================================
   Base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Footer sempre no pé da tela, mesmo em páginas curtas. */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-pixel);
  font-weight: 400;
  line-height: 1.6;
  margin: 0 0 1rem;
}

h1 { font-size: clamp(1.125rem, 3.5vw, 1.5rem); }
h2 { font-size: 1rem; margin-top: 2.5rem; }
h3 { font-size: 0.8125rem; margin-top: 1.75rem; }

p { margin: 0 0 1rem; }

a {
  color: var(--brand-300);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover { color: var(--gold-300); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

::selection {
  background: var(--brand-700);
  color: #fff;
}

.container {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 20px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -64px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--brand-700);
  color: #fff;
  font-family: var(--font-pixel);
  font-size: 0.625rem;
  text-decoration: none;
  border: 2px solid var(--line-strong);
}

.skip-link:focus-visible {
  top: 8px;
  color: #fff;
}

/* ==========================================================================
   Componentes Tibia — janela, barra de título, slot
   ========================================================================== */

/* Janela do cliente: face de pedra, frame chanfrado duplo com traço preto. */
.t-window,
.licenca-box {
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' shape-rendering='crispEdges'%3E%3Crect width='24' height='24' fill='%2333302a'/%3E%3Crect x='2' y='3' width='6' height='4' fill='%23383630'/%3E%3Crect x='14' y='8' width='7' height='5' fill='%23302e2a'/%3E%3Crect x='5' y='15' width='5' height='4' fill='%23383630'/%3E%3Crect x='16' y='18' width='6' height='4' fill='%23302e2a'/%3E%3C/svg%3E") repeat;
  border: 3px solid;
  border-color: var(--frame-hi) var(--frame-lo) var(--frame-lo) var(--frame-hi);
  box-shadow:
    0 0 0 1px var(--line-strong),
    inset 0 0 0 1px var(--line-strong),
    inset 0 0 0 2px var(--frame-mid),
    0 8px 20px rgba(0, 0, 0, 0.55);
  padding: 0;
}

.t-titlebar,
.licenca-rotulo {
  position: relative;
  margin: 2px 2px 0;
  padding: 9px 12px 7px;
  font-family: var(--font-pixel);
  font-size: 0.625rem;
  letter-spacing: 1px;
  text-align: center;
  text-transform: uppercase;
  color: var(--gold-300);
  text-shadow: 1px 1px 0 var(--line-strong);
  background: linear-gradient(#45413a, #2b2822);
  border-bottom: 1px solid var(--line-strong);
  box-shadow: inset 0 1px 0 var(--frame-hi);
}

/* Rebites dourados nos cantos da barra de título. */
.t-titlebar::before,
.t-titlebar::after,
.licenca-rotulo::before,
.licenca-rotulo::after {
  content: "";
  position: absolute;
  top: 50%;
  margin-top: -2px;
  width: 4px;
  height: 4px;
  background: var(--gold-700);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
}

.t-titlebar::before,
.licenca-rotulo::before { left: 6px; }

.t-titlebar::after,
.licenca-rotulo::after { right: 6px; }

/* Slot de inventário: bevel invertido, fundo rebaixado. */
.t-slot {
  background: var(--slot);
  border: 2px solid;
  border-color: var(--frame-lo) var(--frame-hi) var(--frame-hi) var(--frame-lo);
  box-shadow: inset 0 0 0 1px var(--line-strong), inset 2px 2px 6px rgba(0, 0, 0, 0.6);
}

/* Barras de HP/MP decorativas (hero). */
.t-bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  margin: 0 0 14px;
}

.t-bar {
  width: 220px;
  max-width: 60vw;
  height: 8px;
  background: var(--slot);
  border: 1px solid var(--line-strong);
  box-shadow: inset 1px 1px 0 var(--frame-lo);
}

.t-bar-fill {
  display: block;
  height: 100%;
}

.t-bar--hp .t-bar-fill {
  width: 86%;
  background: linear-gradient(#e05548, var(--danger-500));
}

.t-bar--mp .t-bar-fill {
  width: 64%;
  background: linear-gradient(var(--brand-300), var(--brand-700));
}

/* ==========================================================================
   Botões estilo Tibia
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 12px 20px;
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  color: var(--text);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.55);
  text-decoration: none;
  cursor: pointer;
  background: linear-gradient(#46423b, #33302a);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  box-shadow: inset 1px 1px 0 var(--frame-hi),
              inset -1px -1px 0 var(--frame-lo);
}

.btn:hover {
  color: var(--gold-300);
  border-color: var(--gold-500);
  filter: brightness(1.1);
}

.btn:active {
  box-shadow: inset 1px 1px 0 var(--frame-lo),
              inset -1px -1px 0 var(--frame-hi);
  transform: translate(1px, 1px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(var(--brand-500), var(--brand-700));
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.35),
              inset -1px -1px 0 #3c1580;
}

.btn-primary:hover {
  color: #fff;
  border-color: var(--gold-500);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.35),
              inset -1px -1px 0 #3c1580,
              0 0 0 1px var(--gold-700);
}

.btn-primary:active {
  box-shadow: inset 1px 1px 0 #3c1580,
              inset -1px -1px 0 rgba(255, 255, 255, 0.35);
}

/* ==========================================================================
   Navbar
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line-strong);
  box-shadow: 0 1px 0 var(--frame-mid), 0 2px 0 rgba(217, 163, 52, 0.3);
}

.nav-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 24px;
  min-height: 56px;
  padding-block: 6px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.brand:hover { color: var(--text); }

.brand-logo {
  width: 36px;
  height: 36px;
}

.brand-name {
  font-family: var(--font-pixel);
  font-size: 0.875rem;
  letter-spacing: 1px;
}

/* ==========================================================================
   Hero (home)
   ========================================================================== */

.hero {
  position: relative;
  text-align: center;
  padding: 16px 20px 8px;
  background: radial-gradient(ellipse 70% 80% at 50% 0%, rgba(131, 38, 255, 0.16), transparent 70%);
}

.hero h1 {
  margin: 0 0 12px;
  text-shadow: 3px 3px 0 var(--brand-800);
}

.hero-tagline {
  max-width: 52ch;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* ==========================================================================
   Landing 100vh (index)
   ========================================================================== */

.shop-main {
  justify-content: center;
  justify-content: safe center;
  min-height: 0;
}

/* Trava o scroll só onde tudo cabe com folga. */
@media (min-width: 900px) and (min-height: 640px) {
  body.page-locked {
    height: 100dvh;
    overflow: hidden;
  }

  /* Válvula de escape: se algo não couber, rola por dentro, sem cortar. */
  .page-locked .shop-main {
    overflow-y: auto;
  }
}

.shop {
  padding: 4px 0 16px;
}

/* ==========================================================================
   Loja — cards de produto como janelas Tibia
   ========================================================================== */

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 760px;
  margin: 16px auto 0;
  padding: 0;
  list-style: none;
}

.product-card {
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow:
    0 0 0 1px var(--line-strong),
    inset 0 0 0 1px var(--line-strong),
    inset 0 0 0 2px var(--frame-mid),
    0 12px 26px rgba(0, 0, 0, 0.65);
  transform: translateY(-2px);
}

.product-card .t-titlebar {
  font-size: 0.6875rem;
  margin-bottom: 0;
}

.product-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 16px;
}

.product-media {
  display: grid;
  place-items: center;
  padding: 12px;
}

.product-media img {
  width: auto;
  max-width: 100%;
  max-height: min(24vh - 50px, 240px);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.product-tagline {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Badges */

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  font-family: var(--font-pixel);
  font-size: 0.625rem;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--slot);
  border: 1px solid var(--frame-mid);
  border-radius: 0;
  box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.6);
}

.badge-gold {
  color: var(--gold-300);
  border-color: var(--gold-700);
}

.badge-server {
  color: var(--text);
  border-color: var(--frame-hi);
}

.badge-discord {
  color: var(--brand-300);
  border-color: var(--brand-700);
}

/* Preço como slot de moeda. */
.product-price {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: center;
  margin: 0;
  padding: 8px 14px;
  font-family: var(--font-pixel);
  font-size: 0.875rem;
  color: var(--gold-300);
  text-shadow: 1px 1px 0 var(--line-strong);
  background: var(--slot);
  border: 2px solid;
  border-color: var(--frame-lo) var(--frame-hi) var(--frame-hi) var(--frame-lo);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.product-price::before {
  content: "";
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' shape-rendering='crispEdges'%3E%3Crect x='2' y='2' width='8' height='8' fill='%23d9a334'/%3E%3Crect x='4' y='0' width='4' height='1' fill='%237a5a14'/%3E%3Crect x='2' y='1' width='2' height='1' fill='%237a5a14'/%3E%3Crect x='8' y='1' width='2' height='1' fill='%237a5a14'/%3E%3Crect x='1' y='2' width='1' height='2' fill='%237a5a14'/%3E%3Crect x='10' y='2' width='1' height='2' fill='%237a5a14'/%3E%3Crect x='0' y='4' width='1' height='4' fill='%237a5a14'/%3E%3Crect x='11' y='4' width='1' height='4' fill='%237a5a14'/%3E%3Crect x='1' y='8' width='1' height='2' fill='%237a5a14'/%3E%3Crect x='10' y='8' width='1' height='2' fill='%237a5a14'/%3E%3Crect x='2' y='10' width='2' height='1' fill='%237a5a14'/%3E%3Crect x='8' y='10' width='2' height='1' fill='%237a5a14'/%3E%3Crect x='4' y='11' width='4' height='1' fill='%237a5a14'/%3E%3Crect x='4' y='1' width='4' height='1' fill='%23ffd76a'/%3E%3Crect x='3' y='3' width='2' height='2' fill='%23ffd76a'/%3E%3C/svg%3E") no-repeat center / 12px 12px;
}

.product-card .btn {
  width: 100%;
  margin-top: auto;
}

/* ==========================================================================
   Página de retorno do pagamento
   ========================================================================== */

.status-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 48px 20px;
}

.status-title {
  font-size: clamp(0.875rem, 3.5vw, 1.25rem);
  margin: 0 0 8px;
}

.status-title--success { color: var(--ok-300); text-shadow: 3px 3px 0 var(--ok-800); }
.status-title--pending { color: var(--gold-300); text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55); }
.status-title--failure { color: var(--danger-300); text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55); }

.status-text {
  max-width: 52ch;
  margin: 0 0 24px;
  color: var(--text-muted);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  margin-top: 48px;
  background: var(--bg-1);
  border-top: 1px solid var(--line-strong);
  box-shadow: inset 0 1px 0 var(--frame-hi);
}

.page-locked .site-footer {
  margin-top: 0;
}

.footer-inner {
  padding-block: 10px;
  text-align: center;
}

.footer-copy {
  margin: 0 0 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-disclaimer {
  margin: 0;
  font-size: 0.6875rem;
  color: var(--text-muted);
  opacity: 0.8;
}

/* ==========================================================================
   Página 404
   ========================================================================== */

.error-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 48px 20px;
}

.error-code {
  font-family: var(--font-pixel);
  font-size: clamp(2.5rem, 10vw, 4rem);
  color: var(--brand-300);
  text-shadow: 4px 4px 0 var(--brand-800);
  margin: 0;
}

/* ==========================================================================
   Entrega da licença (tela de retorno) e recuperação de chave
   ========================================================================== */

/* .licenca-box recebe a receita .t-window; .licenca-rotulo, a de .t-titlebar
   (seletores compartilhados lá em cima). Aqui, só os ajustes locais. */
.licenca-box {
  width: min(100%, 34rem);
  margin: 0 auto 20px;
}

.licenca-rotulo {
  margin-bottom: 16px;
}

/* A chave é o conteúdo mais importante da página: grande, monoespaçada e
   selecionável, para dar certo tanto no copiar quanto no copiar à mão. */
.licenca-chave {
  margin: 0 0 16px;
  padding-inline: 20px;
  font-family: var(--font-mono);
  font-size: clamp(1rem, 4.2vw, 1.5rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold-300);
  word-break: break-all;
  user-select: all;
}

.licenca-aviso {
  max-width: 46ch;
  margin: 0 auto 20px;
  color: var(--danger-300);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.licenca-acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 0 20px 20px;
}

.form-chave {
  width: min(100%, 26rem);
  margin: 0 auto 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.form-chave label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-chave input {
  min-height: 44px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--slot);
  border: 2px solid;
  border-color: var(--frame-lo) var(--frame-hi) var(--frame-hi) var(--frame-lo);
  box-shadow: inset 0 0 0 1px var(--line-strong), inset 2px 2px 6px rgba(0, 0, 0, 0.6);
  outline: none;
}

.form-chave input:focus-visible {
  border-color: var(--focus);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 0 0 3px rgba(255, 210, 63, 0.28);
}

/* min-height evita o bloco pular de altura quando a mensagem troca. */
.form-msg {
  min-height: 1.5rem;
  margin: 0 0 16px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.form-msg.erro { color: var(--danger-300); }
.form-msg.ok   { color: var(--ok-300); }

/* ==========================================================================
   Movimento reduzido
   ========================================================================== */

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

  .product-card:hover {
    transform: none;
  }

  .btn:active {
    transform: none;
  }
}
