/* =========================================================
   SUPER LUX – Câmeras · Folha de estilos principal
   Identidade: navy profundo + dourado, inspirada nas cartas oficiais.
   ========================================================= */

:root {
  /* Paleta (extraída dos modelos de carta) */
  --bg:          #0b1124;
  --surface:     #121b38;
  --surface-2:   #182349;
  --line:        rgba(255,255,255,.08);
  --ink:         #f3f4fa;
  --muted:       #9aa3c0;

  --gold:        #ffc414;
  --gold-soft:   #ffd75e;
  --gold-deep:   #c79000;

  --card-light:  #f4f4f8;
  --card-dark:   #141e3d;
  --card-dark-2: #0f1832;

  /* Raridades */
  --r-popular:   #35c96e;
  --r-historica: #3f8cff;
  --r-iconica:   #a855f7;
  --r-lendaria:  #ffc414;
  --r-superlux:  #ffd75e;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Sora', system-ui, sans-serif;

  --radius: 16px;
  --shadow-lg: 0 24px 60px rgba(0,0,0,.5);
  --t-fast: .18s ease;
  --t-med:  .35s cubic-bezier(.22,.8,.3,1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* hidden sempre vence display do CSS */
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  touch-action: manipulation;                 /* sem delay/zoom em double-tap */
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;                  /* sem "puxar para recarregar" */
}
input, textarea { -webkit-user-select: text; user-select: text; }

/* Textura sutil de fundo (igual ao verso da carta) */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(63,90,180,.18), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 2px, transparent 2px 4px);
  pointer-events: none;
}
.bg-vignette {
  position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(ellipse 120% 90% at 50% 50%, transparent 55%, rgba(0,0,0,.45));
  pointer-events: none;
}

