:root {
  --golfo: #17C3B2;
  --golfo-dark: #0B7189;
  --hondo: #0A4C70;
  --noche: #0B3554;
  --barranca: #ECB86E;
  --krill: #FF4D7A;
  --krill-dark: #D62E5C;
  --sol: #FFC93C;
  --sol-dark: #E0A400;
  --tinta: #1C2740;
  --gris: #5A6577;
  --papel: #FFF8E6;
  --papel-line: #E9D9B0;
  --nube: #F2F8FA;
  --menta: #7DFFD8;
  --abismo: #062A44;
  /* Atkinson Hyperlegible: hecha para leer fácil a cualquier edad. Lilita One: del argentino Juan Montoreano */
  --font: 'Atkinson Hyperlegible Next', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Lilita One', 'Atkinson Hyperlegible Next', system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
@font-face { font-family: 'Lilita One'; font-style: normal; font-weight: 400; font-display: swap; src: url(../../fonts/lilita-one-latin.woff2) format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible Next'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(../../fonts/atkinson-next-latin.woff2) format('woff2'); }

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  color: var(--tinta);
  font-family: var(--font);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
/* títulos, números grandes y botones de acción */
.score, .mult, .pop, .over-score, .btn-main, .ready-big, .panel-title, .sheet h2, .celebrate-card h2,
.stat-row b, .kpis b, .rank-list .pos, .profile-head h2, .avatar, .section-title,
.pz-bn, .pz-vs-x, .cb-bn, .cb-clock, .cb-pop, .kt-place b {
  font-family: var(--display); font-weight: 400; letter-spacing: .01em;
}
body {
  display: flex; justify-content: center; overflow: hidden;
  background: linear-gradient(180deg, #CFEFF8 0%, var(--nube) 55%);
}
@media (min-width: 700px) and (min-height: 600px) {
  body { align-items: center; background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(10, 76, 112, .25)), url(../img/arte/bahia.webp?v=1) center 62% / cover no-repeat, #CFEFF8; }
  #stage { height: calc(100dvh - 32px) !important; width: min(100vw, calc((100dvh - 32px) * 0.52)) !important; border-radius: 28px; box-shadow: 0 3px 0 #D8E7EC, 0 20px 50px rgba(10, 76, 112, .18); }
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* Proporción de celular aunque se abra en compu: todos ven la misma porción de juego */
#stage {
  position: relative;
  width: min(100vw, calc(100vh * 0.52));
  width: min(100vw, calc(100dvh * 0.52));
  height: 100vh; height: 100dvh;
  overflow: hidden;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  background: #6CC6E6;
}
#c { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

/* ---------- Efectos ---------- */
#fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
.pop {
  position: absolute; transform: translate(-50%, -50%);
  font-weight: 700; font-size: 18px; color: #fff; white-space: nowrap;
  text-shadow: 0 2px 0 rgba(10, 76, 112, .6);
  animation: pop .8s ease-out forwards;
}
.pop.star { color: var(--sol); font-size: 21px; }
.pop.big { font-size: 26px; color: var(--sol); }
.pop.huge { font-size: 34px; color: #fff; text-shadow: 0 3px 0 var(--krill-dark); }
@keyframes pop {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(.55); }
  14% { opacity: 1; transform: translate(-50%, -62%) scale(1.18); }
  26% { transform: translate(-50%, -70%) scale(.97); }
  36% { transform: translate(-50%, -78%) scale(1); }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -170%) scale(1); }
}
.tap-ripple {
  position: absolute; width: 74px; height: 74px; margin: -37px 0 0 -37px; border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, .85); box-shadow: 0 0 0 2px rgba(10, 76, 112, .15);
  animation: ripple .42s ease-out forwards; pointer-events: none;
}
@keyframes ripple { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tap-ripple { display: none; } }
/* destello al chocar o al ganar: el color entra por los bordes y el centro, donde se juega, queda limpio */
#flash {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .38s ease-out; z-index: 2;
  background: radial-gradient(ellipse 78% 62% at 50% 52%, rgba(255, 61, 99, 0) 38%, rgba(255, 61, 99, .55) 78%, rgba(214, 46, 92, .9) 100%);
}
#flash.on { opacity: .62; transition: none; }
#flash.gold { background: radial-gradient(ellipse 78% 62% at 50% 52%, rgba(255, 201, 60, 0) 34%, rgba(255, 214, 102, .6) 76%, rgba(255, 190, 40, .95) 100%); }

