/*
Theme Name: Ciudad de Juegos
Description: Portal de juegos clásicos — diseño "Serene Oak & Sage" (crema, verde bosque, serif).
Version: 0.1.0
*/

:root {
  --surface: #fff8ef; --surface-2: #f4ede1; --surface-3: #eee7db;
  --ink: #1e1b14; --ink-2: #3f4943; --line: #d8cdbb;
  --primary: #046141; --primary-d: #034a32; --cta: #e08a00; --cta-d: #b56e00;
  --radius: 20px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--surface); color: var(--ink);
  font: 18px/1.6 -apple-system, "Segoe UI", Roboto, sans-serif;
}
h1, h2, h3, .cdj-serif { font-family: Georgia, "Times New Roman", serif; font-weight: 700; }
a { color: var(--primary); }
img { max-width: 100%; }
.cdj-wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* ── Header ── */
.cdj-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 248, 239, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.cdj-head-in { display: flex; align-items: center; gap: 18px; padding: 12px 0; }
.cdj-logo { font: 700 26px Georgia, serif; color: var(--primary); text-decoration: none; }
.cdj-logo span { color: var(--cta); }
.cdj-nav { margin-left: auto; }
.cdj-nav > ul { display: flex; gap: 4px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.cdj-nav li { position: relative; }
.cdj-nav li.menu-item-has-children > a::after { content: '▾'; margin-left: 4px; font-size: .8em; }
.cdj-nav .sub-menu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 60;
  flex-direction: column; gap: 2px; min-width: 210px; padding: 8px;
  list-style: none; background: var(--surface); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(30, 27, 20, .16);
}
.cdj-nav li:hover > .sub-menu, .cdj-nav li:focus-within > .sub-menu { display: flex; }
.cdj-nav .sub-menu a { display: block; white-space: nowrap; }
.cdj-nav a {
  text-decoration: none; color: var(--ink-2); font-size: 15px; font-weight: 600;
  padding: 7px 14px; border-radius: 999px;
}
.cdj-nav a:hover { background: var(--surface-3); color: var(--primary); }

/* ── Hero ── */
.cdj-hero { text-align: center; padding: 72px 20px 44px; }
.cdj-hero h1 { font-size: clamp(34px, 5vw, 56px); margin: 0 0 12px; letter-spacing: -.5px; }
.cdj-hero p { font-size: 20px; color: var(--ink-2); max-width: 640px; margin: 0 auto 22px; }
.cdj-hero .chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cdj-hero .chip {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 16px; font-size: 14px; font-weight: 600; color: var(--ink-2);
}
.cdj-cta {
  display: inline-block; background: var(--cta); color: #fff; text-decoration: none;
  font-weight: 700; padding: 14px 34px; border-radius: 999px; font-size: 19px;
  box-shadow: 0 6px 18px rgba(224, 138, 0, .35);
}
.cdj-cta:hover { background: var(--cta-d); }

/* ── Stats ── */
.cdj-stats {
  display: flex; gap: 0; justify-content: center; flex-wrap: wrap;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.cdj-stats div { padding: 22px 34px; text-align: center; }
.cdj-stats b { display: block; font: 700 30px Georgia, serif; color: var(--primary); }
.cdj-stats span { font-size: 14px; color: var(--ink-2); }

/* ── Secciones y grid ── */
.cdj-sec { padding: 44px 0 8px; }
.cdj-sec > h2 { font-size: 30px; margin: 0 0 6px; }
.cdj-sec > p { color: var(--ink-2); margin: 0 0 22px; }
.cdj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 18px; }
.cdj-card {
  display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: var(--ink);
  transition: transform .15s, box-shadow .15s;
}
.cdj-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(30, 27, 20, .10); }
.cdj-card-txt { padding: 14px 18px 18px; }
.cdj-card h3 { margin: 0 0 6px; font-size: 21px; }
.cdj-card p { margin: 0; font-size: 15px; color: var(--ink-2); line-height: 1.45; }
.cdj-card .tag {
  display: inline-block; margin-top: 12px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px; color: var(--primary);
}
/* miniatura SVG: la mesa del juego cobra vida al hover */
.cdj-thumb { display: block; width: 100%; height: auto; aspect-ratio: 280/124; }
.cdj-thumb .th-i { transform-box: fill-box; transform-origin: center bottom; }
.cdj-card:hover .th-i { animation: thDeal 1.5s ease-in-out infinite alternate; animation-delay: calc(var(--i, 0) * 90ms); }
@keyframes thDeal { to { transform: translateY(-5px); } }
.cdj-thumb .th-path { stroke-dasharray: 220; stroke-dashoffset: 220; }
.cdj-card:hover .th-path { animation: thDraw 1.6s ease-in-out infinite alternate; }
@keyframes thDraw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .cdj-card:hover .th-i, .cdj-card:hover .th-path { animation: none; }
}