/* Sem animações (configuração / prefers-reduced-motion) */
body.no-anim *, body.no-anim *::before, body.no-anim *::after {
  transition: none !important;
  animation: none !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* =====================  TELAS  ===================== */
.screen {
  position: fixed; inset: 0; z-index: 1;
  display: none;
  flex-direction: column;
  opacity: 0;
  transition: opacity var(--t-med);
  overflow: hidden auto;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.screen.is-active { display: flex; }
.screen.is-visible { opacity: 1; }

.screen-head {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 16px clamp(16px, 4vw, 40px);
  position: sticky; top: 0; z-index: 5;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.screen-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 28px);
  letter-spacing: .02em;
}
.head-count { color: var(--muted); font-size: 14px; }

/* =====================  BOTÕES / INPUTS  ===================== */
.btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .04em;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 14px 32px;
  cursor: pointer;
  transition: transform var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.btn:hover  { background: #1e2b59; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.btn-primary {
  color: #1a1503;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  border: none;
  box-shadow: 0 4px 0 var(--gold-deep), 0 14px 30px rgba(255,196,20,.22);
}
.btn-primary:hover { background: linear-gradient(180deg, #ffe289, var(--gold-soft)); }
.btn-primary:active { box-shadow: 0 1px 0 var(--gold-deep); transform: translateY(3px); }

.btn-icon {
  width: 44px; height: 44px;
  padding: 0;
  display: grid; place-items: center;
  font-size: 18px;
}

.input {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
}
.input:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
select.input { appearance: none; }

/* Switch */
.switch {
  appearance: none;
  width: 52px; height: 30px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  position: relative;
  cursor: pointer;
  transition: background var(--t-fast);
}
.switch::after {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform var(--t-fast), background var(--t-fast);
}
.switch:checked { background: rgba(255,196,20,.25); }
.switch:checked::after { transform: translateX(22px); background: var(--gold); }

input[type=range] {
  accent-color: var(--gold);
  width: min(240px, 50vw);
}

/* =====================  MENU  ===================== */
.menu-wrap {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 20px;
  text-align: center;
  animation: menu-in .8s cubic-bezier(.22,.8,.3,1) both;
}
@keyframes menu-in { from { opacity: 0; transform: translateY(24px); } }

.menu-logo {
  width: clamp(240px, 44vw, 420px);
  filter: drop-shadow(0 20px 40px rgba(0,0,0,.6));
  animation: logo-float 6s ease-in-out infinite;
}
@keyframes logo-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.menu-tagline {
  color: var(--muted);
  font-style: italic;
  margin: 0 0 24px;
}
.menu-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(320px, 84vw);
}
.menu-nav .btn { width: 100%; }
.menu-footer { color: var(--muted); font-size: 12px; margin-top: 28px; opacity: .7; }

/* =====================  CARTA  =====================
   Escala proporcional via container queries:
   a carta ocupa 100% do contêiner e 1em ≈ 4% da largura (4cqw),
   então todo o interior escala junto em qualquer tamanho. */
.card-scope {
  container-type: inline-size;
  width: 100%;
}
.slx-card {
  width: 100%;
  aspect-ratio: 744 / 1039;
  font-size: 4cqw;                     /* 1em ≈ 4% da largura da carta */
  font-family: var(--font-display);
  border-radius: 1.4em;
  overflow: hidden;
  position: relative;
  background: var(--card-light);
  box-shadow: 0 1.4em 3em rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.06);
  user-select: none;
  display: flex;
  flex-direction: column;
}

/* ---- metade clara (foto) ---- */
.slx-top {
  position: relative;
  flex: 0 0 46.5%;
  background: linear-gradient(180deg, #fbfbfd, var(--card-light));
  color: #22284a;
}
.slx-ip {
  position: absolute; top: 1.1em; left: 1.2em;
  display: flex; align-items: center; gap: .45em;
  font-weight: 700; font-size: 1.15em;
  z-index: 1;
  color: #f1f2f5;
  background: #141e3d;
  padding: 3px 10px;
  border-radius: 6px;
}
.slx-ip .dot {
  width: .8em; height: .8em; border-radius: 50%;
  background: var(--r-color, var(--gold));
  box-shadow: 0 0 .5em var(--r-color, var(--gold));
}
.slx-name {
  position: absolute; top: .9em; right: 1em;
  max-width: 62%;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: #141e3d;
  font-weight: 700;
  font-size: 1.05em;
  line-height: 1.15;
  text-align: center;
  padding: .5em .9em;
  border-radius: 999px;
  box-shadow: 0 .22em 0 var(--gold-deep);
  z-index: 1;
}
.slx-flag {
  position: absolute; top: 4.4em; right: 1.2em;
  width: 2em; height: 1.55em;
  border-radius: .35em;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 .15em .5em rgba(0,0,0,.18);
  display: grid; place-items: center;
  padding: .2em;
  z-index: 1;
}
.slx-flag svg { width: 100%; height: 100%; border-radius: .18em; }
.slx-photo {
  position: absolute;
  /* inset: 3.6em 1em 2.2em; */
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.slx-photo svg {
  width: 74%;
  max-height: 100%;
  filter: drop-shadow(0 .8em 1.2em rgba(20,30,61,.28));
}
/* Foto real da câmera (assets/cards/<ID>.png) — cobre a silhueta */
.slx-photo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: drop-shadow(0 .8em 1.2em rgba(20,30,61,.28));
}
.slx-photo.has-photo svg { display: none; }
.slx-meta-l, .slx-meta-r {
  position: absolute; bottom: .8em;
  font-size: .78em;
  letter-spacing: .04em;
  color: #a2a7bd;
}
.slx-meta-l { left: 1.5em; font-style: italic;   color: #141e3d;
  background: #f1f2f5;
  padding: 3px 10px;
  border-radius: 6px; opacity: .75; }
.slx-meta-r { right: 1.5em; font-weight: 700; text-transform: uppercase;   color: #141e3d;
  background: #f1f2f5;
  padding: 3px 10px;
  border-radius: 6px; opacity: .75; }

/* ---- metade escura (dados) ---- */
.slx-bottom {
  flex: 1;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.015) 0 2px, transparent 2px 4px),
    linear-gradient(180deg, var(--card-dark), var(--card-dark-2));
  padding: 1em 1.1em 1.1em;
  display: flex;
  flex-direction: column;
  color: var(--ink);
}
.slx-pill-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .8em;
}
.slx-pill {
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: #141e3d;
  font-weight: 700;
  font-size: .82em;
  padding: .5em .95em;
  border-radius: 999px;
  box-shadow: 0 .22em 0 var(--gold-deep);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 68%;
}
.slx-launch {
  text-align: right;
  font-size: .68em;
  font-weight: 600;
  letter-spacing: .1em;
  color: #b9c0da;
  text-transform: uppercase;
  line-height: 1.4;
}
.slx-text {
  flex: 1;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: .74em;
  line-height: 1.5;
  text-align: center;
  color: #dfe3f2;
  margin: .9em .4em;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- atributos ---- */
.slx-attrs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55em .8em;
}
.slx-attr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5em;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: .8em;
  padding: .35em .35em .35em .8em;
  font-size: .8em;
  transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.slx-attr .label { font-weight: 500; color: #e8ebf7; }
.slx-attr .value {
  min-width: 2.6em;
  text-align: center;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: #141e3d;
  font-weight: 700;
  font-size: 1.25em;
  padding: .18em .35em;
  border-radius: .55em;
  box-shadow: 0 .18em 0 var(--gold-deep);
}

/* Atributo interativo (vez do jogador) */
.slx-card.is-choosable .slx-attr { cursor: pointer; }
.slx-card.is-choosable .slx-attr:hover,
.slx-card.is-choosable .slx-attr:focus-visible {
  background: rgba(255,196,20,.14);
  box-shadow: 0 0 0 1px var(--gold) inset;
  transform: translateX(.15em);
}

/* Atributo em disputa */
.slx-attr.is-selected {
  background: rgba(255,196,20,.12);
  box-shadow: 0 0 0 1.5px var(--gold) inset;
  animation: sel-pulse 1.1s ease-in-out infinite;
}
@keyframes sel-pulse {
  50% { box-shadow: 0 0 0 1.5px var(--gold) inset, 0 0 1em rgba(255,196,20,.45); }
}
.slx-attr.is-picked {
  background: rgba(255,196,20,.18);
  box-shadow: 0 0 0 1.5px var(--gold) inset, 0 0 1.2em rgba(255,196,20,.35);
}
.slx-attr.is-picked-opp {
  background: rgba(63,140,255,.14);
  box-shadow: 0 0 0 1.5px var(--r-historica) inset, 0 0 1.2em rgba(63,140,255,.3);
}
.slx-attr.is-picked.is-picked-opp {
  box-shadow: 0 0 0 1.5px var(--gold) inset, 0 0 0 3px rgba(63,140,255,.5) inset;
}
.slx-attr.is-winner .value { animation: value-pop .5s cubic-bezier(.2,1.6,.4,1); }
.slx-attr.is-loser { opacity: .55; }
@keyframes value-pop {
  40% { transform: scale(1.25); }
}

/* ---- carta especial SUPER LUX ---- */
/* Selo do logo no canto superior esquerdo, abaixo do indicador ⭐ */
.slx-sl-logo {
  position: absolute;
  left: .0em; top: 3.6em;
  width: 30%;
  transform: rotate(-6deg);
  transform-origin: top left;
  z-index: 3;
  pointer-events: none;
  filter: drop-shadow(0 .18em .5em rgba(255,255,255,.55)) drop-shadow(0 .06em .18em rgba(0,0,0,.4));
  animation: sl-logo-pulse 2.6s ease-in-out infinite;
}
@keyframes sl-logo-pulse {
  50% {
    transform: rotate(-6deg) scale(1.05);
    filter: drop-shadow(0 .18em .8em rgba(255,215,94,.85)) drop-shadow(0 .06em .18em rgba(0,0,0,.4));
  }
}
.slx-card.is-special {
  box-shadow: 0 1.4em 3em rgba(0,0,0,.55), 0 0 0 2px var(--gold), 0 0 2.5em rgba(255,196,20,.4);
}
.slx-card.is-special::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.25) 48%, transparent 60%);
  background-size: 250% 100%;
  animation: special-shine 3s linear infinite;
  pointer-events: none;
}
@keyframes special-shine {
  from { background-position: 130% 0; }
  to   { background-position: -130% 0; }
}
.slx-card.is-special .slx-name,
.slx-card.is-special .slx-pill,
.slx-card.is-special .slx-attr .value {
  background: linear-gradient(180deg, #fff3c4, var(--gold-soft) 45%, var(--gold));
}

/* ---- verso / flip ---- */
.flip-box {
  position: relative;
  transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.35,.9,.3,1);
  aspect-ratio: 744 / 1039;
}
.flip-box.is-flipped { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 16px;
  transform: translateZ(0); /* estabiliza o backface em engines móveis */
}
.flip-back { transform: rotateY(180deg) translateZ(1px); }
.flip-face .slx-card { height: 100%; }
.flip-back img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: inherit;
  box-shadow: var(--shadow-lg);
}

