/* ========================================================================== 
   Variables
   ========================================================================== */

:root {
  /* Colors */
  --color-background: #fffdf7;
  --color-surface: #ffffff;
  --color-text: #1e2430;
  --color-muted-text: #5b6474;

  /* Brand palette - playful, vibrant, family-friendly */
  --color-primary: #ff4b6e; /* energetic pink/red */
  --color-primary-soft: #ffe3eb;
  --color-primary-strong: #e71f47;

  --color-secondary: #ffb400; /* sunny yellow */
  --color-accent-blue: #2f89ff; /* bright blue */
  --color-accent-green: #00c27a; /* playful green */

  --color-success: #1bbf71;
  --color-success-soft: #e3f8ef;
  --color-warning: #ffb400;
  --color-warning-soft: #fff4d6;
  --color-danger: #f54444;
  --color-danger-soft: #ffe2e2;

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2933;
  --gray-900: #111827;

  /* Typography */
  --font-family-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-family-display: "Baloo 2", "Fredoka", "Poppins", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;

  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 1rem;    /* 16px */
  --font-size-lg: 1.125rem;  /* 18px */
  --font-size-xl: 1.25rem;   /* 20px */
  --font-size-2xl: 1.5rem;   /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2.25rem;  /* 36px */
  --font-size-5xl: 3rem;     /* 48px */

  --line-height-tight: 1.1;
  --line-height-snug: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (0–96px) */
  --space-0: 0;
  --space-1: 0.125rem;  /* 2px */
  --space-2: 0.25rem;   /* 4px */
  --space-3: 0.375rem;  /* 6px */
  --space-4: 0.5rem;    /* 8px */
  --space-6: 0.75rem;   /* 12px */
  --space-8: 1rem;      /* 16px */
  --space-10: 1.25rem;  /* 20px */
  --space-12: 1.5rem;   /* 24px */
  --space-16: 2rem;     /* 32px */
  --space-20: 2.5rem;   /* 40px */
  --space-24: 3rem;     /* 48px */
  --space-28: 3.5rem;   /* 56px */
  --space-32: 4rem;     /* 64px */
  --space-40: 5rem;     /* 80px */
  --space-48: 6rem;     /* 96px */

  /* Radius */
  --radius-none: 0;
  --radius-sm: 0.375rem;   /* 6px - slightly soft */
  --radius-md: 0.75rem;    /* 12px - friendly rounded */
  --radius-lg: 1.25rem;    /* 20px - pill-ish */
  --radius-full: 9999px;

  /* Shadows - soft and playful */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 4px 10px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 10px 25px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 18px 45px rgba(15, 23, 42, 0.16);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-normal: 200ms cubic-bezier(0.22, 0.61, 0.36, 1);
  --transition-slow: 300ms cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Layout */
  --container-width: 1120px;
  --container-gutter: var(--space-16);
}

/* Slightly tighter container on very large screens for focus */
@media (min-width: 1280px) {
  :root {
    --container-width: 1200px;
  }
}


/* ========================================================================== 
   Reset / Normalize
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
  margin: 0;
}

body {
  min-height: 100vh;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

textarea {
  resize: vertical;
}

input,
textarea,
select,
button {
  outline: none;
}

:focus {
  outline: none;
}

[hidden] {
  display: none !important;
}

/* Respect motion preferences */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ========================================================================== 
   Base Styles
   ========================================================================== */

body {
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  background-color: var(--color-background);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  display: block;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family-display);
  font-weight: 700;
  line-height: var(--line-height-snug);
  color: var(--color-text);
  letter-spacing: 0.01em;
}

h1 {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-12);
}

h2 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-10);
}

h3 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-8);
}

h4 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-6);
}

h5 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-4);
}

h6 {
  font-size: var(--font-size-base);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  margin-bottom: var(--space-3);
}

p {
  margin-bottom: var(--space-8);
  max-width: 70ch;
  color: var(--color-muted-text);
}

strong {
  font-weight: 600;
}

small {
  font-size: var(--font-size-sm);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

a:hover {
  color: var(--color-primary-strong);
}

a:active {
  transform: translateY(1px);
}

/* Lists with comfortable spacing */
ul,
ol {
  padding-left: 1.25rem;
  margin-bottom: var(--space-8);
}

li + li {
  margin-top: var(--space-2);
}

/* Focus styles - visible and accessible */
:focus-visible {
  outline: 3px solid var(--color-accent-blue);
  outline-offset: 3px;
}


/* ========================================================================== 
   Utilities
   ========================================================================== */

/* Container */

.container {
  width: 100%;
  max-width: calc(var(--container-width) + var(--container-gutter) * 2);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-gutter);
  padding-right: var(--container-gutter);
}

