/* ==========================================================================
   PREMIUM "MODERN FANTASY GAME" THEME
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Rowdies:wght@400;700&display=swap');

:root {
  /* Fantasy / Parchment Game Palette */
  --bg-color: #fdf8eb; /* Warm parchment background */
  --text-main: #3b3a30; /* Dark brownish-gray for text */
  --text-muted: #6b695c;
  
  --primary: #2d5a3c; /* Forest green */
  --primary-dark: #1e4029;
  --primary-shadow: #142e1d;
  
  --secondary: #8b5a2b; /* Wood/Leather brown */
  --secondary-dark: #6b421a;
  --secondary-shadow: #4a2d10;
  
  --gold: #f5b041;
  --gold-dark: #d68910;
  --gold-shadow: #a04000;
  
  --surface: #fcf7ec; /* Lighter parchment for cards */
  --surface-hover: #ffffff;
  --border-light: #e8dcc4; /* Darker parchment border */
  
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --radius-full: 9999px;
  
  --font-heading: 'Rowdies', cursive;
  --font-body: 'Outfit', sans-serif;
  
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.4);
}

body.theme-home {
  background-color: transparent;
  color: var(--text-main);
  font-family: var(--font-body);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}



/* ==========================================================================
   BUTTONS & UTILITIES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.1rem;
  padding: 1rem 2rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(to bottom, rgba(16, 185, 129, 0.85), rgba(5, 150, 105, 0.95)), url('../img/ui_button_wood.png') center/cover;
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  box-shadow: 0 6px 0 var(--primary-shadow), 0 15px 20px rgba(45, 90, 60, 0.3), inset 0 2px 0 rgba(255,255,255,0.2);
}

.btn-primary:hover {
  transform: translateY(2px);
  box-shadow: 0 4px 0 var(--primary-shadow), 0 10px 15px rgba(45, 90, 60, 0.3);
}

.btn-primary:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 var(--primary-shadow);
}

.btn-secondary {
  background: white;
  color: var(--text-main);
  box-shadow: 0 6px 0 var(--border-light), 0 15px 20px rgba(0,0,0,0.05);
  border: 2px solid var(--border-light);
}

.btn-secondary:hover {
  transform: translateY(2px);
  box-shadow: 0 4px 0 var(--border-light), 0 10px 15px rgba(0,0,0,0.05);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.home-main {
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.hero-section {
  background: url('../img/hero-bg-ordoya-new.png') center center / cover no-repeat;
  padding: 4rem 5%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 450px;
  color: var(--text-main);
  transition: background-image 0.5s ease;
}

/* Time-of-Day Dynamic Hero Backgrounds */
body.time-evening .hero-section {
  background: url('/assets/img/hero_bg_ordoya_evening.png') center center / cover no-repeat !important;
}

body.time-evening .hero-section::before {
  background: linear-gradient(to bottom, rgba(35, 15, 45, 0.1) 0%, rgba(45, 20, 50, 0.3) 60%, var(--bg-color) 100%) !important;
}

body.time-night .hero-section {
  background: url('/assets/img/hero_bg_ordoya_night.png') center center / cover no-repeat !important;
}

body.time-night .hero-section::before {
  background: linear-gradient(to bottom, rgba(10, 15, 30, 0.2) 0%, rgba(15, 25, 45, 0.4) 60%, var(--bg-color) 100%) !important;
}

/* Time Theme Selector Bar */
.time-theme-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  margin: 0.8rem auto 0.2rem auto;
  width: fit-content;
  color: white;
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  z-index: 100;
  position: relative;
}

.time-theme-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 800;
}

.time-theme-btn:hover {
  background: #10b981;
  color: black;
  border-color: #10b981;
}

/* Seamless transition overlay on hero */
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(253, 248, 235, 0) 0%, rgba(253, 248, 235, 0.2) 60%, var(--bg-color) 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 10;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Mascot & Floating Tiles */
.hero-mascot {
  position: absolute;
  bottom: 0;
  right: -50px; /* Positioned slightly off-screen to the right as before */
  width: 715px; /* 30% larger width */
  height: 500px; /* Base height for tiles to orbit around */
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 5;
}