/* =====================  ARENA / JOGO  ===================== */
#screen-game { justify-content: space-between; }

.game-hud {
  display: grid;
  grid-template-columns: 44px 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px clamp(12px, 3vw, 32px);
}
.hud-side { display: flex; align-items: center; gap: 10px; }
.hud-opponent { justify-content: flex-start; }
.hud-player   { justify-content: flex-end; }
.hud-name { color: var(--muted); font-size: 13px; }
.hud-count {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 4px 14px;
  border-radius: 999px;
  transition: transform var(--t-fast);
}
.hud-count.bump { animation: value-pop .5s cubic-bezier(.2,1.6,.4,1); }
.hud-deck {
  width: 20px;
  aspect-ratio: 744 / 1039;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 2px 2px 0 rgba(0,0,0,.45), 4px 4px 0 rgba(0,0,0,.25); /* pilha */
}

/* =====================  MULTIPLAYER (lobby)  ===================== */
.mp-body {
  margin: auto;
  width: min(440px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 40px;
}
.mp-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mp-card h3 { margin: 0; font-family: var(--font-display); font-size: 16px; color: var(--gold); }
.mp-card p  { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.mp-join-row { display: flex; gap: 10px; }
.mp-join-row .input { flex: 1; text-transform: uppercase; letter-spacing: .3em; font-weight: 700; text-align: center; }
.mp-code {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 44px;
  letter-spacing: .35em;
  text-align: center;
  color: var(--gold);
  background: var(--surface-2);
  border-radius: 12px;
  padding: 14px 8px 14px calc(8px + .35em);
}
.mp-status { text-align: center; color: var(--muted); font-size: 13px; min-height: 1.4em; }
.mp-link {
  text-align: center;
  font-size: 12px;
  color: var(--gold);
  word-break: break-all;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px 12px;
  user-select: text;
  -webkit-user-select: text;
}
.mp-share-row { display: flex; gap: 10px; }
.mp-share-row .btn { flex: 1; text-align: center; text-decoration: none; }
.mp-status.err { color: #ff7b8a; }
.mp-wait::after { content: '…'; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
.hud-center { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hud-round { font-size: 13px; color: var(--muted); }
.hud-round b { color: var(--ink); }
.hud-pot {
  font-size: 12px;
  color: #141e3d;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  padding: 2px 12px;
  border-radius: 999px;
  font-weight: 600;
}

.arena {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 5vw, 80px);
  padding: 8px clamp(12px, 3vw, 40px) 20px;
  min-height: 0;
}
.arena-slot { display: grid; place-items: center; min-width: 0; }
.card-holder {
  position: relative;
  perspective: 1200px;
  -webkit-perspective: 1200px;
  width: var(--game-card-w, 300px);
}
.card-holder .flip-box { width: 100%; }
/* Sem container queries na cadeia 3D (quebram o flip em engines móveis):
   a fonte da carta é derivada diretamente da largura conhecida. */
.card-holder .slx-card { font-size: calc(var(--game-card-w, 300px) / 25); }

.arena-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.vs-badge {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 3vw, 30px);
  letter-spacing: .1em;
  color: var(--gold);
  text-shadow: 0 0 24px rgba(255,196,20,.5);
}
.turn-banner {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  max-width: 180px;
  min-height: 2.6em;
}
.turn-banner b { color: var(--gold); }
.turn-banner.is-waiting::after { content: '…'; animation: dots 1.2s steps(4) infinite; }

.btn-confirm {
  animation: confirm-in .35s cubic-bezier(.2,1.5,.4,1) both, confirm-glow 1.6s ease-in-out .4s infinite;
}
@keyframes confirm-in { from { opacity: 0; transform: scale(.7); } }
@keyframes confirm-glow {
  50% { box-shadow: 0 4px 0 var(--gold-deep), 0 0 34px rgba(255,196,20,.55); }
}

/* Botão de anúncio da carta especial */
.btn-superlux {
  color: #1a1503;
  background: linear-gradient(180deg, #fff3c4, var(--gold-soft) 45%, var(--gold));
  border: none;
  font-weight: 700;
  letter-spacing: .06em;
  box-shadow: 0 4px 0 var(--gold-deep), 0 0 30px rgba(255,196,20,.5);
  animation: confirm-in .35s cubic-bezier(.2,1.5,.4,1) both, sl-throb 1s ease-in-out .4s infinite;
}
@keyframes sl-throb {
  50% { transform: scale(1.06); box-shadow: 0 4px 0 var(--gold-deep), 0 0 46px rgba(255,196,20,.85); }
}

/* Timer da jogada */
.round-timer {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 3px solid var(--gold);
  background: var(--surface);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
  box-shadow: 0 0 20px rgba(255,196,20,.25);
}
.round-timer.danger {
  border-color: #ff5c6e;
  color: #ff7b8a;
  animation: timer-panic 1s ease-in-out infinite;
}
@keyframes timer-panic {
  50% { transform: scale(1.12); box-shadow: 0 0 26px rgba(255,92,110,.6); }
}

/* Escolha de dificuldade */
.diff-panel { min-width: min(360px, 88vw); }
.diff-panel p { margin-bottom: 20px; }
.diff-options { display: flex; flex-direction: column; gap: 10px; }
.diff-btn {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  padding: 14px 22px;
  border-radius: 16px;
}
.diff-btn b { font-size: 16px; letter-spacing: .04em; }
.diff-btn small { font-family: var(--font-body); font-weight: 300; font-size: 12px; color: var(--muted); }
.diff-btn.is-current {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold) inset, 0 0 20px rgba(255,196,20,.18);
}
.diff-btn.is-current b { color: var(--gold); }
.diff-btn[data-diff="pro"] b { color: var(--gold-soft); }

/* Sorteio de dados */
.dice-panel { min-width: min(340px, 86vw); }
.dice-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  margin-bottom: 10px;
}
.dice-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dice-label { font-size: 13px; color: var(--muted); }
.dice-face {
  font-size: 88px;
  line-height: 1;
  color: var(--gold);
  filter: drop-shadow(0 6px 18px rgba(255,196,20,.35));
}
.dice-vs {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  color: var(--muted);
}
.dice-msg {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--gold);
  margin: 8px 0 0 !important;
  min-height: 1.4em;
}
.dice-msg.is-waiting { color: var(--muted); }
.dice-msg.is-waiting::after { content: '…'; animation: dots 1.2s steps(4) infinite; }

/* Entrada / saída de cartas */
.card-holder .deal-in   { animation: deal-in .5s cubic-bezier(.22,.8,.3,1) both; }
@keyframes deal-in {
  from { opacity: 0; transform: translateY(30px) scale(.92); }
}
.card-holder .fly-player { animation: fly-down .55s cubic-bezier(.5,0,.8,.4) both; }
.card-holder .fly-ai     { animation: fly-up   .55s cubic-bezier(.5,0,.8,.4) both; }
.card-holder .fly-pot    { animation: fly-pot  .55s cubic-bezier(.5,0,.8,.4) both; }
@keyframes fly-down { to { opacity: 0; transform: translateY(60vh) rotate(6deg)  scale(.7); } }
@keyframes fly-up   { to { opacity: 0; transform: translateY(-60vh) rotate(-6deg) scale(.7); } }
@keyframes fly-pot  { to { opacity: 0; transform: scale(.6); } }

/* Banner de resultado da rodada */
.round-banner {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(.8);
  z-index: 20;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 4.5vw, 42px);
  letter-spacing: .04em;
  color: var(--ink);
  background: rgba(11,17,36,.85);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  padding: .5em 1.2em;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-med), transform var(--t-med);
  white-space: nowrap;
}
.round-banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.round-banner.win  { color: var(--gold); box-shadow: 0 0 40px rgba(255,196,20,.3); }
.round-banner.lose { color: #ff7b8a; }

/* Overlay genérico */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: rgba(5,8,18,.8);
  backdrop-filter: blur(10px);
  animation: fade-in .3s ease both;
  overflow: auto;
  padding: 24px;
}
@keyframes fade-in { from { opacity: 0; } }
.overlay-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 40px 48px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: panel-in .45s cubic-bezier(.2,1.4,.4,1) both;
}
@keyframes panel-in { from { opacity: 0; transform: scale(.85); } }
.overlay-panel h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 44px);
  margin: 0 0 8px;
  color: var(--gold);
}
.overlay-panel p { color: var(--muted); margin: 0 0 24px; }
.overlay-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Explosão da carta especial */
.superlux-burst {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(255,196,20,.28), transparent 60%);
  animation: fade-in .3s ease both;
}
.burst-rays {
  position: absolute;
  width: 160vmax; height: 160vmax;
  background: repeating-conic-gradient(rgba(255,215,94,.14) 0deg 6deg, transparent 6deg 16deg);
  animation: rays-spin 8s linear infinite;
}
@keyframes rays-spin { to { transform: rotate(360deg); } }
.burst-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 9vw, 96px);
  letter-spacing: .08em;
  background: linear-gradient(180deg, #fff3c4, var(--gold), var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 8px 32px rgba(255,196,20,.6));
  animation: burst-text-in .7s cubic-bezier(.2,1.5,.4,1) both;
}
@keyframes burst-text-in { from { opacity: 0; transform: scale(.5) rotate(-4deg); } }

