/* =========================================================
   Cultura Chupística — estilos
   Mobile-first · party neon · card FX
   ========================================================= */

:root {
  --bg: #0b0614;
  --bg-elev: #140a22;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-2: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.12);
  --text: #f7f2ff;
  --text-muted: rgba(247, 242, 255, 0.68);
  --text-dim: rgba(247, 242, 255, 0.45);
  --primary: #ff4d6d;
  --primary-2: #ff8fa3;
  --accent: #c77dff;
  --cyan: #00f5d4;
  --gold: #ffe66d;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 28px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --font: "Outfit", system-ui, sans-serif;
  --display: "Space Grotesk", "Outfit", system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --topbar-h: 64px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  overflow-x: hidden;
  /* topbar + optional site-notice */
  padding-top: calc(var(--topbar-h) + var(--safe-t) + 34px);
  padding-bottom: calc(24px + var(--safe-b));
}

body.playing {
  padding-top: calc(var(--topbar-h) + var(--safe-t));
}

body.playing .site-notice {
  display: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- Background FX ---------- */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: float 18s ease-in-out infinite;
}

.blob-1 {
  width: min(70vw, 480px);
  height: min(70vw, 480px);
  background: #ff4d6d;
  top: -10%;
  left: -15%;
}

.blob-2 {
  width: min(60vw, 400px);
  height: min(60vw, 400px);
  background: #7b2cbf;
  bottom: 5%;
  right: -10%;
  animation-delay: -6s;
}

.blob-3 {
  width: min(50vw, 320px);
  height: min(50vw, 320px);
  background: #00f5d4;
  top: 40%;
  left: 40%;
  opacity: 0.2;
  animation-delay: -12s;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(0.95); }
}

/* ---------- Topbar ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: calc(var(--topbar-h) + var(--safe-t));
  padding: var(--safe-t) 16px 0;
  background: rgba(11, 6, 20, 0.72);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(255, 77, 109, 0.25), rgba(199, 125, 255, 0.18));
  border: 1px solid rgba(255, 77, 109, 0.35);
  color: var(--primary-2);
  box-shadow: 0 4px 16px rgba(255, 77, 109, 0.2);
}

.brand-mark .icon {
  display: block;
}

.brand-logo {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 10px;
  display: block;
  background: transparent;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

.brand-text {
  line-height: 1.15;
}

/* ---------- Icons system ---------- */
.icon {
  display: block;
  flex-shrink: 0;
  vertical-align: middle;
}

