/* Doma Game Studios — folha única do site.
   Tokens repetidos nas três origens (preferência do sistema e as duas marcações
   explícitas) pra o seletor de tema vencer nas duas direções. */

@font-face {
  font-family: "Kanit Display";
  src: url("kanit-extrabold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Kanit Display";
  src: url("kanit-semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fira Text";
  src: url("fira-book.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Victor Utility";
  src: url("victor-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

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

:root {
  --ground: #f6f4fa;
  --raise: #ffffff;
  --sink: #0a0810;
  --edge: #e4dfef;
  --edge-strong: #cfc7e4;
  --ink: #17122a;
  --ink-soft: #5e5776;
  --brand: #6d28d9;
  --live: #9a5b06;
  --live-ground: #fbf1df;
  --live-edge: #ecd6ab;
  --shadow: 0 2px 4px rgba(23, 18, 42, 0.04), 0 24px 60px -30px rgba(23, 18, 42, 0.45);

  /* As faces embutidas cobrem só latino. Japonês, chinês e árabe caem nos
     fallbacks do sistema de propósito — subsetar CJK pra uma página web
     custaria megabytes e o sistema já tem as fontes. */
  --display: "Kanit Display", "Hiragino Sans", "Noto Sans CJK SC", "Segoe UI", system-ui, sans-serif;
  --text: "Fira Text", "Hiragino Sans", "Noto Sans CJK SC", "Segoe UI", system-ui, sans-serif;
  --utility: "Victor Utility", ui-monospace, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #100d18;
    --raise: #191524;
    --sink: #0a0810;
    --edge: #2a2440;
    --edge-strong: #3b3358;
    --ink: #efecf7;
    --ink-soft: #9c94b2;
    --brand: #a78bfa;
    --live: #f2b14b;
    --live-ground: #241b0f;
    --live-edge: #4a3719;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.4), 0 28px 70px -34px rgba(0, 0, 0, 0.9);
  }
}

:root[data-theme="dark"] {
  --ground: #100d18;
  --raise: #191524;
  --sink: #0a0810;
  --edge: #2a2440;
  --edge-strong: #3b3358;
  --ink: #efecf7;
  --ink-soft: #9c94b2;
  --brand: #a78bfa;
  --live: #f2b14b;
  --live-ground: #241b0f;
  --live-edge: #4a3719;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.4), 0 28px 70px -34px rgba(0, 0, 0, 0.9);
}

:root[data-theme="light"] {
  --ground: #f6f4fa;
  --raise: #ffffff;
  --sink: #0a0810;
  --edge: #e4dfef;
  --edge-strong: #cfc7e4;
  --ink: #17122a;
  --ink-soft: #5e5776;
  --brand: #6d28d9;
  --live: #9a5b06;
  --live-ground: #fbf1df;
  --live-edge: #ecd6ab;
  --shadow: 0 2px 4px rgba(23, 18, 42, 0.04), 0 24px 60px -30px rgba(23, 18, 42, 0.45);
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand);
}

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

/* ---- Marca ---------------------------------------------------------------
   O logo é branco e roxo, desenhado pra fundo escuro: sobre o tema claro ele
   sumiria. A tile escura é a moldura fixa da marca, igual nos dois temas. */
.brand-tile {
  background: var(--sink);
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
}

/* ==========================================================================
   Página em construção
   ========================================================================== */
.construcao {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.construcao main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 3.5vw, 2.25rem);
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 5vw, 2rem);
  text-align: center;
}

.mark {
  background: var(--sink);
  border-radius: 22px;
  border: 1px solid var(--edge);
  padding: clamp(1.4rem, 4vw, 1.9rem) clamp(1.75rem, 5vw, 2.4rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.9rem, 2.4vw, 1.3rem);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: peca-entra 800ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.mark::before {
  content: "";
  position: absolute;
  inset: -60% 0 30%;
  background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.3), transparent 70%);
  pointer-events: none;
}

.mark img {
  position: relative;
  display: block;
}

.mark-glyph {
  width: clamp(70px, 17vw, 92px);
}

