/* ==========================================================================
   SAMMENSATTE TEKSTER & REKLAME-RØNTGEN — STILARK
   Moderne visuell lab-estetikk med lys/mørk modus, interaktive røntgensoner,
   komposisjons-rutenett (Det gylne snitt) og avsnittsbygger.
   ========================================================================== */

:root {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-elevated: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.9);
  --text-main: #0f172a;
  --text-muted: #475569;
  --border-color: #e2e8f0;
  --accent-indigo: #4f46e5;
  --accent-indigo-bg: #eef2ff;
  --accent-cyan: #0891b2;
  --accent-cyan-bg: #ecfeff;
  --accent-amber: #d97706;
  --accent-amber-bg: #fffbeb;
  --accent-emerald: #059669;
  --accent-emerald-bg: #ecfdf5;
  --accent-rose: #e11d48;
  --accent-rose-bg: #fff1f2;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 26px rgba(15, 23, 42, 0.09);
  --radius-md: 12px;
  --radius-lg: 18px;
}



* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.25rem;
}

.header-inner {
  max-width: 1260px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f46e5, #0891b2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.pill-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-indigo-bg);
  color: var(--accent-indigo);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  font-weight: 700;
  font-size: 0.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.16s ease;
  text-decoration: none;
}

.btn:hover {
  border-color: var(--accent-indigo);
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #0891b2);
  color: #fff;
  border: none;
}

.main-container {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3.5rem;
  flex: 1;
}

/* Hub */
.hero-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.hero-banner h2 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 900;
  margin: 0.4rem 0 0.6rem;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.25rem;
}

.hub-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.hub-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-indigo);
  box-shadow: var(--shadow-md);
}

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

.hub-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.mini-tag {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text-muted);
}

/* Room & Poster X-Ray */
.room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.mission-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.mission-tab {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
}

.mission-tab.active {
  background: var(--accent-indigo);
  color: #fff;
  border-color: var(--accent-indigo);
}

.work-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.65rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

/* Multimodal Ad Poster Stage */
.xray-stage-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1.35rem;
  align-items: start;
}

@media (max-width: 900px) {
  .xray-stage-grid {
    grid-template-columns: 1fr;
  }
}

.ad-poster-frame {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-md);
  background: #0f172a;
}

.ad-poster-img {
  width: 100%;
  display: block;
  object-fit: cover;
  max-height: 460px;
}

.ad-overlay-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 1.25rem 1.4rem;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.85) 0%, rgba(2, 6, 23, 0) 100%);
  color: #fff;
  pointer-events: none;
}

.ad-headline {
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
  font-weight: 900;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.ad-subline {
  font-size: 0.92rem;
  opacity: 0.95;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

.ad-overlay-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 1.4rem;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.9) 0%, rgba(2, 6, 23, 0) 100%);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  pointer-events: none;
}

.xray-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  background: rgba(79, 70, 229, 0.92);
  color: #fff;
  border: 2px solid #fff;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: all 0.18s ease;
  z-index: 10;
}

.xray-pin:hover,
.xray-pin.active {
  background: #10b981;
  transform: translate(-50%, -50%) scale(1.08);
}

.xray-inspector-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Composition Golden Ratio Overlay */
.comp-overlay-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 2px solid rgba(251, 191, 36, 0.85);
}

.comp-line-v1, .comp-line-v2 {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(251, 191, 36, 0.85);
  box-shadow: 0 0 8px rgba(0,0,0,0.6);
}
.comp-line-v1 { left: 33.33%; }
.comp-line-v2 { left: 66.66%; }

.comp-line-h1, .comp-line-h2 {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(251, 191, 36, 0.85);
  box-shadow: 0 0 8px rgba(0,0,0,0.6);
}
.comp-line-h1 { top: 33.33%; }
.comp-line-h2 { top: 66.66%; }

.comp-focal-ring {
  position: absolute;
  left: 66.66%;
  top: 66.66%;
  width: 64px;
  height: 64px;
  transform: translate(-50%, -50%);
  border: 3px dashed #10b981;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.22);
  pointer-events: none;
}

/* Options & Steps */
.step-block {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.option-btn {
  text-align: left;
  padding: 0.9rem 1.05rem;
  border-radius: 11px;
  border: 2px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.94rem;
  line-height: 1.5;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}

.option-btn:hover {
  border-color: var(--accent-indigo);
}

.option-btn.correct {
  border-color: var(--accent-emerald);
  background: var(--accent-emerald-bg);
}

.option-btn.wrong {
  border-color: var(--accent-rose);
  background: var(--accent-rose-bg);
}

.feedback-banner {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.91rem;
  font-weight: 600;
}

.feedback-banner.ok {
  background: var(--accent-emerald-bg);
  color: var(--accent-emerald);
  border: 1px solid var(--accent-emerald);
}

.feedback-banner.err {
  background: var(--accent-rose-bg);
  color: var(--accent-rose);
  border: 1px solid var(--accent-rose);
}

.app-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}



/* ==========================================================================
   Fasit-seksjon (Didaktisk oversikt for lærere og elever)
   ========================================================================== */
.fasit-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.fasit-details {
  border-radius: 8px;
}
.fasit-summary {
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  padding: 0.5rem 0;
  color: var(--accent-indigo);
  user-select: none;
}
.fasit-summary:hover {
  text-decoration: underline;
}
.fasit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}
.fasit-card {
  padding: 1rem;
  border-radius: 8px;
  background: var(--bg-elevated);
  border-left: 4px solid var(--accent-indigo);
  font-size: 0.92rem;
}
.fasit-card.correct-card {
  border-left-color: var(--accent-emerald);
}
.fasit-card h4 {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}
.fasit-card p {
  margin: 0.3rem 0;
  color: var(--text-muted);
}
.fasit-answer {
  font-weight: 700;
  color: var(--accent-emerald);
}
.fasit-expl {
  font-size: 0.86rem;
  margin-top: 0.4rem;
  font-style: italic;
  color: var(--text-muted);
}
