/* ══════════════════════════════════════════════════════════════
   Juegos – Premium Arcade 2026
   Aesthetic: Apple Arcade meets luxury gaming lounge
   Font: SF Pro Display feel via system stack + DM Sans
   ══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800;1,9..40,400&display=swap');

#win-juegos .content,
#win-juegos * {
  box-sizing: border-box;
}

#win-juegos {
  background: #0c0e14;
  color: #d4d4dc;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#win-juegos:not(.hidden) {
  display: flex !important;
  flex-direction: column;
  visibility: visible !important;
}

#win-juegos.hidden {
  display: none !important;
}

#win-juegos .content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#win-juegos .sx-host {
  flex: 1;
  overflow: auto;
  width: 100%;
  height: 100%;
}

/* ══════════════════════════════════════════════════════════════
   HOME SCREEN
   ══════════════════════════════════════════════════════════════ */

#win-juegos .jg-home {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 14px 24px 20px;
  overflow: hidden;
  background: #0c0e14;
}


/* ── Search (inside filters bar) ── */
#win-juegos .jg-home__search {
  position: relative;
  flex-shrink: 0;
  margin-left: auto;
}

#win-juegos .jg-home__search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #4a4a5c;
  pointer-events: none;
  opacity: 0.6;
}

#win-juegos .jg-home__search-input {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 8px;
  padding: 7px 12px 7px 30px;
  color: #d4d4dc;
  font-size: 12px;
  font-weight: 400;
  width: 140px;
  transition: width .3s cubic-bezier(.4,0,.2,1), border-color .2s, background .2s, box-shadow .2s;
  font-family: inherit;
  outline: none;
  letter-spacing: 0.1px;
}

#win-juegos .jg-home__search-input::placeholder {
  color: #4a4a5c;
  font-weight: 400;
}

#win-juegos .jg-home__search-input:focus {
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  width: 200px;
  box-shadow: 0 0 0 3px rgba(255,255,255,.03);
}

/* ── Filter Pills + Search — single row ── */
#win-juegos .jg-home__filters {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 16px;
  flex-shrink: 0;
  background: rgba(255,255,255,.03);
  padding: 3px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,.04);
}

#win-juegos .jg-pill {
  padding: 7px 16px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: #6b6b7b;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  font-family: inherit;
  white-space: nowrap;
  letter-spacing: 0.2px;
  position: relative;
}

#win-juegos .jg-pill:hover {
  color: #a0a0b0;
  background: rgba(255,255,255,.04);
}

#win-juegos .jg-pill--active {
  background: rgba(255,255,255,.08);
  color: #f5f5f7;
  box-shadow: 0 1px 3px rgba(0,0,0,.3), 0 1px 1px rgba(0,0,0,.2);
}

#win-juegos .jg-pill--active:hover {
  background: rgba(255,255,255,.10);
  color: #fff;
}

/* ── Body wrapper (grid + sidebar) ── */
#win-juegos .jg-home__body {
  display: flex;
  gap: 20px;
  flex: 1;
  align-items: stretch;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.06) transparent;
}

#win-juegos .jg-home__body::-webkit-scrollbar { width: 6px; }
#win-juegos .jg-home__body::-webkit-scrollbar-track { background: transparent; }
#win-juegos .jg-home__body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.08);
  border-radius: 3px;
}
#win-juegos .jg-home__body::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,.14);
}

/* ── Grid ── */
#win-juegos .jg-home__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  flex: 1;
  align-content: start;
  padding-bottom: 32px;
  min-width: 0;
}

/* ══════════════════════════════════════════════════════════════
   GAME CARD — Cinematic, tactile, premium
   ══════════════════════════════════════════════════════════════ */

#win-juegos .jg-card {
  background: linear-gradient(168deg, #141416 0%, #0d0d10 100%);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 18px;
  padding: 22px 16px 14px;
  cursor: pointer;
  transition: transform .32s cubic-bezier(.22,1,.36,1),
              box-shadow .32s cubic-bezier(.22,1,.36,1),
              border-color .32s cubic-bezier(.22,1,.36,1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  min-height: 260px;
  animation: jgFadeIn .45s cubic-bezier(.16,1,.3,1) both;
  will-change: transform;
}

/* Ambient glow behind the icon — always softly visible, intensifies on hover */
#win-juegos .jg-card::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 110px;
  background: radial-gradient(ellipse at center, var(--accent-soft) 0%, transparent 68%);
  opacity: 0.35;
  transition: opacity .4s cubic-bezier(.22,1,.36,1), transform .4s cubic-bezier(.22,1,.36,1);
  pointer-events: none;
  z-index: 0;
  filter: blur(6px);
}

/* Shimmer sweep effect on hover */
#win-juegos .jg-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -80%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255,255,255,.03) 40%,
    rgba(255,255,255,.06) 50%,
    rgba(255,255,255,.03) 60%,
    transparent 100%
  );
  transition: left .55s cubic-bezier(.22,1,.36,1);
  pointer-events: none;
  z-index: 2;
}

#win-juegos .jg-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: color-mix(in srgb, var(--accent) 20%, transparent);
  box-shadow:
    0 20px 50px -12px rgba(0,0,0,.6),
    0 8px 20px -4px rgba(0,0,0,.4),
    0 0 40px -10px var(--accent-soft);
}

#win-juegos .jg-card:hover::before {
  opacity: 0.7;
  transform: translateX(-50%) scale(1.3);
}

#win-juegos .jg-card:hover::after {
  left: 130%;
}

#win-juegos .jg-card:active {
  transform: translateY(-3px) scale(0.97);
  transition-duration: .08s;
  box-shadow:
    0 8px 24px -6px rgba(0,0,0,.5),
    0 0 20px -8px var(--accent-soft);
}

/* Badge (genre) */
#win-juegos .jg-card__badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,.04);
  color: #5a5a6e;
  border: none;
  align-self: center;
  position: relative;
  z-index: 1;
  transition: color .3s, background .3s;
}