.mark-wordmark {
  width: clamp(152px, 38vw, 200px);
}

/* ---- Torre incompleta ----------------------------------------------------
   O slot vago no topo é o assunto da página: a peça que ainda não assentou.
   Dizer "em construção" com a mecânica do próprio jogo vale mais que uma
   barra de progresso, que não significaria nada aqui. */
.tower {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  width: min(280px, 72vw);
}

.tower span {
  display: block;
  height: 18px;
  border-radius: 4px;
  margin-inline-start: var(--offset);
  animation: bloco-assenta 620ms cubic-bezier(0.2, 1.25, 0.4, 1) both;
}

.tower span:nth-child(1) {
  width: 64%;
  --offset: 18%;
}
.tower span:nth-child(2) {
  width: 72%;
  --offset: 18%;
  background: #a78bfa;
  animation-delay: 860ms;
}
.tower span:nth-child(3) {
  width: 84%;
  --offset: 6%;
  background: #8b5cf6;
  animation-delay: 740ms;
}
.tower span:nth-child(4) {
  width: 92%;
  --offset: 6%;
  background: #7c3aed;
  animation-delay: 620ms;
}
.tower span:nth-child(5) {
  width: 100%;
  --offset: 0%;
  background: #5b21b6;
  animation-delay: 500ms;
}

/* Depois dos nth-child, senão a especificidade deles sobrescreve os delays
   daqui. Keyframes próprios que terminam já na opacidade do laço: herdar o
   `to { opacity: 1 }` dos blocos sólidos faria um degrau visível no instante
   em que o pulso assume. */
.tower .pending {
  border: 2px dashed var(--brand);
  background: none;
  animation: slot-assenta 620ms cubic-bezier(0.2, 1.25, 0.4, 1) 980ms both,
    slot-aguarda 2200ms ease-in-out 1720ms infinite;
}

@keyframes bloco-assenta {
  from {
    transform: translateY(-260%);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes slot-assenta {
  from {
    transform: translateY(-260%);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 0.55;
  }
}

@keyframes slot-aguarda {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 0.18;
  }
}

@keyframes peca-entra {
  from {
    transform: translateY(-12px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  max-width: 46ch;
  animation: peca-entra 800ms cubic-bezier(0.22, 1, 0.36, 1) 240ms both;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: var(--live-ground);
  border: 1px solid var(--live-edge);
  color: var(--live);
  font-family: var(--utility);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.construcao h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.9rem, 5.4vw, 2.75rem);
  letter-spacing: -0.025em;
  line-height: 1.05;
  text-wrap: balance;
  margin: 0;
}

.construcao h1 em {
  font-style: normal;
  color: var(--brand);
}

.copy p {
  margin: 0;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.mailto {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1rem, 3.4vw, 1.25rem);
  letter-spacing: -0.01em;
  color: var(--brand);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 160ms ease;
  word-break: break-word;
  margin-top: 0.25rem;
}

.mailto:hover {
  border-bottom-color: var(--brand);
}

.construcao footer {
  border-top: 1px solid var(--edge);
  padding: 1.5rem clamp(1.25rem, 5vw, 2rem);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  justify-content: center;
  font-family: var(--utility);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
}

/* ==========================================================================
   Documento legal (política de privacidade)
   ========================================================================== */
.doc {
  --coluna: 46rem;
}

.doc .faixa {
  width: 100%;
  max-width: var(--coluna);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2rem);
}

.doc-top {
  border-bottom: 1px solid var(--edge);
  padding-block: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
}

.doc-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
}

.doc-brand .brand-tile {
  width: 42px;
  height: 42px;
}

.doc-brand img {
  width: 25px;
  display: block;
}

.doc-brand b {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: block;
  line-height: 1.15;
}

