:root {
  --bg: #0b0b0c;
  --card: #151517;
  --line: #2a2a2d;
  --red: #e11d2e;
  --red2: #8f0f1b;
  --txt: #f2f2f2;
  --mut: #8a8a90;
}

* {
  box-sizing: border-box;
  margin: 0;
}

html,
body {
  min-height: 100%;
  width: 100%;
}

html {
  scroll-padding-top: env(safe-area-inset-top, 0px);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  background: radial-gradient(
    ellipse at 50% 0%,
    #2a0509 0%,
    var(--bg) 60%
  ) fixed;
  color: var(--txt);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding:
    calc(20px + env(safe-area-inset-top, 0px))
    16px
    calc(20px + env(safe-area-inset-bottom, 0px));

  overflow-x: hidden;
}

/* TELAS */

.screen {
  display: none;
  width: 100%;
  max-width: 420px;
  min-width: 0;
  text-align: center;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  animation: in 0.5s ease;
}

.screen.on {
  display: flex;
}

@keyframes in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* TÍTULOS */

h1 {
  font-size: 2.4rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

h1 b {
  color: var(--red);
  font-weight: 600;
}

h2 {
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--mut);
  letter-spacing: 0.08em;
}

.sub {
  color: var(--mut);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* BOTÕES */

button {
  font: inherit;
  cursor: pointer;

  border: 1px solid var(--red);
  background: transparent;
  color: var(--txt);

  padding: 14px 34px;
  border-radius: 999px;

  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.8rem;

  transition: 0.25s;
}

button:hover {
  background: var(--red);
  box-shadow: 0 0 28px #e11d2e66;
}

button.ghost {
  border-color: var(--line);
  color: var(--mut);
  letter-spacing: 0.1em;
}

button.ghost:hover {
  background: transparent;
  border-color: var(--mut);
  color: var(--txt);
  box-shadow: none;
}

button:disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* CAMPOS DE TEXTO */

input {
  width: 100%;
  min-width: 0;

  background: var(--card);
  border: 1px solid var(--line);
  color: var(--txt);

  padding: 15px 18px;
  border-radius: 12px;

  font: inherit;
  text-align: center;
  outline: none;

  transition: 0.2s;
}

input:focus {
  border-color: var(--red);
}

/* INDICADOR DE FASE */

.level {
  font-size: 0.7rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--red);
}

.bar {
  display: flex;
  gap: 6px;
}

.bar i {
  width: 34px;
  height: 3px;
  background: var(--line);
  border-radius: 2px;
  transition: 0.4s;
}

.bar i.a {
  background: var(--red);
}

/* VEZ DO JOGADOR */

.turn {
  font-size: 1.2rem;
  font-weight: 300;
}

.turn b {
  color: var(--red);
  font-weight: 600;
}

/* DADO */

.die {
  width: 150px;
  height: 150px;
  flex-shrink: 0;

  border-radius: 28px;

  background: linear-gradient(
    145deg,
    #1d1d20,
    #0f0f11
  );

  border: 1px solid var(--line);

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 3.2rem;
  color: var(--red);

  box-shadow:
    0 0 40px #e11d2e22,
    inset 0 0 20px #0008;
}

.die.roll {
  animation: roll 0.7s ease;
}

@keyframes roll {
  0% {
    transform: rotate(0) scale(1);
  }

  40% {
    transform: rotate(200deg) scale(0.85);
  }

  100% {
    transform: rotate(720deg) scale(1);
  }
}

/* AÇÃO SORTEADA */

.action {
  min-height: 96px;
  width: 100%;
  min-width: 0;

  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;

  padding: 20px;

  font-size: 1.15rem;
  line-height: 1.45;

  display: flex;
  align-items: center;
  justify-content: center;
}

.action b {
  color: var(--red);
}

/* GRUPOS DE BOTÕES */

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

/* BANNERS E MODAIS */

.banner {
  position: fixed;
  inset: 0;

  background: #000d;

  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;

  gap: 10px;
  z-index: 9;
  padding: 20px;
}

