/* ==========================================================================
   Sphynx: Gravity Lab — estilos del juego
   Laboratorio de ciencia ficción adorable: cristal, neón azul y magenta.
   ========================================================================== */
:root {
  --gl-ink: #1c1430;
  --gl-paper: #f4f6ff;
  --gl-panel: rgba(20, 14, 40, 0.92);
  --gl-panel-ink: #f2ecff;
  --gl-blue: #37c7ff;
  --gl-magenta: #ff5fd3;
  --gl-amber: #ffc83d;
  --gl-danger: #ff4d6b;
  --gl-radius: 20px;
}

body.gl-page {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--gl-ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(55, 199, 255, 0.22), transparent 45%),
    radial-gradient(circle at 82% 20%, rgba(255, 95, 211, 0.2), transparent 46%),
    linear-gradient(180deg, #eef2ff, #e6ecfb 60%, #dfe7fa);
  min-height: 100vh;
  overflow-x: hidden;
}

.gl-site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px clamp(14px, 4vw, 34px);
}
.gl-brand {
  font-weight: 900;
  color: var(--gl-ink);
  text-decoration: none;
  font-size: 1.05rem;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(28, 20, 48, 0.14);
}
.gl-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.gl-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(28, 20, 48, 0.12);
  color: var(--gl-ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
}
.gl-nav a:hover { background: rgba(255, 255, 255, 0.85); }

.gl-main { max-width: 1080px; margin: 0 auto; padding: 0 clamp(12px, 3vw, 26px) 40px; }

.gl-hero { text-align: center; padding: 8px 8px 18px; }
.gl-kicker {
  margin: 0 0 4px;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
  color: #6a4fd0;
}
.gl-hero h1 { margin: 0 0 8px; font-size: clamp(1.7rem, 5.4vw, 2.6rem); font-weight: 900; }
.gl-hero .gl-tagline { margin: 0 auto 14px; max-width: 640px; font-size: 1.02rem; line-height: 1.55; }
.gl-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.gl-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 0;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.gl-button:focus-visible { outline: 3px solid var(--gl-blue); outline-offset: 2px; }
.gl-button.primary {
  background: linear-gradient(120deg, var(--gl-blue), #7a5cff 55%, var(--gl-magenta));
  color: #fff;
  box-shadow: 0 10px 24px rgba(90, 70, 220, 0.35);
}
.gl-button.primary:hover { transform: translateY(-2px); }
.gl-button.secondary {
  background: rgba(255, 255, 255, 0.85);
  color: var(--gl-ink);
  border: 1px solid rgba(28, 20, 48, 0.18);
}
.gl-button.dark { background: var(--gl-ink); color: #fff; }
.gl-button.is-disabled { opacity: 0.55; pointer-events: none; }

/* ---------- carcasa del juego ---------- */
.gl-shell { margin: 6px auto 26px; }
.gl-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}
.gl-stat {
  min-width: 86px;
  text-align: center;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(28, 20, 48, 0.14);
  border-radius: 14px;
  padding: 6px 12px;
}
.gl-stat span {
  display: block;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
}
.gl-stat strong { font-size: 1.15rem; font-weight: 900; }

.gl-meter-wrap {
  flex-basis: 100%;
  max-width: 560px;
  margin: 0 auto;
}
.gl-meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6a4fd0;
  margin-bottom: 3px;
}
.gl-meter {
  height: 12px;
  border-radius: 999px;
  background: rgba(28, 20, 48, 0.14);
  overflow: hidden;
  border: 1px solid rgba(28, 20, 48, 0.16);
}
.gl-meter > i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gl-blue), #7a5cff, var(--gl-magenta));
  transition: width 0.15s linear;
}
.gl-meter.is-full > i { animation: gl-meter-pulse 0.7s ease-in-out infinite alternate; }
@keyframes gl-meter-pulse { from { filter: brightness(1); } to { filter: brightness(1.5); } }

.gl-stage-wrap {
  position: relative;
  border-radius: var(--gl-radius);
  overflow: hidden;
  border: 3px solid rgba(28, 20, 48, 0.55);
  box-shadow: 0 22px 50px rgba(28, 20, 48, 0.35);
  background: #120d26;
  touch-action: none;
  overscroll-behavior: contain;
  -webkit-user-select: none;
  user-select: none;
}
.gl-canvas { display: block; width: 100%; height: auto; }

.gl-stage-buttons {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
  z-index: 30;
}
.gl-icon-button {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(20, 14, 40, 0.65);
  color: #fff;
  font-size: 1.15rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.gl-icon-button:focus-visible { outline: 3px solid var(--gl-blue); outline-offset: 2px; }
.gl-icon-button[aria-pressed="true"] { background: rgba(122, 92, 255, 0.85); }

/* ---------- overlays ---------- */
.gl-screen {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 20;
  background: rgba(12, 8, 28, 0.72);
  backdrop-filter: blur(3px);
}
.gl-screen.is-visible { display: flex; }
.gl-panel {
  width: min(480px, 94%);
  max-height: 96%;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: var(--gl-panel);
  color: var(--gl-panel-ink);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--gl-radius);
  padding: 20px 20px 22px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.gl-panel::-webkit-scrollbar { width: 0; height: 0; }
.gl-panel h2 { margin: 4px 0 8px; font-size: 1.5rem; font-weight: 900; }
.gl-panel p { margin: 0 0 10px; line-height: 1.5; font-size: 0.96rem; }
.gl-panel .gl-kicker { color: var(--gl-blue); }

.gl-start-visual { position: relative; margin: 2px auto 8px; width: fit-content; }
.gl-start-visual img {
  width: var(--dm-sticker-hero, clamp(170px, 44vw, 260px));
  height: auto;
  display: block;
  filter: drop-shadow(0 14px 26px rgba(55, 199, 255, 0.35));
}
.gl-rules {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}
.gl-rules li {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 6px 12px;
}
.gl-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }

