/* ============================================================
   Muestra — Platform Homepage CSS
   Mobile-first, PlayTek visual language
   ============================================================ */

:root {
  --pt-primary: #00f5e9;
  --pt-secondary: #081a2b;
  --pt-bg: #04121f;
  --pt-surface: rgba(8, 26, 43, 0.82);
  --pt-border: rgba(0, 245, 233, 0.14);
  --pt-text: #f4fbff;
  --pt-muted: rgba(244, 251, 255, 0.65);
  --pt-accent-trivia: #8ad8ff;
  --pt-accent-arquero: #f7c948;
  --pt-radius-card: 28px;
  --pt-radius-btn: 18px;
  --pt-gap: clamp(16px, 4vw, 28px);
}

@supports (width: 100dvw) {
  :root {
    --dvh: 100dvh;
  }
}

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

html {
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: Outfit, Inter, Arial, sans-serif;
  background: var(--pt-bg);
  color: var(--pt-text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Background ──────────────────────────────────────────── */
.platform-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 20% 12%, rgba(0, 245, 233, 0.12), transparent 32%),
    radial-gradient(circle at 78% 80%, rgba(138, 216, 255, 0.09), transparent 28%),
    radial-gradient(circle at 50% 50%, rgba(247, 201, 72, 0.05), transparent 50%),
    linear-gradient(180deg, #04121f 0%, #050e1a 100%);
  pointer-events: none;
}

/* ── Header ──────────────────────────────────────────────── */
.platform-header {
  position: relative;
  z-index: 10;
  padding: clamp(16px, 3vw, 24px) clamp(20px, 5vw, 48px);
  border-bottom: 1px solid var(--pt-border);
  background: rgba(4, 18, 31, 0.72);
  backdrop-filter: blur(16px);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 112px;
  overflow: hidden;
}

.brand-logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(0, 245, 233, 0.08);
  border: 1px solid rgba(0, 245, 233, 0.22);
  flex-shrink: 0;
}

.brand-logo-image {
  display: block;
  width: 112px;
  height: auto;
  max-width: 112px;
  object-fit: contain;
  flex-shrink: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.brand-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--pt-primary);
}

.header-tagline {
  font-size: 13px;
  color: var(--pt-muted);
  letter-spacing: 0.04em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  color: #04121f;
  background: linear-gradient(135deg, var(--pt-primary), #88d8ff);
  box-shadow: 0 10px 24px rgba(0, 245, 233, 0.16);
}

/* ── Main ────────────────────────────────────────────────── */
.platform-main {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 64px) clamp(20px, 5vw, 48px) clamp(48px, 8vw, 80px);
}

/* ── Hero ────────────────────────────────────────────────── */
.games-hero {
  text-align: center;
  margin-bottom: clamp(32px, 6vw, 56px);
}

.games-hero-title {
  font-size: clamp(36px, 8vw, 72px);
  font-weight: 900;
  line-height: 0.94;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--pt-text) 30%, var(--pt-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.games-hero-subtitle {
  margin-top: 14px;
  font-size: clamp(15px, 2.5vw, 18px);
  color: var(--pt-muted);
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* ── Games Grid ──────────────────────────────────────────── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: var(--pt-gap);
}

/* ── Game Card ───────────────────────────────────────────── */
.game-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--pt-text);
  border-radius: var(--pt-radius-card);
  overflow: hidden;
  border: 1px solid var(--pt-border);
  background: var(--pt-surface);
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.32);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.game-card:hover,
.game-card:focus-visible {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.42);
  border-color: rgba(0, 245, 233, 0.28);
  outline: none;
}

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

/* ── Card Media ──────────────────────────────────────────── */
.game-card__media {
  position: relative;
  height: clamp(160px, 28vw, 220px);
  overflow: hidden;
}

.game-card__cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder art for games without cover images */
.game-card__cover-placeholder {
  width: 100%;
  height: 100%;
}

