:root{
  --text: #111;
  --shadow: 0 10px 30px rgba(0,0,0,0.10);
  --glass: rgba(255,255,255,0.18);
  --glass-border: rgba(255,255,255,0.28);
}

*{ box-sizing: border-box; }

body{
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;

  background: linear-gradient(
    120deg,
    rgba(33,150,243,0.35),
    rgba(76,175,80,0.28),
    rgba(155,89,182,0.28),
    rgba(243,156,18,0.25)
  );
  background-size: 300% 300%;
  animation: gradientMove 12s ease-in-out infinite;
}

@keyframes gradientMove{
  0%{ background-position: 0% 50%; }
  50%{ background-position: 100% 50%; }
  100%{ background-position: 0% 50%; }
}

body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 20% 20%, rgba(255,255,255,0.18), transparent 60%),
    radial-gradient(900px 500px at 80% 35%, rgba(255,255,255,0.14), transparent 60%),
    radial-gradient(900px 500px at 50% 85%, rgba(255,255,255,0.10), transparent 60%);
  filter: blur(2px);
  z-index: 0;
}

/* Page wrapper */
.page{
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 110px 20px 40px;
}

/* Glass Card */
.card{
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 22px;
  border-radius: 22px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 18px 60px rgba(0,0,0,0.12);
}

.h1{
  margin: 0 0 8px 0;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 800;
}

.p{
  margin: 0 0 16px 0;
  opacity: 0.85;
  line-height: 1.5;
}

/* NAVBAR */
.navbar{
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 50;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 10px 12px;
  border-radius: 18px;

  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 18px 60px rgba(0,0,0,0.12);
}

.nav-logo img{ height: 44px; display: block; }