.mascot-img {
  position: absolute;
  bottom: 0; /* Anchors the mascot to the bottom of the 0-height container */
  width: 100%;
  height: auto;
  max-height: 850px;
  object-fit: contain;
  filter: drop-shadow(0 20px 25px rgba(0,0,0,0.4));
  animation: floatMascot 6s ease-in-out infinite;
}

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

.floating-tile {
  position: absolute;
  object-fit: contain;
  filter: drop-shadow(0 15px 15px rgba(0,0,0,0.3));
}

.tile-o {
  top: 15%;
  left: 0%;
  width: 50px;
  animation: floatTile1 5s ease-in-out infinite;
}
.tile-r {
  top: 30%;
  right: 0%;
  width: 60px;
  animation: floatTile2 6s ease-in-out 1s infinite;
}
.tile-d {
  bottom: 25%;
  right: 15%;
  width: 70px;
  animation: floatTile3 7s ease-in-out 2s infinite;
}

@keyframes floatTile1 {
  0%, 100% { transform: translateY(0) rotate(-15deg); }
  50% { transform: translateY(-15px) rotate(5deg); }
}
@keyframes floatTile2 {
  0%, 100% { transform: translateY(0) rotate(10deg); }
  50% { transform: translateY(-20px) rotate(-10deg); }
}
@keyframes floatTile3 {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-25px) rotate(15deg); }
}

.welcome-ribbon-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  margin-left: -1rem;
}

.welcome-ribbon-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain; /* Sikrer at bildet aldri trykkes sammen! */
  z-index: 1;
}

.welcome-badge {
  position: relative;
  z-index: 2;
  padding: 1.5rem 2.5rem; /* Puten som bestemmer størrelsen på hele elementet */
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: white;
  text-transform: uppercase;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.hero-content h1 {
  font-family: var(--font-heading);
  font-size: 7rem; /* Dobbelt så stor (fra 3.5rem) */
  line-height: 1.1;
  color: white;
  text-shadow: 0 4px 15px rgba(0,0,0,0.6);
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
}

.hero-content h1::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -50px;
  width: 100px;
  height: 100px;
  background: url('../img/ui_sparkles.png') center/contain no-repeat;
  pointer-events: none;
  animation: pulse 3s infinite alternate;
  filter: drop-shadow(0 0 10px rgba(255,215,0,0.8));
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 7rem; /* Dobbelt så stor */
  line-height: 1.1;
  margin: 0 0 1.5rem 0;
  color: var(--primary);
  text-shadow: 0 2px 4px rgba(255,255,255,0.8);
}

.hero-title .highlight {
  color: black;
  display: inline-block;
  -webkit-text-stroke: 3px white;
  text-shadow: 0 4px 15px rgba(0,0,0,0.4); /* Litt skygge bak outlinen for dybde */
}

.hero-desc {
  font-size: 1.25rem;
  color: var(--text-main);
  font-weight: 600;
  margin-bottom: 3rem;
  max-width: 95%;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 1.5rem;
}


.daily-challenge-card {
  background: url('../img/bg_parchment.png') center/cover;
  background-blend-mode: multiply;
  background-color: #fffae6;
  border-radius: 20px;
  padding: 2rem;
  color: #3f2a1d;
  box-shadow: 0 15px 35px rgba(0,0,0,0.2), inset 0 0 40px rgba(139, 69, 19, 0.15);
  border: 8px solid transparent;
  border-image: repeating-linear-gradient(45deg, #d4af37 0, #d4af37 10px, #b5952f 10px, #b5952f 20px) 8;
  position: relative;
  z-index: 10;
  width: 340px;
  text-align: center;
}

.daily-challenge-card::after {
  content: '';
  position: absolute;
  top: -15px; left: -15px; right: -15px; bottom: -15px;
  border: 2px solid rgba(212, 175, 55, 0.5);
  border-radius: 28px;
  pointer-events: none;
}

.dc-eyebrow {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--primary);
  margin: 0 0 1.5rem 0;
  letter-spacing: 1px;
}