.gl-result-grid {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 8px 0 10px;
  flex-wrap: wrap;
}
.gl-result-card {
  min-width: 110px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 8px 14px;
}
.gl-result-card span { display: block; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.75; font-weight: 800; }
.gl-result-card strong { font-size: 1.4rem; font-weight: 900; }
.gl-record-badge {
  display: inline-block;
  margin: 2px 0 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 900;
  background: linear-gradient(90deg, var(--gl-amber), var(--gl-magenta));
  color: #2a1400;
  animation: gl-pop 0.5s ease;
}
@keyframes gl-pop { 0% { transform: scale(0.4); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }

.gl-progress-block { margin: 8px 0 4px; text-align: left; font-size: 0.86rem; }
.gl-progress-block .row { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 3px; font-weight: 700; }
.gl-progress-bar { height: 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); overflow: hidden; margin-bottom: 8px; }
.gl-progress-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gl-blue), var(--gl-magenta)); border-radius: 999px; }
.gl-progress-block .done { color: #7dffb2; }

/* cuenta atrás */
.gl-countdown {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 25;
  pointer-events: none;
}
.gl-countdown.is-visible { display: flex; }
.gl-countdown span {
  font-size: clamp(64px, 18vw, 120px);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 30px var(--gl-blue), 0 6px 0 rgba(0, 0, 0, 0.4);
  animation: gl-pop 0.4s ease;
}

/* banner GENIUS */
.gl-genius-banner {
  position: absolute;
  top: 18%;
  left: 0;
  right: 0;
  display: none;
  justify-content: center;
  z-index: 15;
  pointer-events: none;
}
.gl-genius-banner.is-visible { display: flex; }
.gl-genius-banner span {
  font-size: clamp(26px, 7vw, 54px);
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #fff;
  padding: 6px 26px;
  border-radius: 16px;
  background: linear-gradient(100deg, rgba(55, 199, 255, 0.85), rgba(255, 95, 211, 0.85));
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
  transform: rotate(-3deg);
  animation: gl-pop 0.45s ease;
}

/* ---------- recompensa ---------- */
.gl-reward-figure { position: relative; margin: 4px auto 8px; width: fit-content; }
.gl-reward-figure img {
  width: var(--dm-sticker-reward, clamp(210px, 58vw, 310px));
  height: auto;
  display: block;
  border-radius: 18px;
  animation: gl-reward-in 0.9s cubic-bezier(0.2, 1.4, 0.4, 1);
  filter: drop-shadow(0 16px 30px rgba(255, 95, 211, 0.45));
}
@keyframes gl-reward-in { 0% { transform: scale(0.15) rotate(-14deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.gl-reward-name { font-size: 1.2rem; font-weight: 900; margin: 2px 0 4px; }
.gl-legendary .gl-reward-figure img { filter: drop-shadow(0 0 34px rgba(255, 95, 211, 0.75)) drop-shadow(0 0 60px rgba(55, 199, 255, 0.5)); }

/* estado accesible fuera del canvas */
.gl-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

/* ---------- reto diario ---------- */
.gl-daily {
  max-width: 560px;
  margin: 0 auto 22px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(28, 20, 48, 0.14);
  border-radius: 16px;
  padding: 12px 16px;
  text-align: center;
}
.gl-daily h2 { margin: 0 0 4px; font-size: 1rem; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; color: #6a4fd0; }
.gl-daily p { margin: 0 0 6px; font-weight: 700; }
.gl-daily .gl-progress-bar { background: rgba(28, 20, 48, 0.12); }
.gl-daily .done { color: #0d8a48; font-weight: 900; }

/* ---------- contenido editorial ---------- */
.gl-content { max-width: 820px; margin: 0 auto 20px; }
.gl-content section {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(28, 20, 48, 0.12);
  border-radius: 18px;
  padding: 20px 22px;
  margin-bottom: 16px;
  line-height: 1.6;
}
.gl-content h2 { margin: 0 0 8px; font-size: 1.25rem; font-weight: 900; }
.gl-content h3 { margin: 12px 0 4px; font-size: 1rem; font-weight: 800; }
.gl-content p { margin: 0 0 10px; }
.gl-content ol, .gl-content ul { margin: 0 0 10px; padding-left: 20px; }
.gl-content li { margin-bottom: 4px; }
.gl-link-row { display: flex; flex-wrap: wrap; gap: 10px; }

.gl-site-footer {
  text-align: center;
  padding: 22px 14px 34px;
  font-size: 0.92rem;
}
.gl-site-footer a { color: var(--gl-ink); font-weight: 700; }

/* ---------- responsive y accesibilidad ---------- */
@media (max-width: 640px) {
  .gl-stat { min-width: 72px; padding: 5px 8px; }
  .gl-stat strong { font-size: 1rem; }
  .gl-panel { padding: 16px 14px 18px; }
  .gl-content section { padding: 16px 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .gl-reward-figure img,
  .gl-genius-banner span,
  .gl-countdown span,
  .gl-record-badge { animation: none !important; }
  .gl-meter.is-full > i { animation: none !important; }
  .gl-button.primary:hover { transform: none; }
}
