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

:root {
  --text-color: #f5e6c8;
  --fire-intensity: 0.6;
  --fp-max-h: 62vh;
  --fp-max-h: 62dvh;
  --fp-w: 94vw;
  --stone-dark: #251d1a;
  --stone-mid: #3a2d28;
  --stone-light: #4e3d36;
  --wood-dark: #2c1810;
  --wood-mid: #4a2818;
  --wood-light: #6b3b23;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  width: 100dvw;
  height: 100dvh;
  overflow: hidden;
  background-color: #0b0705;
  color: #f5e6c8;
  color: var(--text-color);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body.font-serif {
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
}

body.font-sans {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body.no-header {
  --fp-max-h: 78vh;
  --fp-max-h: 78dvh;
}

/* Hauptszene - fixed füllt exakt den sichtbaren Viewport (inkl. Android 6 Adressleiste) */
.scene {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #120b08;
  background: radial-gradient(circle at 50% 62%, #24140d 0%, #120b08 55%, #070403 100%);
}

/* =========================================================
   HINTERGRUND-RAUM & WINTERFENSTER
   ========================================================= */
.room-backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  overflow: hidden;
}

.wall-texture {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(255, 220, 180, 0.012) 0px,
      rgba(255, 220, 180, 0.012) 2px,
      transparent 2px,
      transparent 48px
    ),
    linear-gradient(180deg, rgba(10, 6, 4, 0.55) 0%, rgba(28, 16, 10, 0.15) 60%, rgba(8, 5, 3, 0.75) 100%);
}

.ambient-glow {
  position: absolute;
  left: 50%;
  top: 62%;
  width: 110vw;
  max-width: 1400px;
  height: 95vh;
  max-height: 950px;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  background: radial-gradient(
    ellipse at center,
    rgba(255, 130, 40, 0.28) 0%,
    rgba(235, 90, 20, 0.14) 36%,
    rgba(160, 45, 10, 0.04) 64%,
    transparent 76%
  );
  opacity: 0.78;
  will-change: opacity, transform;
  -webkit-animation: ambientPulse 4.2s ease-in-out infinite alternate;
  animation: ambientPulse 4.2s ease-in-out infinite alternate;
}

@-webkit-keyframes ambientPulse {
  0% {
    -webkit-transform: translate(-50%, -50%) scale(0.98);
    transform: translate(-50%, -50%) scale(0.98);
    opacity: 0.68;
  }
  100% {
    -webkit-transform: translate(-50%, -50%) scale(1.02);
    transform: translate(-50%, -50%) scale(1.02);
    opacity: 0.85;
  }
}

@keyframes ambientPulse {
  0% {
    transform: translate(-50%, -50%) scale(0.98);
    opacity: 0.68;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.02);
    opacity: 0.85;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.99);
    opacity: 0.74;
  }
}

