/* =========================================================
   ACES & FACES POKER — Premium casino theme
   Paleta: negro/burdeos + dorado champagne + rojo profundo
   ========================================================= */
:root {
  --bg-0: #08070a;
  --bg-1: #120b10;
  --burgundy: #4a0a18;
  --burgundy-2: #2b0610;
  --red: #b3101f;
  --red-2: #e0203a;
  --gold: #d4af37;
  --gold-2: #f6e7b4;
  --gold-3: #8a6a1c;
  --champagne: #e8d9a8;
  --ink: #f7f1e3;
  --muted: #a89a7a;
  --font-display: 'Cinzel', 'Times New Roman', serif;
  --font-ui: 'Oswald', 'Arial Narrow', sans-serif;
  --card-w: 150px; /* se sobreescribe dentro de .hand-area con unidades de contenedor */
  --gap: clamp(6px, 1vh, 12px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background-color: var(--bg-0);
  background-image:
    radial-gradient(1200px 700px at 50% 20%, rgba(0,0,0,0), rgba(0,0,0,.35) 100%),
    url('/games/aces-faces-poker/static/img/bg-official.webp');
  background-size: cover, cover;
  background-position: center top, center top;
  background-attachment: fixed, fixed;
  background-repeat: no-repeat;
  overflow-x: hidden;
}
@media (min-resolution: 1.5dppx) {
  body { background-image: radial-gradient(1200px 700px at 50% 20%, rgba(0,0,0,0), rgba(0,0,0,.35) 100%), url('/games/aces-faces-poker/static/img/bg-official@2x.webp'); }
}
/* marco dorado del fondo oficial: se reproduce con borde fijo para cualquier ratio */
body::before {
  content: '';
  position: fixed; inset: 10px; pointer-events: none; z-index: 0; border-radius: 6px;
  border: 1px solid rgba(212,175,55,.55);
  box-shadow: inset 0 0 0 3px rgba(0,0,0,.35), inset 0 0 0 4px rgba(212,175,55,.25), 0 0 40px rgba(0,0,0,.6);
}

.table {
  position: relative; z-index: 1;
  height: 100dvh; width: 100vw; margin: 0;
  padding: clamp(10px, 1.6vh, 18px) clamp(14px, 2vw, 28px);
  box-sizing: border-box;
  display: grid;
  grid-template-columns: clamp(250px, 24vw, 360px) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "marquee marquee"
    "paytable hand"
    "console console";
  gap: var(--gap) clamp(10px, 1.4vw, 20px);
}

.fx-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 40;
}

/* ---------- Marquee (logo oficial) ---------- */
.marquee { grid-area: marquee; position: relative; display: grid; justify-items: center; padding: 5vh 0 0; }
.title { margin: 0; line-height: 0; }
.logo {
  width: auto; height: clamp(80px, 15vh, 160px); display: block;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.7)) drop-shadow(0 0 18px rgba(212,175,55,.18));
  animation: logoGlow 4s ease-in-out infinite alternate;
  mask-image: radial-gradient(ellipse 70% 62% at 50% 52%, #000 45%, transparent 98%);
  -webkit-mask-image: radial-gradient(ellipse 70% 62% at 50% 52%, #000 45%, transparent 98%);
}
@keyframes logoGlow { from { filter: drop-shadow(0 8px 24px rgba(0,0,0,.7)) drop-shadow(0 0 12px rgba(212,175,55,.12)); } to { filter: drop-shadow(0 8px 24px rgba(0,0,0,.7)) drop-shadow(0 0 26px rgba(212,175,55,.32)); } }

/* logo de marca en la esquina */
.brand-corner {
  position: fixed; right: clamp(14px, 2vw, 30px); bottom: clamp(12px, 2vh, 26px); z-index: 30;
  height: clamp(52px, 9vh, 96px); width: auto; pointer-events: none;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.7)) drop-shadow(0 0 14px rgba(212,175,55,.35));
  animation: brandFloat 5s ease-in-out infinite alternate;
}
@keyframes brandFloat { from { transform: translateY(0) rotate(-2deg); } to { transform: translateY(-4px) rotate(2deg); } }