.nav-links{
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-links a,
.mobile-menu a{
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 12px;
  transition: transform 0.15s ease, background 0.15s ease;
}

.nav-links a:hover,
.mobile-menu a:hover{
  background: rgba(255,255,255,0.25);
  transform: translateY(-1px);
}

.nav-links a.active{
  background: rgba(0,0,0,0.10);
  outline: 1px solid rgba(0,0,0,0.12);
}

.nav-actions{
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Ripple toggle button */
.ripple-toggle{
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: #111;
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  white-space: nowrap;
}
.ripple-toggle[aria-pressed="false"]{ opacity: 0.8; background: #333; }
.dot{ width: 10px; height: 10px; border-radius: 50%; background: #33d17a; }
.ripple-toggle[aria-pressed="false"] .dot{ background: #ffcc00; }

/* Hamburger */
.menu-btn{
  display: none;
  width: 46px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: rgba(0,0,0,0.10);
  cursor: pointer;
  box-shadow: var(--shadow);
}
.menu-btn span{
  display: block;
  height: 2px;
  width: 22px;
  margin: 5px auto;
  background: #111;
  border-radius: 999px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.menu-btn.open span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.menu-btn.open span:nth-child(2){ opacity: 0; }
.menu-btn.open span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu{
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(260px, 92vw);
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 18px 60px rgba(0,0,0,0.12);

  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.mobile-menu.open{ opacity: 1; transform: translateY(0); pointer-events: auto; }


.square{
  aspect-ratio: 1 / 1;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  font-size: 18px;
  color: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
  width: 100%;
}
.square:hover{
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.05);
  opacity: 0.98;
}
.musik{ background: linear-gradient(135deg, #2ecc71, #27ae60); }
.video{ background: linear-gradient(135deg, #3498db, #2980b9); }
.extra{ background: linear-gradient(135deg, #9b59b6, #8e44ad); }
.extra2{ background: linear-gradient(135deg, #f39c12, #d35400); }
@media (max-width: 720px){
  .nav-links{ display: none; }
  .menu-btn{ display: inline-block; }
}

/* Simple grids for content */
.grid2{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 820px){
  .grid2{ grid-template-columns: 1fr; }
}

/* Gallery thumbnails */
.gallery{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 980px){ .gallery{ grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px){ .gallery{ grid-template-columns: repeat(2, 1fr); } }
.thumb{
  aspect-ratio: 1/1;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.18);
}
.thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Forms */
.field{
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
input, textarea{
  width: 100%;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 14px;
  padding: 12px 12px;
  background: rgba(255,255,255,0.35);
  outline: none;
  font: inherit;
}
textarea{ min-height: 120px; resize: vertical; }

.btn{
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 800;
  background: rgba(17,17,17,0.92);
  color: #fff;
  box-shadow: 0 18px 40px rgba(0,0,0,0.22);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  body{ animation: none; }
}

/* ===== Lightbox ===== */
.lb{
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: none;
}
.lb.open{ display: block; }

.lb-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
}

.lb-panel{
  position: absolute;
  inset: 18px;
  margin: auto;
  width: min(1100px, calc(100% - 36px));
  height: min(720px, calc(100% - 36px));
  border-radius: 22px;

  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.20);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 22px 80px rgba(0,0,0,0.35);

  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
}

.lb-img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: rgba(0,0,0,0.18);
}

.lb-cap{
  padding: 12px 14px;
  font-weight: 800;
  opacity: 0.9;
  border-top: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.10);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-btn{
  position: absolute;
  top: 12px;
  border: 0;
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, filter 0.15s ease;
  user-select: none;
}
.lb-btn:hover{ transform: translateY(-1px); filter: brightness(1.05); }

.lb-close{ right: 12px; }

.lb-prev, .lb-next{
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  padding: 12px 14px;
}
.lb-prev{ left: 12px; }
.lb-next{ right: 12px; }

@media (max-width: 720px){
  .lb-panel{ inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); }
  .lb-prev, .lb-next{ display: none; } /* optional: Buttons ausblenden, Swipe/Keyboard nutzen */
}


/* =========================
   PLAYER BAR (fixed bottom)
========================= */
.player-bar{
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 200;

  padding: 16px;
  border-radius: 22px;

  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 22px 60px rgba(0,0,0,0.25);

  display: grid;
  gap: 14px;
}

/* Abstand unten im Layout */
.page{
  padding-bottom: 140px;
}

/* =========================
   TOP ROW
========================= */
.player-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.track-meta{
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.track-title{
  font-weight: 900;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-sub{
  font-size: 12px;
  opacity: 0.7;
}

/* =========================
   WAVEFORM
========================= */
.waveform{
  width: 100%;
  height: 72px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.18);
}

/* =========================
   BOTTOM ROW
========================= */
.player-bottom{
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 14px;
}

.controls{
  display: flex;
  align-items: center;
  gap: 10px;
}

.time{
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  white-space: nowrap;
}

.time .sep{
  opacity: 0.5;
  margin: 0 6px;
}

.volume{
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.volume input[type="range"]{
  width: 140px;
}

/* =========================
   BUTTONS
========================= */
.icon-btn,
.play-btn{
  border: 0;
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;

  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.20);
  box-shadow: var(--shadow);

  font-weight: 800;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease;
}

.icon-btn:hover,
.play-btn:hover{
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.play-btn{
  background: rgba(17,17,17,0.92);
  color: #fff;
  min-width: 56px;
  text-align: center;
}

.icon-btn.active{
  background: rgba(17,17,17,0.85);
  color: #fff;
}

/* =========================
   PLAYLIST DRAWER
========================= */
.playlist-drawer{
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 10px);

  border-radius: 22px;
  padding: 16px;

  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 22px 60px rgba(0,0,0,0.25);

  max-height: 320px;
  overflow-y: auto;

  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.playlist-drawer.open{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.playlist-head{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.playlist-title{
  font-weight: 900;
}

/* Playlist items */
.pl-item{
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  transition: background 0.15s ease;
}

.pl-item:hover{
  background: rgba(0,0,0,0.08);
}

.pl-item.active{
  background: rgba(17,17,17,0.85);
  color: #fff;
}

.pl-name{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-dur{
  opacity: 0.7;
  font-size: 12px;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 720px){
  .player-bottom{
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .volume{
    justify-content: flex-start;
  }

  .volume input[type="range"]{
    width: 100%;
  }
}

.btn:disabled{
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  filter: none;
}


/* Typewriter: stabiler Platz (kein Springen) */
.tw-wrap{
  display: inline-flex;
  align-items: baseline;
  min-height: 1.3em;
  line-height: 1.3;
}
.tw-cursor{
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 6px;
  background: var(--text);
  transform: translateY(2px);
  animation: twBlink 0.75s infinite;
}
@keyframes twBlink{
  0%,49%{opacity:1}
  50%,100%{opacity:0}
}
@media (prefers-reduced-motion: reduce){
  .tw-cursor{ animation: none; opacity: 1; }
}


/* Galerie Grid */
.gallery{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px,1fr));
  gap: 16px;
}

/* einzelne Kachel */
.gallery .thumb{
  position: relative;
  display: block;
  border-radius: 18px;
  overflow: hidden; /* wichtig für scale */
  background: rgba(0,0,0,0.05);
}

/* Bild */
.gallery .thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;

  transition:
    transform 0.35s ease,
    filter 0.35s ease;

  transform-origin: center;
}

/* Hover Effekt */
.gallery .thumb:hover img{
  transform: scale(1.04);
  filter: brightness(1.05);
}

.gallery .thumb{
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery .thumb:hover{
  transform: translateY(-4px);
  box-shadow: 0 12px 35px rgba(0,0,0,0.18);
}

.gallery .thumb{
  -webkit-tap-highlight-color: transparent;
}