.icon-badge {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: color-mix(in srgb, var(--badge-accent, var(--primary)) 95%, white);
  background:
    linear-gradient(145deg,
      color-mix(in srgb, var(--badge-accent, var(--primary)) 28%, transparent),
      color-mix(in srgb, var(--badge-accent, var(--primary)) 10%, transparent));
  border: 1px solid color-mix(in srgb, var(--badge-accent, var(--primary)) 42%, transparent);
  box-shadow:
    0 8px 24px color-mix(in srgb, var(--badge-accent, var(--primary)) 22%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.btn-icon-left {
  gap: 8px;
}

.btn-icon-only {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
}

.btn-icon-only .icon {
  margin: 0 auto;
}

.brand-text {
  font-family: var(--display);
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text em {
  font-style: normal;
  color: var(--primary-2);
}

.nav-pills {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow-x: auto;
  max-width: 60vw;
  scrollbar-width: none;
}

.nav-pills::-webkit-scrollbar {
  display: none;
}

.nav-pill {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.nav-pill:hover {
  color: var(--text);
}

.nav-pill.active {
  background: linear-gradient(135deg, var(--primary), #c9184a);
  color: white;
  box-shadow: 0 4px 16px rgba(255, 77, 109, 0.35);
}

@media (max-width: 420px) {
  .brand-text {
    display: none;
  }
  .nav-pill {
    padding: 8px 10px;
    font-size: 0.72rem;
  }
}

/* ---------- Layout ---------- */
#app {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.view {
  animation: viewIn 0.45s var(--ease-out);
}

.view[hidden] {
  display: none !important;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-head {
  text-align: center;
  margin-bottom: 28px;
  max-width: 560px;
  margin-inline: auto;
}

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 10px;
}

.section-head h2 {
  font-family: var(--display);
  font-size: clamp(1.75rem, 5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.section-lead {
  color: var(--text-muted);
  font-size: 1.02rem;
}

.section-cta {
  display: flex;
  justify-content: center;
  margin-top: 36px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s var(--ease-out), box-shadow 0.2s, background 0.2s, border-color 0.2s;
  white-space: nowrap;
  user-select: none;
  touch-action: manipulation;
}

.btn:active:not(:disabled) {
  transform: scale(0.96);
}

.btn-lg {
  padding: 16px 28px;
  font-size: 1.05rem;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.btn-primary {
  background: linear-gradient(135deg, #ff4d6d 0%, #c9184a 55%, #9b0d35 100%);
  color: white;
  box-shadow: 0 8px 28px rgba(255, 77, 109, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 12px 36px rgba(255, 77, 109, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.28);
  background: var(--surface);
}

.btn-icon {
  transition: transform 0.2s;
}

.btn-primary:hover .btn-icon {
  transform: translateX(3px);
}

.btn-play {
  min-width: min(240px, 55vw);
  padding: 16px 28px;
  font-size: 1.05rem;
}

/* ---------- Welcome / Hero ---------- */
#view-welcome {
  display: grid;
  gap: 40px;
  align-items: center;
}

@media (min-width: 900px) {
  #view-welcome {
    grid-template-columns: 1.1fr 0.9fr;
    min-height: calc(100dvh - var(--topbar-h) - 80px);
    gap: 32px;
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(0, 245, 212, 0.6);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 245, 212, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(0, 245, 212, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 245, 212, 0); }
}

.hero-title {
  font-family: var(--display);
  font-size: clamp(2.2rem, 8vw, 3.6rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.04em;
  margin-bottom: 16px;
}

.gradient-text {
  background: linear-gradient(120deg, #ff4d6d, #c77dff 45%, #00f5d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% auto;
  animation: shine 6s linear infinite;
}

@keyframes shine {
  to { background-position: 200% center; }
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 28px;
}

.hero-sub strong {
  color: var(--primary-2);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 36px;
}

.hero-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stat {
  flex: 1;
  min-width: 90px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-icon {
  color: var(--gold);
  opacity: 0.9;
  margin-bottom: 4px;
}

.stat-num {
  display: block;
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* Floating preview cards */
.preview-cards {
  position: relative;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
}

.float-card {
  position: absolute;
  width: min(220px, 70vw);
  padding: 22px 20px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(30, 16, 48, 0.95), rgba(20, 10, 34, 0.9));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.float-card .fc-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  margin-bottom: 12px;
  color: var(--primary-2);
  background: rgba(255, 77, 109, 0.18);
  border: 1px solid rgba(255, 77, 109, 0.3);
}

.float-card .fc-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
  background: rgba(255, 77, 109, 0.2);
  color: var(--primary-2);
}

.float-card p {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.25;
}

.fc-1 {
  transform: rotate(-8deg) translate(-40px, 10px);
  z-index: 1;
  animation: cardFloat 5s ease-in-out infinite;
}

.fc-2 {
  transform: rotate(4deg) translate(20px, -30px);
  z-index: 3;
  border-color: rgba(199, 125, 255, 0.35);
  box-shadow: 0 24px 50px rgba(123, 44, 191, 0.35);
  animation: cardFloat 5s ease-in-out infinite 0.5s;
}

.fc-2 .fc-icon {
  color: #e0aaff;
  background: rgba(199, 125, 255, 0.2);
  border-color: rgba(199, 125, 255, 0.35);
}

.fc-2 .fc-tag {
  background: rgba(199, 125, 255, 0.25);
  color: #e0aaff;
}

.fc-3 .fc-icon {
  color: #ff8fa3;
  background: rgba(230, 57, 70, 0.18);
  border-color: rgba(230, 57, 70, 0.35);
}

.fc-3 {
  transform: rotate(12deg) translate(50px, 50px);
  z-index: 2;
  animation: cardFloat 5s ease-in-out infinite 1s;
}

@keyframes cardFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -12px; }
}

@media (max-width: 899px) {
  .preview-cards {
    min-height: 260px;
    margin-top: 8px;
  }
  .fc-1 { transform: rotate(-6deg) translate(-28px, 20px); }
  .fc-2 { transform: rotate(3deg) translate(10px, -10px); }
  .fc-3 { transform: rotate(10deg) translate(36px, 55px); }
}

/* ---------- How to play ---------- */
.steps {
  list-style: none;
  display: grid;
  gap: 12px;
  max-width: 680px;
  margin: 0 auto 36px;
  counter-reset: none;
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  padding: 18px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.2s, transform 0.2s;
  align-items: start;
}

.step:hover {
  border-color: rgba(255, 77, 109, 0.35);
  transform: translateX(4px);
}

.step-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--primary-2);
  background: linear-gradient(145deg, rgba(255, 77, 109, 0.22), rgba(199, 125, 255, 0.12));
  border: 1px solid rgba(255, 77, 109, 0.3);
  flex-shrink: 0;
}

.step:nth-child(2) .step-icon { color: #c77dff; border-color: rgba(199, 125, 255, 0.35); background: linear-gradient(145deg, rgba(199, 125, 255, 0.22), rgba(123, 44, 191, 0.1)); }
.step:nth-child(3) .step-icon { color: #00f5d4; border-color: rgba(0, 245, 212, 0.3); background: linear-gradient(145deg, rgba(0, 245, 212, 0.18), rgba(0, 180, 160, 0.08)); }
.step:nth-child(4) .step-icon { color: #ffe66d; border-color: rgba(255, 230, 109, 0.35); background: linear-gradient(145deg, rgba(255, 230, 109, 0.18), rgba(255, 180, 50, 0.08)); }
.step:nth-child(5) .step-icon { color: #ff6b9d; border-color: rgba(255, 107, 157, 0.35); background: linear-gradient(145deg, rgba(255, 107, 157, 0.2), rgba(255, 0, 110, 0.08)); }
.step:nth-child(6) .step-icon { color: #4cc9f0; border-color: rgba(76, 201, 240, 0.35); background: linear-gradient(145deg, rgba(76, 201, 240, 0.18), rgba(67, 97, 238, 0.08)); }

.step-num {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  opacity: 0.9;
  line-height: 1.2;
}

.step-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.step-body p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.step-body em {
  color: var(--gold);
  font-style: normal;
  font-weight: 600;
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  max-width: 800px;
  margin: 0 auto;
}

.tip-card {
  padding: 18px 16px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border);
}

.tip-icon {
  display: inline-grid;
  margin-bottom: 12px;
}

.tip-icon.icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.tip-card h4 {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.tip-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ---------- Themes ---------- */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-chip {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.filter-chip:hover {
  color: var(--text);
}

.filter-chip.active {
  color: #0b0614;
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 4px 20px rgba(0, 245, 212, 0.3);
}

.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.theme-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 22px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.25s var(--ease-out), border-color 0.2s, box-shadow 0.25s;
  min-height: 168px;
}

.theme-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--card-accent) 28%, transparent), transparent 55%);
  opacity: 0.9;
  pointer-events: none;
}

.theme-card:hover,
.theme-card:focus-visible {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--card-accent) 55%, white);
  box-shadow: 0 16px 40px color-mix(in srgb, var(--card-accent) 25%, transparent);
  outline: none;
}

.theme-card:active {
  transform: translateY(-1px) scale(0.99);
}

.theme-icon {
  margin-bottom: 14px;
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 16px;
}

.theme-icon .icon {
  width: 24px;
  height: 24px;
}

.theme-play-arrow {
  opacity: 0.9;
}

.theme-name {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
  position: relative;
}

.theme-tagline {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  flex: 1;
  position: relative;
}

.theme-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  position: relative;
  width: 100%;
}

.theme-count {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.theme-play {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--card-accent, var(--primary-2));
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.theme-card.hidden-filter {
  display: none;
}

/* ---------- Game ---------- */
.view-game {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - var(--topbar-h) - 100px);
}

.game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.game-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  flex: 1;
}

.game-deck-name {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}

.game-deck-name .game-deck-icon {
  color: var(--deck-accent, var(--primary-2));
  flex-shrink: 0;
}

.game-counter {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.table {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 8px 0 20px;
}

.card-stage {
  width: 100%;
  max-width: 380px;
  aspect-ratio: 3 / 4;
  max-height: min(58dvh, 460px);
  position: relative;
  perspective: 1400px;
  touch-action: pan-y;
}

.card-stack {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

/* Playing card — transitions fluidas (solo transform/opacity) */
.play-card {
  --card-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --card-dur: 0.48s;
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background:
    linear-gradient(165deg, rgba(40, 22, 62, 0.98) 0%, rgba(18, 10, 32, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 25px 50px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 1px 0 rgba(255, 255, 255, 0.12) inset;
  display: flex;
  flex-direction: column;
  padding: 22px;
  overflow: hidden;
  transform-origin: center center;
  transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
  opacity: 1;
  filter: none;
  will-change: transform, opacity, filter;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  user-select: none;
  touch-action: none;
  transition:
    transform var(--card-dur) var(--card-ease),
    opacity 0.38s var(--card-ease),
    filter 0.38s ease,
    box-shadow 0.38s ease;
}

.play-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--deck-accent, var(--primary)) 40%, transparent);
  pointer-events: none;
  opacity: 0.7;
}

.play-card::after {
  content: "";
  position: absolute;
  top: -40%;
  left: -20%;
  width: 80%;
  height: 80%;
  background: radial-gradient(circle, color-mix(in srgb, var(--deck-accent, var(--primary)) 35%, transparent), transparent 70%);
  pointer-events: none;
}

.play-card.is-back {
  z-index: 2;
  transform: translate3d(0, 14px, 0) scale(0.94);
  opacity: 0.62;
  filter: brightness(0.78);
  pointer-events: none;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.play-card.is-back-2 {
  z-index: 1;
  transform: translate3d(0, 26px, 0) scale(0.88);
  opacity: 0.36;
  filter: brightness(0.58);
  pointer-events: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.play-card.is-active {
  z-index: 5;
  transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
  opacity: 1;
  filter: none;
  pointer-events: auto;
  cursor: grab;
}

.play-card.is-active:active {
  cursor: grabbing;
}

/* Arrastre: sin transición para seguimiento 1:1 */
.play-card.is-dragging {
  cursor: grabbing;
  transition: none !important;
  z-index: 12;
}

/* Salida — transición (no keyframes) */
.play-card.is-leaving {
  z-index: 15;
  pointer-events: none;
  filter: none;
  box-shadow: 0 30px 50px rgba(0, 0, 0, 0.35);
}

.play-card.is-leaving-right,
.play-card.is-leaving-left {
  z-index: 15;
  pointer-events: none;
  filter: none;
  box-shadow: 0 30px 50px rgba(0, 0, 0, 0.35);
  transition:
    transform 0.42s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.34s cubic-bezier(0.4, 0, 1, 1) !important;
}

.play-card.is-leaving-right {
  transform: translate3d(118%, 12px, 0) rotate(16deg) scale(0.94);
  opacity: 0;
}

.play-card.is-leaving-left {
  transform: translate3d(-118%, 12px, 0) rotate(-16deg) scale(0.94);
  opacity: 0;
}

/* Entrada desde fuera (solo anterior / rebuild) */
.play-card.is-enter-prep-right {
  z-index: 6;
  transform: translate3d(110%, 8px, 0) rotate(12deg) scale(0.96);
  opacity: 0;
  transition: none !important;
  pointer-events: none;
}

.play-card.is-enter-prep-left {
  z-index: 6;
  transform: translate3d(-110%, 8px, 0) rotate(-12deg) scale(0.96);
  opacity: 0;
  transition: none !important;
  pointer-events: none;
}

.play-card.is-enter-prep-stack {
  /* ya está en is-back; al promover usa la transición base */
  pointer-events: none;
}

/* Contenido: fade suave al promover, sin bounce agresivo */
.play-card.is-active .card-icon-wrap {
  animation: iconSoftIn 0.45s var(--card-ease) both;
}

.play-card.is-back .card-icon-wrap,
.play-card.is-back-2 .card-icon-wrap {
  animation: none;
}

/* Card content */
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
  margin-bottom: auto;
}

.card-deck-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--deck-accent, var(--primary-2)) 90%, white);
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--deck-accent, var(--primary)) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--deck-accent, var(--primary)) 35%, transparent);
}

