/* ============================================================
   Christmas Games Hub — Shared Stylesheet
   ChristmasTales.co.uk Christmas Collection
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Mountains+of+Christmas:wght@400;700&family=Nunito:wght@400;600;700;800&display=swap');

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:        #c0392b;
  --red-dark:   #922b21;
  --red-light:  #e74c3c;
  --green:      #1a6b3c;
  --green-mid:  #27ae60;
  --green-light:#2ecc71;
  --gold:       #f1c40f;
  --gold-dark:  #d4ac0d;
  --cream:      #fef9f0;
  --snow:       #eaf4fb;
  --navy:       #0d1b2a;
  --font-title: 'Mountains of Christmas', cursive;
  --font-body:  'Nunito', sans-serif;
  --radius:     16px;
  --shadow:     0 8px 32px rgba(0,0,0,0.25);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--navy);
  color: var(--cream);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Snowfall Background ── */
.snow-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.snowflake {
  position: absolute;
  top: -20px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  animation: snowfall linear infinite;
}

@keyframes snowfall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0.2; }
}

/* ── Page Wrapper ── */
.page-wrap {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

/* ── Site Header ── */
.site-header {
  text-align: center;
  padding: 48px 0 32px;
}

.site-header .back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--gold);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}
.site-header .back-link:hover { color: #fff; }

.site-header h1 {
  font-family: var(--font-title);
  font-size: clamp(2.8rem, 6vw, 5rem);
  color: var(--gold);
  text-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 0 40px rgba(241,196,15,0.3);
  line-height: 1.1;
}

.site-header .subtitle {
  margin-top: 12px;
  font-size: 1.1rem;
  color: rgba(255,255,255,0.75);
  font-weight: 600;
}

/* ── Games Grid ── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin-top: 48px;
}

/* ── Game Card ── */
.game-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  display: block;
  color: inherit;
}

.game-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 16px 48px rgba(0,0,0,0.4), 0 0 0 2px var(--gold);
}

.game-card-banner {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  position: relative;
  overflow: hidden;
}

.game-card-body {
  padding: 20px 24px 24px;
}

.game-card-body h2 {
  font-family: var(--font-title);
  font-size: 1.6rem;
  color: var(--gold);
  margin-bottom: 6px;
}

.game-card-body p {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.5;
  margin-bottom: 16px;
}

.badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
}

.badge.green  { background: rgba(39,174,96,0.25);  color: var(--green-light); }
.badge.red    { background: rgba(192,57,43,0.25);  color: #e74c3c; }
.badge.gold   { background: rgba(241,196,15,0.2);  color: var(--gold); }

.play-btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  padding: 11px 28px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  box-shadow: 0 4px 12px rgba(192,57,43,0.4);
}

.play-btn:hover {
  background: linear-gradient(135deg, var(--red-light), var(--red));
  transform: scale(1.04);
}

/* ── Game Page Layout ── */
.game-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px 60px;
}

.game-page h1 {
  font-family: var(--font-title);
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--gold);
  text-shadow: 0 4px 16px rgba(0,0,0,0.5);
  margin-bottom: 8px;
  text-align: center;
}

.game-page .instructions {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.65);
  text-align: center;
  margin-bottom: 20px;
  max-width: 560px;
}

.game-canvas-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow), 0 0 0 3px var(--gold);
  position: relative;
}

#game-canvas {
  display: block;
}

.score-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 800px;
  background: rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 12px 24px;
  margin-bottom: 16px;
  font-weight: 700;
  font-size: 1rem;
}

.score-bar .score-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-bar .score-value {
  color: var(--gold);
  font-size: 1.2rem;
}

.back-to-hub {
  margin-top: 24px;
  display: inline-block;
  color: var(--gold);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: color 0.2s;
}
.back-to-hub:hover { color: #fff; }

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: 32px 0 16px;
  color: rgba(255,255,255,0.35);
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .games-grid { grid-template-columns: 1fr; }
  .site-header h1 { font-size: 2.4rem; }
}