/* =====================  COLEÇÃO  ===================== */
.filters {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) repeat(4, minmax(120px, 1fr));
  gap: 10px;
  padding: 0 clamp(16px, 4vw, 40px) 16px;
}
.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); /* tablets/notebooks */
  gap: 20px;
  padding: 4px clamp(16px, 4vw, 40px) 48px;
}
@media (min-width: 1200px) {
  .collection-grid { grid-template-columns: repeat(6, 1fr); }   /* desktop: 6 por linha */
}
@media (max-width: 600px) {
  .collection-grid {
    grid-template-columns: 1fr;                                 /* mobile: 1 por linha */
    justify-items: center;
    gap: 22px;
  }
  .collection-grid .grid-item { width: min(84vw, 360px); }
}
.grid-item {
  cursor: pointer;
  transition: transform var(--t-fast), filter var(--t-fast);
  animation: grid-in .4s ease both;
}
@keyframes grid-in { from { opacity: 0; transform: translateY(12px); } }
.grid-item:hover { transform: translateY(-6px); filter: brightness(1.08); }
.grid-item:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 12px; }
.grid-item {
  container-type: inline-size;
  background: none;
  border: none;
  padding: 0;
}
.grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 60px 20px;
}

/* Modal centraliza E rola corretamente quando a carta está ampliada */
#card-modal { display: flex; }
.modal-card-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: auto;
  padding: 48px 16px;
  --modal-base: min(88vw, 46vh, 380px);
  --modal-w: var(--modal-base);
}
.modal-card-wrap .flip-box {
  width: var(--modal-w);
  cursor: pointer;
  transition: width .25s ease;
}
.modal-card-wrap .slx-card { font-size: calc(var(--modal-w) / 25); }
.modal-zoom {
  display: flex;
  align-items: center;
  gap: 12px;
}
.zoom-level {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  min-width: 52px;
  text-align: center;
}
.modal-hint { color: var(--muted); font-size: 13px; }
.modal-close { position: fixed; top: 20px; right: 20px; z-index: 60; }