.card-label-icon {
  opacity: 0.95;
}

.card-index {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.card-body {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 8px;
  gap: 14px;
}

.card-icon-wrap {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 22px;
  color: color-mix(in srgb, var(--deck-accent, var(--primary)) 95%, white);
  background:
    linear-gradient(150deg,
      color-mix(in srgb, var(--deck-accent, var(--primary)) 32%, transparent),
      color-mix(in srgb, var(--deck-accent, var(--primary)) 8%, transparent));
  border: 1px solid color-mix(in srgb, var(--deck-accent, var(--primary)) 45%, transparent);
  box-shadow:
    0 12px 32px color-mix(in srgb, var(--deck-accent, var(--primary)) 28%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.card-main-icon {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}

@keyframes iconSoftIn {
  0% { transform: scale(0.92); opacity: 0.35; }
  100% { transform: scale(1); opacity: 1; }
}

.card-category {
  font-family: var(--display);
  font-size: clamp(1.35rem, 6vw, 1.85rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.card-example {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  max-width: 92%;
  padding: 12px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--deck-accent, var(--primary)) 14%, rgba(0, 0, 0, 0.25));
  border: 1px dashed color-mix(in srgb, var(--deck-accent, var(--primary)) 45%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.card-example-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--deck-accent, var(--primary-2)) 85%, white);
  opacity: 0.9;
}

.card-example-text {
  font-family: var(--display);
  font-size: clamp(1.05rem, 4.2vw, 1.25rem);
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  text-wrap: balance;
}

.card-prompt {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 90%;
}

.card-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 12px;
}

.card-corner {
  opacity: 0.45;
  color: color-mix(in srgb, var(--deck-accent, var(--primary-2)) 80%, white);
  display: inline-flex;
}

.card-chupa {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.card-hint {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-dim);
  max-width: 320px;
  padding: 0 12px;
}

.game-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 0 12px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, rgba(11, 6, 20, 0.95) 60%, transparent);
  padding-bottom: calc(8px + var(--safe-b));
}

