/* ==========================================================================
   EL TESORO GAMES - Design System v2.0
   Domain: eltesorogames.com
   Design Origin: PlayStation & Raycast Inky Dark Arcade System
   Reference: github.com/voltagent/awesome-design-md
   ========================================================================== */

:root {
  /* PlayStation & Raycast Color Ladder */
  --ps-canvas: #07080a;
  --ps-surface-base: #0d0f15;
  --ps-surface-elevated: #131620;
  --ps-surface-card: #171b28;
  --ps-surface-hover: #1e2436;

  /* PlayStation Blue & PS Plus Gold Accents */
  --ps-blue: #0070d1;
  --ps-blue-pressed: #005bb0;
  --ps-blue-light: #53b1ff;
  --ps-blue-glow: rgba(0, 112, 209, 0.35);

  --ps-gold-start: #ffce21;
  --ps-gold-mid: #f5a623;
  --ps-gold-end: #ee8e00;
  --ps-gold-glow: rgba(245, 166, 35, 0.3);

  --ps-commerce: #d53b00;

  /* Hairline Borders */
  --ps-hairline-subtle: rgba(255, 255, 255, 0.08);
  --ps-hairline-medium: rgba(255, 255, 255, 0.14);
  --ps-hairline-bright: rgba(255, 255, 255, 0.24);

  /* Typography Colors */
  --ps-ink: #ffffff;
  --ps-body: rgba(255, 255, 255, 0.85);
  --ps-muted: #9aa1b1;
  --ps-dim: #60687a;

  /* Fonts */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", sans-serif;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-card: 0 12px 36px -8px rgba(0, 0, 0, 0.7);
  --shadow-elevation: 0 20px 48px -10px rgba(0, 0, 0, 0.85);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  background-color: var(--ps-canvas);
}

body {
  font-family: var(--font-family);
  background-color: var(--ps-canvas);
  color: var(--ps-ink);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Atmospheric PlayStation Background Lighting */
.ambient-glow-1 {
  position: fixed;
  top: -180px;
  left: 25%;
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(0, 112, 209, 0.16) 0%, rgba(7, 8, 10, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.ambient-glow-2 {
  position: fixed;
  bottom: 5%;
  right: -100px;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(245, 166, 35, 0.1) 0%, rgba(7, 8, 10, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* Site Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 8, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--ps-hairline-subtle);
  padding: 12px 20px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
}

.header-container {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease;
}

.brand-wrapper:hover {
  transform: translateY(-1px);
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #182033 0%, #0d111c 100%);
  border: 1px solid var(--ps-hairline-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 112, 209, 0.25);
}

.brand-text h1 {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #ffffff 0%, #ffd875 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.brand-text span {
  font-size: 11px;
  color: var(--ps-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}

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

/* PlayStation Rounded Full Action Pills */
.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--ps-hairline-subtle);
  color: var(--ps-ink);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 38px;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--ps-blue-light);
  color: #ffffff;
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: translateY(0);
}

/* Hero Section */
.hero-section {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 32px auto 20px;
  padding: 0 20px;
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 112, 209, 0.12);
  border: 1px solid rgba(0, 112, 209, 0.35);
  padding: 6px 18px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 800;
  color: var(--ps-blue-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0, 112, 209, 0.15);
}

.hero-title {
  font-size: clamp(30px, 4.8vw, 56px);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.gold-gradient {
  background: linear-gradient(135deg, #ffffff 0%, var(--ps-gold-start) 45%, var(--ps-gold-mid) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(15px, 1.8vw, 18px);
  color: var(--ps-muted);
  max-width: 660px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

/* Mobile-Friendly Stat Badges */
.hero-badges-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
}

.stat-chip {
  background: var(--ps-surface-base);
  border: 1px solid var(--ps-hairline-subtle);
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--ps-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stat-chip strong {
  color: var(--ps-ink);
}

/* Controls (Search + Categories) */
.controls-container {
  max-width: 1320px;
  margin: 0 auto 36px;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}

.search-box {
  position: relative;
  max-width: 580px;
  margin: 0 auto 22px;
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ps-dim);
  font-size: 16px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--ps-surface-base);
  border: 1.5px solid var(--ps-hairline-subtle);
  border-radius: var(--radius-pill);
  padding: 14px 44px 14px 48px;
  color: var(--ps-ink);
  font-size: 15px;
  font-family: inherit;
  transition: all 0.25s ease;
  outline: none;
  min-height: 48px;
}

.search-input:focus {
  border-color: var(--ps-blue);
  background: var(--ps-surface-elevated);
  box-shadow: 0 0 20px var(--ps-blue-glow);
}

.search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  color: var(--ps-muted);
  font-size: 12px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

.search-clear:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Category Tabs - Mobile Scrollable Rail */
.filter-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 4px 8px;
}