.icon-btn {
  position: absolute; top: 4px; right: 0;
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(212,175,55,.4);
  background: rgba(0,0,0,.4); color: var(--gold); cursor: pointer; display: grid; place-items: center;
}
.icon-btn .mute-line { display: none; }
.icon-btn.muted .wave { display: none; }
.icon-btn.muted .mute-line { display: block; }

/* ---------- Paytable ---------- */
.paytable {
  grid-area: paytable; min-height: 0; container-type: inline-size;
  display: grid; grid-template-rows: auto 1fr;
  border: 1px solid rgba(212,175,55,.35); border-radius: 12px; overflow: hidden;
  background: linear-gradient(180deg, rgba(10,6,10,.82), rgba(30,6,14,.86));
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
  font-size: min(clamp(10px, 1.55vh, 15px), 4.2cqw);
}
.pt-body { display: grid; grid-auto-rows: 1fr; min-height: 0; }
.pt-head, .pt-row {
  display: grid; grid-template-columns: minmax(0, 2.3fr) repeat(5, minmax(0, 1fr)); align-items: center;
}
.pt-head { background: rgba(212,175,55,.12); border-bottom: 1px solid rgba(212,175,55,.35); }
.pt-head .pt-cell { color: var(--gold-2); font-weight: 700; letter-spacing: .1em; }
.pt-cell { padding: 0 clamp(3px, 1.6cqw, 8px); text-align: right; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pt-head .pt-cell { padding: 4px 8px; }
.pt-name { text-align: left; color: var(--champagne); letter-spacing: .03em; text-transform: uppercase; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-row { border-bottom: 1px solid rgba(255,255,255,.04); transition: background .2s; }
.pt-row:last-child { border-bottom: 0; }
.pt-col { color: #e6dcc3; }
.pt-col.bet-active { background: rgba(212,175,55,.10); color: #fff3c4; }
.pt-head .pt-col.bet-active { background: rgba(212,175,55,.28); color: #fff; }
.pt-row.tier-legendary .pt-name { color: var(--gold-2); text-shadow: 0 0 10px rgba(212,175,55,.6); }
.pt-row.tier-legendary .pt-name::before,
.pt-row.tier-epic .pt-name::before { content: '★ '; color: var(--gold); }
.pt-row.tier-epic .pt-name { color: #f2c9c9; }
.pt-row[data-key="FOUR_ACES"] { background: linear-gradient(90deg, rgba(212,175,55,.16), transparent 70%); }
.pt-row[data-key="FOUR_ACES"] .pt-name { font-weight: 700; }
.pt-row.active {
  background: linear-gradient(90deg, rgba(212,175,55,.45), rgba(179,16,31,.35));
  animation: rowBlink .7s ease-in-out infinite alternate;
}
.pt-row.active .pt-cell { color: #fff; font-weight: 700; }
@keyframes rowBlink { from { filter: brightness(1);} to { filter: brightness(1.35);} }

/* ---------- Hand area ---------- */
.hand-area {
  grid-area: hand; min-height: 0; position: relative; container-type: size;
  /* 5 cartas + 4 huecos + márgenes deben caber en el ancho del panel; y la carta no puede superar ~62% del alto */
  --card-w: calc(min(240px, calc((100cqw - 48px) / 5.45), calc(62cqh * 200 / 280)) * 0.95);
  --double-w: calc(min(220px, calc((100cqw - 120px) / 6.2), calc(58cqh * 200 / 280)) * 0.95);
  display: grid; grid-template-rows: auto 1fr; align-items: center; justify-items: center;
  padding: clamp(8px, 1.2vh, 14px) 12px; border-radius: 16px;
  border: 1px solid rgba(212,175,55,.3);
  background:
    radial-gradient(ellipse at 50% 20%, rgba(120,16,34,.55), transparent 65%),
    linear-gradient(180deg, rgba(43,6,16,.9), rgba(21,4,9,.92));
  box-shadow: inset 0 0 60px rgba(0,0,0,.6), 0 10px 40px rgba(0,0,0,.5);
}
.status {
  min-height: 22px; margin: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  font-family: var(--font-display); font-weight: 700; letter-spacing: .12em;
  font-size: clamp(12px, 2vw, 18px); color: var(--champagne);
  transition: color .3s;
}
.status.win { color: var(--gold-2); text-shadow: 0 0 14px rgba(212,175,55,.5); }
.status.epic { color: #ffb3b3; text-shadow: 0 0 16px rgba(224,32,58,.6); }
.status.legendary { color: #fff3c4; text-shadow: 0 0 20px var(--gold), 0 0 40px rgba(212,175,55,.6); animation: rowBlink .5s ease-in-out infinite alternate; }
.status.lose { color: var(--muted); }
.status.double { color: var(--red-2); }

.hand-area:has(.double-panel.open) .cards { transform: translateY(calc(-50% - 8vh)) scale(.36); opacity: .55; filter: saturate(.8); }
.hand-area:has(.double-panel.open) .status { opacity: 0; }
.cards {
  transition: transform .35s ease;
  width: 100%; display: grid; grid-template-columns: repeat(5, var(--card-w)); justify-content: center; align-content: center; gap: 10px;
  padding-top: 14px; /* espacio para el badge HELD */
}
.card-slot {
  position: relative; width: var(--card-w); aspect-ratio: 200 / 280;
  padding: 0; border: 0; background: transparent; cursor: pointer;
  perspective: 900px; border-radius: 8%;
  transition: transform .18s ease, filter .3s ease;
  -webkit-tap-highlight-color: transparent;
}
.card-slot:hover { transform: translateY(-4px); }
.card-slot:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.table[data-phase="IDLE"] .card-slot,
.table[data-phase="RESULT"] .card-slot,
.table[data-phase^="DOUBLE"] .card-slot { cursor: default; }
.table[data-phase="IDLE"] .card-slot:hover,
.table[data-phase="RESULT"] .card-slot:hover { transform: none; }

.card-inner {
  display: block; position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform .5s cubic-bezier(.2,.7,.2,1);
  border-radius: 8%;
  box-shadow: 0 10px 24px rgba(0,0,0,.6);
}
.card-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 8%; overflow: hidden; display: block;
}
.card-face svg { width: 100%; height: 100%; display: block; }
.card-back { transform: rotateY(180deg); }
.card-slot.face-down .card-inner { transform: rotateY(180deg); }
.card-slot.flip .card-inner { animation: flipIn .55s cubic-bezier(.2,.7,.2,1); }
@keyframes flipIn {
  0% { transform: rotateY(180deg) translateY(-14px); }
  100% { transform: rotateY(0) translateY(0); }
}

.held-badge {
  position: absolute; left: 50%; top: -12px; transform: translateX(-50%) scale(.6);
  z-index: 3; padding: 3px 10px; border-radius: 4px;
  font-family: var(--font-display); font-weight: 900; font-size: clamp(9px, 1.4vw, 12px); letter-spacing: .18em;
  color: #1a1206; background: linear-gradient(180deg, var(--gold-2), var(--gold));
  box-shadow: 0 2px 10px rgba(0,0,0,.6), 0 0 14px rgba(212,175,55,.5);
  opacity: 0; transition: opacity .18s, transform .18s;
}
.card-slot.held .held-badge { opacity: 1; transform: translateX(-50%) scale(1); }
.card-slot.held .card-inner { box-shadow: 0 0 0 3px var(--gold), 0 10px 24px rgba(0,0,0,.6), 0 0 22px rgba(212,175,55,.5); }
.card-slot.held { transform: translateY(-8px); }

.card-slot.dim { filter: brightness(.55) saturate(.7); }
.card-slot.winning { filter: none; transform: translateY(-8px); }
.card-slot.winning .card-inner {
  box-shadow: 0 0 0 3px var(--gold-2), 0 0 28px rgba(212,175,55,.7), 0 12px 28px rgba(0,0,0,.6);
  animation: winPulse 1s ease-in-out infinite alternate;
}
@keyframes winPulse { from { filter: brightness(1);} to { filter: brightness(1.18);} }

/* Celebración intermedia — Four J/Q/K */
.card-slot.epic .card-inner {
  box-shadow: 0 0 0 3px var(--red-2), 0 0 32px rgba(224,32,58,.75), 0 0 60px rgba(212,175,55,.5), 0 12px 28px rgba(0,0,0,.6);
  animation: epicPulse .7s ease-in-out infinite alternate;
}
@keyframes epicPulse {
  from { transform: scale(1); filter: brightness(1); }
  to { transform: scale(1.04); filter: brightness(1.25) drop-shadow(0 0 10px var(--red-2)); }
}

/* Celebración legendaria — Four Aces */
.card-slot.legendary .card-inner {
  box-shadow: 0 0 0 4px #fff3c4, 0 0 40px var(--gold), 0 0 90px rgba(212,175,55,.9), 0 12px 28px rgba(0,0,0,.6);
  animation: legendaryPulse .55s ease-in-out infinite alternate;
}
.card-slot.legendary::after {
  content: ''; position: absolute; inset: -14%; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, rgba(255,243,196,.55), rgba(212,175,55,.25) 40%, transparent 70%);
  animation: haloSpin 2.4s linear infinite;
}
.card-slot.legendary .ace-pip { animation: pipBeat .55s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes legendaryPulse {
  from { transform: scale(1) rotate(-1deg); filter: brightness(1); }
  to { transform: scale(1.08) rotate(1deg); filter: brightness(1.12) drop-shadow(0 0 16px var(--gold-2)); }
}
@keyframes haloSpin { from { transform: rotate(0) scale(1);} to { transform: rotate(360deg) scale(1.08);} }
@keyframes pipBeat { from { transform: scale(1);} to { transform: scale(1.12);} }

body.shake-legendary .table { animation: shake .5s cubic-bezier(.36,.07,.19,.97) 2; }
@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
  40%, 60% { transform: translate3d(3px, 0, 0); }
}

/* ---------- Double panel ---------- */
.double-panel {
  display: none; position: absolute; left: 10px; right: 10px; top: 21%; bottom: 10px; z-index: 5;
  padding: clamp(8px, 1.4vh, 16px) 14px; border-radius: 14px;
  border: 1px solid rgba(224,32,58,.5);
  background: linear-gradient(180deg, rgba(50,6,14,.97), rgba(15,3,7,.97));
  box-shadow: 0 10px 30px rgba(0,0,0,.7), inset 0 0 40px rgba(224,32,58,.15);
  grid-template-rows: 1fr auto; align-items: center;
}
.double-panel.open { display: grid; animation: slideDown .35s ease; }
@keyframes slideDown { from { opacity: 0; transform: translateY(14px);} to { opacity: 1; transform: none;} }
.double-inner { display: flex; gap: clamp(16px, 3vw, 44px); align-items: center; justify-content: center; min-height: 0; }
.double-dealer-wrap, .double-picks-wrap { display: grid; justify-items: center; align-content: center; }
.double-dealer-wrap { padding-right: clamp(12px, 2vw, 32px); border-right: 1px solid rgba(212,175,55,.3); }
.double-label { display: block; text-align: center; margin-bottom: clamp(6px, 1vh, 12px); font-family: var(--font-display); font-size: clamp(10px, 1.4vh, 13px); letter-spacing: .24em; color: var(--gold); }
/* tamaño de carta del DOUBLE: grande, limitado por alto de la zona y por ancho (1 casa + 4 elecciones) */
.double-card {
  width: var(--double-w);
  aspect-ratio: 200/280; border-radius: 8%; overflow: hidden;
  border: 0; padding: 0; background: transparent; box-shadow: 0 10px 26px rgba(0,0,0,.65);
}
.double-dealer-wrap .double-card { box-shadow: 0 0 0 3px var(--gold), 0 0 26px rgba(212,175,55,.45), 0 10px 26px rgba(0,0,0,.65); }
.double-card svg { width: 100%; height: 100%; display: block; }
.double-picks { display: flex; gap: clamp(8px, 1.2vw, 16px); justify-content: center; }
.double-pick { cursor: pointer; transition: transform .18s, box-shadow .18s; }
.double-pick:not(:disabled):hover { transform: translateY(-8px) scale(1.03); box-shadow: 0 0 0 3px var(--gold), 0 0 22px rgba(212,175,55,.5), 0 12px 26px rgba(0,0,0,.6); }
.double-pick.revealed:not(.chosen) { filter: brightness(.45); transform: scale(.94); }
.double-pick.chosen.win { box-shadow: 0 0 0 4px var(--gold-2), 0 0 40px var(--gold); transform: translateY(-10px) scale(1.08); animation: winPulse .8s ease-in-out infinite alternate; }
.double-pick.chosen.lose { box-shadow: 0 0 0 4px var(--red-2), 0 0 30px var(--red); }
.double-pick.chosen.push { box-shadow: 0 0 0 4px var(--champagne); }
.double-message { margin: clamp(4px, 1vh, 10px) 0 0; text-align: center; font-family: var(--font-display); font-weight: 700; font-size: clamp(12px, 1.8vh, 17px); letter-spacing: .08em; color: var(--champagne); }

/* ---------- Console ---------- */
.console {
  grid-area: console;
  display: grid; grid-template-columns: clamp(250px, 24vw, 360px) minmax(0, 1fr); gap: clamp(8px, 1.2vw, 16px); align-items: stretch;
  padding: clamp(8px, 1.2vh, 14px) clamp(10px, 1.4vw, 16px); border-radius: 14px;
  border: 1px solid rgba(212,175,55,.3);
  background: linear-gradient(180deg, rgba(23,16,26,.9), rgba(11,10,14,.94));
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 10px 30px rgba(0,0,0,.6);
}
.hud { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.hud-item {
  padding: 4px 8px; display: grid; align-content: center; border-radius: 10px; text-align: center;
  background: linear-gradient(180deg, rgba(0,0,0,.6), rgba(30,6,14,.6));
  border: 1px solid rgba(212,175,55,.25); box-shadow: inset 0 2px 8px rgba(0,0,0,.7);
}
.hud-label { display: block; font-size: clamp(8px, 1.1vh, 10px); letter-spacing: .28em; color: var(--muted); }
.hud-value {
  display: block; font-family: var(--font-ui); font-weight: 700; font-size: clamp(18px, 3vh, 30px); line-height: 1.1;
  color: var(--gold-2); text-shadow: 0 0 12px rgba(212,175,55,.45); font-variant-numeric: tabular-nums;
}
.hud-win .hud-value { color: #fff3c4; }
.hud-bet .hud-value { color: var(--red-2); text-shadow: 0 0 12px rgba(224,32,58,.5); }

.controls { display: grid; grid-template-columns: 1fr 1fr 1.6fr 1fr 1fr; gap: clamp(4px, .6vw, 8px); align-items: stretch; padding-right: clamp(56px, 9vh, 104px); /* hueco para el logo de esquina */ }
.btn {
  border: 0; border-radius: 10px; padding: clamp(8px, 1.6vh, 14px) 6px; cursor: pointer;
  font-family: var(--font-display); font-weight: 900; letter-spacing: .08em; font-size: clamp(10px, 1.1vw, 15px); white-space: nowrap; min-width: 0;
  color: var(--ink); transition: transform .12s, filter .2s, box-shadow .2s;
  box-shadow: 0 4px 0 rgba(0,0,0,.6), 0 8px 18px rgba(0,0,0,.5);
  position: relative; overflow: hidden;
}
.btn:not(:disabled):hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn:not(:disabled):active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.6); }
.btn:disabled { opacity: .38; cursor: not-allowed; filter: grayscale(.4); }
.btn-secondary { background: linear-gradient(180deg, #3a2a2e, #1c1418); border: 1px solid rgba(212,175,55,.35); }
.btn-primary {
  font-size: clamp(14px, 1.6vw, 22px); color: #1a1206;
  background: linear-gradient(180deg, #fff2c2 0%, var(--gold) 50%, #a67c1c 100%);
  border: 1px solid #f6e7b4;
  box-shadow: 0 4px 0 #5a4410, 0 10px 24px rgba(212,175,55,.35);
}
.btn-primary:not(:disabled)::after {
  content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-20deg); animation: sheen 2.6s ease-in-out infinite;
}
@keyframes sheen { 0% { left: -60%; } 40%, 100% { left: 130%; } }
.btn-primary.is-draw {
  background: linear-gradient(180deg, #ff5c6e 0%, var(--red) 55%, #6d0a15 100%);
  color: #fff; border-color: #ff9aa7; box-shadow: 0 4px 0 #3a050b, 0 10px 24px rgba(224,32,58,.4);
}
.btn-accent { background: linear-gradient(180deg, #8b1024, #4a0a18); border: 1px solid rgba(255,120,140,.35); }
.btn-gold { background: linear-gradient(180deg, #6b5320, #3a2c10); border: 1px solid rgba(212,175,55,.5); color: var(--gold-2); }

.btn-link[hidden] { display: none; }
.btn-link { grid-column: 1 / -1; margin: 0 auto; display: block; padding: 3px 12px; font-size: 12px; background: none; border: 1px dashed var(--gold); color: var(--gold); padding: 6px 14px; border-radius: 8px; cursor: pointer; font-family: var(--font-ui); letter-spacing: .08em; }

/* ---------- Celebration overlay ---------- */
.celebration {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(circle at 50% 45%, rgba(0,0,0,.55), rgba(0,0,0,.85));
}
.celebration.show { opacity: 1; pointer-events: auto; }
.celebration-card {
  text-align: center; padding: 30px 46px; border-radius: 20px;
  border: 2px solid var(--gold); background: linear-gradient(180deg, rgba(40,6,14,.96), rgba(10,4,8,.96));
  box-shadow: 0 0 60px rgba(212,175,55,.45), 0 30px 80px rgba(0,0,0,.8);
  transform: scale(.7); transition: transform .45s cubic-bezier(.2,1.4,.4,1);
}
.celebration.show .celebration-card { transform: scale(1); }
.celebration-sub { margin: 0 0 6px; font-family: var(--font-display); letter-spacing: .34em; font-size: 12px; color: var(--red-2); }
.celebration-title {
  margin: 0; font-family: var(--font-display); font-weight: 900; font-size: clamp(30px, 6vw, 60px); letter-spacing: .06em; line-height: 1.05;
  background: linear-gradient(180deg, #fff6d5, var(--gold) 50%, var(--gold-3)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.celebration-amount {
  margin: 12px 0 0; font-family: var(--font-ui); font-weight: 700; font-size: clamp(38px, 8vw, 84px);
  color: #fff3c4; text-shadow: 0 0 24px var(--gold), 0 0 60px rgba(212,175,55,.6); font-variant-numeric: tabular-nums; line-height: 1;
}
.celebration.tier-legendary .celebration-card { animation: legendaryCard .9s ease-in-out infinite alternate; border-width: 3px; }
.celebration.tier-legendary .celebration-sub { color: var(--gold-2); font-size: 15px; }
@keyframes legendaryCard { from { box-shadow: 0 0 60px rgba(212,175,55,.45), 0 30px 80px rgba(0,0,0,.8);} to { box-shadow: 0 0 120px rgba(212,175,55,.9), 0 30px 80px rgba(0,0,0,.8);} }
.celebration.tier-epic .celebration-card { border-color: var(--red-2); box-shadow: 0 0 60px rgba(224,32,58,.5), 0 30px 80px rgba(0,0,0,.8); }
.celebration.tier-epic .celebration-title { background: linear-gradient(180deg, #ffe9e9, #ff5c6e 50%, var(--red)); -webkit-background-clip: text; background-clip: text; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .table {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas: "marquee" "paytable" "hand" "console";
  }
  .paytable { font-size: clamp(9px, 1.4vh, 13px); }
  .console { grid-template-columns: 1fr; }
  .controls { padding-right: 0; }
  .brand-corner { height: clamp(36px, 6vh, 60px); right: 10px; bottom: 8px; opacity: .85; }
}
@media (max-width: 640px) {
  .table { padding: 8px; }
  .pt-cell { padding: 0 5px; }
  .pt-head, .pt-row { grid-template-columns: minmax(84px, 1.6fr) repeat(5, 1fr); }
  .controls { grid-template-columns: 1fr 1fr; }
  .btn-primary { grid-column: 1 / -1; order: -1; }
  .hand-area { --double-w: min(120px, calc((100cqw - 60px) / 4.6), calc(30cqh * 200 / 280)); }
  .double-inner { flex-direction: column; gap: 8px; }
  .double-dealer-wrap { border-right: 0; padding-right: 0; }
  .double-panel { top: 18%; }
}
/* pantallas muy bajas (portátiles 16:9 pequeños): cartas más pequeñas */
@media (max-height: 640px) {
  .logo { height: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