.progress-track {
  height: 4px;
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
  margin-top: 4px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--cyan));
  background-size: 200% 100%;
  transition: width 0.4s var(--ease-out);
  animation: progressShine 3s linear infinite;
}

@keyframes progressShine {
  to { background-position: 200% 0; }
}



/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: calc(24px + var(--safe-b));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 200;
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(20, 10, 34, 0.95);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s var(--ease-out);
  max-width: min(90vw, 360px);
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- SEO content panel ---------- */
.seo-panel {
  margin-top: 48px;
  padding: 28px 22px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  max-width: 720px;
  margin-inline: auto;
  grid-column: 1 / -1;
}

@media (min-width: 900px) {
  #view-welcome {
    grid-template-rows: auto auto;
  }
  .seo-panel {
    margin-top: 24px;
  }
}

.seo-panel h2 {
  font-family: var(--display);
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.seo-panel h3 {
  font-size: 1.05rem;
  margin: 22px 0 10px;
  color: var(--primary-2);
}

.seo-panel p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 12px;
  line-height: 1.6;
}

.seo-panel strong {
  color: var(--text);
}

.seo-list {
  margin: 0 0 8px 1.1rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  display: grid;
  gap: 8px;
}

.seo-list li::marker {
  color: var(--cyan);
}

.seo-aliases {
  font-size: 0.82rem !important;
  color: var(--text-dim) !important;
  line-height: 1.55 !important;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22);
  border: 1px dashed var(--border);
}