.filter-tabs::-webkit-scrollbar {
  display: none;
}

.filter-tab {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--ps-hairline-subtle);
  color: var(--ps-muted);
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
}

.filter-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ps-ink);
}

.filter-tab.active {
  background: var(--ps-blue);
  border-color: var(--ps-blue-light);
  color: #ffffff;
  box-shadow: 0 4px 18px var(--ps-blue-glow);
}

/* Games Section */
.games-section {
  max-width: 1320px;
  margin: 0 auto 60px;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
}

/* PlayStation Style Game Card */
.game-card {
  background: var(--ps-surface-card);
  border: 1px solid var(--ps-hairline-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-card);
  position: relative;
}

.game-card:hover {
  transform: translateY(-5px);
  border-color: rgba(0, 112, 209, 0.5);
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 112, 209, 0.25);
  background: var(--ps-surface-hover);
}

.card-header-art {
  height: 168px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #101524 0%, #080a12 100%);
  border-bottom: 1px solid var(--ps-hairline-subtle);
}

.card-art-bg {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s ease;
}

.game-card:hover .card-art-bg {
  transform: scale(1.08);
  opacity: 0.28;
}

.card-art-icon {
  font-size: 60px;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.65));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.game-card:hover .card-art-icon {
  transform: scale(1.12) rotate(3deg);
}

.card-badge-top {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(7, 8, 10, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 206, 33, 0.4);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 800;
  color: var(--ps-gold-start);
  z-index: 3;
  letter-spacing: 0.04em;
}

.card-badge-genre {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ps-ink);
  z-index: 3;
}

.card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 21px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--ps-ink);
  line-height: 1.25;
}

.card-description {
  font-size: 14px;
  color: var(--ps-muted);
  margin-bottom: 18px;
  line-height: 1.55;
  flex: 1;
}

.card-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 22px;
}

.feature-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--ps-hairline-subtle);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ps-muted);
}

.card-footer-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

/* Primary Play Button (PlayStation Blue Pill) */
.btn-play {
  flex: 2;
  background: var(--ps-blue);
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px var(--ps-blue-glow);
  min-height: 46px;
}

.btn-play:hover {
  background: #007eee;
  box-shadow: 0 6px 22px rgba(0, 112, 209, 0.55);
  transform: translateY(-2px);
}

.btn-play:active {
  transform: translateY(0);
}

/* Secondary Info Button (Raycast Inky Glass Pill) */
.btn-details {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--ps-hairline-medium);
  color: var(--ps-ink);
  font-size: 13px;
  font-weight: 700;
  padding: 12px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 46px;
}

.btn-details:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

/* Empty State */
.empty-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: var(--ps-surface-card);
  border: 1px dashed var(--ps-hairline-medium);
  border-radius: var(--radius-lg);
  display: none;
}

.empty-results.visible {
  display: block;
}

.empty-results h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--ps-ink);
}

.empty-results p {
  color: var(--ps-muted);
  font-size: 14px;
}