.game-cover--puzzle-mundial {
  background: linear-gradient(135deg, #04121f 0%, #081a2b 40%, #0d2d4a 70%, #00f5e9 140%);
  position: relative;
  overflow: hidden;
}

.game-cover--puzzle-mundial::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 33.33%, rgba(0, 245, 233, 0.12) 33.33%, rgba(0, 245, 233, 0.12) 34%),
    repeating-linear-gradient(90deg, transparent, transparent 33.33%, rgba(0, 245, 233, 0.12) 33.33%, rgba(0, 245, 233, 0.12) 34%);
}

.game-cover--trivia-mundial-fotos {
  background: linear-gradient(135deg, #050e1a, #081a2b 40%, #0d2f52);
  position: relative;
  overflow: hidden;
}

.game-cover--trivia-mundial-fotos::after {
  content: "⚽";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(56px, 10vw, 80px);
  filter: drop-shadow(0 0 24px rgba(138, 216, 255, 0.5));
}

.game-cover--el-del-arquero {
  background: linear-gradient(180deg, #0b3b23, #2b8a3e 60%, #0b3b23);
  position: relative;
  overflow: hidden;
}

.game-cover--el-del-arquero::after {
  content: "🥅";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(56px, 10vw, 80px);
}

.game-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(4, 18, 31, 0.7) 100%);
}

/* ── Card Body ───────────────────────────────────────────── */
.game-card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(18px, 3vw, 24px);
  flex: 1;
}

.game-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(0, 245, 233, 0.1);
  border: 1px solid rgba(0, 245, 233, 0.2);
  color: var(--pt-primary);
}

.game-card--trivia-mundial-fotos .game-card__badge {
  background: rgba(138, 216, 255, 0.1);
  border-color: rgba(138, 216, 255, 0.2);
  color: var(--pt-accent-trivia);
}

.game-card--el-del-arquero .game-card__badge {
  background: rgba(247, 201, 72, 0.1);
  border-color: rgba(247, 201, 72, 0.2);
  color: var(--pt-accent-arquero);
}

.game-card__name {
  font-size: clamp(20px, 3.5vw, 26px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.game-card__desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--pt-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-card__cta {
  margin-top: auto;
  padding-top: 12px;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--pt-radius-btn);
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--pt-primary), #38d0ff);
  color: #04121f;
  box-shadow: 0 10px 28px rgba(0, 245, 233, 0.22);
  transition: box-shadow 0.18s ease;
}

.game-card--trivia-mundial-fotos .cta-btn {
  background: linear-gradient(135deg, #1ee6de, #55b8ff);
  box-shadow: 0 10px 28px rgba(138, 216, 255, 0.22);
}

.game-card--el-del-arquero .cta-btn {
  background: linear-gradient(135deg, #f7c948, #ffd87a);
  box-shadow: 0 10px 28px rgba(247, 201, 72, 0.22);
}

.game-card:hover .cta-btn {
  box-shadow: 0 16px 36px rgba(0, 245, 233, 0.32);
}

/* ── Empty state ─────────────────────────────────────────── */
.no-games {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px;
  color: var(--pt-muted);
  font-size: 18px;
}

/* ── Footer ──────────────────────────────────────────────── */
.platform-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 24px;
  color: var(--pt-muted);
  font-size: 13px;
  border-top: 1px solid var(--pt-border);
}

/* ── Mobile Optimizations ────────────────────────────────── */
@media (max-width: 480px) {
  .header-tagline {
    display: none;
  }

  .header-inner,
  .header-actions {
    width: 100%;
  }

  .header-inner,
  .header-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .games-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .game-card__media {
    height: clamp(140px, 42vw, 200px);
  }

  .game-card__body {
    padding: 16px;
  }

  .cta-btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 16px;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 769px) {
  .games-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Touch: remove hover on touch devices ────────────────── */
@media (hover: none) {
  .game-card:hover {
    transform: none;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.32);
    border-color: var(--pt-border);
  }

  .game-card:active {
    transform: scale(0.97);
    opacity: 0.9;
  }
}
