/* ==========================================================================
   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: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-body);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background-image: radial-gradient(circle at 50% 0%, #ffffff 0%, var(--bg-color) 100%);
}

.theme-home .site-footer {
  display: none !important;
}

/* ==========================================================================
   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.png') center center / cover no-repeat;
  padding: 6rem 5%;
  position: relative;
  overflow: hidden; /* Sørger for at kongen klippes av ved den nederste gull-linjen! */
  box-shadow: inset 0 0 150px rgba(0,0,0,0.8); /* Dark vignette */
  border-bottom: 4px solid var(--gold);
}

/* Magical overlay texture on hero */
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.4) 100%);
  pointer-events: none;
}

.hero-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 600px;
  color: var(--text-main);
}


.hero-content {
  position: relative;
  z-index: 10;
  max-width: 35%; /* Text takes up left side */
  display: flex;
  flex-direction: column;
  justify-content: 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: 95%;
  max-width: 1600px;
  margin: 0 auto;
  padding-bottom: 4rem;
}

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

h1.section-title {
  font-size: 3rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 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: 1.1rem;
  padding: 0.5rem 1rem;
  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: 1rem;
  width: 100%;
}

.game-card {
  position: relative;
  border-radius: 16px;
  padding: 1rem;
  color: white;
  text-decoration: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  max-width: 350px;
  width: 100%;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3), inset 0 2px 0 rgba(255,255,255,0.2), inset 0 -4px 0 rgba(0,0,0,0.2);
  border: 2px solid rgba(255,255,255,0.1);
  overflow: hidden;
}

/* Grit/noise overlay inside cards */
.game-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noiseFilter"><feTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noiseFilter)" opacity="0.15"/></svg>');
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* Card gradients */
.game-ordjakt { background: linear-gradient(135deg, #4b7245, #355231); }
.game-kryssord { background: linear-gradient(135deg, #4f728c, #365166); }
.game-ordkamp { background: linear-gradient(135deg, #815d90, #5c4266); }
.game-anagram { background: linear-gradient(135deg, #d97d31, #a65e23); }
.game-quiz { background: linear-gradient(135deg, #287071, #1a4f50); }
.game-coming-soon { 
  background: var(--surface); 
  border: 3px dashed var(--border-light);
  color: var(--text-main);
  box-shadow: none;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Abstract overlay shape inside cards */
.game-card::before {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 100px;
  height: 100px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  transition: transform 0.3s ease;
}

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

.game-card:hover::before {
  transform: scale(1.2);
}

.card-icon {
  font-size: 2.5rem;
  background: transparent;
  flex: 0 0 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-coming-soon .card-icon {
  color: var(--text-muted);
}

.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 */
}

.card-content h3 {
  font-family: var(--font-main);
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0 0 0.3rem 0;
  letter-spacing: 0.5px;
}

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

.game-card .btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: white;
  box-shadow: none;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  width: auto;
}

.game-card .btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: white;
}

.game-card.game-coming-soon .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: #f4ebd6;
  border-color: #e6d5b8;
}

.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;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@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(3, 1fr);
  }
}

@media (max-width: 768px) {
  .home-header {
    flex-direction: column;
    gap: 1rem;
    border-radius: var(--radius-md);
  }
  .home-nav {
    display: none;
  }
  .hero-title {
    font-size: 3rem;
  }
  .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 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 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;
  }
}