.banner.on {
  display: flex;
  animation: in 0.4s;
}

.banner h1 {
  font-size: 1.8rem;
}

/* LISTA DE FASES */

.lvlist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.lvlist button {
  width: 100%;

  display: flex;
  justify-content: space-between;
  align-items: center;

  letter-spacing: 0.12em;
  border-radius: 14px;
  padding: 16px 20px;
}

.lvlist button span:last-child {
  color: var(--red);
  letter-spacing: 0.2em;
}

.lvlist button:hover span:last-child {
  color: #fff;
}

/* AVISO DE PRIVACIDADE */

.priv {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  background: #121214f2;
  border-top: 1px solid var(--line);
  padding: 12px 16px
    calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 8;
  font-size: 0.75rem;
  color: var(--mut);
  line-height: 1.4;
}

.priv.on {
  display: flex;
}

.priv a {
  color: var(--red);
}

.priv button {
  padding: 9px 18px;
  letter-spacing: 0.1em;
  white-space: nowrap;
  flex-shrink: 0;
}

.priv-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.priv .priv-x {
  padding: 6px 12px;
  font-size: 1.1rem;
  line-height: 1;
  letter-spacing: 0;
}

/* PUBLICIDADE EXOCLICK
   A zona fica no fluxo normal da página.
   O posicionamento interno do anúncio depende da rede. */

#ad-container,
.ad-container {
  position: relative;
  display: block;
  width: 100%;
  max-width: 300px;
  min-width: 0;
  margin: 16px auto 0;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
  flex-shrink: 0;
}

/* Elemento da zona */

#ad-container ins,
.ad-container ins {
  display: block;
  max-width: 100%;
  box-sizing: border-box;
}

/* Conteúdo incorporado */

#ad-container iframe,
.ad-container iframe {
  max-width: 100%;
}

/* CELULARES */

@media (max-width: 600px) {
  body {
    padding:
      calc(16px + env(safe-area-inset-top, 0px))
      12px
      calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .screen {
    max-width: 420px;
    gap: 18px;
  }

  h1 {
    font-size: 2rem;
  }

  .die {
    width: 130px;
    height: 130px;
    font-size: 2.8rem;
  }

  .action {
    min-height: 88px;
    padding: 16px;
    font-size: 1rem;
  }

  button {
    padding: 13px 22px;
    font-size: 0.75rem;
  }

  #ad-container,
  .ad-container {
    width: 100%;
    max-width: 300px;
    margin: 16px auto 0;
  }

  .priv {
    gap: 8px;
    padding: 10px 12px
      calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .priv button {
    padding: 9px 12px;
    font-size: 0.7rem;
  }
}

/* CELULARES PEQUENOS */

@media (max-width: 360px) {
  body {
    padding-left: 10px;
    padding-right: 10px;
  }

  .screen {
    gap: 15px;
  }

  h1 {
    font-size: 1.8rem;
  }

  .die {
    width: 115px;
    height: 115px;
    font-size: 2.5rem;
  }

  .row {
    gap: 8px;
  }

  button {
    padding: 12px 16px;
    letter-spacing: 0.12em;
  }

  .priv {
    align-items: flex-start;
    font-size: 0.7rem;
  }
}


#b-swap {
  padding: 8px 16px;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  margin: -8px 0;
}

/* ACESSIBILIDADE */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* CRÉDITOS DO DESENVOLVEDOR */

.dev-credit {
  width: 100%;
  max-width: 420px;
  margin: 24px auto 0;
  padding: 12px 0;
  text-align: center;
  color: var(--mut);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  line-height: 1.5;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.dev-credit a {
  color: var(--txt);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--red);
  padding-bottom: 2px;
  transition: color 0.2s ease;
}

.dev-credit a:hover {
  color: var(--red);
}

@media (max-width: 600px) {
  .dev-credit {
    margin-top: 18px;
    padding-bottom: 8px;
    font-size: 0.7rem;
  }
}