.windows-layer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.window-frame {
  position: absolute;
  top: 11vh;
  top: clamp(32px, 11dvh, 130px);
  width: 15vw;
  min-width: 92px;
  max-width: 310px;
  height: 38vh;
  min-height: 140px;
  max-height: 460px;
  padding: 8px;
  padding: clamp(6px, 0.8dvw, 14px);
  background: #1c100b;
  background: linear-gradient(145deg, #2d1b13 0%, #1c100b 100%);
  border-radius: 6px 6px 2px 2px;
  box-shadow:
    inset 0 0 0 2px rgba(95, 58, 38, 0.35),
    0 14px 36px rgba(0, 0, 0, 0.72);
  opacity: 0.88;
  transition: opacity 0.4s ease;
}

.window-left {
  left: 4vw;
  left: clamp(12px, 4dvw, 90px);
}

.window-right {
  right: 4vw;
  right: clamp(12px, 4dvw, 90px);
}

.window-glass {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 3px;
  background: #0e2038;
  background: linear-gradient(180deg, #07111e 0%, #0e2038 55%, #162b46 100%);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.75);
}

.night-sky {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.moon {
  position: absolute;
  top: 14%;
  right: 18%;
  width: 22px;
  height: 22px;
  width: clamp(16px, 2.2dvw, 38px);
  height: clamp(16px, 2.2dvw, 38px);
  border-radius: 50%;
  background: #e8dfc0;
  background: radial-gradient(circle at 35% 35%, #fffce8 0%, #e8dfc0 68%, #b9b090 100%);
  box-shadow: 0 0 22px rgba(235, 240, 255, 0.35);
  opacity: 0.9;
}

.stars {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 22% 18%, rgba(255, 255, 255, 0.85), transparent),
    radial-gradient(1px 1px at 45% 28%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1.5px 1.5px at 70% 14%, rgba(255, 255, 255, 0.75), transparent),
    radial-gradient(1px 1px at 15% 42%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1.2px 1.2px at 84% 36%, rgba(255, 255, 255, 0.75), transparent),
    radial-gradient(1px 1px at 56% 48%, rgba(255, 255, 255, 0.5), transparent);
}

.stars-alt {
  background-image:
    radial-gradient(1.5px 1.5px at 28% 22%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 62% 16%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1.5px 1.5px at 78% 32%, rgba(255, 255, 255, 0.85), transparent),
    radial-gradient(1px 1px at 18% 38%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1.2px 1.2px at 42% 45%, rgba(255, 255, 255, 0.65), transparent);
}

.pine-silhouettes {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 42%;
}

.snow-canvas {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

body.no-snow .snow-canvas {
  display: none;
}

.window-frost {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background:
    radial-gradient(circle at 0% 100%, rgba(210, 230, 250, 0.16) 0%, transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(210, 230, 250, 0.14) 0%, transparent 45%);
  pointer-events: none;
}

.window-mullions {
  position: absolute;
  top: 8px;
  right: 8px;
  bottom: 8px;
  left: 8px;
  top: clamp(6px, 0.8dvw, 14px);
  right: clamp(6px, 0.8dvw, 14px);
  bottom: clamp(6px, 0.8dvw, 14px);
  left: clamp(6px, 0.8dvw, 14px);
  pointer-events: none;
}

.mullion-v {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 5px;
  width: clamp(4px, 0.5dvw, 9px);
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  background: #271710;
  background: linear-gradient(90deg, #1b100b, #331e15, #1b100b);
}

.mullion-h {
  position: absolute;
  top: 48%;
  left: 0;
  right: 0;
  height: 5px;
  height: clamp(4px, 0.5dvw, 9px);
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
  background: #271710;
  background: linear-gradient(180deg, #1b100b, #331e15, #1b100b);
}

.window-sill {
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: -8px;
  height: 10px;
  height: clamp(8px, 1dvh, 14px);
  background: #362015;
  background: linear-gradient(180deg, #4a2c1d 0%, #24140d 100%);
  border-radius: 2px;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.7);
}

.room-vignette {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: radial-gradient(
    ellipse at 50% 56%,
    transparent 35%,
    rgba(6, 3, 2, 0.45) 75%,
    rgba(4, 2, 1, 0.82) 100%
  );
}

/* =========================================================
   VORDERGRUND: TYPOGRAFIE & KAMIN
   ========================================================= */
.scene-foreground {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: flex-end;
  justify-content: flex-end;
  padding-top: 12px;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* Typografie-Bereich */
.header-banner {
  -webkit-flex: 1 1 auto;
  flex: 1 1 auto;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  text-align: center;
  width: 92%;
  max-width: 1180px;
  padding: 10px 18px;
  padding: clamp(6px, 1.4dvh, 22px) clamp(14px, 3dvw, 36px);
  z-index: 5;
}

.header-banner.is-hidden {
  display: none;
}

.welcome-text {
  margin: 0;
  color: #f5e6c8;
  color: var(--text-color);
  font-size: 2rem;
  font-size: clamp(1.35rem, 2.8dvw + 0.55rem, 4.1rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: 0.02em;
  text-wrap: balance;
  overflow-wrap: break-word;
  word-wrap: break-word;
  text-shadow:
    0 2px 14px rgba(0, 0, 0, 0.85),
    0 0 28px rgba(255, 165, 80, 0.22);
}

.welcome-text.is-empty {
  display: none;
}

.sub-text {
  margin: 8px 0 0 0;
  margin-top: clamp(4px, 0.9dvh, 14px);
  color: #f5e6c8;
  color: var(--text-color);
  opacity: 0.86;
  font-size: 1.1rem;
  font-size: clamp(0.88rem, 1.25dvw + 0.35rem, 1.75rem);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.05em;
  text-wrap: balance;
  overflow-wrap: break-word;
  word-wrap: break-word;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
}

.sub-text.is-empty {
  display: none;
}

/* =========================================================
   KAMIN-SZENE (kompatibel bis Android 6 / Chrome 44+)
   ========================================================= */
.fireplace-stage {
  -webkit-flex: 0 0 auto;
  flex: 0 0 auto;
  width: 100%;
  display: -webkit-flex;
  display: flex;
  -webkit-justify-content: center;
  justify-content: center;
  -webkit-align-items: flex-end;
  align-items: flex-end;
}

.fireplace-unit {
  position: relative;
  /* CSS-Fallback-Größe; wird von layoutScene() exakt an Viewport angepasst */
  width: 92vw;
  max-width: 78vh;
  height: 73vw;
  max-height: 62vh;
  margin: 0 auto;
}

/* Kaminsims-Dekoration (Kerzen, Girlande, Lichterkette) */
.mantel-decor {
  position: relative;
  width: 96%;
  height: 15%;
  margin: 0 auto;
  z-index: 4;
  pointer-events: none;
}

/* Kerzen */
.candle {
  position: absolute;
  bottom: 0;
  width: 2.4%;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-align-items: center;
  align-items: center;
}

.candle-left-1 { left: 10%; height: 68%; }
.candle-left-2 { left: 14.2%; height: 52%; }
.candle-right-1 { right: 14.2%; height: 54%; }
.candle-right-2 { right: 10%; height: 70%; }

.candle-flame {
  width: 55%;
  height: 28%;
  min-height: 6px;
  border-radius: 50% 50% 45% 45% / 70% 70% 35% 35%;
  background: #ffe08a;
  background: radial-gradient(ellipse at 50% 70%, #ffffff 0%, #ffe08a 40%, #ff8a1f 85%, transparent 100%);
  box-shadow: 0 0 10px rgba(255, 170, 60, 0.75);
  -webkit-transform-origin: bottom center;
  transform-origin: bottom center;
  -webkit-animation: candleFlicker 2.4s ease-in-out infinite alternate;
  animation: candleFlicker 2.4s ease-in-out infinite alternate;
}

.candle-left-2 .candle-flame { -webkit-animation-delay: -0.7s; animation-delay: -0.7s; -webkit-animation-duration: 2.1s; animation-duration: 2.1s; }
.candle-right-1 .candle-flame { -webkit-animation-delay: -1.3s; animation-delay: -1.3s; -webkit-animation-duration: 2.6s; animation-duration: 2.6s; }
.candle-right-2 .candle-flame { -webkit-animation-delay: -0.4s; animation-delay: -0.4s; -webkit-animation-duration: 2.2s; animation-duration: 2.2s; }

@-webkit-keyframes candleFlicker {
  0% { -webkit-transform: scale(0.95, 0.96) rotate(-2deg); transform: scale(0.95, 0.96) rotate(-2deg); opacity: 0.9; }
  50% { -webkit-transform: scale(1.04, 1.06) rotate(2deg); transform: scale(1.04, 1.06) rotate(2deg); opacity: 1; }
  100% { -webkit-transform: scale(0.97, 0.99) rotate(-1deg); transform: scale(0.97, 0.99) rotate(-1deg); opacity: 0.92; }
}

@keyframes candleFlicker {
  0% { transform: scale(0.95, 0.96) rotate(-2deg); opacity: 0.9; }
  50% { transform: scale(1.04, 1.06) rotate(2deg); opacity: 1; }
  100% { transform: scale(0.97, 0.99) rotate(-1deg); opacity: 0.92; }
}

.candle-body {
  width: 100%;
  -webkit-flex: 1 1 auto;
  flex: 1 1 auto;
  background: #f5ebd6;
  background: linear-gradient(90deg, #d9cdb4 0%, #f5ebd6 45%, #bfb095 100%);
  border-radius: 2px 2px 0 0;
  box-shadow: inset 0 2px 4px rgba(255, 220, 150, 0.45);
}

.candle-holder {
  width: 155%;
  height: 14%;
  min-height: 4px;
  background: #a57e27;
  background: linear-gradient(180deg, #d1a545 0%, #7d5914 100%);
  border-radius: 2px;
}

/* Tannengirlande */
.garland-svg {
  position: absolute;
  left: 0;
  bottom: -44%;
  width: 100%;
  height: 155%;
  -webkit-filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.65));
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.65));
}

/* Lichterkette */
.fairy-lights {
  position: absolute;
  left: 0;
  bottom: -44%;
  width: 100%;
  height: 155%;
}

.bulb {
  position: absolute;
  width: 7px;
  height: 7px;
  width: clamp(5px, 0.65dvw, 10px);
  height: clamp(5px, 0.65dvw, 10px);
  border-radius: 50%;
  background: #fff2c6;
  box-shadow:
    0 0 6px 2px rgba(255, 200, 95, 0.85),
    0 0 14px 4px rgba(255, 160, 45, 0.42);
  will-change: opacity, transform;
  -webkit-animation: bulbGlow 3.2s ease-in-out infinite alternate;
  animation: bulbGlow 3.2s ease-in-out infinite alternate;
}

@-webkit-keyframes bulbGlow {
  0% { opacity: 0.55; -webkit-transform: scale(0.88); transform: scale(0.88); }
  50% { opacity: 1; -webkit-transform: scale(1.1); transform: scale(1.1); }
  100% { opacity: 0.68; -webkit-transform: scale(0.95); transform: scale(0.95); }
}

@keyframes bulbGlow {
  0% { opacity: 0.55; transform: scale(0.88); }
  50% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 0.68; transform: scale(0.95); }
}

.b1  { left: 5.5%;  top: 74%; -webkit-animation-delay: 0.0s; animation-delay: 0.0s; }
.b2  { left: 9%;    top: 56%; -webkit-animation-delay: 0.4s; animation-delay: 0.4s; }
.b3  { left: 16%;   top: 63%; -webkit-animation-delay: 0.9s; animation-delay: 0.9s; }
.b4  { left: 24%;   top: 66%; -webkit-animation-delay: 1.4s; animation-delay: 1.4s; }
.b5  { left: 32%;   top: 64%; -webkit-animation-delay: 0.2s; animation-delay: 0.2s; }
.b6  { left: 40%;   top: 64%; -webkit-animation-delay: 1.1s; animation-delay: 1.1s; }
.b7  { left: 48%;   top: 59%; -webkit-animation-delay: 0.6s; animation-delay: 0.6s; }
.b8  { left: 55%;   top: 61%; -webkit-animation-delay: 1.7s; animation-delay: 1.7s; }
.b9  { left: 63%;   top: 66%; -webkit-animation-delay: 0.3s; animation-delay: 0.3s; }
.b10 { left: 71%;   top: 64%; -webkit-animation-delay: 1.2s; animation-delay: 1.2s; }
.b11 { left: 79%;   top: 66%; -webkit-animation-delay: 0.8s; animation-delay: 0.8s; }
.b12 { left: 86%;   top: 60%; -webkit-animation-delay: 1.5s; animation-delay: 1.5s; }
.b13 { left: 91%;   top: 56%; -webkit-animation-delay: 0.5s; animation-delay: 0.5s; }
.b14 { left: 94.5%; top: 74%; -webkit-animation-delay: 1.0s; animation-delay: 1.0s; }

/* Holz-Kaminsims */
.mantel-shelf {
  position: relative;
  width: 99%;
  height: 7%;
  margin: 0 auto;
  z-index: 3;
}

.mantel-crown {
  width: 100%;
  height: 62%;
  background: #4a2818;
  background: linear-gradient(180deg, #6b3b23 0%, #4a2818 45%, #2c1810 100%);
  border-radius: 4px 4px 2px 2px;
  box-shadow:
    inset 0 2px 3px rgba(255, 200, 140, 0.2),
    0 6px 14px rgba(0, 0, 0, 0.75);
}

.mantel-trim {
  width: 95%;
  height: 38%;
  margin: 0 auto;
  background: #2f180e;
  background: linear-gradient(180deg, #3c1f13 0%, #23110a 100%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.75);
}

/* Kamin-Korpus & Mauerwerk (Absolute Positionierung statt CSS Grid für Android 6 Kompatibilität) */
.fireplace-body {
  position: relative;
  width: 88%;
  height: 69%;
  margin: 0 auto;
  background: #1b1411;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.85);
}

/* Steinsäulen & Sturz */
.pillar,
.lintel {
  background-color: #3a2d28;
  background-image:
    repeating-linear-gradient(
      180deg,
      rgba(14, 9, 7, 0.82) 0px,
      rgba(14, 9, 7, 0.82) 2px,
      transparent 2px,
      transparent 28px
    ),
    linear-gradient(135deg, rgba(255, 210, 165, 0.07) 0%, rgba(0, 0, 0, 0.28) 100%);
}

.pillar-left {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 18%;
  border-right: 2px solid rgba(10, 6, 4, 0.85);
  box-shadow: inset -12px 0 22px -8px rgba(255, 130, 45, 0.25);
}

.pillar-right {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 18%;
  border-left: 2px solid rgba(10, 6, 4, 0.85);
  box-shadow: inset 12px 0 22px -8px rgba(255, 130, 45, 0.25);
}

.lintel {
  position: absolute;
  top: 0;
  left: 18%;
  right: 18%;
  height: 17%;
  border-bottom: 3px solid #120b08;
  box-shadow:
    inset 0 -10px 18px -6px rgba(255, 135, 48, 0.3),
    0 6px 12px rgba(0, 0, 0, 0.6);
  z-index: 2;
}

/* Feuerraum */
.firebox {
  position: absolute;
  top: 17%;
  left: 18%;
  right: 18%;
  bottom: 0;
  overflow: hidden;
  background: #090503;
  border-radius: 8% 8% 0 0 / 12% 12% 0 0;
}

.firebox-back {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 190, 120, 0.03) 0px,
      rgba(255, 190, 120, 0.03) 1px,
      rgba(0, 0, 0, 0.35) 1px,
      rgba(0, 0, 0, 0.35) 18px
    ),
    radial-gradient(ellipse at 50% 80%, #2b1409 0%, #120805 62%, #070302 100%);
}

.firebox-glow {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: radial-gradient(
    ellipse at 50% 84%,
    rgba(255, 145, 42, 0.65) 0%,
    rgba(220, 72, 16, 0.34) 44%,
    rgba(110, 22, 5, 0.08) 76%,
    transparent 100%
  );
  opacity: 0.76;
  pointer-events: none;
}

/* Gusseiserner Rost */
.grate {
  position: absolute;
  left: 16%;
  right: 16%;
  bottom: 5%;
  height: 15%;
  display: -webkit-flex;
  display: flex;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  -webkit-align-items: flex-end;
  align-items: flex-end;
  pointer-events: none;
  z-index: 1;
}

.grate-bar {
  width: 5%;
  height: 100%;
  background: #231d1b;
  background: linear-gradient(90deg, #0b0908, #2c2522, #0b0908);
  border-radius: 3px 3px 0 0;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.9);
}

.grate-base {
  position: absolute;
  left: -4%;
  right: -4%;
  bottom: 22%;
  height: 22%;
  background: #1a1513;
  background: linear-gradient(180deg, #27201d, #0a0807);
  border-radius: 2px;
}

#fire-canvas {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
}

.firebox-inner-shadow {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  pointer-events: none;
  box-shadow:
    inset 14px 16px 26px rgba(0, 0, 0, 0.85),
    inset -14px 0 26px rgba(0, 0, 0, 0.85);
}

/* Sockel / Hearth */
.hearth {
  position: relative;
  width: 97%;
  height: 9%;
  margin: 0 auto;
  background: #312621;
  background: linear-gradient(180deg, #4b3b34 0%, #312621 45%, #1d1613 100%);
  border-radius: 3px 3px 0 0;
  box-shadow:
    inset 0 2px 3px rgba(255, 200, 145, 0.16),
    0 10px 26px rgba(0, 0, 0, 0.9);
  z-index: 3;
  overflow: hidden;
}

.hearth-reflection {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: radial-gradient(
    ellipse at 50% 0%,
    rgba(255, 130, 40, 0.38) 0%,
    rgba(255, 95, 20, 0.12) 48%,
    transparent 76%
  );
  opacity: 0.72;
  -webkit-animation: hearthShimmer 3.1s ease-in-out infinite alternate;
  animation: hearthShimmer 3.1s ease-in-out infinite alternate;
}

@-webkit-keyframes hearthShimmer {
  0% { opacity: 0.6; }
  100% { opacity: 0.85; }
}

@keyframes hearthShimmer {
  0% { opacity: 0.6; }
  100% { opacity: 0.85; }
}

/* Boden */
.floor {
  position: relative;
  -webkit-flex: 0 0 auto;
  flex: 0 0 auto;
  width: 100%;
  height: 24px;
  height: clamp(14px, 4.5dvh, 56px);
  background: #0f0906;
  background: linear-gradient(180deg, #160d09 0%, #0b0604 100%);
  border-top: 1px solid rgba(255, 180, 110, 0.08);
  z-index: 2;
  overflow: hidden;
}

.floor-glow {
  position: absolute;
  left: 50%;
  top: 0;
  width: 85vw;
  max-width: 900px;
  height: 100%;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at 50% 0%,
    rgba(255, 125, 38, 0.34) 0%,
    rgba(210, 75, 18, 0.12) 55%,
    transparent 82%
  );
  opacity: 0.75;
}

/* =========================================================
   AUDIO-BUTTON (Touch-optimiert >= 44x44px, Auto-Hide)
   ========================================================= */
.audio-toggle {
  position: fixed;
  right: 16px;
  right: max(16px, calc(12px + env(safe-area-inset-right)));
  bottom: 16px;
  bottom: max(16px, calc(12px + env(safe-area-inset-bottom)));
  z-index: 30;
  width: 48px;
  height: 48px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: -webkit-inline-flex;
  display: inline-flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(245, 230, 200, 0.25);
  background: rgba(18, 11, 8, 0.78);
  color: #f5e6c8;
  color: var(--text-color);
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  -webkit-transform: translateY(6px);
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.audio-toggle.is-visible,
.audio-toggle:focus-visible {
  opacity: 1;
  pointer-events: auto;
  -webkit-transform: translateY(0);
  transform: translateY(0);
}

.audio-toggle:hover {
  background: rgba(38, 22, 14, 0.88);
  border-color: rgba(245, 230, 200, 0.5);
}

.audio-toggle:active {
  -webkit-transform: scale(0.94);
  transform: scale(0.94);
}

.audio-toggle:focus-visible {
  outline: 2px solid #f5e6c8;
  outline: 2px solid var(--text-color);
  outline-offset: 3px;
}

.audio-toggle[aria-pressed="true"] {
  border-color: rgba(255, 175, 85, 0.65);
  color: #ffd599;
}

.audio-toggle .icon-unmuted {
  display: none;
}

.audio-toggle[aria-pressed="true"] .icon-muted {
  display: none;
}

.audio-toggle[aria-pressed="true"] .icon-unmuted {
  display: block;
}

/* =========================================================
   RESPONSIVE ANPASSUNGEN (Portrait, Schmale Displays, Flache Screens, 4K)
   ========================================================= */

/* Portrait / Hochformat (Smartphones & Hochkant-Tablets) */
@media (max-aspect-ratio: 1 / 1) {
  .window-frame {
    top: 18px;
    top: max(18px, env(safe-area-inset-top));
    width: 24vw;
    min-width: 78px;
    max-width: 175px;
    height: 23vh;
    min-height: 118px;
    max-height: 250px;
    opacity: 0.48;
  }

  .window-left {
    left: -10px;
  }

  .window-right {
    right: -10px;
  }

  .welcome-text {
    font-size: 1.65rem;
    font-size: clamp(1.3rem, 5.2dvw, 2.75rem);
  }

  .sub-text {
    font-size: 1rem;
    font-size: clamp(0.88rem, 3.2dvw, 1.35rem);
  }
}

/* Sehr schmale Smartphones (z.B. 320px-380px, inkl. viele Android 6 Geräte) */
@media (max-width: 400px) and (max-aspect-ratio: 1 / 1) {
  .header-banner {
    padding: 8px 14px;
  }

  .welcome-text {
    font-size: 1.45rem;
    font-size: clamp(1.2rem, 5dvw, 1.8rem);
  }

  .sub-text {
    font-size: 0.92rem;
    font-size: clamp(0.82rem, 3.2dvw, 1.05rem);
  }

  .window-frame {
    opacity: 0.36;
  }
}

/* Kurze Landscape-Screens (z.B. Smartphone quer) */
@media (max-height: 520px) and (min-aspect-ratio: 1 / 1) {
  .header-banner {
    padding: 4px 16px;
  }

  .welcome-text {
    font-size: 1.3rem;
    font-size: clamp(1.05rem, 3.8dvh + 0.4rem, 1.9rem);
  }

  .sub-text {
    font-size: 0.9rem;
    font-size: clamp(0.78rem, 2.4dvh + 0.25rem, 1.05rem);
    margin-top: 2px;
  }

  .floor {
    height: 12px;
  }

  .window-frame {
    top: 10vh;
    height: 52vh;
    width: 14vw;
    min-width: 80px;
    max-width: 150px;
  }
}

/* 4K & Ultra-Large Screens */
@media (min-width: 2400px) {
  .welcome-text {
    font-size: clamp(3rem, 2.6dvw, 5.5rem);
  }

  .sub-text {
    font-size: clamp(1.4rem, 1.2dvw, 2.4rem);
  }

  .audio-toggle {
    width: 64px;
    height: 64px;
  }

  .audio-toggle svg {
    width: 28px;
    height: 28px;
  }
}

/* Respektiere reduzierte Bewegung nur minimal beim UI, Feuer bleibt ruhig */
@media (prefers-reduced-motion: reduce) {
  .bulb,
  .ambient-glow,
  .hearth-reflection {
    -webkit-animation-duration: 8s;
    animation-duration: 8s;
  }
}