/* ---------- Marcador ---------- */
#hud { position: absolute; top: 0; left: 0; right: 0; padding: calc(var(--safe-top) + 10px) 14px 0; pointer-events: none; z-index: 2; }
.time { height: 8px; border-radius: 8px; background: rgba(28, 39, 64, .18); overflow: hidden; }
.time i { display: block; height: 100%; width: 100%; background: linear-gradient(180deg, #FFE08A 0 38%, var(--sol) 38%); border-radius: 8px; transform-origin: left; box-shadow: inset 0 -2px 0 rgba(224, 164, 0, .55); }
.hud-row { display: flex; justify-content: space-between; align-items: flex-start; margin-top: 8px; }
.score-wrap { display: flex; align-items: center; gap: 8px; }
.score { display: inline-block; transform-origin: 0 60%; font-size: 42px; font-weight: 700; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 3px 0 rgba(10, 76, 112, .5); }
.mult { background: var(--krill); color: #fff; font-weight: 700; font-size: 17px; padding: 3px 9px 4px; border-radius: 999px; box-shadow: 0 3px 0 var(--krill-dark); }
.mult.bump { animation: bump .35s ease-out; }
@keyframes bump { 0% { transform: scale(1.6) rotate(-6deg); } 100% { transform: scale(1); } }
.lives { display: flex; gap: 4px; padding-top: 4px; }
.lives svg { width: 34px; height: 22px; }
.lives svg { transform-origin: 50% 60%; }
.lives svg.lost { opacity: .25; }
.lives svg.drop { animation: life-drop .55s cubic-bezier(.3, 1.3, .5, 1); }
.lives svg.gain { animation: life-gain .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes life-drop { 0% { opacity: 1; transform: scale(1); } 22% { opacity: 1; transform: scale(1.45) rotate(-14deg); } 60% { opacity: .5; transform: scale(.82) rotate(8deg) translateY(3px); } 100% { opacity: .25; transform: none; } }
@keyframes life-gain { 0% { transform: scale(.2); } 60% { transform: scale(1.3); } 100% { transform: none; } }
.target {
  margin-top: 8px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 3px 10px;
  background: rgba(255, 255, 255, .85); border-radius: 12px; padding: 6px 10px 7px;
  box-shadow: 0 3px 0 rgba(10, 76, 112, .2); max-width: min(300px, calc(100% - 100px));   /* que no quede debajo del botón de pausa */
}
/* arriba el premio (si no entra, se corta); abajo la barrita y, a su derecha, lo que falta */
.target-label { display: contents; font-size: 14px; font-weight: 600; line-height: 1.15; }
.tl-t { grid-column: 1 / -1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; line-height: 1.2; }
.tl-n { grid-column: 2; grid-row: 2; white-space: nowrap; font-size: 13px; font-weight: 600; line-height: 1; color: var(--gris); }
.target .target-bar { grid-column: 1; grid-row: 2; }
.target.solo .target-bar { grid-column: 1 / -1; }
.tl-n b { font-family: var(--display); font-weight: 400; font-size: 15px; color: var(--tinta); font-variant-numeric: tabular-nums; }
.target-bar { height: 7px; border-radius: 7px; background: #E3EEF1; overflow: hidden; }
.target-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--krill), var(--sol)); border-radius: 7px; transition: width .15s; }
.target.won { background: var(--sol); animation: bump .45s ease-out; }
.target.leader .target-bar i { background: linear-gradient(90deg, #8B7CFF, var(--golfo)); }
.hud-tag { margin: 6px 0 0; font-size: 13px; font-weight: 600; display: inline-block; background: rgba(28, 39, 64, .7); color: #fff; padding: 3px 10px; border-radius: 999px; }

/* ---------- Pantallas ---------- */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; z-index: 4; }

/* ---------- Portada: arriba el mundo 3D del juego de la semana, abajo el golfo ---------- */
.hub-scroll { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; overscroll-behavior: contain; }
.hub-scroll > .tab-panel { min-height: 100%; display: flex; flex-direction: column; }
.tab-panel > .sea, .tab-panel > .panel.solo { flex: 1 0 auto; }
.hero { position: relative; isolation: isolate; padding: calc(var(--safe-top) + 12px) 18px 0; min-height: 46vh; min-height: 46dvh; display: flex; flex-direction: column; background: #8CCFF0; }
/* la portada: la playa dibujada y, si se puede, el mismo dibujo en movimiento */
.hero-art { position: absolute; inset: 0 0 -34px; z-index: -1; overflow: hidden; pointer-events: none; }
.hero-still, .hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 74% 100%; }
.hero-video { opacity: 0; transition: opacity .8s ease; }
.hero-video.on { opacity: 1; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.brand { display: flex; align-items: center; gap: 7px; text-decoration: none; font-weight: 700; font-size: 16px; color: var(--tinta);
  background: rgba(255, 255, 255, .92); padding: 4px 12px 4px 5px; border-radius: 999px; box-shadow: 0 3px 0 rgba(10, 76, 112, .2); }
.brand-mark { width: 26px; height: 26px; border-radius: 9px; background: url(../img/icon.svg?v=2) center / cover; }
.chip {
  border: 0; border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 15px;
  background: rgba(255, 255, 255, .92); box-shadow: 0 3px 0 rgba(10, 76, 112, .25); cursor: pointer;
  max-width: 60%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip.in { background: var(--noche); color: #fff; box-shadow: 0 3px 0 rgba(4, 30, 50, .5); }
.chip:empty { visibility: hidden; }
.sheet .muted a { color: var(--golfo-dark); font-weight: 600; }   /* links a las bases y a la privacidad */                 /* hasta que se sabe si entró o no */
.directo #hub { visibility: hidden; }
.hero-title {
  margin: 0; padding-top: 14px; max-width: 12ch;
  font-family: var(--display); font-weight: 400; font-size: clamp(33px, 9.4vw, 40px); line-height: .96; letter-spacing: .01em; color: var(--noche);
  text-shadow: 0 2px 0 rgba(255, 255, 255, .8), 0 0 24px rgba(255, 255, 255, .75);
}
.hero-live {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 6px 13px 6px 10px;
  border-radius: 999px; background: rgba(255, 255, 255, .9); color: var(--noche); font-size: 15px; font-weight: 700; line-height: 1.2;
  box-shadow: 0 3px 0 rgba(10, 76, 112, .2);
}
.live-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: #20B26C; animation: live 2s ease-out infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(32, 178, 108, .6); } 70%, 100% { box-shadow: 0 0 0 9px rgba(32, 178, 108, 0); } }

/* el golfo: se va oscureciendo hacia el fondo, con dos olas arriba */
.sea {
  position: relative; display: flex; flex-direction: column; gap: 16px; min-height: 70vh;
  padding: 2px 14px calc(var(--safe-bottom) + 108px); color: #fff;
  background: linear-gradient(180deg, #1BC3B4 0, #0F92A8 190px, #0B6790 460px, #0A4C70 820px, var(--abismo) 1500px);
}
.sea::before, .sea::after { content: ''; position: absolute; left: 0; right: 0; pointer-events: none; background-repeat: repeat-x; }
.sea::before {
  top: -26px; height: 28px; background-size: 150px 28px; opacity: .55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 28'%3E%3Cpath d='M0 16C25 4 50 4 75 16s50 12 75 0v12H0z' fill='%237DEBDD'/%3E%3C/svg%3E");
  animation: ola 11s linear infinite reverse;
}
.sea::after {
  top: -20px; height: 22px; background-size: 110px 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 110 22'%3E%3Cpath d='M0 12C18 3 37 3 55 12s37 9 55 0v10H0z' fill='%231BC3B4'/%3E%3C/svg%3E");
  animation: ola2 7s linear infinite;
}
@keyframes ola { to { background-position-x: 150px; } }
@keyframes ola2 { to { background-position-x: 110px; } }
.sea > * { position: relative; }
.sea-title { margin: 14px 2px 0; font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1; text-shadow: 0 3px 0 rgba(4, 34, 56, .35); }
.sea-note { margin: -8px 2px 0; font-size: 15px; line-height: 1.35; color: rgba(255, 255, 255, .86); }

/* Los anfitriones: la Galesa, el Tehuelche y Zorrito parados en un banco de arena, el que habla adelante */
.hosts { position: relative; margin: 6px -2px -4px; }
.hosts-bubble {
  position: relative; z-index: 2; margin: 0 6px; padding: 11px 16px 12px; border-radius: 22px; background: #fff; color: var(--tinta);
  box-shadow: 0 5px 0 rgba(4, 34, 56, .28); font-size: 16px; line-height: 1.3; min-height: 66px;
}
.hosts-bubble b { display: block; margin-bottom: 1px; font-family: var(--display); font-weight: 400; font-size: 19px; line-height: 1.05; color: var(--host, var(--golfo-dark)); }
.hosts-bubble::after {
  content: ''; position: absolute; bottom: -11px; left: var(--tail, 18%); margin-left: -12px;
  border: 12px solid transparent; border-top-color: #fff; border-bottom: 0; transition: left .35s cubic-bezier(.3, 1.4, .5, 1);
}
.hosts-row { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; height: 168px; margin-top: 4px; }
.hosts-row::before {
  content: ''; position: absolute; left: 4%; right: 4%; bottom: 2px; height: 40px; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 38%, #FBE7B8 0, #F1D08F 58%, #D9AE68 100%);
  box-shadow: 0 6px 0 rgba(4, 34, 56, .18), inset 0 -5px 0 rgba(160, 110, 40, .25);
}
.host {
  position: relative; display: flex; justify-content: center; align-items: flex-end; height: 100%; padding: 0; border: 0; background: none; cursor: pointer;
  transform-origin: 50% 100%; transform: translateY(-10px) scale(.95);
  transition: transform .35s cubic-bezier(.3, 1.4, .5, 1);
}
/* los tres están siempre: respiran despacio, cada uno a su ritmo; el que habla se adelanta y gesticula */
.host img { display: block; height: 150px; width: auto; max-width: 118%; filter: drop-shadow(0 4px 0 rgba(4, 34, 56, .16)); transform-origin: 50% 100%; animation: host-idle 3.6s ease-in-out infinite; }
.host:nth-child(2) img { animation-delay: -1.2s; animation-duration: 4s; }
.host:nth-child(3) img { animation-delay: -2.3s; animation-duration: 3.3s; }
.host.on { transform: translateY(-14px) scale(1); z-index: 1; }
.host.on img { animation: host-bob 2.8s ease-in-out infinite; }
.host:focus-visible { outline: 3px solid var(--sol); outline-offset: -3px; border-radius: 18px; }
@keyframes host-idle { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.012, .988); } }
@keyframes host-bob { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-5px) rotate(-1.5deg); } 60% { transform: translateY(0) rotate(1deg); } }
.hosts-bubble.swap b, .hosts-bubble.swap #host-line { animation: host-in .32s ease-out; }
@keyframes host-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .host, .hosts-bubble::after { transition: none; } .host img, .host.on img, .hosts-bubble.swap b, .hosts-bubble.swap #host-line { animation: none; } }

/* Juego de la semana: la figurita grande con su entrada al premio */
.feature { border-radius: 30px; box-shadow: 0 8px 0 rgba(4, 34, 56, .42), 0 22px 44px rgba(4, 34, 56, .3); color: var(--tinta); }
.feature-art {
  position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; cursor: pointer;
  border-radius: 30px 30px 0 0; overflow: hidden; background: var(--g1); border: 6px solid #fff; border-bottom: 0;
}
.feature-art img, .tile-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.feature-art svg { position: absolute; left: 50%; top: 52%; width: 58%; height: auto; transform: translate(-50%, -50%); filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .12)); }
.feature-art::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, .5) 50%, transparent 62%);
  transform: translateX(-130%); animation: brillo 7s ease-in-out 2.2s infinite;
}
@keyframes brillo { 0%, 78% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }
.ribbon {
  position: absolute; left: 10px; top: 12px; z-index: 1; padding: 6px 14px 8px; border-radius: 12px;
  font-family: var(--display); font-size: 18px; line-height: 1; color: var(--tinta); background: var(--sol);
  box-shadow: 0 3px 0 var(--sol-dark), 0 6px 14px rgba(0, 0, 0, .18); transform: rotate(-3deg);
}
.feature-body { display: flex; flex-direction: column; gap: 10px; padding: 12px 18px 18px; background: #fff; }
.feature-name { margin: 0; font-family: var(--display); font-weight: 400; font-size: 36px; line-height: .95; color: var(--g2); }
.feature-how { margin: -4px 0 0; font-size: 16px; line-height: 1.3; color: var(--gris); }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.facts li { display: flex; align-items: flex-start; gap: 9px; font-size: 15.5px; line-height: 1.3; }
.facts .ic { flex: none; width: 24px; font-size: 18px; line-height: 1.1; text-align: center; }
.facts b { font-weight: 800; }
.btn-big {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 66px; margin-top: 2px;
  border: 0; border-radius: 22px; cursor: pointer; background: var(--krill); color: #fff;
  font-family: var(--display); font-weight: 400; font-size: 30px; letter-spacing: .02em; text-shadow: 0 2px 0 rgba(140, 20, 60, .35);
  box-shadow: 0 6px 0 var(--krill-dark); transition: transform .08s, box-shadow .08s;
}
.btn-big svg { width: 24px; height: 24px; fill: #fff; filter: drop-shadow(0 2px 0 rgba(140, 20, 60, .35)); }
.btn-big:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--krill-dark); }