#win-juegos .jg-card:hover .jg-card__badge {
  color: #8a8a9a;
  background: rgba(255,255,255,.06);
}

/* Icon — BIG and cinematic */
#win-juegos .jg-card__icon {
  font-size: 72px;
  line-height: 1;
  margin: 8px 0 6px;
  transition: transform .4s cubic-bezier(.34,1.56,.64,1),
              filter .4s cubic-bezier(.22,1,.36,1);
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.4));
  position: relative;
  z-index: 1;
}

#win-juegos .jg-card:hover .jg-card__icon {
  transform: scale(1.18) translateY(-4px);
  filter: drop-shadow(0 8px 20px rgba(0,0,0,.5))
          drop-shadow(0 0 12px var(--accent-soft));
}

/* Name */
#win-juegos .jg-card__name {
  font-size: 15px;
  font-weight: 700;
  color: #eaeaef;
  text-align: center;
  line-height: 1.2;
  letter-spacing: -0.3px;
  position: relative;
  z-index: 1;
  transition: color .3s;
}

#win-juegos .jg-card:hover .jg-card__name {
  color: #fff;
}

/* Description */
#win-juegos .jg-card__desc {
  font-size: 11px;
  color: #4a4a5c;
  text-align: center;
  line-height: 1.45;
  flex: 1;
  position: relative;
  z-index: 1;
}

/* Stars — hidden */
#win-juegos .jg-card__stars {
  display: none;
}

/* XP / Mastery bar */
#win-juegos .jg-card__xp {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,.05);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

#win-juegos .jg-card__xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #fff));
  border-radius: 3px;
  transition: width .8s cubic-bezier(.22,1,.36,1);
  box-shadow: 0 0 8px var(--accent-soft);
}

/* Score */
#win-juegos .jg-card__score {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.04);
  font-size: 11px;
  color: #3e3e4e;
  margin-top: auto;
  position: relative;
  z-index: 1;
}

#win-juegos .jg-card__score span {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: .8px;
}

#win-juegos .jg-card__score strong {
  color: var(--accent, #8a8a9a);
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
  transition: text-shadow .3s;
}

#win-juegos .jg-card:hover .jg-card__score strong {
  text-shadow: 0 0 14px var(--accent-soft);
}

/* Play count badge */
#win-juegos .jg-card__plays {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 9px;
  font-weight: 700;
  color: var(--accent, #6b6b7b);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  z-index: 3;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .25s cubic-bezier(.22,1,.36,1), transform .25s cubic-bezier(.22,1,.36,1);
}

#win-juegos .jg-card:hover .jg-card__plays {
  opacity: 1;
  transform: translateY(0);
}

@keyframes jgFadeIn {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.94);
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* ── Empty State ── */
#win-juegos .jg-home__empty {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: #3a3a4a;
  font-size: 14px;
}

#win-juegos .jg-home__empty-icon {
  font-size: 40px;
  opacity: .3;
}

/* ══════════════════════════════════════════════════════════════
   GAME VIEW
   ══════════════════════════════════════════════════════════════ */

#win-juegos .jg-game-view {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow: hidden;
  background: #0c0e14;
  border-radius: 0;
}

#win-juegos .jg-game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.04);
  border-radius: 12px;
}

#win-juegos .jg-back-btn {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  color: #d4d4dc;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  font-family: inherit;
  transition: all .2s cubic-bezier(.4,0,.2,1);
}

#win-juegos .jg-back-btn:hover {
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.14);
  transform: translateY(-1px);
}

#win-juegos .jg-back-btn:active {
  transform: translateY(0);
  background: rgba(255,255,255,.08);
}

#win-juegos .jg-game-title {
  font-size: 17px;
  font-weight: 700;
  flex: 1;
  text-align: center;
  color: #eaeaef;
  letter-spacing: -0.3px;
}

#win-juegos .jg-game-score {
  font-size: 14px;
  font-weight: 700;
  color: #34d399;
  padding: 6px 12px;
  background: rgba(52, 211, 153, .08);
  border-radius: 8px;
  border: 1px solid rgba(52, 211, 153, .12);
  font-variant-numeric: tabular-nums;
}

#win-juegos .jg-game-area {
  flex: 1;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  min-height: 0;
  padding: 8px;
  background: rgba(0,0,0,.2);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.03);
}

#win-juegos .jg-game-controls {
  text-align: center;
  font-size: 12px;
  color: #5a5a6e;
  padding: 12px;
  margin-top: 10px;
  background: rgba(255,255,255,.02);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.03);
}

/* ══════════════════════════════════════════════════════════════
   GAME RESULT OVERLAY — Celebratory but classy
   ══════════════════════════════════════════════════════════════ */

#win-juegos .jg-result-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(6,7,11,.85);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  animation: jgOverlayIn .35s cubic-bezier(.4,0,.2,1);
}

@keyframes jgOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

#win-juegos .jg-result-card {
  background: #181a24;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 20px;
  padding: 36px 44px;
  text-align: center;
  box-shadow: 0 24px 64px -12px rgba(0,0,0,.6),
              0 0 0 1px rgba(255,255,255,.02);
  animation: jgResultCardIn .45s cubic-bezier(.34,1.56,.64,1);
  max-width: 360px;
  width: 90%;
}

@keyframes jgResultCardIn {
  from { transform: translateY(24px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

#win-juegos .jg-result-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 20px;
  color: #f5f5f7;
  letter-spacing: -0.5px;
}

#win-juegos .jg-result-score {
  font-size: 16px;
  color: #8a8a9a;
  margin-bottom: 8px;
  font-weight: 500;
}

#win-juegos .jg-result-score strong {
  color: #34d399;
  font-size: 32px;
  font-weight: 800;
  display: block;
  margin-top: 4px;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}

#win-juegos .jg-result-level {
  font-size: 13px;
  color: #5a5a6e;
  margin-bottom: 28px;
  font-weight: 500;
}