/* Flex helpers */

.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.gap-sm {
  gap: var(--space-6);
}

.gap-md {
  gap: var(--space-12);
}

.gap-lg {
  gap: var(--space-20);
}

/* Grid helpers */

.grid {
  display: grid;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-16);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-16);
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Spacing utilities (limited set for base) */

.section {
  padding-top: var(--space-32);
  padding-bottom: var(--space-32);
}

.section-sm {
  padding-top: var(--space-20);
  padding-bottom: var(--space-20);
}

.section-lg {
  padding-top: var(--space-40);
  padding-bottom: var(--space-40);
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

/* Screen-reader only */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only-focusable:focus,
.sr-only-focusable:focus-visible {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}


/* ========================================================================== 
   Components
   ========================================================================== */

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 0;
  cursor: pointer;
  transition:
    background-color var(--transition-normal),
    color var(--transition-normal),
    box-shadow var(--transition-normal),
    transform var(--transition-fast);
  box-shadow: var(--shadow-sm);
  background-image: linear-gradient(135deg, var(--color-primary), var(--color-accent-blue));
  color: #ffffff;
}

.button:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px) scale(1.01);
}

.button:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: var(--shadow-xs);
}

.button:disabled,
.button[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.button--ghost {
  background: transparent;
  color: var(--color-primary);
  box-shadow: none;
  border: 2px solid var(--color-primary-soft);
}

.button--ghost:hover {
  background-color: var(--color-primary-soft);
}

.button--secondary {
  background-image: none;
  background-color: var(--color-accent-blue);
}

.button--success {
  background-image: none;
  background-color: var(--color-success);
}

.button--danger {
  background-image: none;
  background-color: var(--color-danger);
}

/* Inputs */

.input,
.select,
.textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--gray-200);
  background-color: #ffffff;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--gray-400);
}

.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  border-color: var(--color-accent-blue);
  box-shadow: 0 0 0 3px rgba(47, 137, 255, 0.25);
}

.input[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--color-danger);
}

.input[disabled],
.select[disabled],
.textarea[disabled] {
  background-color: var(--gray-100);
  cursor: not-allowed;
  opacity: 0.8;
}

.label {
  display: inline-block;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.helper-text {
  font-size: var(--font-size-xs);
  color: var(--gray-500);
  margin-top: var(--space-2);
}

.helper-text--error {
  color: var(--color-danger);
}

/* Cards - for product info, game variations, tips, etc. */

.card {
  background-color: var(--color-surface);
  border-radius: 1.25rem;
  padding: var(--space-16);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 255, 255, 0.7);
  position: relative;
  overflow: hidden;
}

.card--playful::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 180, 0, 0.16), transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(47, 137, 255, 0.16), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.card__content {
  position: relative;
  z-index: 1;
}

.card--highlight {
  border: 2px dashed rgba(255, 75, 110, 0.4);
}

.card--muted {
  background-color: var(--gray-50);
}

/* Badges - for age groups, difficulty, etc. */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge--primary {
  background-color: var(--color-primary-soft);
  color: var(--color-primary-strong);
}

.badge--success {
  background-color: var(--color-success-soft);
  color: var(--color-success);
}

.badge--warning {
  background-color: var(--color-warning-soft);
  color: var(--color-warning);
}

.badge--info {
  background-color: rgba(47, 137, 255, 0.15);
  color: var(--color-accent-blue);
}

/* Pills / Chips - for game categories, tags */

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background-color: var(--gray-100);
  font-size: var(--font-size-xs);
  font-weight: 500;
}

/* Hero-style colorful background helper */

.hero-bubble-bg {
  position: relative;
  overflow: hidden;
}

.hero-bubble-bg::before,
.hero-bubble-bg::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  opacity: 0.4;
  filter: blur(4px);
  z-index: -1;
}

.hero-bubble-bg::before {
  background: radial-gradient(circle at center, var(--color-primary) 0, transparent 60%);
  top: -120px;
  right: -80px;
}

.hero-bubble-bg::after {
  background: radial-gradient(circle at center, var(--color-accent-blue) 0, transparent 60%);
  bottom: -140px;
  left: -60px;
}

@media (prefers-reduced-motion: reduce) {
  .button,
  a {
    transition: none;
  }
}