.seo-faq {
  margin-top: 8px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.18);
  margin-bottom: 8px;
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 0.92rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  color: var(--cyan);
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item p {
  padding: 0 16px 14px;
  margin: 0;
  font-size: 0.88rem;
}

.seo-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.noscript-box {
  max-width: 720px;
  margin: 24px auto;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 16px 16px 24px;
  font-size: 0.75rem;
  color: var(--text-dim);
  max-width: 640px;
  margin-inline: auto;
  line-height: 1.5;
}

.site-footer strong {
  color: var(--text-muted);
  font-weight: 600;
}

.footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 10px;
}

.footer-nav button {
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-nav button:hover {
  color: var(--primary-2);
}

.view-game ~ .site-footer,
body:has(#view-game.view-active) .site-footer {
  display: none;
}

/* Hide footer in game more reliably via class on body */
body.playing .site-footer {
  display: none;
}

body.playing {
  padding-bottom: 0;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .blob { animation: none; }
  .float-card { animation: none; }
}

/* ---------- Landscape phone game tweak ---------- */
@media (max-height: 500px) and (orientation: landscape) {
  .card-stage {
    max-height: 70dvh;
    aspect-ratio: 4 / 3;
    max-width: 280px;
  }
  .card-category {
    font-size: 1.2rem;
  }
  .card-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 16px;
  }
  .card-main-icon {
    width: 28px;
    height: 28px;
  }
  .hero-stats {
    display: none;
  }
}