#win-juegos .jg-result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

#win-juegos .jg-result-btn {
  padding: 11px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  border: none;
  background: #f5f5f7;
  color: #0c0e14;
  font-family: inherit;
  letter-spacing: -0.2px;
}

#win-juegos .jg-result-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px -4px rgba(245,245,247,.2);
}

#win-juegos .jg-result-btn:active {
  transform: translateY(0);
}

#win-juegos .jg-result-btn.ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,.1);
  color: #8a8a9a;
}

#win-juegos .jg-result-btn.ghost:hover {
  background: rgba(255,255,255,.05);
  color: #d4d4dc;
  border-color: rgba(255,255,255,.15);
}

/* ══════════════════════════════════════════════════════════════
   GAME-SPECIFIC STYLES
   ══════════════════════════════════════════════════════════════ */

/* TIC TAC TOE */
#win-juegos .jg-ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 80px);
  gap: 6px;
  margin-bottom: 20px;
}

#win-juegos .jg-ttt-cell {
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

#win-juegos .jg-ttt-cell:hover {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.10);
}

#win-juegos #jg-ttt-status {
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  color: #d4d4dc;
}

/* MEMORY GAME */
#win-juegos .jg-memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 70px);
  gap: 8px;
}

#win-juegos .jg-memory-card {
  width: 70px;
  height: 70px;
  cursor: pointer;
  perspective: 1000px;
}

#win-juegos .jg-memory-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s cubic-bezier(.4,0,.2,1);
  transform-style: preserve-3d;
}

#win-juegos .jg-memory-card.flipped .jg-memory-inner {
  transform: rotateY(180deg);
}

#win-juegos .jg-memory-front,
#win-juegos .jg-memory-back {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-weight: 700;
  font-size: 24px;
  backface-visibility: hidden;
}

#win-juegos .jg-memory-front {
  background: #1e2030;
  color: #fff;
  border: 1px solid rgba(255,255,255,.08);
}

#win-juegos .jg-memory-back {
  background: rgba(255,255,255,.03);
  transform: rotateY(180deg);
  border: 1px solid rgba(255,255,255,.06);
}

#win-juegos .jg-memory-card.matched .jg-memory-back {
  opacity: 0.4;
}

/* SIMON GAME */
#win-juegos .jg-simon-board {
  display: grid;
  grid-template-columns: repeat(2, 120px);
  gap: 12px;
}

#win-juegos .jg-simon-button {
  width: 120px;
  height: 120px;
  border-radius: 14px;
  cursor: pointer;
  transition: all .08s;
  border: 1px solid rgba(255,255,255,.1);
  opacity: 1;
}

#win-juegos .jg-simon-button:hover {
  box-shadow: 0 0 24px currentColor;
}

/* 2048 GAME */
#win-juegos .jg-2048-grid {
  display: grid;
  grid-template-columns: repeat(4, 80px);
  gap: 6px;
  background: #15171f;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.04);
}

#win-juegos .jg-2048-cell {
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.04);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  transition: all 0.2s cubic-bezier(.34,1.56,.64,1);
  font-variant-numeric: tabular-nums;
}

#win-juegos .jg-2048-cell:hover {
  transform: scale(1.04);
}

#win-juegos .jg-2048-cell[data-value="2"] {
  background: #e0e7ff; color: #3730a3;
  border-color: transparent;
}

#win-juegos .jg-2048-cell[data-value="4"] {
  background: #c7d2fe; color: #312e81;
  border-color: transparent;
}

#win-juegos .jg-2048-cell[data-value="8"] {
  background: #bbf7d0; color: #166534;
  border-color: transparent;
}

#win-juegos .jg-2048-cell[data-value="16"] {
  background: #86efac; color: #14532d;
  border-color: transparent;
}

#win-juegos .jg-2048-cell[data-value="32"] {
  background: #fde68a; color: #78350f;
  border-color: transparent;
  animation: jg2048pulse 2s ease-in-out infinite;
}

#win-juegos .jg-2048-cell[data-value="64"] {
  background: #fcd34d; color: #713f12;
  border-color: transparent;
  animation: jg2048pulse 1.8s ease-in-out infinite;
}

#win-juegos .jg-2048-cell[data-value="128"] {
  background: #fdba74; color: #7c2d12;
  border-color: transparent;
  animation: jg2048pulse 1.5s ease-in-out infinite;
}

#win-juegos .jg-2048-cell[data-value="256"] {
  background: #f87171; color: #7f1d1d;
  border-color: transparent;
  animation: jg2048pulse 1.2s ease-in-out infinite;
}

#win-juegos .jg-2048-cell[data-value="512"] {
  background: #ef4444; color: #fff;
  border-color: transparent;
  animation: jg2048pulse 1s ease-in-out infinite;
}

#win-juegos .jg-2048-cell[data-value="1024"] {
  background: #e879f9; color: #86198f;
  border-color: transparent;
  animation: jg2048pulse .8s ease-in-out infinite;
}

#win-juegos .jg-2048-cell[data-value="2048"] {
  background: linear-gradient(135deg, #a78bfa, #818cf8);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 30px rgba(139,92,246,.4);
  animation: jg2048win 2.5s linear infinite;
  font-size: 22px;
}

@keyframes jg2048pulse {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50% { box-shadow: 0 0 16px -4px currentColor; }
}

@keyframes jg2048win {
  0% { box-shadow: 0 0 20px rgba(167,139,250,.3), 0 0 40px rgba(167,139,250,.1); }
  50% { box-shadow: 0 0 30px rgba(129,140,248,.5), 0 0 50px rgba(129,140,248,.2); }
  100% { box-shadow: 0 0 20px rgba(167,139,250,.3), 0 0 40px rgba(167,139,250,.1); }
}

/* Keep legacy keyframes for any JS refs */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 12px currentColor; }
  50% { box-shadow: 0 0 24px currentColor; }
}