.dc-icon-wrapper {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #fef08a, var(--gold));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 1.5rem auto;
  box-shadow: 0 10px 20px rgba(251, 191, 36, 0.3);
  border: 4px solid white;
}

.dc-title {
  font-weight: 800;
  font-size: 1.4rem;
  margin: 0 0 0.5rem 0;
}

.dc-desc {
  color: var(--text-muted);
  font-weight: 500;
  margin: 0 0 2rem 0;
}

.dc-btn {
  width: 100%;
}

/* ==========================================================================
   PROGRESS BAR OVERLAY
   ========================================================================== */
.progress-section {
  position: relative;
  z-index: 10;
  background: var(--surface);
  border-radius: var(--radius-full);
  padding: 1.2rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  margin: -4rem auto 4rem auto; /* Overlaps hero */
  position: relative;
  z-index: 20;
  width: 95%;
  max-width: 1600px;
}

.progress-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1.5;
}

.level-badge {
  width: 60px;
  height: 60px;
  background: var(--gold);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: white;
  border: 4px solid #fff;
  box-shadow: 0 4px 10px rgba(251, 191, 36, 0.4);
  transform: rotate(-5deg);
}

.progress-info {
  flex: 1;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.progress-xp {
  color: var(--primary);
}

.progress-bar-container {
  height: 12px;
  background: #f1f5f9;
  border-radius: var(--radius-full);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #34d399);
  border-radius: var(--radius-full);
}

.progress-streak {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-left: 3rem;
  border-left: 2px solid var(--border-light);
}

.fire-icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 2px 5px rgba(239, 68, 68, 0.3));
}

.streak-text strong {
  display: block;
  font-weight: 800;
  color: var(--text-main);
  font-size: 1.1rem;
}

.streak-sub {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
}

.progress-week {
  display: flex;
  gap: 0.5rem;
}

.day {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
  background: #f1f5f9;
}

.day.checked {
  background: var(--primary);
  color: white;
}

.day.current {
  background: var(--gold);
  color: white;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.3);
}

/* ==========================================================================
   GAME GRID
   ========================================================================== */
.section-wrapper {
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1.75rem 3rem 1.75rem;
  box-sizing: border-box;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  margin-bottom: 1.25rem;
}

/* Removed h1.section-title specific sizing to match h2 */

.section-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  color: var(--text-main);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.see-all {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
  font-size: 1rem;
  padding: 0.4rem 0.9rem;
  background: rgba(16, 185, 129, 0.1);
  border-radius: var(--radius-full);
  transition: all 0.2s;
}

.see-all:hover {
  background: var(--primary);
  color: white;
}

.game-cards {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.85rem;
  width: 100%;
}

@media (max-width: 1200px) {
  .game-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .game-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

.game-card {
  position: relative;
  border-radius: 20px;
  padding: 1rem 0.75rem 0.85rem 0.75rem;
  color: white;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  width: 100%;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 12px 25px -5px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.35), inset 0 -4px 0 rgba(0, 0, 0, 0.25);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  overflow: hidden;
}

/* Glossy top sheen overlay */
.game-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 48%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.05) 60%, transparent 100%);
  pointer-events: none;
  border-radius: 18px 18px 0 0;
}

.card-title-top {
  font-family: var(--font-main);
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  font-weight: 800;
  text-transform: uppercase;
  margin: 0;
  letter-spacing: 0.6px;
  white-space: nowrap;
  position: relative;
  z-index: 2;
  text-align: center;
  color: #ffffff;
  text-shadow: 0 2px 5px rgba(0,0,0,0.6);
}

.card-body-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.75rem;
  position: relative;
  z-index: 2;
}

