﻿:root {
  color-scheme: dark;
  --bg: #070816;
  --bg-soft: #10142d;
  --panel: rgba(13, 18, 44, 0.92);
  --panel-2: rgba(25, 31, 67, 0.92);
  --text: #f7fbff;
  --muted: #aab7d7;
  --line: rgba(144, 171, 255, 0.16);
  --cyan: #39f5dd;
  --mint: #5ef2a8;
  --pink: #ff65c7;
  --orange: #ff8d3a;
  --yellow: #ffe777;
  --shadow: 0 22px 55px rgba(0, 0, 0, 0.38);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --max: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(98, 71, 255, 0.22), transparent 25%),
    radial-gradient(circle at 20% 0%, rgba(57, 245, 221, 0.11), transparent 30%),
    linear-gradient(180deg, #070816 0%, #090a18 48%, #0c1022 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}
body.modal-open { overflow: hidden; }

.bg-grid {
  position: fixed; inset: 0;
  pointer-events: none; opacity: 0.32;
  background-image:
    linear-gradient(rgba(129, 158, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(129, 158, 255, 0.06) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at center, black 0%, black 70%, transparent 100%);
}

.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(18px, 3vw, 34px);
  backdrop-filter: blur(20px);
  background: rgba(8, 10, 26, 0.78);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.brand {
  display: inline-flex; align-items: center; gap: 14px;
  color: var(--text); text-decoration: none;
}
.brand__mark {
  width: 48px; height: 48px; display: grid; place-items: center;
  border-radius: 16px; font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  background: linear-gradient(135deg, #3df5dd, #8b5dff 55%, #ff5bcf);
  color: #041019; box-shadow: 0 0 0 4px rgba(61,245,221,0.08), 0 18px 35px rgba(60, 52, 255, 0.35);
}
.brand strong { display: block; font-size: 1.05rem; letter-spacing: .01em; }
.brand small { display: block; color: var(--muted); font-size: .82rem; }

.site-nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.site-nav a {
  color: var(--muted); text-decoration: none; font-weight: 700; font-size: .95rem;
  padding: 10px 14px; border-radius: 999px; transition: .2s ease;
}
.site-nav a:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.page-shell {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 72px;
}

.hero {
  display: grid; grid-template-columns: 1.3fr .9fr; gap: 28px;
  align-items: stretch; margin-top: 14px;
}
.hero__copy, .hero-card, .toolbar, .about-panel, .card, .modal__panel, .game-shell, .searchbox, .filters__btn {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.hero__copy, .hero-card, .toolbar, .about-panel {
  position: relative; overflow: hidden;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(16, 20, 45, 0.9), rgba(12, 14, 32, 0.94));
}
.hero__copy { padding: clamp(24px, 4vw, 42px); }
.hero__copy::after, .hero-card::after, .about-panel::after {
  content: '';
  position: absolute; inset: auto -20% -20% auto;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(61,245,221,.16) 0%, transparent 65%);
  filter: blur(8px);
}
.eyebrow {
  margin: 0 0 12px; text-transform: uppercase; letter-spacing: .24em;
  color: var(--cyan); font-weight: 800; font-size: .75rem;
}
.hero h1, .toolbar h2, .about-panel h2 {
  margin: 0; font-family: 'Space Grotesk', sans-serif; line-height: .95; letter-spacing: -.03em;
}
.hero h1 { font-size: clamp(2.7rem, 6vw, 5.5rem); max-width: 10ch; }
.hero__text, .about-panel__text p, .hero-card p, .card__desc, .modal__description {
  color: var(--muted); line-height: 1.6;
}
.hero__text { max-width: 60ch; font-size: 1.05rem; margin: 18px 0 0; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 30px 0 20px; }
.btn {
  appearance: none; border: 0; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 20px; border-radius: 16px; font-weight: 800; font-size: 1rem;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary {
  color: #07101d; background: linear-gradient(135deg, var(--orange), #ffbd4b);
  box-shadow: 0 18px 42px rgba(255, 147, 59, 0.32);
}
.btn--ghost {
  color: var(--text); background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
}
.hero__chips { display: flex; flex-wrap: wrap; gap: 10px; }
.hero__chips span, .modal__meta span, .game-shell__legend span {
  border-radius: 999px; padding: 8px 12px; font-size: .85rem; font-weight: 700;
  background: rgba(255,255,255,0.05); color: var(--text); border: 1px solid rgba(255,255,255,0.08);
}

.hero-card { padding: 24px; display: flex; flex-direction: column; justify-content: space-between; }
.hero-card h2 { margin: 12px 0 10px; font-family: 'Space Grotesk', sans-serif; font-size: clamp(1.8rem, 3vw, 2.6rem); }
.hero-card__top { display:flex; align-items:center; gap:10px; color: var(--mint); font-weight: 700; }
.status-dot {
  width: 12px; height: 12px; border-radius: 50%; background: var(--mint);
  box-shadow: 0 0 0 8px rgba(94, 242, 168, .12);
}
.hero-card__stats { display:grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 18px; }
.hero-card__stats div {
  padding: 14px; border-radius: 18px; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}
.hero-card__stats strong { display:block; font-size: 1.3rem; color: #fff; }
.hero-card__stats span { display:block; color: var(--muted); margin-top: 2px; }

.toolbar {
  display:flex; align-items:end; justify-content:space-between; gap: 20px;
  padding: 22px 24px; margin-top: 26px;
}
.toolbar h2, .about-panel h2 { font-size: clamp(1.8rem, 3vw, 3rem); }
.searchbox {
  display:flex; align-items:center; gap: 10px;
  padding: 12px 16px; border-radius: 18px; min-width: min(100%, 420px);
  background: rgba(255,255,255,0.06);
}
.searchbox span { color: var(--cyan); font-size: 1.2rem; }
.searchbox input {
  width: 100%; background: transparent; border: 0; outline: 0; color: var(--text);
  font: inherit; font-size: 1rem;
}
.searchbox input::placeholder { color: #9faccd; }

.filters { margin-top: 18px; }
.filters__row { display:flex; flex-wrap: wrap; gap: 12px; }
.filters__btn {
  cursor:pointer; border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04); color: var(--text); font-weight: 800;
  padding: 12px 16px; border-radius: 999px; transition: .2s ease;
}
.filters__btn:hover { transform: translateY(-1px); background: rgba(255,255,255,0.08); }
.filters__btn.is-active {
  color: #07101d; background: linear-gradient(135deg, #40f8de, #53ffd4);
  box-shadow: 0 10px 30px rgba(64, 248, 222, .26);
}

.games-grid {
  margin-top: 22px;
  display:grid; gap: 18px;
  grid-template-columns: repeat(4, minmax(0,1fr));
}
.card {
  background: linear-gradient(180deg, rgba(18, 20, 47, 0.96), rgba(12, 14, 32, 0.98));
  border-radius: 24px; overflow:hidden; position: relative;
  display:flex; flex-direction:column; min-height: 420px;
}
.card__cover {
  position: relative; min-height: 166px; overflow:hidden;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display:flex; align-items:flex-end; justify-content:space-between; padding: 16px;
}
.card__cover::before, .card__cover::after {
  content:''; position:absolute; inset:0; pointer-events:none;
}
.card__cover::before { background: linear-gradient(140deg, rgba(255,255,255,.08), transparent 40%); }
.card__cover::after {
  background-image: linear-gradient(rgba(255,255,255,.13) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.13) 1px, transparent 1px);
  background-size: 26px 26px; opacity:.18;
}
.cover-tag {
  position: relative; z-index:1; border-radius: 999px; padding: 8px 12px;
  background: rgba(6, 9, 25, 0.62); border: 1px solid rgba(255,255,255,0.16);
  font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em;
}
.cover-badge { position: relative; z-index:1; font-size: .8rem; color: #07101d; font-weight: 900; background: var(--yellow); padding: 8px 10px; border-radius: 999px; }
.card__body { padding: 18px 18px 20px; display:flex; flex-direction:column; flex:1; }
.card__topline { display:flex; justify-content:space-between; gap: 10px; align-items:center; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; font-size: .74rem; font-weight: 800; }
.card h3 { margin: 12px 0 10px; font-size: 1.35rem; line-height: 1.05; font-family: 'Space Grotesk', sans-serif; }
.card__desc { margin: 0 0 14px; }
.card__chips { display:flex; flex-wrap: wrap; gap: 8px; margin-top:auto; }
.card__chips span { font-size: .78rem; color: var(--text); background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); padding: 7px 10px; border-radius: 999px; }
.card__action {
  margin-top: 16px; display:inline-flex; align-self:flex-start; border:0; cursor:pointer;
  padding: 12px 14px; border-radius: 14px; color: #06101f; background: linear-gradient(135deg, #40f8de, #aef54f);
  font-weight: 900; box-shadow: 0 16px 34px rgba(65, 248, 222, .18);
}
.card__action:hover { filter: brightness(1.05); }

.about-panel {
  margin-top: 22px; padding: clamp(22px, 3vw, 36px);
  display:grid; grid-template-columns: 1.1fr .9fr; gap: 22px; align-items:center;
}
.about-panel h2 { max-width: 16ch; }
.about-panel__text { max-width: 58ch; }

.site-footer {
  width: min(var(--max), calc(100% - 32px)); margin: 0 auto 40px; padding: 14px 6px 40px;
  display:flex; justify-content:space-between; gap: 18px; color: var(--muted); font-size: .95rem; border-top: 1px solid rgba(255,255,255,0.08);
}
.site-footer p { margin: 12px 0 0; }

.modal {
  position: fixed; inset: 0; z-index: 40; display: none; align-items:center; justify-content:center;
  padding: 22px; background: rgba(2, 4, 10, 0.74); backdrop-filter: blur(18px);
}
.modal.is-open { display:flex; }
.modal__backdrop { position:absolute; inset:0; }
.modal__panel {
  position: relative; width: min(1180px, 100%); max-height: 94vh; overflow:hidden auto;
  border-radius: 30px; background: linear-gradient(180deg, rgba(13,18,44,.98), rgba(8,10,22,.98));
  padding: 22px; border: 1px solid rgba(255,255,255,0.09);
}
.modal__panel:fullscreen, .modal__panel:-webkit-full-screen {
  width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; padding: 22px 24px 18px;
}
.modal__header { display:flex; justify-content:space-between; gap: 20px; align-items:flex-start; }
.modal__header h2 { margin: 0; font-family: 'Space Grotesk', sans-serif; font-size: clamp(2rem, 4vw, 3rem); }
.modal__description { margin: 10px 0 0; max-width: 68ch; }
.modal__actions { display:flex; gap: 10px; }
.icon-btn {
  width: 46px; height: 46px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06); color: var(--text); cursor:pointer; font-size: 1.1rem; font-weight: 900;
}
.icon-btn:hover { background: rgba(255,255,255,0.12); }
.modal__meta { display:flex; flex-wrap:wrap; gap: 10px; margin-top: 16px; }
.modal__body { margin-top: 18px; }

.game-shell {
  display:grid; gap: 16px;
}
.game-shell__top, .game-shell__bottom {
  display:flex; justify-content:space-between; align-items:center; gap: 16px; flex-wrap:wrap;
}
.game-shell__status {
  background: rgba(255,255,255,0.05); padding: 10px 14px; border-radius: 14px; color: var(--text);
  border: 1px solid rgba(255,255,255,0.08); font-weight: 700;
}
.game-shell__legend { display:flex; flex-wrap: wrap; gap: 8px; }
.game-shell__stage {
  position: relative; min-height: 520px; border-radius: 24px; overflow:hidden;
  background: linear-gradient(180deg, rgba(20, 25, 62, 0.95), rgba(10, 12, 28, 0.98));
  border: 1px solid rgba(255,255,255,0.08);
}
.game-shell__stage canvas { display:block; width:100%; height:100%; }
.game-shell__stage .stage-note {
  position:absolute; left: 16px; top: 16px; z-index:2; max-width: 36ch;
  background: rgba(4, 6, 15, 0.6); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px; padding: 10px 12px; color: var(--muted); font-size: .95rem;
}
.game-shell__bottom { color: var(--muted); font-size: .96rem; }
.game-shell__bottom strong { color: var(--text); }

.health-row { display:grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items:center; }
.health-card {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  padding: 10px 12px; border-radius: 16px;
}
.health-card__title { display:flex; justify-content:space-between; margin-bottom: 8px; font-weight: 800; color: var(--text); }
.health-bar { height: 12px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow:hidden; }
.health-bar span { display:block; height:100%; border-radius: inherit; background: linear-gradient(90deg, #39f5dd, #ff5bc7); }
.vs-chip { color: #08101d; background: linear-gradient(135deg, var(--yellow), #ffbe58); padding: 10px 14px; font-weight: 900; border-radius: 999px; }

.memory-board, .pulse-board {
  display:grid; gap: 12px;
}
.memory-board { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.memory-card {
  aspect-ratio: 1; border:0; border-radius: 20px; cursor:pointer; font-weight: 900;
  font-size: 1.8rem; color: transparent; background: linear-gradient(180deg, #12152e, #0a0d1c);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.09);
}
.memory-card.is-open, .memory-card.is-solved { color: #fff; }
.memory-card.is-solved { background: linear-gradient(135deg, rgba(57,245,221,0.4), rgba(140,98,255,0.45)); }
.memory-card.is-open { background: linear-gradient(135deg, rgba(255,101,199,.4), rgba(255,141,58,.35)); }

.reaction-panel {
  display:grid; gap: 14px;
}
.reaction-timer {
  font-family: 'Space Grotesk', sans-serif; font-size: clamp(2rem, 10vw, 6rem); font-weight: 700;
  color: var(--yellow); text-align:center;
}
.reaction-button {
  min-height: 180px; display:grid; place-items:center; border-radius: 28px; cursor:pointer; user-select:none;
  background: linear-gradient(135deg, #132146, #080b18); border: 1px solid rgba(255,255,255,0.08);
  font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 900; color: #fff; transition: .15s ease;
}
.reaction-button.is-ready { background: linear-gradient(135deg, #1ef4b6, #7dfd6f); color: #031017; }
.reaction-button.is-early { background: linear-gradient(135deg, #ff5d5d, #ff9d3d); }
.reaction-result { text-align:center; color: var(--muted); }

.pulse-board {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.pulse-pad {
  min-height: 160px; border-radius: 24px; border: 0; cursor:pointer; color:#fff; font-weight: 900; font-size: 1.15rem;
  position:relative; overflow:hidden; text-shadow: 0 3px 10px rgba(0,0,0,.45);
}
.pulse-pad::before {
  content:''; position:absolute; inset: 0; background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.3), transparent 40%);
}
.pulse-pad:nth-child(1) { background: linear-gradient(135deg, #ff5bc7, #7d5cff); }
.pulse-pad:nth-child(2) { background: linear-gradient(135deg, #39f5dd, #2c8cff); }
.pulse-pad:nth-child(3) { background: linear-gradient(135deg, #ffe777, #ff9a40); color: #1a1525; }
.pulse-pad:nth-child(4) { background: linear-gradient(135deg, #5ef2a8, #1a8f6a); color: #06121d; }

.cover-duel { background: linear-gradient(135deg, #1b1134, #250d55 45%, #ff5bc7 110%); }
.cover-duel::after { content: '⚔'; position:absolute; inset:auto 18px 12px auto; font-size: 3.1rem; z-index:1; opacity:.9; }
.cover-hoops { background: linear-gradient(135deg, #15264c, #1c5d9f 48%, #ff8d3a 110%); }
.cover-hoops::after { content:'⛹'; position:absolute; inset:auto 18px 10px auto; font-size: 3rem; z-index:1; }
.cover-goal { background: linear-gradient(135deg, #10364f, #0f7c66 45%, #f4b942 110%); }
.cover-goal::after { content:'⚽'; position:absolute; inset:auto 18px 8px auto; font-size: 2.8rem; z-index:1; }
.cover-drift { background: linear-gradient(135deg, #220f3a, #5230ff 48%, #f55b8c 110%); }
.cover-drift::after { content:'⌁'; position:absolute; inset:auto 18px 10px auto; font-size: 3rem; z-index:1; }
.cover-snake { background: linear-gradient(135deg, #0e5d51, #19b58b 44%, #aef54f 110%); }
.cover-snake::after { content:'⬡'; position:absolute; inset:auto 18px 8px auto; font-size: 2.6rem; z-index:1; }
.cover-memory { background: linear-gradient(135deg, #1d173b, #8b5dff 46%, #40f8de 110%); }
.cover-memory::after { content:'◈'; position:absolute; inset:auto 18px 8px auto; font-size: 2.8rem; z-index:1; }
.cover-reaction { background: linear-gradient(135deg, #1a1144, #ff5bc7 45%, #ffe777 110%); }
.cover-reaction::after { content:'⚡'; position:absolute; inset:auto 18px 10px auto; font-size: 3rem; z-index:1; }
.cover-clicker { background: linear-gradient(135deg, #12192e, #2a7cff 48%, #39f5dd 110%); }
.cover-clicker::after { content:'◉'; position:absolute; inset:auto 18px 10px auto; font-size: 3rem; z-index:1; }

@media (max-width: 1160px) {
  .hero, .about-panel, .games-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 840px) {
  .site-header, .toolbar, .about-panel { grid-template-columns: 1fr; display:grid; }
  .site-header { gap: 12px; }
  .site-nav { justify-content:flex-start; }
  .hero { grid-template-columns: 1fr; }
  .games-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .modal { padding: 10px; }
  .modal__header { flex-direction:column; }
  .health-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .page-shell { width: min(100% - 22px, var(--max)); padding-top: 18px; }
  .games-grid, .about-panel { grid-template-columns: 1fr; }
  .memory-board, .pulse-board { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .toolbar { gap: 14px; }
  .searchbox { min-width: 0; width: 100%; }
  .site-footer { flex-direction:column; }
  .card { min-height: 390px; }
  .modal__panel { padding: 16px; border-radius: 22px; }
  .game-shell__stage { min-height: 430px; }
}
/* --- Ajustes visuales finales --- */
.bg-grid {
  opacity: 0.08;
  background-size: 96px 96px;
}

.page-shell {
  width: min(1360px, calc(100% - 24px));
  padding-top: 22px;
}

.hero {
  grid-template-columns: minmax(0, 1.16fr) minmax(320px, .84fr);
  gap: 20px;
  align-items: stretch;
}

.hero__copy {
  min-height: 470px;
}

.hero h1 {
  max-width: 12ch;
  font-size: clamp(2.4rem, 5.1vw, 4.9rem);
}

.hero__text {
  max-width: 54ch;
  font-size: 1rem;
}

.hero-card {
  min-height: 470px;
}

.toolbar {
  margin-top: 18px;
  padding: 18px 22px;
  align-items: center;
}

.toolbar h2 {
  max-width: 14ch;
}

.searchbox {
  min-width: 320px;
  background: rgba(255,255,255,0.07);
}

.games-grid {
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 16px;
  margin-top: 18px;
}

.card {
  min-height: 378px;
}

.card__cover {
  min-height: 150px;
}

.about-panel {
  margin-top: 18px;
}

.about-panel h2 {
  max-width: 14ch;
}

.site-footer {
  margin-top: 22px;
}

@media (min-width: 1540px) {
  .page-shell,
  .site-footer {
    width: min(1440px, calc(100% - 28px));
  }
}

@media (max-width: 1200px) {
  .hero,
  .about-panel,
  .games-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    width: 100%;
    gap: 8px;
  }

  .site-nav a {
    padding: 8px 11px;
    font-size: .9rem;
  }

  .hero,
  .about-panel,
  .games-grid,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .hero__copy,
  .hero-card {
    min-height: auto;
  }

  .hero h1 {
    max-width: 100%;
    font-size: clamp(2.25rem, 10vw, 3.6rem);
  }

  .searchbox {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 18px, 1360px);
  }

  .hero__copy,
  .hero-card,
  .toolbar,
  .about-panel,
  .card,
  .modal__panel {
    border-radius: 20px;
  }

  .games-grid,
  .about-panel {
    grid-template-columns: 1fr;
  }

  .card {
    min-height: 360px;
  }

  .modal {
    padding: 10px;
  }

  .modal__panel {
    padding: 16px;
  }

  .game-shell__stage {
    min-height: 400px;
  }
}