@keyframes rainbow-glow {
  0% { box-shadow: 0 0 20px #ef4444; }
  33% { box-shadow: 0 0 20px #fbbf24; }
  66% { box-shadow: 0 0 20px #4ade80; }
  100% { box-shadow: 0 0 20px #ef4444; }
}

#win-juegos .jg-2048-cell.new-tile {
  animation: tile-appear 0.3s cubic-bezier(.34,1.56,.64,1);
}

@keyframes tile-appear {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

#win-juegos .jg-2048-cell.merged {
  animation: tile-merge 0.25s ease-out;
}

@keyframes tile-merge {
  0% { transform: scale(1.2); }
  50% { transform: scale(0.92); }
  100% { transform: scale(1); }
}

/* WHACK-A-MOLE */
#win-juegos .jg-whack-time {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 16px;
  color: #34d399;
  font-variant-numeric: tabular-nums;
}

#win-juegos .jg-whack-time.warning {
  color: #f59e0b;
  animation: jgTimePulse .5s;
}

@keyframes jgTimePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

#win-juegos .jg-whack-grid {
  display: grid;
  grid-template-columns: repeat(3, 80px);
  gap: 12px;
}

#win-juegos .wm-hole {
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, #2a2520, #1a1815);
  border-radius: 50%;
  border: 3px solid #2e2a25;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 4px 10px rgba(0,0,0,.6);
  transition: all .1s;
}

#win-juegos .wm-hole::before {
  content: "🐭";
  position: absolute;
  font-size: 36px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) translateY(60px);
  transition: transform .12s cubic-bezier(.4,0,.2,1);
  z-index: 1;
}

#win-juegos .wm-hole.active::before {
  transform: translate(-50%, -50%) translateY(0);
}

#win-juegos .wm-hole:hover {
  border-color: #3e3a35;
}

/* ══════════════════════════════════════════════════════════════
   RANKING / LEADERBOARD MODAL
   ══════════════════════════════════════════════════════════════ */

#win-juegos .jg-ranking-modal {
  position: absolute;
  inset: 0;
  background: rgba(6,7,11,.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn .25s ease;
}

#win-juegos .jg-ranking-card {
  background: #181a24;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 18px;
  width: min(460px, 90%);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px -12px rgba(0,0,0,.6);
}

#win-juegos .jg-ranking-header {
  padding: 20px 22px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#win-juegos .jg-ranking-title {
  font-size: 18px;
  font-weight: 700;
  color: #f5f5f7;
  margin: 0;
  letter-spacing: -0.3px;
}

#win-juegos .jg-ranking-close {
  background: rgba(255,255,255,.06);
  border: none;
  width: 30px; height: 30px;
  border-radius: 8px;
  color: #8a8a9a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  font-family: inherit;
}

#win-juegos .jg-ranking-close:hover {
  background: rgba(255,255,255,.10);
  color: #f5f5f7;
}

#win-juegos .jg-ranking-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

#win-juegos .jg-rank-item {
  display: flex;
  align-items: center;
  padding: 10px 22px;
  border-bottom: 1px solid rgba(255,255,255,.03);
  gap: 12px;
  transition: background .15s;
}

#win-juegos .jg-rank-item:hover {
  background: rgba(255,255,255,.03);
}

#win-juegos .jg-rank-pos {
  font-size: 15px; font-weight: 800; color: #4a4a5c; width: 28px;
  font-variant-numeric: tabular-nums;
}

#win-juegos .jg-rank-pos.top-1 { color: #fbbf24; }
#win-juegos .jg-rank-pos.top-2 { color: #94a3b8; }
#win-juegos .jg-rank-pos.top-3 { color: #cd7f32; }

#win-juegos .jg-rank-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  object-fit: cover; background: #1e2030;
  border: 1px solid rgba(255,255,255,.06);
}

#win-juegos .jg-rank-info { flex: 1; }
#win-juegos .jg-rank-name { font-weight: 600; font-size: 13px; color: #d4d4dc; }
#win-juegos .jg-rank-score {
  font-weight: 800; font-size: 15px; color: #34d399;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}
#win-juegos .jg-rank-date { font-size: 11px; color: #4a4a5c; }

/* ══════════════════════════════════════════════════════════════
   IMMERSIVE MODE
   ══════════════════════════════════════════════════════════════ */

#win-juegos .jg-immersive-btn {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  color: #8a8a9a;
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 8px;
  transition: all .15s;
}

#win-juegos .jg-immersive-btn:hover {
  background: rgba(255,255,255,.10);
  color: #f5f5f7;
}

#win-juegos.immersive-mode {
  position: fixed !important;
  top: 0 !important; left: 0 !important;
  width: 100vw !important; height: 100vh !important;
  z-index: 99999 !important;
  border-radius: 0 !important;
  transform: none !important;
}

#win-juegos.immersive-mode .titlebar { display: none !important; }

#win-juegos.immersive-mode .jg-game-view {
  border-radius: 0 !important;
  padding: 0 !important;
}

#win-juegos.immersive-mode .jg-game-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  opacity: 1;
  transition: opacity .3s;
  pointer-events: none;
}

#win-juegos.immersive-mode .jg-game-title,
#win-juegos.immersive-mode .jg-game-score {
  opacity: 0;
  pointer-events: none;
}

#win-juegos.immersive-mode .jg-game-header:hover { opacity: 1; }

#win-juegos.immersive-mode .jg-immersive-btn {
  position: fixed;
  top: 16px; right: 16px;
  z-index: 100;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.15);
  width: 40px; height: 40px;
  pointer-events: auto;
  opacity: 0.5;
  border-radius: 10px;
}

#win-juegos.immersive-mode .jg-immersive-btn:hover {
  opacity: 1;
  background: rgba(239,68,68,.5);
}

#win-juegos.immersive-mode .jg-back-btn {
  position: fixed;
  top: 16px; left: 16px;
  z-index: 100;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  padding: 8px 14px;
  border-radius: 10px;
  pointer-events: auto;
  opacity: 0.5;
}