.doc-brand span {
  font-family: var(--utility);
  font-size: 0.5rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Um <select> nativo: dez idiomas em botões viram um mural, e o nativo já traz
   rolagem, busca por teclado e o comportamento certo no celular. */
.lang {
  display: flex;
  align-items: center;
  position: relative;
}

/* A seta do controle nativo encosta na borda e não acompanha o tema. Desenhada
   aqui, ela herda a cor por `currentColor` e troca de lado sozinha em árabe,
   porque `inset-inline-end` segue a direção do texto. */
.lang::after {
  content: "";
  position: absolute;
  inset-inline-end: 0.8rem;
  top: 50%;
  width: 0.4rem;
  height: 0.4rem;
  /* Bordas FÍSICAS de propósito: as lógicas espelham em árabe e o chevron passa
     a apontar para o lado. Só a posição segue a direção do texto. */
  border-right: 2px solid var(--ink-soft);
  border-bottom: 2px solid var(--ink-soft);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.lang select {
  font-family: var(--text);
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--raise);
  border: 1px solid var(--edge-strong);
  border-radius: 9px;
  padding-block: 0.45rem;
  padding-inline: 0.8rem 2.2rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 160ms ease;
}

.lang select:hover {
  border-color: var(--brand);
}

.doc-head {
  padding-block: clamp(2.5rem, 6vw, 3.75rem) clamp(1.5rem, 4vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.doc-head .eyebrow {
  font-family: var(--utility);
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
}

.doc-head h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 5.4vw, 2.9rem);
  letter-spacing: -0.025em;
  line-height: 1.06;
  text-wrap: balance;
  margin: 0;
}

.doc-head time {
  font-family: var(--utility);
  font-size: 0.75rem;
  color: var(--ink-soft);
}

/* O resumo é o que a maioria vai ler de fato: fica antes do índice e recebe o
   único tratamento de destaque do documento. */
.resumo {
  background: var(--raise);
  border: 1px solid var(--edge);
  border-radius: 16px;
  padding: clamp(1.25rem, 3.5vw, 1.75rem);
  box-shadow: var(--shadow);
  margin-block: 0.5rem 2.5rem;
}

.resumo h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 0.9rem;
}

.resumo ul {
  margin: 0;
  padding-inline-start: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.resumo li::marker {
  color: var(--brand);
}

.indice {
  margin-block: 0 2.5rem;
}

.indice h2 {
  font-family: var(--utility);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.75rem;
}

.indice ol {
  margin: 0;
  padding-inline-start: 1.4rem;
  columns: 2;
  column-gap: 2rem;
  font-size: 0.9375rem;
}

.indice li {
  margin-bottom: 0.3rem;
  break-inside: avoid;
}

.indice a {
  color: var(--ink-soft);
  text-decoration: none;
}

.indice a:hover {
  color: var(--brand);
  text-decoration: underline;
}

/* A numeração não é enfeite: o texto das seções remete a "seção 6", então o
   número precisa estar visível e estável. */
.doc section {
  padding-block: 1.5rem;
  border-top: 1px solid var(--edge);
  scroll-margin-top: 1.5rem;
}

.doc section h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.015em;
  line-height: 1.2;
  text-wrap: balance;
  margin: 0 0 0.75rem;
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
}

.doc section h2 .num {
  font-family: var(--utility);
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--brand);
  flex: none;
  font-variant-numeric: tabular-nums;
}

.doc section p {
  margin: 0 0 0.9rem;
}

.doc section p:last-child {
  margin-bottom: 0;
}

.doc section ul {
  margin: 0 0 0.9rem;
  padding-inline-start: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.doc section li::marker {
  color: var(--edge-strong);
}

.doc-foot {
  border-top: 1px solid var(--edge);
  margin-top: 2.5rem;
  padding-block: 2rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-family: var(--utility);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.doc-foot a {
  color: var(--ink-soft);
}

/* Sugestão de idioma: só aparece via JS, e nunca redireciona sozinha — quem
   abriu um link direto continua onde escolheu estar. */
.sugestao {
  display: none;
  margin-top: 1.25rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--edge-strong);
  border-radius: 10px;
  background: var(--raise);
  font-size: 0.9375rem;
}

.sugestao.visivel {
  display: block;
}

@media (max-width: 560px) {
  .indice ol {
    columns: 1;
  }

  .doc-top {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mark,
  .copy,
  .tower span,
  .tower .pending {
    animation: none;
  }
}