/* Cupón del premio mayor (cortado como entrada abajo de la figurita) */
.ticket { position: relative; display: flex; background: var(--papel); border-radius: 0 0 30px 30px; border-top: 2px dashed var(--papel-line);
  -webkit-mask: radial-gradient(circle 11px at 0 0, transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 11px at 100% 0, transparent 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 11px at 0 0, transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 11px at 100% 0, transparent 98%, #000) right / 51% 100% no-repeat; }
.ticket-main { flex: 1; padding: 14px 10px 16px 20px; min-width: 0; }
.ticket-kicker { margin: 0; font-size: 14px; font-weight: 700; color: #8A6A2E; }
.ticket-title { margin: 2px 0 3px; font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1.05; }
.ticket-detail { margin: 0; font-size: 14px; line-height: 1.3; color: #4A4A4A; }
.ticket-stub { width: 92px; flex: none; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 10px 14px 12px 8px; border-left: 2px dashed var(--papel-line); }
.stub-label { font-size: 13px; font-weight: 700; color: #8A6A2E; }
/* invitar a los amigos por WhatsApp: el Gran premio y los descuentos */
.ticket-share {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; padding: 7px 14px 7px 9px; border: 0; border-radius: 99px; cursor: pointer;
  font-size: 15px; font-weight: 700; color: #fff; background: #0F7B45; box-shadow: 0 3px 0 #0A5A32; transition: transform .08s, box-shadow .08s;
}
.ticket-share svg { width: 20px; height: 20px; flex: none; fill: #fff; }
.ticket-share svg path + path { fill: #0F7B45; }
.ticket-share:active { transform: translateY(3px); box-shadow: 0 0 0 #0A5A32; }
.ticket-share:focus-visible { outline: 3px solid var(--sol); outline-offset: 3px; }
.ticket-stub strong { font-family: var(--display); font-weight: 400; font-size: 21px; line-height: 1.05; font-variant-numeric: tabular-nums; }

/* El resto de los juegos: figuritas pegadas un poco torcidas */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 14px; }
.tile {
  --tilt: -1.4deg; position: relative; display: flex; flex-direction: column; align-items: stretch; text-align: left;
  padding: 6px 6px 13px; border: 0; border-radius: 24px; background: #fff; color: var(--tinta); font: inherit; cursor: pointer;
  box-shadow: 0 6px 0 rgba(4, 34, 56, .45), 0 14px 26px rgba(4, 34, 56, .25);
  transform: rotate(var(--tilt)); transition: transform .26s cubic-bezier(.3, 1.6, .5, 1), box-shadow .2s;
}
.tile:nth-child(4n+2) { --tilt: 1.2deg; } .tile:nth-child(4n+3) { --tilt: .8deg; } .tile:nth-child(4n) { --tilt: -1deg; }
.tile:active { transform: rotate(0deg) translateY(4px) scale(.965); box-shadow: 0 2px 0 rgba(4, 34, 56, .45), 0 6px 12px rgba(4, 34, 56, .2); transition-duration: .07s; }
.tile-art { position: relative; display: block; aspect-ratio: 1; border-radius: 19px; overflow: hidden; background: var(--g1); }
.tile-art svg { position: absolute; inset: 10%; width: 80%; height: 80%; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .1)); }
.tile-go {
  position: absolute; right: 8px; bottom: 8px; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--krill); box-shadow: 0 0 0 3px #fff, 0 4px 0 3px var(--krill-dark);
}
.tile-go svg { width: 19px; height: 19px; margin-left: 3px; fill: #fff; }
.tile-name { margin: 10px 6px 0; font-family: var(--display); font-weight: 400; font-size: 21px; line-height: 1; color: var(--g2); }
.tile-line { margin: 5px 6px 0; font-size: 14px; line-height: 1.25; color: var(--gris); }
.tile-line b { color: var(--tinta); font-weight: 800; }
.tile-flag {
  position: absolute; left: -4px; top: 14px; z-index: 1; padding: 4px 10px 6px; border-radius: 10px; transform: rotate(-6deg);
  font-family: var(--display); font-size: 16px; line-height: 1; color: #fff; background: var(--krill); box-shadow: 0 3px 0 var(--krill-dark);
}
.tile-flag.rank { color: var(--tinta); background: var(--sol); box-shadow: 0 3px 0 var(--sol-dark); }

/* entrada: todo sube desde el agua una sola vez al abrir */
.hub-pre .rise { opacity: 0; }
.hub-intro .rise { animation: rise .62s cubic-bezier(.22, 1.45, .45, 1) backwards; animation-delay: calc(var(--i, 0) * 70ms + 60ms); }
@keyframes rise { from { opacity: 0; transform: translateY(34px) rotate(var(--tilt, 0deg)) scale(.9); } to { opacity: 1; transform: rotate(var(--tilt, 0deg)); } }

.sea .invite { margin: 10px 4px 0; font-size: 15px; color: rgba(255, 255, 255, .86); }
.sea .link-btn { color: var(--menta); }
.sea .legal a { color: rgba(255, 255, 255, .75); }
.sea .legal.credit { color: rgba(255, 255, 255, .66); }
.sea .legal.credit a { color: #FFC93C; }
.sea .icon-btn { background-color: rgba(255, 255, 255, .9); }
.sea .notice { color: var(--tinta); }

.panel {
  background: var(--nube); border-radius: 26px 26px 0 0; padding: 18px 14px calc(var(--safe-bottom) + 108px);
  display: flex; flex-direction: column; gap: 14px; min-height: 64vh;
  box-shadow: 0 -8px 24px rgba(10, 76, 112, .18);
}
.panel.solo { min-height: 100%; border-radius: 0; padding-top: calc(var(--safe-top) + 18px); }
.panel-title { margin: 0; font-size: 32px; line-height: 1.05; color: var(--noche); }
.section-title { margin: 8px 0 0; font-size: 22px; color: var(--noche); }
.invite { margin: 2px 4px 0; font-size: 15px; color: var(--gris); }

.sponsor-cta { background: #fff; border-radius: 18px; padding: 14px; border: 2px dashed #CFE0E5; }
.sponsor-cta h3 { margin: 0; font-size: 19px; }
.sponsor-cta p { margin: 4px 0 10px; font-size: 14px; color: var(--gris); line-height: 1.3; }

/* Botones */
.btn { appearance: none; border: 0; cursor: pointer; border-radius: 18px; padding: 12px 16px; font-weight: 600; font-size: 17px; transition: transform .08s; }
.btn:active { transform: translateY(3px); }
.btn:disabled { opacity: .6; }
.btn:focus-visible, .tab:focus-visible, .icon-btn:focus-visible, .chip:focus-visible, .tabbar-btn:focus-visible,
.tile:focus-visible, .feature-art:focus-visible, .btn-big:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .link-btn:focus-visible {
  outline: 3px solid var(--sol); outline-offset: 3px;
}
.btn-play { display: flex; flex-direction: column; align-items: center; width: 100%; background: var(--krill); color: #fff; padding: 13px 16px 12px; box-shadow: 0 5px 0 var(--krill-dark); }
.btn-play:active { box-shadow: 0 2px 0 var(--krill-dark); }
.btn-main { font-size: 27px; line-height: 1; letter-spacing: .02em; }
.btn-sub { font-size: 14px; font-weight: 500; opacity: .95; margin-top: 2px; }
.btn-ghost { background: rgba(255, 255, 255, .88); color: var(--tinta); box-shadow: 0 4px 0 rgba(10, 76, 112, .3); }
.btn-ghost.dark { background: #EAF4F6; box-shadow: 0 4px 0 #C9DDE2; }
.link-btn { background: none; border: 0; color: var(--golfo-dark); text-decoration: underline; font-size: 15px; cursor: pointer; padding: 4px; }
.legal { margin: 0; display: flex; justify-content: center; align-items: center; gap: 14px; font-size: 13px; }
.legal a { color: var(--gris); }
.legal.credit { gap: 0; margin-top: 6px; flex-wrap: wrap; color: var(--gris); }
.legal.credit a:first-child { font-weight: 700; }
.icon-btn { width: 38px; height: 38px; border: 0; border-radius: 50%; background: #E3EEF1 center / 20px no-repeat; cursor: pointer; flex: none; }
#btn-sound { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C2740' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10v4h4l5 4V6L8 10z' fill='%231C2740'/%3E%3Cpath d='M16.5 8.5a5 5 0 0 1 0 7M19 6a8.5 8.5 0 0 1 0 12'/%3E%3C/svg%3E"); }
#btn-sound.off { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C2740' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10v4h4l5 4V6L8 10z' fill='%231C2740'/%3E%3Cpath d='M17 9l5 6M22 9l-5 6'/%3E%3C/svg%3E"); }
.icon-btn.close { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C2740' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E"); background-size: 18px; }

/* Barra de pestañas: flota abajo; la pastilla de color se desliza a la sección elegida */
.tabbar {
  position: absolute; left: 10px; right: 10px; bottom: calc(var(--safe-bottom) + 10px); z-index: 5;
  display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px;
  background: rgba(255, 255, 255, .97); border-radius: 26px;
  box-shadow: 0 2px 0 rgba(4, 34, 56, .12), 0 12px 30px rgba(4, 34, 56, .32);
}
.tabbar::before {
  content: ''; position: absolute; top: 6px; bottom: 6px; left: 6px; width: calc((100% - 12px) / 4); border-radius: 20px;
  background: #FFE3EA; transform: translateX(calc(var(--tab-i, 0) * 100%)); transition: transform .38s cubic-bezier(.3, 1.35, .5, 1);
}
.tabbar-btn {
  position: relative; z-index: 1; border: 0; background: none; cursor: pointer; border-radius: 20px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 13px; font-weight: 700; color: #6B7689; padding: 6px 0 5px;
}
.tabbar-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.tabbar-btn[aria-current="page"] { color: var(--krill-dark); }
.tabbar-btn[aria-current="page"] svg { transform: translateY(-1px) scale(1.1); }
.badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--krill); color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 5px; }

#notice:empty { display: none; }
.notice { background: #fff; border-radius: 14px; padding: 11px 14px; font-size: 15px; line-height: 1.3; box-shadow: 0 4px 0 rgba(10, 76, 112, .12); }
.notice b { font-weight: 700; }
.code { display: inline-block; font-weight: 700; font-size: 20px; letter-spacing: .1em; background: var(--sol); padding: 1px 8px; border-radius: 6px; font-variant-numeric: tabular-nums; }

/* Hojas */
.sheet-screen { justify-content: flex-end; background: rgba(10, 52, 84, .4); }
.sheet {
  background: #fff; border-radius: 24px 24px 0 0;
  padding: 20px 18px calc(var(--safe-bottom) + 18px);
  display: flex; flex-direction: column; gap: 12px; max-height: 94%; overflow-y: auto; touch-action: pan-y;
  animation: sheet .42s cubic-bezier(.2, 1.18, .36, 1);
}
@keyframes sheet { from { transform: translateY(56px); opacity: 0; } 40% { opacity: 1; } to { transform: none; opacity: 1; } }
.sheet-screen { animation: dim .25s ease-out; }
@keyframes dim { from { background-color: rgba(10, 52, 84, 0); } }
.sheet h2 { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.1; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.muted { margin: 0; color: var(--gris); font-size: 15px; line-height: 1.35; }
.muted.small { font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 5px; font-weight: 500; font-size: 15px; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 18px; padding: 11px 12px; border: 2px solid #CFE0E5; border-radius: 12px;
  background: #F6FBFC; color: var(--tinta); resize: vertical;
}
.field-error { margin: 0; color: var(--krill-dark); font-weight: 500; }
/* Entrar con Google: el botón oficial arriba y una rayita con "o con un apodo y una clave" */
.g-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.g-btn { width: 100%; min-height: 44px; display: flex; justify-content: center; }
.g-or { position: relative; width: 100%; margin: 2px 0 0; text-align: center; font-size: 13px; color: var(--gris); }
.g-or::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--linea, #E2ECEF); }
.g-or span { position: relative; padding: 0 10px; background: #fff; }
/* la casilla de mayor de 18 al crear la cuenta */
.adult-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.35; font-weight: 500; cursor: pointer; }
.adult-check input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--golfo-dark, #0F86A0); }
.sheet-actions { display: flex; flex-direction: column; gap: 10px; }
.sheet-actions.two { display: grid; grid-template-columns: 1fr 1fr; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: #E7F1F3; border-radius: 14px; padding: 4px; }
.tab { border: 0; background: none; border-radius: 10px; padding: 9px 6px; font-weight: 600; cursor: pointer; font-size: 15px; }
.tab[aria-selected="true"] { background: #fff; box-shadow: 0 2px 0 #C9DDE2; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpis div { background: #EAF4F6; border-radius: 12px; padding: 8px; text-align: center; }
.kpis b { display: block; font-size: 22px; }
.kpis span { font-size: 12px; color: var(--gris); }

/* figurita del jugador en la hoja de entrar */
.me-card {
  display: grid; grid-template-columns: 60px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  margin: 2px 6px 2px; padding: 12px 16px 13px 12px; border-radius: 22px; color: #fff;
  background: linear-gradient(135deg, #17C3B2 0%, #0F86A0 100%); box-shadow: 0 5px 0 #0B6B80; transform: rotate(-1.4deg);
}
.me-av {
  grid-row: 1 / 3; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--krill-dark); font-family: var(--display); font-size: 32px; box-shadow: 0 0 0 4px rgba(255, 255, 255, .35);
}
.me-av.bumped { animation: bump .35s ease-out; }
.me-name { align-self: end; font-family: var(--display); font-size: 27px; line-height: 1.05; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-city { align-self: start; font-size: 15px; font-weight: 700; opacity: .92; }

/* Antes de arrancar */
#ready, #pause { justify-content: center; align-items: center; padding: 20px; background: rgba(10, 52, 84, .18); }
/* Botón grande de acción (Torre: Soltar). Es parte del juego: tocarlo es lo mismo que tocar la pantalla */
.tap-btn {
  position: absolute; left: 50%; bottom: calc(var(--safe-bottom) + 26px); z-index: 6; width: 124px; height: 124px; margin-left: -62px; padding: 0; border: 0; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--sol); color: #6B4200; box-shadow: 0 6px 0 var(--sol-dark); cursor: pointer; touch-action: none;
  font-family: var(--display); font-weight: 400; font-size: 19px; letter-spacing: .02em; -webkit-user-select: none; user-select: none;
}
.tap-btn svg { width: 46px; height: 46px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.tap-btn.on { transform: translateY(4px); box-shadow: 0 2px 0 var(--sol-dark); }
.tap-btn.hint { animation: tap-hint .6s ease-in-out infinite alternate; }
@keyframes tap-hint { to { box-shadow: 0 6px 0 var(--sol-dark), 0 0 0 14px rgba(255, 201, 60, .42); } }
@media (prefers-reduced-motion: reduce) { .tap-btn.hint { animation: none; box-shadow: 0 6px 0 var(--sol-dark), 0 0 0 8px rgba(255, 201, 60, .42); } }

/* Botón de pausa mientras jugás (arriba a la derecha, debajo del marcador de cada juego) */
.pause-btn {
  position: absolute; right: 12px; top: calc(var(--safe-top) + 104px); z-index: 6; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, .9); color: var(--tinta); cursor: pointer;
  box-shadow: 0 3px 0 rgba(10, 52, 84, .28); touch-action: manipulation;
}
.pause-btn svg { width: 20px; height: 20px; fill: currentColor; }
.pause-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(10, 52, 84, .28); }
.pause-btn:focus-visible { outline: 3px solid var(--sol); outline-offset: 3px; }
.pause-card { width: 100%; max-width: 320px; padding: 20px 18px 18px; }
.pause-note { margin: 6px 0 0; font-size: 15px; color: var(--gris); }
.pause-note:empty { display: none; }
.pause-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.pause-actions .btn-main { font-size: 24px; }
.ready-card { background: rgba(255, 255, 255, .96); border-radius: 22px; padding: 18px 18px 16px; text-align: center; max-width: 330px; box-shadow: 0 6px 0 rgba(10, 76, 112, .25), 0 18px 40px rgba(10, 52, 84, .18); animation: zoom .42s cubic-bezier(.2, 1.4, .4, 1); }
.ready-game { margin: 0 0 6px; font-weight: 700; color: var(--golfo-dark); font-size: 16px; }
.ready-big { margin: 0; font-size: 23px; font-weight: 700; line-height: 1.15; text-wrap: balance; }
.ready-list { list-style: none; padding: 0; margin: 14px 0 4px; text-align: left; font-size: 15px; display: grid; gap: 7px; }
.ready-list li { display: flex; align-items: center; gap: 9px; }
.ready-goal { margin: 10px 0 0; font-size: 15px; background: var(--papel); border-radius: 10px; padding: 7px 9px; }
.ready-goal:empty { display: none; }
.ready-go { margin: 12px 0 0; font-weight: 600; color: var(--krill-dark); animation: blink 1.4s ease-in-out infinite; }
.ready-mode { margin: 6px 0 0; font-size: 13px; color: var(--gris); }
.ready-back { position: absolute; left: 16px; top: calc(var(--safe-top) + 14px); border: 0; border-radius: 999px; background: rgba(255, 255, 255, .9); padding: 7px 14px; font-weight: 600; cursor: pointer; }
@keyframes blink { 50% { opacity: .45; } }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; display: inline-block; }
.dot.krill { background: var(--krill); }
.dot.star { background: var(--sol); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); border-radius: 0; width: 17px; height: 17px; }
.dot.danger { background: #E2483F; border-radius: 4px; }
.dot.jump { background: var(--golfo); border-radius: 4px 4px 50% 50%; }
.dot.cake { background: #7A3B22; border-radius: 3px; box-shadow: inset 0 -4px 0 #FFE9C7; }
.dot.fish { background: #4CB7FF; border-radius: 50% 30% 30% 50%; }
.dot.gold { background: var(--sol); }

/* Fin de partida */
.over-sheet { text-align: center; align-items: stretch; }
.over-reason { margin: 0; font-size: 19px; font-weight: 600; color: var(--golfo-dark); }
.over-score { display: block; font-size: 64px; font-weight: 700; line-height: 1; color: var(--noche); font-variant-numeric: tabular-nums; text-shadow: 0 3px 0 #E3EEF1; }
.over-record { margin: 0; font-size: 16px; font-weight: 500; min-height: 1.2em; }
.over-record.new {
  position: relative; align-self: center; overflow: hidden; padding: 5px 14px 6px; border-radius: 999px;
  font-family: var(--display); font-weight: 400; font-size: 18px; color: var(--tinta); background: var(--sol); box-shadow: 0 3px 0 var(--sol-dark);
  animation: zoom .45s cubic-bezier(.2, 1.6, .4, 1);
}
.over-record.new::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .7) 50%, transparent 65%);
  transform: translateX(-120%); animation: brillo-1 1.1s ease-in-out .5s forwards;
}
@keyframes brillo-1 { to { transform: translateX(120%); } }
.over-stats { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; gap: 7px 8px; font-size: 15px; flex-wrap: wrap; }
.over-stats li { display: flex; align-items: center; gap: 6px; padding: 4px 12px 4px 9px; border-radius: 999px; background: #F1F7F9; animation: stat-in .4s cubic-bezier(.2, 1.3, .4, 1) backwards; }
.over-stats li:nth-child(2) { animation-delay: .08s; } .over-stats li:nth-child(3) { animation-delay: .16s; } .over-stats li:nth-child(4) { animation-delay: .24s; }
@keyframes stat-in { from { opacity: 0; transform: translateY(8px) scale(.9); } }
.over-stats b { font-family: var(--display); font-weight: 400; font-size: 18px; }
.over-rank { margin: 0; font-size: 16px; background: #EEF7F8; border-radius: 12px; padding: 9px 10px; }
.over-rank:empty { display: none; }
.over-chase { margin: 0; font-size: 16px; font-weight: 600; color: #fff; background: linear-gradient(90deg, #8B7CFF, var(--golfo)); border-radius: 12px; padding: 9px 10px; }
#over-won:empty { display: none; }
#over-won { display: flex; flex-direction: column; gap: 8px; }

/* Cupones */
.coupon {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; text-align: left;
  background: var(--papel); border-radius: 14px; padding: 11px 13px; border: 2px dashed var(--papel-line);
}
.coupon h4 { margin: 0; font-size: 17px; line-height: 1.15; }
.coupon p { margin: 2px 0 0; font-size: 13px; color: var(--gris); }
.coupon.used { opacity: .55; }
.coupon .code { font-size: 18px; }
.wa-jema { display: inline-block; margin-top: 7px; padding: 7px 14px; border-radius: 999px; background: #0F7B45; color: #fff; font-size: 14px; font-weight: 700; text-decoration: none; box-shadow: 0 3px 0 #0A5A32; }
.coupon p .wa-jema { color: #fff; }
.coupons-empty { background: #fff; border-radius: 14px; padding: 16px; text-align: center; color: var(--gris); font-size: 15px; line-height: 1.35; }
.goal-list { display: flex; flex-direction: column; gap: 8px; }
.goal-row { background: #fff; border-radius: 14px; padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.goal-row h4 { margin: 0; font-size: 16px; }
.goal-row p { margin: 2px 0 0; font-size: 13px; color: var(--gris); }
.goal-row .left { font-weight: 700; font-size: 14px; text-align: right; }
.goal-row.mine { box-shadow: inset 0 0 0 2px var(--sol); }

/* Caras pintadas de los personajes en el ranking y el perfil, con un aro del color elegido */
.av-emo.face { background: #fff; border: 2px solid var(--c, #fff); box-shadow: none; overflow: hidden; font-size: 1.1em; vertical-align: middle; margin-top: -2px; }
.rank-list .who { padding-top: 3px; }
.av-emo.face img, .avatar.face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.face { background: #fff; box-shadow: 0 0 0 3px var(--c, var(--sol)); overflow: hidden; padding: 0; }

/* Gran premio: el mismo papel del ticket de la portada */
.month-card { margin: 0 0 12px; background: var(--papel); border: 2px dashed var(--papel-line); border-radius: 16px; padding: 13px 15px; }
.month-card .mc-kicker { font-size: 13px; font-weight: 700; color: #8A6A2E; }
.month-card h4 { margin: 2px 0 2px; font-family: var(--display); font-weight: 400; font-size: 21px; line-height: 1.08; }
.month-card p { margin: 5px 0 0; font-size: 14px; line-height: 1.35; color: #4A4A4A; }
.month-card .mc-me { color: var(--tinta); font-size: 15px; }
.month-card .mc-places { list-style: none; margin: 6px 0 2px; padding: 0; display: grid; gap: 4px; }
.month-card .mc-places li { display: grid; grid-template-columns: 26px 1fr; align-items: baseline; font-family: var(--display); font-size: 18px; line-height: 1.12; }
.month-card .mc-places li:first-child { font-size: 21px; }
.month-card .mc-places span { font-size: 17px; }
.over-month { margin: 0; font-size: 15px; line-height: 1.3; background: var(--papel); border: 2px dashed var(--papel-line); border-radius: 12px; padding: 8px 10px; }
.over-month[hidden] { display: none; }
.chip-game.month { background: var(--papel); box-shadow: inset 0 0 0 2px var(--papel-line); }
.chip-game.month[aria-selected="true"] { background: var(--sol); color: var(--tinta); box-shadow: none; }

/* Ranking */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; touch-action: pan-x; }
.chip-game { border: 0; border-radius: 999px; padding: 7px 14px; font-weight: 600; cursor: pointer; background: #E7F1F3; white-space: nowrap; }
.chip-game[aria-selected="true"] { background: var(--tinta); color: #fff; }
.rank-prize { margin: 0; font-size: 14px; background: var(--papel); border-radius: 10px; padding: 8px 10px; }
.rank-prize:empty { display: none; }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; padding: 9px 6px; border-bottom: 1px solid #E3EEF1; font-size: 16px; }
.rank-list .pos { font-weight: 700; text-align: center; color: var(--gris); }
.rank-list li:nth-child(-n+3) .pos { font-size: 20px; }
.rank-list .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.rank-list .who small { display: block; font-size: 12px; color: #7A8597; font-weight: 400; }
.rank-list .pts { font-weight: 700; font-variant-numeric: tabular-nums; }
.rank-list li.me { background: #FFEFF3; border-radius: 10px; }
.rank-list .empty { display: block; text-align: center; color: var(--gris); padding: 28px 10px; border: 0; }
.rank-me { margin: 0; font-size: 15px; text-align: center; color: var(--gris); }
.challenge { background: none; border: 0; color: var(--golfo-dark); text-decoration: underline; font-size: 12px; padding: 0; cursor: pointer; }

/* Perfil */
.profile-head { display: flex; gap: 12px; align-items: center; }
.avatar { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--krill), var(--sol)); flex: none; }
.profile-head h2 { margin: 0; font-size: 26px; }
.profile-head p { margin: 2px 0 0; color: var(--gris); }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-row div { background: #fff; border-radius: 14px; padding: 10px 6px; text-align: center; }
.stat-row b { display: block; font-size: 24px; line-height: 1.1; }
.stat-row span { font-size: 12px; color: var(--gris); }
.my-games { display: grid; gap: 8px; }
.my-game { background: #fff; border-radius: 14px; padding: 10px 12px; display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 15px; }
.my-game b { font-variant-numeric: tabular-nums; }
.ach-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ach { background: #fff; border-radius: 14px; padding: 10px 6px; text-align: center; font-size: 12px; line-height: 1.2; color: var(--gris); }
.ach .ic { font-size: 30px; line-height: 1.1; display: block; margin-bottom: 4px; filter: grayscale(1); opacity: .35; }
.ach b { display: block; color: var(--tinta); font-size: 13px; margin-bottom: 2px; }
.ach.on { background: linear-gradient(160deg, #FFF6D6, #fff); box-shadow: inset 0 0 0 2px var(--sol); }
.ach.on .ic { filter: none; opacity: 1; }
.ach .prize { display: block; margin-top: 4px; color: var(--krill-dark); font-weight: 600; }
.profile-actions { display: flex; gap: 10px; }
.profile-actions .btn { flex: 1; }

/* Festejo */
#celebrate { justify-content: center; align-items: center; padding: 24px; background: rgba(10, 52, 84, .55); z-index: 9; }
.celebrate-card {
  position: relative; background: #fff; border-radius: 26px; padding: 22px 18px 18px; text-align: center; max-width: 330px; width: 100%;
  box-shadow: 0 8px 0 rgba(0, 0, 0, .15); animation: zoom .45s cubic-bezier(.2, 1.6, .4, 1);
}
@keyframes zoom { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.celebrate-card > * { position: relative; z-index: 1; }
.celebrate-card::before {
  content: ''; position: absolute; left: 50%; top: -36px; width: 190px; height: 190px; margin-left: -95px; z-index: 0; pointer-events: none;
  background: repeating-conic-gradient(rgba(255, 201, 60, .5) 0 10deg, rgba(255, 201, 60, 0) 10deg 30deg);
  -webkit-mask: radial-gradient(circle, #000 18%, transparent 68%); mask: radial-gradient(circle, #000 18%, transparent 68%);
  animation: rays 14s linear infinite;
}
@keyframes rays { to { transform: rotate(360deg); } }
.celebrate-card .big-ic { font-size: 64px; line-height: 1; display: block; animation: wobble 1.2s ease-in-out infinite; filter: drop-shadow(0 4px 0 rgba(10, 52, 84, .12)); }
@keyframes wobble { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg) scale(1.06); } }
.celebrate-card h2 { margin: 8px 0 4px; font-size: 27px; line-height: 1.1; }
.celebrate-card p { margin: 0 0 12px; color: var(--gris); font-size: 16px; line-height: 1.35; }
.celebrate-card .coupon { margin-bottom: 14px; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: fall linear forwards; transform: rotate(var(--r0, 0deg)); }
@keyframes fall {
  from { transform: translate3d(0, 0, 0) rotate(var(--r0, 0deg)) rotate3d(var(--ax, 1), var(--ay, 0), 0, 0deg); }
  to { transform: translate3d(var(--dx, 0px), 110vh, 0) rotate(calc(var(--r0, 0deg) + 540deg)) rotate3d(var(--ax, 1), var(--ay, 0), 0, 1080deg); }
}

/* Aviso */
#toast {
  position: absolute; left: 50%; bottom: calc(var(--safe-bottom) + 84px); transform: translateX(-50%);
  background: var(--tinta); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 15px;
  max-width: 90%; text-align: center; z-index: 20; box-shadow: 0 8px 22px rgba(10, 52, 84, .25);
  animation: toast-in .3s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px) scale(.94); } }

@media (prefers-reduced-motion: reduce) {
  .ready-go, .sheet, .celebrate-card, .celebrate-card .big-ic, .mult.bump, .target.won, .live-dot, .sea::before, .sea::after, .feature-art::after, .hub-intro .rise { animation: none; }
  .ready-card, .sheet-screen, .over-record.new, .over-record.new::after, .over-stats li, .celebrate-card::before, #toast, .lives svg.drop, .lives svg.gain { animation: none; }
  .tabbar::before, .tile { transition: none; }
  .hero-video { display: none; }
  .confetti { display: none; }
}

/* Aro que gira mientras baja el modelo 3D de un personaje (decor.js: spin) */
.mf-spin {
  position: fixed; left: 50%; top: 27%; width: 42px; height: 42px; margin: -21px 0 0 -21px; z-index: 30; pointer-events: none;
  border-radius: 50%; border: 4px solid rgba(255, 255, 255, .55); border-top-color: var(--krill, #FF4D7A);
  box-shadow: 0 2px 10px rgba(10, 52, 84, .18); opacity: 0; transform: scale(.7);
  transition: opacity .18s ease, transform .18s ease; animation: mf-spin .8s linear infinite;
}
.mf-spin.on { opacity: 1; transform: scale(1); }
@keyframes mf-spin { to { rotate: 360deg; } }
@media (prefers-reduced-motion: reduce) { .mf-spin { animation-duration: 2.4s; } }