#win-juegos.immersive-mode .jg-back-btn:hover {
  opacity: 1;
  background: rgba(255,255,255,.12);
}

#win-juegos.immersive-mode .jg-game-area {
  border: none !important;
  background: #000 !important;
  border-radius: 0 !important;
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#win-juegos.immersive-mode canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  max-width: none !important;
  max-height: none !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
}

/* ══════════════════════════════════════════════════════════════
   VIRTUAL CONTROLS (TOUCH)
   ══════════════════════════════════════════════════════════════ */

#win-juegos .jg-virtual-pad {
  position: absolute;
  bottom: 20px;
  left: 20px; right: 20px;
  display: none;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 100;
}

@media (pointer: coarse) {
  #win-juegos .jg-virtual-pad { display: flex; }

  /* Mobile touch GUI: larger controls + lower opacity */
  #win-juegos .jg-virtual-pad {
    opacity: 0.35;
    bottom: 26px;
    left: 24px;
    right: 24px;
  }

  #win-juegos .jg-vpad-dpad {
    grid-template-columns: repeat(3, 168px);
    grid-template-rows: repeat(3, 168px);
  }

  #win-juegos .jg-vbtn {
    width: 144px;
    height: 144px;
    font-size: 54px;
    border-width: 2px;
  }

  #win-juegos .jg-vpad-actions {
    gap: 36px;
    padding-bottom: 34px;
    padding-right: 22px;
  }

  #win-juegos .jg-vbtn.action {
    width: 192px;
    height: 192px;
    font-size: 44px;
  }
}

/* Force large virtual controls in CualityX mobile mode */
html[data-cx-mobile-mode="1"] #win-juegos .jg-virtual-pad {
  display: flex !important;
  opacity: 0.35 !important;
  bottom: 26px !important;
  left: 24px !important;
  right: 24px !important;
}

html[data-cx-mobile-mode="1"] #win-juegos .jg-vpad-dpad {
  grid-template-columns: repeat(3, 168px) !important;
  grid-template-rows: repeat(3, 168px) !important;
}

html[data-cx-mobile-mode="1"] #win-juegos .jg-vbtn {
  width: 144px !important;
  height: 144px !important;
  font-size: 54px !important;
  border-width: 2px !important;
}

html[data-cx-mobile-mode="1"] #win-juegos .jg-vpad-actions {
  gap: 36px !important;
  padding-bottom: 34px !important;
  padding-right: 22px !important;
}

html[data-cx-mobile-mode="1"] #win-juegos .jg-vbtn.action {
  width: 192px !important;
  height: 192px !important;
  font-size: 44px !important;
}

#win-juegos .jg-vpad-dpad {
  display: grid;
  grid-template-columns: repeat(3, 56px);
  grid-template-rows: repeat(3, 56px);
  pointer-events: auto;
}

#win-juegos .jg-vbtn {
  width: 48px; height: 48px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.8);
  font-size: 20px;
  touch-action: manipulation;
  user-select: none;
  cursor: pointer;
  margin: auto;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background .08s, transform .08s;
}

#win-juegos .jg-vbtn:active {
  background: rgba(255,255,255,.25);
  transform: scale(0.92);
}

#win-juegos .jg-vbtn.up { grid-column: 2; grid-row: 1; }
#win-juegos .jg-vbtn.left { grid-column: 1; grid-row: 2; }
#win-juegos .jg-vbtn.right { grid-column: 3; grid-row: 2; }
#win-juegos .jg-vbtn.down { grid-column: 2; grid-row: 3; }

#win-juegos .jg-vpad-actions {
  display: flex;
  gap: 16px;
  pointer-events: auto;
  padding-bottom: 20px;
  padding-right: 16px;
}

#win-juegos .jg-vbtn.action {
  width: 64px; height: 64px;
  font-size: 16px; font-weight: 700;
  background: rgba(52,211,153,.12);
  border-color: rgba(52,211,153,.25);
}

#win-juegos .jg-vbtn.action.red {
  background: rgba(248,113,113,.12);
  border-color: rgba(248,113,113,.25);
}

/* ══════════════════════════════════════════════════════════════
   SPLIT SCREEN LAYOUT
   ══════════════════════════════════════════════════════════════ */

.jg-split-layout {
  display: flex;
  width: 100%; height: 100%;
  overflow: hidden;
  position: relative;
}

.jg-sl-main {
  flex: 1;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #000;
  overflow: hidden;
}

.jg-sl-main canvas {
  /* Scale to fill full height while keeping native aspect ratio.
     V2 games override with inline style.width/height, so they still fill the area. */
  height: 100%;
  width: auto;
  max-width: 100%;
  margin: 0; border: none; box-shadow: none;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.jg-sl-sidebar {
  width: 300px;
  height: 100%;
  background: #111318;
  border-left: 1px solid rgba(255,255,255,.04);
  display: flex;
  flex-direction: column;
  padding: 18px;
  z-index: 50;
  flex-shrink: 0;
}

.jg-sl-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  padding-bottom: 14px;
}

.jg-sb-title {
  font-size: 12px; font-weight: 700;
  color: #8a8a9a;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin: 0;
}

.jg-close-game-btn {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  color: #6b6b7b;
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
  font-size: 14px;
  line-height: 1;
}

.jg-close-game-btn:hover {
  background: rgba(239,68,68,.15);
  border-color: rgba(239,68,68,.25);
  color: #ef4444;
}

.jg-sync-ranking-btn {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  color: #6b6b7b;
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
  font-size: 15px;
  line-height: 1;
}
.jg-sync-ranking-btn:hover {
  background: rgba(34,211,238,.12);
  border-color: rgba(34,211,238,.25);
  color: #22d3ee;
}
.jg-sync-ranking-btn.jg-spin {
  animation: jg-spin-anim .7s linear infinite;
  opacity: .6;
  pointer-events: none;
}
@keyframes jg-spin-anim {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.jg-sb-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}