/* Unike, avdempede fargetoner for HVERT ENESTE spill (ingen like farger!) */
.game-kryssord { background: linear-gradient(145deg, rgba(2, 132, 199, 0.45) 0%, rgba(30, 58, 138, 0.45) 100%), #0f172a; } /* Koboltblå */
.game-letekryss { background: linear-gradient(145deg, rgba(13, 148, 136, 0.45) 0%, rgba(15, 118, 110, 0.45) 100%), #0f172a; } /* Mørk Teal */
.game-anagram { background: linear-gradient(145deg, rgba(249, 115, 22, 0.45) 0%, rgba(194, 65, 12, 0.45) 100%), #0f172a; } /* Varm Solnedgangs-oransje */
.game-anagramkongen { background: linear-gradient(145deg, rgba(217, 119, 6, 0.45) 0%, rgba(146, 64, 14, 0.45) 100%), #0f172a; } /* Varm Bronse/Amber */
.game-ordsveis { background: linear-gradient(145deg, rgba(147, 51, 234, 0.45) 0%, rgba(88, 28, 135, 0.45) 100%), #0f172a; } /* Elektrisk Lilla */
.game-ordjakt { background: linear-gradient(145deg, rgba(16, 185, 129, 0.45) 0%, rgba(4, 120, 87, 0.45) 100%), #0f172a; } /* Frisk Smaragdgrønn */
.game-ordsprint { background: linear-gradient(145deg, rgba(239, 68, 68, 0.45) 0%, rgba(153, 27, 27, 0.45) 100%), #0f172a; } /* Neon Rubinrød */
.game-crosswordle { background: linear-gradient(145deg, rgba(6, 182, 212, 0.45) 0%, rgba(14, 116, 144, 0.45) 100%), #0f172a; } /* Cyan/Sjøgrønn */
.game-quiz { background: linear-gradient(145deg, rgba(168, 85, 247, 0.45) 0%, rgba(109, 40, 217, 0.45) 100%), #0f172a; } /* Lilla/Fiolett */
.game-blockword { background: linear-gradient(145deg, rgba(194, 65, 12, 0.45) 0%, rgba(124, 45, 18, 0.45) 100%), #0f172a; } /* Terracotta/Rust */
.game-ordfall { background: linear-gradient(145deg, rgba(234, 88, 12, 0.45) 0%, rgba(180, 83, 9, 0.45) 100%), #0f172a; } /* Dyp Korall/Oransje */
.game-tastemesteren { background: linear-gradient(145deg, rgba(99, 102, 241, 0.45) 0%, rgba(67, 56, 202, 0.45) 100%), #0f172a; } /* Indigo/Ultramarin */

/* Skoletemaer */
.game-skolekryss { background: linear-gradient(145deg, rgba(30, 58, 138, 0.5) 0%, rgba(15, 23, 42, 0.8) 100%), #0f172a; } /* Dyp Skoleblå */
.game-skoleletekryss { background: linear-gradient(145deg, rgba(22, 101, 52, 0.5) 0%, rgba(15, 23, 42, 0.8) 100%), #0f172a; } /* Skogsgrønn */

/* Andre spill */
.game-sudoku { background: linear-gradient(145deg, rgba(71, 85, 105, 0.45) 0%, rgba(30, 41, 59, 0.45) 100%), #0f172a; } /* Skifergrå */
.game-2048 { background: linear-gradient(145deg, rgba(245, 158, 11, 0.45) 0%, rgba(180, 83, 9, 0.45) 100%), #0f172a; } /* Varm Gull */
.game-minesweeper { background: linear-gradient(145deg, rgba(101, 163, 13, 0.45) 0%, rgba(63, 98, 18, 0.45) 100%), #0f172a; } /* Olivengrønn */
.game-kabal { background: linear-gradient(145deg, rgba(159, 18, 57, 0.45) 0%, rgba(136, 19, 55, 0.45) 100%), #0f172a; } /* Vinrød/Borgunder */
.game-flerespill { background: linear-gradient(145deg, rgba(51, 65, 85, 0.45) 0%, rgba(15, 23, 42, 0.45) 100%), #0f172a; } /* Titan/Skifer */
.game-coming-soon { 
  background: linear-gradient(145deg, #334155 0%, #1e293b 100%); 
  border: 2px dashed rgba(255, 255, 255, 0.3);
  color: var(--text-muted);
  box-shadow: none;
}

.game-card:hover {
  transform: translateY(-8px) scale(1.03);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.5);
}

.card-icon-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0 0.2rem 0;
  position: relative;
  z-index: 2;
  width: 100%;
}

.game-card:hover .card-game-icon {
  transform: scale(1.1) rotate(2deg);
}

.badge-coming-soon {
  font-size: 0.65rem;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.5);
  color: #f1f5f9;
  padding: 2px 8px;
  border-radius: 999px;
  margin-top: 6px;
  letter-spacing: 0.5px;
}

.card-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  min-width: 0; /* Hindrer teksten i å sprenge containeren */
  overflow: visible; /* Ensure text is visible */
}

.card-content h3 {
  font-family: var(--font-main);
  font-size: clamp(0.7rem, 2vw, 0.9rem);
  font-weight: 800;
  text-transform: uppercase;
  margin: 0 0 0.2rem 0;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.card-content p {
  font-size: 0.75rem;
  font-weight: 600;
  margin: 0 0 0.6rem 0;
  opacity: 0.9;
  line-height: 1.3;
  white-space: normal;
}

.game-card .card-action-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  width: auto;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  transition: all 0.2s;
  margin-top: 0.5rem !important;
  margin-bottom: 0 !important;
}

.game-card .card-action-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: white;
  transform: translateY(-1px);
}

.game-card.game-coming-soon .card-action-btn {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.1);
  color: var(--text-muted);
}

/* ==========================================================================
   BOTTOM SECTIONS
   ========================================================================== */
.bottom-sections {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 4rem;
}

.bottom-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bottom-card:nth-child(1) {
  background: #fdf8eb;
  border-color: #e6d5b8;
  box-shadow: inset 0 0 20px rgba(139, 90, 43, 0.1);
}

.bottom-card:nth-child(2) {
  background: linear-gradient(to bottom, #e0f2fe, #bae6fd);
  border-color: #7dd3fc;
}

.bottom-card .card-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--text-main);
  margin: 0 0 1.5rem 0;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.favorites-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.favorites-list li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.9);
  transition: all 0.2s;
}

.favorites-list li:hover {
  background: white;
  box-shadow: var(--shadow-sm);
  border-color: var(--primary);
  transform: translateX(4px);
}

.fav-icon {
  font-size: 2rem;
  background: white;
  padding: 0.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.fav-text {
  flex: 1;
}

.fav-text h4 {
  margin: 0 0 0.2rem 0;
  font-size: 1rem;
  color: var(--text-main);
  font-weight: 800;
}

.fav-badge {
  background: #ef4444;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 0;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: absolute;
  right: -10px;
  top: 15px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

/* Ribbon tail effect */
.fav-badge::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 0;
  border-width: 5px 5px 0 0;
  border-style: solid;
  border-color: #991b1b transparent transparent transparent;
}

.play-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  box-shadow: 0 4px 0 var(--primary-shadow);
  transition: all 0.2s;
}

.play-btn:hover {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--primary-shadow);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  flex: 1;
}

.bottom-card p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
  font-weight: 500;
}

.teachers-features {
  list-style: none;
  padding: 0;
  margin: 0;
  font-weight: 700;
  color: var(--text-main);
}

.teachers-features li {
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.teachers-features li::before {
  content: '✓';
  color: white;
  background: var(--primary);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.language-icons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.lang-icon {
  background: rgba(255, 255, 255, 0.9);
  padding: 0.5rem 0.5rem 0.75rem 0.5rem;
  border-radius: 16px;
  text-align: center;
  font-weight: 900;
  color: var(--text-main);
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 6px 14px rgba(0,0,0,0.06);
  font-size: 4.5rem;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lang-icon:hover {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--border-light);
  border-color: var(--primary);
  color: var(--primary);
}

.lang-icon small {
  display: block;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ==========================================================================
   ALERTS & MESSAGES
   ========================================================================== */
.summer-update-alert {
  background: var(--primary);
  background-image: radial-gradient(circle at top right, rgba(255,255,255,0.1), transparent);
  color: white;
  padding: 2rem;
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md), inset 0 2px 0 rgba(255,255,255,0.1);
  border: 1px solid var(--primary-dark);
  line-height: 1.6;
}

.summer-update-alert h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--gold);
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.summer-update-alert p {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 500;
}

.summer-update-alert p:last-child {
  margin-bottom: 0;
}

.summer-update-alert a {
  color: var(--gold);
  text-decoration: underline;
  font-weight: 700;
  transition: color 0.2s;
}

.summer-update-alert a:hover {
  color: white;
}

body.theme-home {
  width: 100%;
  margin: 0;
  padding: 0;
  -webkit-overflow-scrolling: touch;
}

.home-main, .hero-section, .section-wrapper, .game-grid-section {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1100px) {
  .hero-mascot, .floating-tile {
    display: none !important;
  }
}

@media (max-width: 1200px) {
  .hero-content {
    max-width: 100%;
    text-align: center;
    align-items: center;
  }
  .daily-challenge-card {
    position: static;
    transform: none;
    margin: 3rem auto 0 auto;
    width: 100%;
    max-width: 400px;
  }
  .hero-section {
    flex-direction: column;
    padding: 3rem;
  }
  .progress-section {
    flex-wrap: wrap;
    gap: 1.5rem;
    width: 95%;
  }
  .bottom-sections {
    grid-template-columns: 1fr;
  }
  .language-icons {
    grid-template-columns: repeat(6, 1fr);
  }
  .game-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .home-header {
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
  }
  .header-top-mobile {
    width: 100%;
  }
  .hamburger-btn {
    display: flex !important;
  }
  .header-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    padding-top: 1rem;
    gap: 1rem;
    align-items: stretch;
  }
  .header-menu.active {
    display: flex;
  }
  .home-nav {
    flex-direction: column;
    align-items: stretch;
    overflow-x: visible;
    white-space: normal;
    width: 100%;
    gap: 0;
  }
  .home-nav a {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    width: 100%;
  }
  .header-right {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .hamburger-btn.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .hamburger-btn.active span:nth-child(2) {
    opacity: 0;
  }
  .hamburger-btn.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
  .hero-title,
  .hero-content h1 {
    font-size: 3rem;
  }
  .hero-mascot {
    display: none !important;
  }
  .mascot-img {
    max-height: 300px;
  }
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .progress-section {
    flex-direction: column;
    align-items: flex-start;
    margin-top: -3rem;
  }
  .progress-left, .progress-streak {
    border-left: none;
    padding-left: 0;
    width: 100%;
  }
  .bottom-sections {
    grid-template-columns: 1fr;
  }
  .language-icons {
    display: flex;
    overflow-x: auto;
    padding-bottom: 1rem;
    gap: 1rem;
    /* Hide scrollbar for cleaner look */
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  .language-icons::-webkit-scrollbar {
    display: none;
  }
  .lang-icon {
    flex: 0 0 calc(33.333% - 0.66rem); /* Show 3 at a time */
  }
  .game-cards {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }
  .hero-section {
    min-height: auto !important;
    background-position: bottom center !important;
    box-shadow: none !important;
    padding: 2rem 5% 2rem 5% !important;
  }
  .hero-section::before {
    /* Keep the gradient fade on mobile so text/content transitions softly */
  }
  .game-card {
    flex-direction: column;
    text-align: center;
    align-items: center;
    max-width: 100%;
  }
  .card-content {
    align-items: center;
  }
}

@media (max-width: 640px) {
  .game-cards {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  .game-card {
    max-width: 100%;
  }
}

/* Sørg for at forsiden IKKE får tre-bakgrunnen på html (siden global.css setter den) */
@media (min-width: 1024px) {
  html {
    background: var(--bg-color) !important;
  }
}
