/* ===== PlayBlooms — global styles ===== */

:root {
  --pink: #ff6fa5;
  --purple: #8a5cf6;
  --yellow: #ffd166;
  --bg: #fef6f0;
  --card-bg: #ffffff;
  --text: #33263a;
  --muted: #7c7188;
  --radius: 16px;

  --shadow-sm: 0 2px 6px rgba(51, 38, 58, 0.08);
  --shadow-md: 0 8px 20px rgba(51, 38, 58, 0.10);
  --shadow-lg: 0 16px 34px rgba(51, 38, 58, 0.16);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 2px;
  border-radius: 4px;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes letterFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes letterColor {
  0%, 100% {
    color: #ffffff;
  }
  25% {
    color: #ffc233;
  }
  50% {
    color: #ff8c42;
  }
  75% {
    color: #ff4f9a;
  }
}

.hero-title .letter-float {
  display: inline-block;
  animation: letterFloat 2.4s ease-in-out infinite, letterColor 3s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.08s), calc(var(--i) * 0.08s);
}

/* ---- Header / Hero ---- */

.site-header {
  background:
    linear-gradient(rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0.32)),
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.16), transparent 45%),
    radial-gradient(circle at 85% 0%, rgba(255, 255, 255, 0.12), transparent 40%),
    linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff;
}

.hero-nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-logo {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-logo-icon {
  height: 48px;
  width: auto;
  display: block;
}

.hero-links {
  display: flex;
  gap: 24px;
}

.hero-links a {
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0.85;
  transition: opacity 0.15s var(--ease);
}

.hero-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

.hero-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 30px 24px 64px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 20px;
  animation: fadeInUp 0.6s var(--ease) both;
}

.hero-title {
  margin: 0;
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.3px;
  animation: fadeInUp 0.6s var(--ease) 0.08s both;
}

.hero-subtitle {
  margin: 18px auto 0;
  max-width: 540px;
  font-size: 1.1rem;
  line-height: 1.6;
  opacity: 0.92;
  animation: fadeInUp 0.6s var(--ease) 0.16s both;
}

.hero-actions {
  margin-top: 30px;
  animation: fadeInUp 0.6s var(--ease) 0.24s both;
}

.btn-hero {
  display: inline-block;
  background: #fff;
  color: var(--purple);
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 32px;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.btn-hero:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 34px rgba(0, 0, 0, 0.24);
}

.hero-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 36px;
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  animation: fadeInUp 0.6s var(--ease) 0.32s both;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-stat strong {
  font-size: 1.4rem;
}

.hero-stat span {
  font-size: 0.8rem;
  opacity: 0.85;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---- Games grid ---- */

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.section-title {
  text-align: center;
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 28px;
  color: var(--text);
  scroll-margin-top: 20px;
}

/* ---- Filter bar (homepage search / category filter) ---- */

.filter-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
}

.search-input {
  width: 100%;
  max-width: 360px;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid rgba(51, 38, 58, 0.12);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}

.search-input::placeholder {
  color: var(--muted);
}

.search-input:focus {
  border-color: var(--purple);
  box-shadow: var(--shadow-md);
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.category-chip {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--purple);
  background: #fff;
  border: 1px solid rgba(138, 92, 246, 0.35);
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), transform 0.15s var(--ease);
}

.category-chip:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.category-chip.active {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
}

.empty-state {
  display: none;
  text-align: center;
  padding: 50px 20px;
  color: var(--muted);
  font-size: 1rem;
}

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

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

.game-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(51, 38, 58, 0.06);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  display: block;
  animation: fadeInUp 0.5s var(--ease) both;
  animation-delay: calc(var(--card-index, 0) * 0.05s);
}

.game-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.game-card.hidden {
  display: none;
}

/*
 * Thumbnail. EXACT REFERENCE SIZE: 300px (width) x 200px (height).
 */
.thumb {
  width: 100%;
  height: 200px;
  max-width: 300px;
  margin: 0 auto;
  overflow: hidden;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.game-info {
  padding: 16px 16px 20px;
  text-align: center;
}

.category-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--purple);
  background: rgba(138, 92, 246, 0.1);
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 8px;
}

.game-info h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.game-info p {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---- Footer ---- */

.site-footer {
  background: #2e2438;
  color: #f0eaf7;
  padding: 36px 20px 28px;
  text-align: center;
  position: relative;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--pink), var(--purple), var(--yellow));
}

.site-footer nav {
  margin-bottom: 14px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}

.site-footer nav a {
  margin: 0 12px;
  font-weight: 600;
  opacity: 0.85;
  transition: opacity 0.15s var(--ease);
}

.site-footer nav a:hover {
  opacity: 1;
  text-decoration: underline;
}

.site-footer .copyright {
  font-size: 0.85rem;
  opacity: 0.6;
}

/* ---- Game pages (shared) ---- */

.game-page-header {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  padding: 26px 20px;
  text-align: center;
  color: #fff;
}

.game-page-header a.back-link {
  color: #fff;
  display: inline-block;
  margin-bottom: 10px;
  font-weight: 600;
  opacity: 0.9;
  transition: opacity 0.15s var(--ease);
}

.game-page-header a.back-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.game-page-header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
}

.game-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 34px 20px 60px;
  text-align: center;
}

.game-status {
  font-size: 1.1rem;
  margin: 16px 0;
  min-height: 1.4em;
  font-weight: 700;
  color: var(--text);
}

.btn {
  background: var(--purple);
  color: #fff;
  border: none;
  padding: 11px 22px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin: 6px;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s var(--ease), transform 0.15s var(--ease), box-shadow 0.2s var(--ease);
}

.btn:hover {
  background: var(--pink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.score-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
  margin: 10px 0;
  font-size: 1rem;
  color: var(--muted);
}

.score-row strong {
  color: var(--text);
}

.game-instructions {
  max-width: 560px;
  margin: 0 auto 10px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ---- Stub pages (about/privacy/contact) ---- */

.stub-content {
  max-width: 700px;
  margin: 0 auto;
  padding: 50px 20px;
  line-height: 1.7;
}

.stub-content h1 {
  margin-top: 0;
}

.stub-content h2 {
  font-size: 1.2rem;
  margin: 32px 0 10px;
}

.stub-content p {
  color: var(--text);
}

.stub-content ul {
  padding-left: 20px;
}

.stub-content li {
  margin-bottom: 8px;
}

.stub-content li::marker {
  color: var(--purple);
}

.stub-content a {
  color: var(--purple);
  font-weight: 600;
  text-decoration: underline;
}

.stub-content a.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--purple);
  font-weight: 700;
  text-decoration: none;
}

.stub-content a.btn {
  color: #fff;
  text-decoration: none;
}

/* ---- Promo modal ---- */

.promo-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(51, 38, 58, 0.55);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.promo-modal-overlay.visible {
  display: flex;
}

.promo-modal {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  max-width: 360px;
  width: calc(100% - 48px);
  text-align: center;
  animation: fadeInUp 0.4s var(--ease) both;
}

.promo-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}

.promo-modal-close:hover {
  color: var(--text);
}

.promo-modal h3 {
  margin: 0 0 10px;
  font-size: 1.3rem;
  color: var(--text);
}

.promo-modal p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.promo-modal-btn {
  width: 100%;
}

.promo-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.promo-modal-actions .btn {
  flex: 1;
}

.btn-secondary {
  background: transparent;
  color: var(--purple);
  border: 2px solid var(--purple);
}

.btn-secondary:hover {
  background: rgba(138, 92, 246, 0.08);
}