.jg-sb-controls {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.04);
  font-size: 12px;
  color: #5a5a6e;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.jg-sb-controls div { margin-bottom: 4px; }

.jg-sb-list::-webkit-scrollbar { width: 3px; }
.jg-sb-list::-webkit-scrollbar-track { background: transparent; }
.jg-sb-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.06); border-radius: 2px; }

.jg-mini-rank {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255,255,255,.02);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.03);
  transition: background .15s, border-color .15s;
}

.jg-mini-rank:hover {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.06);
}

.jg-mini-pos {
  font-weight: 800;
  width: 20px;
  text-align: center;
  color: #4a4a5c;
  font-size: 11px;
  margin-right: 8px;
  font-variant-numeric: tabular-nums;
}

.jg-mini-rank:nth-child(1) .jg-mini-pos { color: #fbbf24; }
.jg-mini-rank:nth-child(2) .jg-mini-pos { color: #d4d4dc; }
.jg-mini-rank:nth-child(3) .jg-mini-pos { color: #cd7f32; }

.jg-mini-avatar {
  width: 26px; height: 26px;
  border-radius: 8px;
  margin-right: 10px;
  background: #1e2030;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.04);
}

.jg-mini-info {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.jg-mini-name {
  font-size: 12px; color: #d4d4dc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  letter-spacing: -0.1px;
}

.jg-mini-score {
  font-weight: 700;
  color: #34d399;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* Controls overlay for games */
.jg-game-controls-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
}

.jg-game-controls-overlay button,
.jg-game-controls-overlay .jg-snake-btn,
.jg-game-controls-overlay a {
  pointer-events: auto;
}

.jg-game-score-floating {
  position: absolute;
  top: 16px; left: 16px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 5px 11px;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,.08);
  z-index: 20;
  font-variant-numeric: tabular-nums;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════
   GLOBAL RANKING SIDEBAR (Home Screen)
   ══════════════════════════════════════════════════════════════ */

#win-juegos .jg-home__sidebar {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 16px;
  overflow: hidden;
  position: sticky;
  top: 0;
  align-self: flex-start;
  max-height: calc(100vh - 200px);
}

html[data-cx-mobile-mode="1"] #win-juegos .jg-home__sidebar {
  position: relative;
  top: auto;
  align-self: stretch;
  height: 100%;
  max-height: none;
  min-height: 0;
}

html[data-cx-mobile-mode="1"] #win-juegos .jg-home__sidebar-content {
  min-height: 0;
}

#win-juegos .jg-home__sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  flex-shrink: 0;
}

#win-juegos .jg-home__sidebar-icon {
  font-size: 18px;
}

#win-juegos .jg-home__sidebar-title {
  font-size: 13px;
  font-weight: 700;
  color: #d4d4dc;
  letter-spacing: -0.2px;
}

#win-juegos .jg-home__sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.06) transparent;
}

#win-juegos .jg-home__sidebar-content::-webkit-scrollbar { width: 4px; }
#win-juegos .jg-home__sidebar-content::-webkit-scrollbar-track { background: transparent; }
#win-juegos .jg-home__sidebar-content::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.08);
  border-radius: 2px;
}

/* ── User Card (top of sidebar) ── */
#win-juegos .jg-gr-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(99,102,241,.12) 0%, rgba(99,102,241,.05) 100%);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: 12px;
  margin-bottom: 0;
}

#win-juegos .jg-gr-user-card--empty {
  background: rgba(255,255,255,.03);
  border-color: rgba(255,255,255,.06);
}

#win-juegos .jg-gr-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid rgba(99,102,241,.4);
  flex-shrink: 0;
  background: #1e2030;
}

#win-juegos .jg-gr-user-info {
  flex: 1;
  min-width: 0;
}

#win-juegos .jg-gr-user-name {
  font-size: 13px;
  font-weight: 700;
  color: #e0e7ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

#win-juegos .jg-gr-user-stats {
  display: flex;
  gap: 8px;
  margin-top: 3px;
}

#win-juegos .jg-gr-user-score {
  font-size: 12px;
  font-weight: 800;
  color: #818cf8;
  font-variant-numeric: tabular-nums;
}

#win-juegos .jg-gr-user-games {
  font-size: 11px;
  color: #5a5a6e;
  font-weight: 500;
}

#win-juegos .jg-gr-user-badge {
  background: rgba(99,102,241,.2);
  color: #a5b4fc;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 8px;
  letter-spacing: -0.3px;
  flex-shrink: 0;
}

/* ── Separator ── */
#win-juegos .jg-gr-separator {
  height: 1px;
  background: rgba(255,255,255,.06);
  margin: 10px 0;
}

/* ── Top 10 Items ── */
#win-juegos .jg-gr-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, transform .1s;
}

#win-juegos .jg-gr-item:hover {
  background: rgba(255,255,255,.04);
}

#win-juegos .jg-gr-item:active {
  transform: scale(0.98);
}

#win-juegos .jg-gr-item--me {
  background: rgba(99,102,241,.08);
  border: 1px solid rgba(99,102,241,.15);
}

#win-juegos .jg-gr-item-pos {
  width: 24px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: #4a4a5c;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

#win-juegos .jg-gr-item-pos--medal {
  font-size: 16px;
}

#win-juegos .jg-gr-item-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: cover;
  background: #1e2030;
  border: 1px solid rgba(255,255,255,.05);
  flex-shrink: 0;
}

#win-juegos .jg-gr-item-info {
  flex: 1;
  min-width: 0;
}

#win-juegos .jg-gr-item-name {
  font-size: 12px;
  font-weight: 600;
  color: #d4d4dc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.1px;
}

#win-juegos .jg-gr-item-games {
  font-size: 10px;
  color: #4a4a5c;
  font-weight: 500;
}

#win-juegos .jg-gr-item-score {
  font-size: 13px;
  font-weight: 800;
  color: #34d399;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   RANKING BUTTON ON GAME CARDS
   ══════════════════════════════════════════════════════════════ */

