:root{
  --bg-main: #F4EFE6;
}

html, body{
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-main);
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
}

/* ======================================================
   LAYOUT
   ====================================================== */

.app{
  width: 100vw;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  background: transparent;
}

/* Links: Bühne */
.stage{
  position: relative;
  flex: 0 0 48%;
  width: 48%;
  max-width: 48vw;
  height: 100%;
  overflow: hidden;
  background: transparent;
}

/* Rechts: Chronik */
.chronicle{
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  background: transparent;
}

.chronicleInner{
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 18px 18px 18px 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Kopfzeile */
.metaRow{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(0,0,0,0.08);
}

.metaLabel{
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.2px;
  color: rgba(0,0,0,0.75);
  text-transform: uppercase;
}

.metaTimer{
  font-weight: 800;
  font-size: 14px;
  color: rgba(0,0,0,0.55);
  white-space: nowrap;
}

/* Chronik Text */
.date{
  margin: 14px 0 10px 0;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.05;
}

.text{
  flex: 1;
  min-height: 0;
  overflow: auto;
  font-size: 17px;
  line-height: 1.38;
  padding-right: 6px;
  white-space: pre-wrap;
}

/* ======================================================
   SZENE / LAYERING
   ====================================================== */

.sceneLayers{
  position: absolute;
  inset: 0;
}

/* Standard für alle Ebenen */
.layer{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom; /* wichtig: unten bündig -> kein "Rahmen" unten */
  pointer-events: none;
}

/* Turm VOR dem Speer */
img[src*="turm"]{
  z-index: 2;
}

/* Wappen über dem Turm */
img[src*="wappen"]{
  z-index: 3;
  transform-origin: 50% 8%;
  animation: wappenSway 6.8s ease-in-out infinite;
  will-change: transform;
}

/* Augen ganz vorne */
img[src*="augen"]{
  z-index: 4;
}

/* Augen: Sichtbarkeit */
#eyesOpen{ opacity: 1; }
#eyesClosed{ opacity: 0; }

.eyeClosed{ opacity: 1 !important; }
.eyeOpenHidden{ opacity: 0 !important; }


/* Wappen: minimal mitschwingen wie Stoff */
@keyframes wappenSway{
  0%   { transform: translateY(0) rotate(-0.7deg); }
  50%  { transform: translateY(1px) rotate(0.7deg); }
  100% { transform: translateY(0) rotate(-0.7deg); }
}

/* ======================================================
   Mobile: Bild oben, Text unten
   ====================================================== */

@media (max-width: 900px){
  html, body{ overflow: hidden; }

  .app{
    flex-direction: column;
  }

  .stage{
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    height: 58svh;
    height: 58dvh;
  }

  .chronicle{
    width: 100%;
    height: auto;
    flex: 1 1 auto;
    min-height: 0;
  }

  .date{ font-size: 24px; }
  .text{ font-size: 16px; }

  img[src*="speer"]{
    animation: spearPeekMobile 12s ease-in-out infinite;
  }

  img[src*="wappen"]{
    animation-duration: 8.5s;
  }
}