/* ── Ficha de juego ── */
.cdj-game-hero { display: flex; align-items: center; gap: 22px; padding: 40px 0 10px; }
.cdj-game-hero .e { font-size: 64px; line-height: 1; flex-shrink: 0; }
.cdj-game-hero h1 { margin: 0; font-size: clamp(30px, 4vw, 44px); color: var(--ink); font-weight: 800; }
.cdj-game-hero .meta { color: var(--ink-2); font-size: 14.5px; }
.cdj-game-hero .meta a { color: var(--primary); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.cdj-game-hero .meta span { margin-right: 14px; }
.cdj-game-mount {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius);
  height: clamp(680px, 86vh, 920px);
  overflow: hidden;
  position: relative;
  background: radial-gradient(ellipse at top, #2e5e46 0%, #123024 100%);
  box-shadow: 0 12px 40px rgba(30, 27, 20, .18);
  transition: all 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.cdj-game-mount .board-container {
  flex: 1 1 auto;
  min-height: 540px;
}
.cdj-game-mount.is-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  max-height: none !important;
  border-radius: 0 !important;
  z-index: 999999 !important;
}
.cdj-frame {
  display: block; width: 100%; border: 0; border-radius: var(--radius);
  height: clamp(760px, 92vh, 1200px); overflow: hidden;
  background: radial-gradient(ellipse at top, #2e5e46 0%, #123024 100%);
  box-shadow: 0 12px 40px rgba(30, 27, 20, .18);
  transition: all 0.2s ease;
}
.cdj-frame.cdj-frame--fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  max-height: none !important;
  border-radius: 0 !important;
  z-index: 999999 !important;
}
.cdj-cols { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; padding: 26px 0 50px; }
@media (max-width: 880px) { .cdj-cols { grid-template-columns: 1fr; } }
.cdj-board { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.cdj-board th { background: var(--surface-2); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-2); }
.cdj-board th, .cdj-board td { padding: 10px 14px; text-align: left; }
.cdj-board tr:nth-child(even) td { background: #fbf6ec; }
.cdj-board tr.you td { background: #ffe9c4 !important; font-weight: 700; }
.cdj-board-empty { color: var(--ink-2); }

/* ── Anuncios: contenedores anti-CLS (solo visibles con CDJ_ADSENSE_CLIENT) ── */
.cdj-ad { contain: layout; text-align: center; }
.cdj-ad-label {
  display: block; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--ink-2); margin-bottom: 4px;
}
.cdj-ad-leader { min-height: 114px; margin: 20px auto; }
.cdj-ad-rect { min-height: 304px; margin: 20px auto; }
.cdj-ad-infeed { grid-column: 1 / -1; min-height: 140px; margin: 10px 0; }
.cdj-ad-sticky { position: sticky; top: 90px; min-height: 620px; margin-top: 20px; }

.cdj-foot-legal { margin-top: 10px; font-size: 14px; }
.cdj-foot-legal a { color: inherit; opacity: .85; }
.cdj-side .box {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 20px;
}
.cdj-side .box h3 { margin-top: 0; font-size: 19px; }
.cdj-rel { display: flex; flex-direction: column; gap: 8px; }
.cdj-rel a { text-decoration: none; font-weight: 600; }

/* ── Footer ── */
.cdj-foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 30px 0 46px; color: var(--ink-2); font-size: 14px; }

/* badges dificultad + duración (tarjetas y ficha) */
.cdj-badges { display: flex; gap: 10px; align-items: center; font-size: 12.5px; margin: 4px 0 6px; flex-wrap: wrap; }
.cdj-dif { font-weight: 700; letter-spacing: .5px; }
.cdj-dif-1 { color: #57b26a; }
.cdj-dif-2 { color: #d9a521; }
.cdj-dif-3 { color: #d9544f; }
.cdj-dur { color: #8fb5a1; font-weight: 600; }
.cdj-game-hero .meta .cdj-badges { margin: 0; }

/* ---------- Temas estacionales del sitio ---------- */
/* La clase season-* la pone cdj_season_id(); 'season-off' = opt-out del usuario */

.cdj-season-toggle {
  margin-left: 8px; padding: 4px 9px; font-size: 17px; line-height: 1;
  background: none; border: 1px solid rgba(0,0,0,.15); border-radius: 999px;
  cursor: pointer; transition: opacity .15s, transform .15s;
}
.cdj-season-toggle:hover { transform: scale(1.12); }
.cdj-season-toggle:focus-visible { outline: 2px solid var(--cta); outline-offset: 2px; }

/* Decoración común: guirnalda de emojis sobre el hero + acentos por temporada */
body[class*='season-'] .cdj-hero { position: relative; overflow: hidden; }
body[class*='season-'] .cdj-hero::after {
  position: absolute; left: 0; right: 0; bottom: 6px;
  font-size: 26px; letter-spacing: 22px; text-align: center;
  opacity: .28; pointer-events: none; user-select: none;
}
body[class*='season-'] .cdj-sec > h2::before { margin-right: 8px; font-size: .85em; }
body.season-off .cdj-hero::after, body.season-off .cdj-sec > h2::before { content: none !important; }

/* Halloween — naranja calabaza sobre púrpura nocturno */
body.season-halloween { --cta: #e8762d; }
body.season-halloween .cdj-head { border-bottom: 3px solid #e8762d; }
body.season-halloween .cdj-hero {
  background: radial-gradient(ellipse at 50% -20%, #3d2b52 0%, transparent 60%);
}
body.season-halloween .cdj-hero::after { content: '🎃🦇🕷️👻🕸️🍬'; }
body.season-halloween .cdj-sec > h2::before { content: '🎃'; }
body.season-halloween .cdj-logo { text-shadow: 0 0 14px rgba(232,118,45,.35); }

/* Navidad — rojo/verde con dorado */
body.season-navidad { --cta: #c22f3d; }
body.season-navidad .cdj-head { border-bottom: 3px solid #c22f3d; }
body.season-navidad .cdj-hero {
  background: radial-gradient(ellipse at 50% -20%, #1c4a33 0%, transparent 60%);
}
body.season-navidad .cdj-hero::after { content: '🎄⭐❄️🎁🦌🔔'; }
body.season-navidad .cdj-sec > h2::before { content: '🎄'; }

/* Nochevieja — dorado festivo */
body.season-nochevieja { --cta: #b8860b; }
body.season-nochevieja .cdj-head { border-bottom: 3px solid #d4af37; }
body.season-nochevieja .cdj-hero {
  background: radial-gradient(ellipse at 50% -20%, #2b2b1a 0%, transparent 60%);
}
body.season-nochevieja .cdj-hero::after { content: '🥂🎆✨🍾🎇🕛'; }
body.season-nochevieja .cdj-sec > h2::before { content: '✨'; }

/* San Valentín — rosa/rojo */
body.season-sanvalentin { --cta: #d6336c; }
body.season-sanvalentin .cdj-head { border-bottom: 3px solid #e0709a; }
body.season-sanvalentin .cdj-hero {
  background: radial-gradient(ellipse at 50% -20%, #f3d4e0 0%, transparent 60%);
}
body.season-sanvalentin .cdj-hero::after { content: '💘❤️🌹💕💌💝'; }
body.season-sanvalentin .cdj-sec > h2::before { content: '💘'; }

/* Semana Santa — morado sobrio */
body.season-semanasanta { --cta: #6b3fa0; }
body.season-semanasanta .cdj-head { border-bottom: 3px solid #6b3fa0; }
body.season-semanasanta .cdj-hero {
  background: radial-gradient(ellipse at 50% -20%, #e3d9ef 0%, transparent 60%);
}
body.season-semanasanta .cdj-hero::after { content: '🕯️✝️⛪🕊️'; }
body.season-semanasanta .cdj-sec > h2::before { content: '🕯️'; }

/* Verano — turquesa/amarillo */
body.season-verano { --cta: #0e8fa8; }
body.season-verano .cdj-head { border-bottom: 3px solid #f2b705; }
body.season-verano .cdj-hero {
  background: radial-gradient(ellipse at 50% -20%, #cdeff5 0%, transparent 60%);
}
body.season-verano .cdj-hero::after { content: '☀️🏖️🌊🍉⛱️🍦'; }
body.season-verano .cdj-sec > h2::before { content: '☀️'; }

@media (prefers-reduced-motion: no-preference) {
  body[class*='season-'] .cdj-hero::after { animation: cdj-season-float 7s ease-in-out infinite alternate; }
  @keyframes cdj-season-float { from { transform: translateY(0); } to { transform: translateY(-8px); } }
}

/* Formulario de contacto y propuestas */
.cdj-form { max-width: 560px; }
.cdj-field { margin: 0 0 18px; }
.cdj-field label { display: block; font-weight: 700; margin: 0 0 6px; }
.cdj-field label i { color: #c0392b; font-style: normal; }
.cdj-field .cdj-opt { font-weight: 400; font-size: 13px; color: var(--ink-2); }
.cdj-field input, .cdj-field select, .cdj-field textarea {
  width: 100%; box-sizing: border-box; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.cdj-field input:focus-visible, .cdj-field select:focus-visible, .cdj-field textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 40%, transparent); outline-offset: 1px; border-color: var(--primary);
}
.cdj-field [aria-invalid='true'] { border-color: #c0392b; }
.cdj-hint { margin: 5px 0 0; font-size: 13px; color: var(--ink-2); }
.cdj-ferr { margin: 5px 0 0; font-size: 14px; font-weight: 600; color: #c0392b; }
.cdj-fsend { border: 0; cursor: pointer; font-size: 17px; padding: 12px 28px; }
.cdj-fok, .cdj-fko { max-width: 560px; border-radius: 12px; padding: 14px 18px; margin: 0 0 18px; }
.cdj-fok { background: #e2f4ea; border: 1px solid var(--primary); }
.cdj-fko { background: #fdecea; border: 1px solid #c0392b; }
.cdj-fko ul { margin: 6px 0 0; padding-left: 20px; }
.cdj-hp { display: none; }

/* Grupos de amigos */
.cdj-gmeta { color: var(--ink-2); margin-top: -8px; }
.cdj-cta2 { background: var(--surface-3); color: var(--ink); }
.cdj-cta2:hover { background: var(--line); }
.cdj-gmsg { min-height: 1.3em; font-weight: 600; color: var(--primary); }
.cdj-gmembers { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
.cdj-gmembers li { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; font-size: 14px; }
.cdj-group h3 { margin-top: 18px; }
.cdj-gmail { margin-top: 28px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; max-width: 560px; }
.cdj-gmail input { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; width: 240px; max-width: 100%; }
.cdj-gmail .cdj-cta { margin-left: 8px; }
.cdj-gwho { background: #e2f4ea; border: 1px solid var(--primary); border-radius: 10px; padding: 8px 14px; }