/* Details Modal (PlayStation Dialog Style) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 8, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-backdrop.open {
  display: flex;
  opacity: 1;
}

.modal-box {
  background: var(--ps-surface-card);
  border: 1px solid var(--ps-hairline-bright);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: var(--shadow-elevation), 0 0 30px var(--ps-blue-glow);
  position: relative;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-backdrop.open .modal-box {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--ps-hairline-subtle);
  border-radius: 50%;
  color: var(--ps-muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.modal-header-hero {
  padding: 30px 24px;
  background: linear-gradient(135deg, #101626 0%, #070910 100%);
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--ps-hairline-subtle);
}

.modal-game-icon {
  font-size: 50px;
}

.modal-header-text h2 {
  font-size: 24px;
  font-weight: 900;
  color: var(--ps-ink);
  line-height: 1.2;
}

.modal-header-text span {
  font-size: 13px;
  color: var(--ps-blue-light);
  font-weight: 700;
}

.modal-content-body {
  padding: 24px;
}

.modal-full-desc {
  font-size: 15px;
  color: var(--ps-muted);
  line-height: 1.6;
  margin-bottom: 22px;
}

.modal-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.modal-spec-item {
  background: var(--ps-surface-base);
  border: 1px solid var(--ps-hairline-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.modal-spec-item span {
  display: block;
  font-size: 11px;
  color: var(--ps-dim);
  text-transform: uppercase;
  margin-bottom: 4px;
  font-weight: 700;
}

.modal-spec-item strong {
  font-size: 13px;
  color: var(--ps-ink);
}

.modal-actions {
  display: flex;
  gap: 12px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--ps-hairline-subtle);
  background: #040508;
  padding: 40px 20px;
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  position: relative;
  z-index: 1;
}

.footer-container {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.footer-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-brand-title {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, #ffffff 0%, var(--ps-gold-start) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.footer-domain {
  font-size: 13px;
  color: var(--ps-dim);
}

.footer-domain strong {
  color: var(--ps-blue-light);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  font-size: 13px;
}

.footer-links a {
  color: var(--ps-muted);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--ps-blue-light);
}

.footer-legal {
  font-size: 12px;
  color: var(--ps-dim);
}

/* ==========================================================================
   Mobile Responsive Adjustments (Phones < 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .site-header {
    padding: 10px 14px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
  }

  .brand-text h1 {
    font-size: 17px;
  }

  .brand-icon {
    width: 34px;
    height: 34px;
  }

  .icon-btn {
    padding: 7px 12px;
    font-size: 12px;
    min-height: 34px;
  }

  .hero-section {
    padding: 0 14px;
    margin: 20px auto 14px;
  }

  .hero-title {
    font-size: 32px;
    line-height: 1.15;
  }

  .hero-subtitle {
    font-size: 14px;
    margin-bottom: 20px;
  }

  .hero-badges-row {
    gap: 6px;
    margin-bottom: 20px;
  }

  .stat-chip {
    padding: 5px 12px;
    font-size: 11px;
  }

  .controls-container {
    padding: 0 14px;
    margin-bottom: 24px;
  }

  .search-input {
    font-size: 14px;
    padding: 12px 38px 12px 42px;
    min-height: 44px;
  }

  /* Horizontal swipe rail for categories on phone */
  .filter-tabs {
    justify-content: flex-start;
    padding-left: 2px;
    padding-right: 2px;
  }

  .filter-tab {
    padding: 8px 14px;
    font-size: 12px;
    min-height: 36px;
  }

  .games-section {
    padding: 0 14px;
  }

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

  .card-header-art {
    height: 140px;
  }

  .card-art-icon {
    font-size: 50px;
  }

  .card-body {
    padding: 18px;
  }

  .card-title {
    font-size: 19px;
  }

  .modal-specs-grid {
    grid-template-columns: 1fr;
  }

  .modal-header-hero {
    padding: 20px 18px;
  }

  .modal-content-body {
    padding: 18px;
  }
}


/* ==========================================================================
   Hide Netlify Drawer, Deploy Preview Badge, and Injected Overlays
   ========================================================================== */
#netlify-drawer,
.netlify-drawer,
netlify-drawer,
[data-netlify-drawer],
[id*="netlify-drawer"],
[class*="netlify-drawer"],
[class*="NetlifyDrawer"],
.netlify-badge,
a[href*="netlify.com"][class*="badge"],
iframe[src*="netlify.com/drawer"],
iframe[title*="Netlify"],
div[id*="netlify-feedback"],
div[class*="netlify-feedback"],
[data-testid*="netlify-drawer"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  position: absolute !important;
  top: -9999px !important;
  left: -9999px !important;
  z-index: -999999 !important;
}