/* =====================  COMO JOGAR / SETTINGS / CRÉDITOS  ===================== */
.howto-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px) 60px;
  width: 100%;
}
.howto-step {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
}
.howto-step .icon {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  font-size: 26px;
  background: var(--surface-2);
  border-radius: 14px;
}
.howto-step h3 {
  margin: 2px 0 6px;
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--gold);
}
.howto-step p { margin: 0; color: #cfd5e8; font-size: 14px; line-height: 1.6; }

.settings-body {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px) 60px;
  width: 100%;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 12px;
  font-size: 15px;
}

.credits-body {
  margin: auto;
  text-align: center;
  color: var(--muted);
  padding: 20px;
  max-width: 480px;
}
.credits-logo { width: 200px; margin-bottom: 20px; }
.credits-body b { color: var(--ink); }
.credits-tech { margin-top: 28px; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; opacity: .6; }

/* =====================  RESPONSIVIDADE  ===================== */
@media (max-width: 860px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .filters #f-search { grid-column: 1 / -1; }
}

@media (min-width: 721px) {
  :root { --game-card-w: min(400px, 30vw, 54vh); }   /* cartas maiores no desktop */
}
@media (max-width: 720px) {
  :root { --game-card-w: min(42vw, 34vh); }
  .arena { gap: 10px; padding-bottom: 12px; }
  .arena-mid { gap: 6px; }
  .turn-banner { max-width: 110px; font-size: 11px; }
  .overlay-panel { padding: 28px 24px; }
}
@media (max-width: 420px) {
  .hud-name { display: none; }
}