#win-juegos .jg-card__ranking-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: rgba(255,255,255,.06);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  z-index: 5;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .25s cubic-bezier(.22,1,.36,1),
              transform .25s cubic-bezier(.22,1,.36,1),
              background .15s,
              box-shadow .15s;
  padding: 0;
}

#win-juegos .jg-card:hover .jg-card__ranking-btn {
  opacity: 1;
  transform: translateY(0);
}

#win-juegos .jg-card__ranking-btn:hover {
  background: rgba(251,191,36,.15);
  box-shadow: 0 0 12px rgba(251,191,36,.15);
  transform: scale(1.1);
}

#win-juegos .jg-card__ranking-btn:active {
  transform: scale(0.95);
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — SIDEBAR
   ══════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  #win-juegos .jg-card {
    animation: none !important;
    transition: none !important;
  }

  #win-juegos .jg-card::after {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════
   TEMA CLARO — overrides (solo html[data-theme="light"]). Aditivo:
   no toca el tema oscuro por defecto. Lo controla el selector de
   Tema en Configuracion > Sistema (Claro/Oscuro/Horario).

   IMPORTANTE: el AREA DE JUEGO (.jg-game-area, .jg-sl-main, los
   canvas y los tableros de cada juego TTT/Memory/Simon/2048/Whack)
   NO se tematiza — el lienzo se queda oscuro a proposito para no
   romper el render del juego. Solo se tematiza el MENU/chrome:
   home, tarjetas, filtros, sidebar, modales, headers y botones.
   ═══════════════════════════════════════════════════════════ */

/* App + pantalla home (fondos oscuros -> claros) */
html[data-theme="light"] #win-juegos { background: #eef1f7; color: #1e293b; }
html[data-theme="light"] #win-juegos .jg-home { background: #eef1f7; }

/* Barra de filtros + busqueda */
html[data-theme="light"] #win-juegos .jg-home__filters {
  background: rgba(0,0,0,.03);
  border-color: rgba(0,0,0,.08);
}
html[data-theme="light"] #win-juegos .jg-pill { color: rgba(30,41,59,.6); }
html[data-theme="light"] #win-juegos .jg-pill:hover {
  color: #1e293b;
  background: rgba(0,0,0,.05);
}
html[data-theme="light"] #win-juegos .jg-pill--active {
  background: #ffffff;
  color: #312e81;
  box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 1px rgba(0,0,0,.06);
}
html[data-theme="light"] #win-juegos .jg-pill--active:hover {
  background: #ffffff;
  color: #312e81;
}
html[data-theme="light"] #win-juegos .jg-home__search-input {
  background: #ffffff;
  border-color: rgba(0,0,0,.12);
  color: #1e293b;
}
html[data-theme="light"] #win-juegos .jg-home__search-input::placeholder { color: rgba(30,41,59,.45); }
html[data-theme="light"] #win-juegos .jg-home__search-input:focus {
  border-color: rgba(0,0,0,.2);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0,0,0,.04);
}
html[data-theme="light"] #win-juegos .jg-home__search-icon { color: rgba(30,41,59,.5); }

/* Scrollbars del body de la home */
html[data-theme="light"] #win-juegos .jg-home__body { scrollbar-color: rgba(0,0,0,.18) transparent; }
html[data-theme="light"] #win-juegos .jg-home__body::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); }
html[data-theme="light"] #win-juegos .jg-home__body::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.25); }

/* Tarjetas de juego (menu de seleccion) */
html[data-theme="light"] #win-juegos .jg-card {
  background: #ffffff;
  border-color: rgba(0,0,0,.08);
}
html[data-theme="light"] #win-juegos .jg-card:hover {
  box-shadow:
    0 20px 40px -12px rgba(0,0,0,.18),
    0 8px 16px -4px rgba(0,0,0,.1),
    0 0 40px -10px var(--accent-soft);
}
html[data-theme="light"] #win-juegos .jg-card__badge {
  background: rgba(0,0,0,.05);
  color: rgba(30,41,59,.55);
}
html[data-theme="light"] #win-juegos .jg-card:hover .jg-card__badge {
  background: rgba(0,0,0,.08);
  color: rgba(30,41,59,.75);
}
html[data-theme="light"] #win-juegos .jg-card__icon { filter: drop-shadow(0 4px 12px rgba(0,0,0,.15)); }
html[data-theme="light"] #win-juegos .jg-card__name { color: #1e293b; }
html[data-theme="light"] #win-juegos .jg-card:hover .jg-card__name { color: #0f172a; }
html[data-theme="light"] #win-juegos .jg-card__desc { color: rgba(30,41,59,.55); }
html[data-theme="light"] #win-juegos .jg-card__xp { background: rgba(0,0,0,.06); }
html[data-theme="light"] #win-juegos .jg-card__score {
  border-top-color: rgba(0,0,0,.08);
  color: rgba(30,41,59,.5);
}
html[data-theme="light"] #win-juegos .jg-card__ranking-btn { background: rgba(0,0,0,.05); }

/* Estado vacio */
html[data-theme="light"] #win-juegos .jg-home__empty { color: rgba(30,41,59,.5); }

/* ── Sidebar de ranking global (home) ── */
html[data-theme="light"] #win-juegos .jg-home__sidebar {
  background: #ffffff;
  border-color: rgba(0,0,0,.08);
}
html[data-theme="light"] #win-juegos .jg-home__sidebar-header { border-bottom-color: rgba(0,0,0,.08); }
html[data-theme="light"] #win-juegos .jg-home__sidebar-title { color: #1e293b; }
html[data-theme="light"] #win-juegos .jg-home__sidebar-content { scrollbar-color: rgba(0,0,0,.18) transparent; }
html[data-theme="light"] #win-juegos .jg-home__sidebar-content::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); }
html[data-theme="light"] #win-juegos .jg-gr-separator { background: rgba(0,0,0,.08); }
html[data-theme="light"] #win-juegos .jg-gr-item:hover { background: rgba(0,0,0,.04); }
html[data-theme="light"] #win-juegos .jg-gr-item-pos { color: rgba(30,41,59,.5); }
html[data-theme="light"] #win-juegos .jg-gr-item-name { color: #1e293b; }
html[data-theme="light"] #win-juegos .jg-gr-item-games { color: rgba(30,41,59,.5); }
html[data-theme="light"] #win-juegos .jg-gr-user-name { color: #312e81; }
html[data-theme="light"] #win-juegos .jg-gr-user-games { color: rgba(30,41,59,.55); }

