/* ------------------------------------------
   Reset / Basics
------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; padding: 0; -webkit-text-size-adjust: 100%; }

:root{
  --yellow: #ffcf33;
  --red: #d32f2f;
  --black: #000;
  --card-bg: rgba(255,255,255,0.92);

  /* Fluid spacing */
  --pad-x: clamp(14px, 3.2vw, 22px);
  --pad-y: clamp(16px, 3.8vw, 26px);

  /* Fluid radii */
  --radius-lg: clamp(18px, 4vw, 30px);
  --radius-md: clamp(14px, 3vw, 22px);

  /* Shadow scale */
  --shadow-x: clamp(5px, 1.5vw, 10px);
  --shadow-y: clamp(5px, 1.5vw, 10px);
}

/* ------------------------------------------
   Animated background
------------------------------------------ */
@keyframes rainbow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

body{
  /* iOS Safari viewport + safe area fixes */
  min-height: 100vh;                  /* baseline */
  min-height: -webkit-fill-available; /* iOS Safari */
  display: flex;
  flex-direction: column;
  align-items: center;

  font-family:
    system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
  color: #fff;

  background: linear-gradient(-45deg, #ff0000, #ffcf33, #00ff00, #00e5ff, #9c27b0);
  background-size: 400% 400%;
  animation: rainbow 20s ease infinite;

  overflow-x: hidden;
  position: relative;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* prevents footer being covered by iOS home bar */
  padding-bottom: env(safe-area-inset-bottom);
}

/* Prefer dvh if available (modern Safari/iOS) */
@supports (height: 100dvh) {
  body { min-height: 100dvh; }
}

/* Konfetti-Effekt mit CSS Dots */
.confetti-overlay{
  position: fixed;
  inset: 0;
  pointer-events: none;

  background-image:
    radial-gradient(circle, #fff 10%, transparent 10%),
    radial-gradient(circle, #ffcf33 10%, transparent 10%),
    radial-gradient(circle, #ff00ff 10%, transparent 10%);
  background-size: 50px 50px, 80px 80px, 110px 110px;
  background-position: 0 0, 20px 30px, 40px 10px;

  /* calmer so header stays readable */
  opacity: 0.18;
  z-index: 0;

  /* iOS Safari rendering/perf fixes for fixed layers */
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: transform;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
  .stream-link { transition: none; }
  .stream-link:hover { transform: none; }
}

/* iOS Safari: smoothen animation workload a bit */
@supports (-webkit-touch-callout: none) {
  body{
    animation-duration: 26s;
    background-size: 320% 320%;
  }
  .confetti-overlay{ opacity: 0.14; }
}

/* ------------------------------------------
   Header (readability booster)
------------------------------------------ */
header{
  z-index: 10;
  width: min(900px, calc(100% - (var(--pad-x) * 2)));
  padding: clamp(18px, 5.5vw, 46px) var(--pad-x) clamp(12px, 3vw, 22px);
  text-align: center;
  position: relative;
}

/* dark “glass” plate behind headline for contrast */
header::before{
  content: "";
  position: absolute;
  left: var(--pad-x);
  right: var(--pad-x);
  top: 12px;
  bottom: 8px;
  border-radius: 22px;

  background: rgba(0,0,0,0.48);
  border: 2px solid rgba(255,255,255,0.14);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  z-index: -1;
}

.subtitle{
  font-weight: 900;
  letter-spacing: 2px;
  font-size: clamp(1.05rem, 3.3vw, 1.8rem);
  margin-bottom: 10px;
  text-shadow: 0 3px 0 rgba(0,0,0,0.55), 0 12px 24px rgba(0,0,0,0.25);
}

/* h1 bleibt wie dein "1. Eintrag" (nur sauber formatiert) */
h1{
  margin: 0;
  font-weight: 900;
  letter-spacing: 0.5px;
  font-size: clamp(2.1rem, 9vw, 5rem);
  color: var(--yellow);
  text-transform: lowercase;
  line-height: 1.05;
word-break: break-word;}


/* Optional: use on Impressum/Datenschutz to keep title smaller */
.page-title{
  font-size: clamp(2rem, 7vw, 3.2rem);
  text-transform: none;
}

/* ------------------------------------------
   Main container
------------------------------------------ */
.main-container{
  z-index: 10;
  width: min(900px, calc(100% - (var(--pad-x) * 2)));
  background: var(--card-bg);
  color: #111;

  padding: var(--pad-y) var(--pad-x);
  border-radius: var(--radius-lg);
  border: clamp(5px, 1.2vw, 8px) dashed var(--yellow);
  box-shadow: var(--shadow-x) var(--shadow-y) 0px var(--red);

  margin: 0 var(--pad-x) clamp(22px, 6vw, 50px);
}

/* Default h2 (content pages) */
h2{
  margin: 22px 0 10px;
  color: #222;
  font-weight: 900;
  font-size: clamp(1.2rem, 4.2vw, 1.6rem);
  text-shadow: none;
  letter-spacing: 0.5px;
}

/* Startseite: großer Section Title (JETZT EINSCHALTEN) */
.main-container > h2{
  margin: 0 0 clamp(12px, 3vw, 18px);
  color: #333;
  font-size: clamp(1.5rem, 5vw, 2.5rem);
}

/* ------------------------------------------
   Grid + Buttons
------------------------------------------ */
.grid{
  display: grid;
  gap: clamp(12px, 2.6vw, 20px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.stream-link{
  text-decoration: none !important;
  color: #fff !important;

  border-radius: var(--radius-md)!important;
  padding: clamp(14px, 3.6vw, 20px)!important;
  font-size: clamp(1.05rem, 3.6vw, 1.35rem)!important;
  font-weight: 900!important;

  display: flex!important;
  flex-direction: column!important;
  align-items: center!important;
  justify-content: center!important;
  gap: 8px!important;

  text-align: center!important;
  line-height: 1.15!important;
  text-shadow: 2px 2px 0px rgba(0,0,0,0.5)!important;

  border-bottom: 5px solid rgba(0,0,0,0.2)!important;

  min-height: 78px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;

  transition: transform 160ms ease, filter 160ms ease;
}

/* Hover only on real hover devices */
@media (hover: hover) and (pointer: fine) {
  .stream-link:hover {
    transform: scale(1.04) rotate(1.2deg);
    filter: brightness(1.12);
  }
}

.stream-link:active{
  transform: scale(0.99);
  filter: brightness(1.05);
}

.stream-link:focus-visible{
  outline: 4px solid rgba(0,0,0,0.35);
  outline-offset: 4px;
}

.btn-live  { background-color: var(--red); }
.btn-laut  { background-color: #ff9800; }
.btn-radio { background-color: #4caf50; }
.btn-alexa { background-color: #2196f3; }
.btn-tunein{ background-color: #9c27b0; }

.emoji { font-size: clamp(1.8rem, 6vw, 2.5rem); }

@media (min-width: 521px) {
  .btn-live {
    grid-column: 1 / -1;
    font-size: clamp(1.25rem, 3.2vw, 2rem);
    padding: clamp(16px, 3.2vw, 22px);
    min-height: 96px;
  }
}

/* ------------------------------------------
   Footer + Impressum-Link
------------------------------------------ */
footer{
  z-index: 10;
  width: 100%;
  margin-top: auto;
  background: #000;
  text-align: center;
  color: var(--yellow);
  font-size: clamp(1rem, 3.2vw, 1.2rem);
  line-height: 1.3;

  /* iOS home bar safe area + comfortable spacing */
  padding:
    clamp(14px, 3.5vw, 20px)
    var(--pad-x)
    calc(clamp(14px, 3.5vw, 20px) + env(safe-area-inset-bottom));
}

.footer-inner{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.footer-link{
  color: var(--yellow);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer-link:focus-visible{
  outline: 3px solid rgba(255,255,255,0.6);
  outline-offset: 4px;
  border-radius: 8px;
}

/* ------------------------------------------
   Generic content page helpers (Impressum/Datenschutz)
------------------------------------------ */
.main-container p,
.main-container li{
  font-size: clamp(1rem, 3.4vw, 1.1rem);
  line-height: 1.65;
  margin: 0 0 14px;
}

.main-container a{
  color: var(--red);
  font-weight: 800;
  text-decoration: none;
}

.main-container a:hover{
  text-decoration: underline;
}

.backlink{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  color: #111;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(0,0,0,0.08);
  margin: 0 0 18px;
}

.backlink:active{ transform: scale(0.99); }

.backlink:focus-visible{
  outline: 4px solid rgba(0,0,0,0.35);
  outline-offset: 4px;
}