/* Celular em pé — experiência "carta na mão":
   ESCOLHENDO: só a SUA carta, grande.
   COMPARANDO: as duas cartas na tela. */
@media (orientation: portrait) and (max-width: 720px) {
  .arena {
    flex-direction: column;
    justify-content: space-between;
    gap: 4px;
    padding: 4px 12px calc(10px + env(safe-area-inset-bottom));
  }
  .arena-mid {
    flex-direction: row;
    gap: 14px;
    align-items: center;
  }
  .vs-badge { font-size: 16px; }
  .turn-banner { max-width: none; min-height: 0; text-align: left; }
  .arena-player .slx-card { box-shadow: 0 -1em 3em rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.06); }

  /* Fase de escolha: carta do adversário oculta, a sua em destaque */
  #screen-game.is-choosing .arena-ai { display: none; }
  #screen-game.is-choosing .arena { justify-content: center; gap: 10px; }
  #screen-game.is-choosing .arena-player .card-holder,
  #screen-game.is-choosing .arena-player .slx-card { --game-card-w: min(86vw, 42vh); }

  /* Fase de comparação: as duas cartas visíveis */
  #screen-game.is-reveal .arena-ai .card-holder,
  #screen-game.is-reveal .arena-ai .slx-card     { --game-card-w: min(42vw, 20vh); }
  #screen-game.is-reveal .arena-player .card-holder,
  #screen-game.is-reveal .arena-player .slx-card { --game-card-w: min(56vw, 26vh); }
}

/* Paisagem baixa (celular deitado) */
@media (orientation: landscape) and (max-height: 480px) {
  :root { --game-card-w: min(30vh, 24vw); }
  .game-hud { padding-block: 6px; }
}