/* ── Vista de juego: header / chrome alrededor del lienzo ── */
html[data-theme="light"] #win-juegos .jg-game-view { background: #eef1f7; }
html[data-theme="light"] #win-juegos .jg-game-header {
  background: #ffffff;
  border-color: rgba(0,0,0,.08);
}
html[data-theme="light"] #win-juegos .jg-back-btn {
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.1);
  color: #1e293b;
}
html[data-theme="light"] #win-juegos .jg-back-btn:hover {
  background: rgba(0,0,0,.08);
  border-color: rgba(0,0,0,.16);
}
html[data-theme="light"] #win-juegos .jg-back-btn:active { background: rgba(0,0,0,.06); }
html[data-theme="light"] #win-juegos .jg-game-title { color: #1e293b; }
html[data-theme="light"] #win-juegos .jg-game-controls {
  background: rgba(0,0,0,.03);
  border-color: rgba(0,0,0,.06);
  color: rgba(30,41,59,.6);
}
html[data-theme="light"] #win-juegos .jg-immersive-btn {
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.1);
  color: rgba(30,41,59,.6);
}
html[data-theme="light"] #win-juegos .jg-immersive-btn:hover {
  background: rgba(0,0,0,.08);
  color: #1e293b;
}

/* NOTA: .jg-game-area se deja con su fondo oscuro original (lienzo). */

/* ── Modal de resultado ── */
html[data-theme="light"] #win-juegos .jg-result-overlay { background: rgba(230,233,242,.85); }
html[data-theme="light"] #win-juegos .jg-result-card {
  background: #ffffff;
  border-color: rgba(0,0,0,.08);
  box-shadow: 0 24px 64px -12px rgba(0,0,0,.25), 0 0 0 1px rgba(0,0,0,.03);
}
html[data-theme="light"] #win-juegos .jg-result-title { color: #1e293b; }
html[data-theme="light"] #win-juegos .jg-result-score { color: rgba(30,41,59,.6); }
html[data-theme="light"] #win-juegos .jg-result-level { color: rgba(30,41,59,.5); }
html[data-theme="light"] #win-juegos .jg-result-btn { background: #312e81; color: #ffffff; }
html[data-theme="light"] #win-juegos .jg-result-btn:hover { box-shadow: 0 6px 20px -4px rgba(49,46,129,.35); }
html[data-theme="light"] #win-juegos .jg-result-btn.ghost {
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.1);
  color: rgba(30,41,59,.65);
}
html[data-theme="light"] #win-juegos .jg-result-btn.ghost:hover {
  background: rgba(0,0,0,.08);
  color: #1e293b;
  border-color: rgba(0,0,0,.16);
}

/* ── Modal de ranking / leaderboard ── */
html[data-theme="light"] #win-juegos .jg-ranking-modal { background: rgba(230,233,242,.88); }
html[data-theme="light"] #win-juegos .jg-ranking-card {
  background: #ffffff;
  border-color: rgba(0,0,0,.08);
  box-shadow: 0 24px 64px -12px rgba(0,0,0,.25);
}
html[data-theme="light"] #win-juegos .jg-ranking-header { border-bottom-color: rgba(0,0,0,.08); }
html[data-theme="light"] #win-juegos .jg-ranking-title { color: #1e293b; }
html[data-theme="light"] #win-juegos .jg-ranking-close {
  background: rgba(0,0,0,.05);
  color: rgba(30,41,59,.6);
}
html[data-theme="light"] #win-juegos .jg-ranking-close:hover {
  background: rgba(0,0,0,.1);
  color: #1e293b;
}
html[data-theme="light"] #win-juegos .jg-rank-item { border-bottom-color: rgba(0,0,0,.05); }
html[data-theme="light"] #win-juegos .jg-rank-item:hover { background: rgba(0,0,0,.03); }
html[data-theme="light"] #win-juegos .jg-rank-pos { color: rgba(30,41,59,.5); }
html[data-theme="light"] #win-juegos .jg-rank-name { color: #1e293b; }
html[data-theme="light"] #win-juegos .jg-rank-date { color: rgba(30,41,59,.5); }

/* ── Split-screen sidebar (chrome alrededor del lienzo, .jg-sl-main queda #000) ── */
html[data-theme="light"] .jg-sl-sidebar {
  background: #ffffff;
  border-left-color: rgba(0,0,0,.08);
}
html[data-theme="light"] .jg-sl-header { border-bottom-color: rgba(0,0,0,.08); }
html[data-theme="light"] .jg-sb-title { color: rgba(30,41,59,.6); }
html[data-theme="light"] .jg-close-game-btn {
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.08);
  color: rgba(30,41,59,.55);
}
html[data-theme="light"] .jg-sync-ranking-btn {
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.08);
  color: rgba(30,41,59,.55);
}
html[data-theme="light"] .jg-sb-controls {
  border-top-color: rgba(0,0,0,.08);
  color: rgba(30,41,59,.6);
}
html[data-theme="light"] .jg-sb-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); }
html[data-theme="light"] .jg-mini-rank {
  background: rgba(0,0,0,.02);
  border-color: rgba(0,0,0,.05);
}
html[data-theme="light"] .jg-mini-rank:hover {
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.08);
}
html[data-theme="light"] .jg-mini-pos { color: rgba(30,41,59,.5); }
html[data-theme="light"] .jg-mini-name { color: #1e293b; }
