:root {
  --bg-dark: #0f172a;
  --accent-blue: #00d2ff;
  --accent-purple: #9d50bb;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
}

body {
  background: radial-gradient(circle at top left, #1e293b, #0f172a);
  min-height: 100vh;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  padding: 30px 15px;
  margin: 0;
  color: white;
}

/* Überschrift oder Titel (optional hinzufügen) */
.soundboard-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 30px;
  background: linear-gradient(to right, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.soundboard-header {
  max-width: 1100px;
  margin: 0 auto 25px;
  padding: 20px 20px 10px;
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.25);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0,210,255,0.18), rgba(157,80,187,0.18));
  border: 1px solid rgba(255,255,255,0.18);
}

.subtitle {
  margin: 6px 0 0;
  color: rgba(255,255,255,0.75);
  font-size: 0.95rem;
}

.status-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.user-badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(0,210,255,0.14);
  color: #d7faff;
  font-size: 0.95rem;
  cursor: pointer;
}

.user-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 10px;
  width: max-content;
  min-width: 140px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  padding: 8px;
  z-index: 20;
}

.user-menu .secondary-btn {
  width: 100%;
  padding: 10px 14px;
  border: none;
}

.hidden { display: none !important; }

.header-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border: 1px solid rgba(255,255,255,0.18);
  background: linear-gradient(135deg, rgba(0,210,255,0.12), rgba(157,80,187,0.12));
  color: white;
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(0,0,0,0.16);
  transition: transform 0.2s ease, background 0.25s ease, border-color 0.25s ease;
  white-space: nowrap;
}

.header-toggle-btn:hover {
  background: linear-gradient(135deg, rgba(0,210,255,0.16), rgba(157,80,187,0.16));
}

.header-toggle-btn .toggle-icon {
  display: inline-block;
  transition: transform 0.25s ease;
  font-size: 1.8rem;
}

.header-toggle-btn .toggle-text {
  display: inline-block;
}

.header-toggle-btn.active .toggle-icon {
  transform: rotate(90deg);
}

.user-action-btn,
.user-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.18);
  background: linear-gradient(135deg, rgba(0,210,255,0.12), rgba(157,80,187,0.12));
  box-shadow: 0 12px 24px rgba(0,0,0,0.16);
  color: white;
  cursor: pointer;
  white-space: nowrap;
}

.user-action-btn .btn-icon,
.user-badge .badge-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.user-action-btn .btn-text,
.user-badge .badge-text {
  display: inline-block;
}

.header-extra {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: max-height 0.32s ease, opacity 0.25s ease;
}

.header-extra.visible {
  max-height: 1000px;
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 701px) {
  .header-extra {
    max-height: none;
    opacity: 1;
    pointer-events: auto;
  }

  .header-toggle-btn {
    display: none;
  }
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.filter-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.switch {
  position: relative;
  width: 52px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  transition: background 0.25s ease;
}

.slider::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  transition: transform 0.25s ease;
}

.switch input:checked + .slider {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
}

.switch input:checked + .slider::before {
  transform: translateX(24px);
}

.toggle-label {
  color: rgba(255,255,255,0.85);
  font-size: 0.95rem;
}

#search-input {
  width: 100%;
  max-width: 100%;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: white;
  font-size: 1rem;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}

#search-input:focus {
  border-color: rgba(0,210,255,0.5);
  box-shadow: 0 0 0 3px rgba(0,210,255,0.12);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.filter-btn {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: white;
  padding: 10px 16px;
  border-radius: 999px;
  transition: all 0.25s ease;
  cursor: pointer;
}

.filter-btn.active,
.filter-btn:hover {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border-color: transparent;
  box-shadow: 0 14px 40px rgba(0, 210, 255, 0.18);
}

.soundboard {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 18px;
  max-width: 1100px;
  margin: 0 auto;
}

.loader-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  border-radius: 24px;
  z-index: 10;
  gap: 14px;
  color: #e2e8f0;
}

.loader-circle {
  width: 56px;
  height: 56px;
  border: 5px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.loader-overlay span {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.92);
}

.sound-btn {
  position: relative;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  text-align: center;
  transition: all 0.25s ease;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.22);
}

.sound-btn.flo {
  overflow: hidden;
  background: linear-gradient(180deg, rgba(0,0,0,0.4), rgba(0,0,0,0.25)), url('/soundboard/img/flo.jpg') no-repeat center/cover;
}

.sound-btn.flo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.20);
}

/* Der coole Hover-Effekt */
@media (hover: hover) {
  .sound-btn:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.05));
    transform: translateY(-3px) scale(1.03);
    border-color: rgba(255,255,255,0.22);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  }
}

.sound-btn:active {
  transform: scale(0.97);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.sound-btn::after {
  content: '';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 6px;
  height: 6px;
  background: var(--accent-blue);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-blue);
  opacity: 0.65;
}

.sound-btn.playing {
  background: linear-gradient(135deg, #00fbff, #9d50bb);
  box-shadow: 0 0 30px rgba(0, 210, 255, 0.8);
  transform: scale(1.05);
  border-color: #fff;
  z-index: 10;
  animation: pulse-playing 1.5s infinite;
}

.favorite-star {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(15,23,42,0.8);
  color: rgba(255,255,255,0.7);
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
  z-index: 5;
}

.favorite-star.favorited {
  color: #ffd166;
  background: rgba(255,209,102,0.18);
  transform: scale(1.05);
}

.sound-btn.hide {
    display: none;
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 50;
}

.modal-card {
  width: min(520px, 100%);
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  box-shadow: 0 40px 120px rgba(0,0,0,0.5);
  position: relative;
  padding: 30px;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: none;
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
}

.modal-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.tab-btn {
  flex: 1;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: white;
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border-color: transparent;
  box-shadow: 0 20px 50px rgba(0,210,255,0.16);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  color: white;
  outline: none;
}

.auth-form input:focus {
  border-color: rgba(0,210,255,0.5);
  box-shadow: 0 0 0 3px rgba(0,210,255,0.12);
}

.primary-btn {
  width: 100%;
  padding: 14px 0;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border: none;
  border-radius: 14px;
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.form-note {
  margin: 0 0 6px;
  color: rgba(255,255,255,0.75);
}

.form-status {
  min-height: 22px;
  color: #ffb7b7;
  font-size: 0.95rem;
}

@media (max-width: 1000px) {
  .soundboard {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
  }
  
  .sound-btn {
    border-radius: 16px;
    font-size: 0.88rem; 
    padding: 12px;
    line-height: 1.2;
    
    white-space: normal; 
    word-wrap: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  }

  .header-top {
    gap: 16px;
  }

  .header-toggle-btn {
    max-width: 260px;
  }

  .filter-toggle-row {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .filter-row {
    justify-content: center;
  }

  .toggle-row {
    justify-content: space-between;
  }
}

@media (max-width: 700px) {
  body {
    padding: 20px 12px;
  }

  .soundboard-header {
    padding: 18px 16px 14px;
  }

  .header-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: nowrap;
  }

  .brand-row {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }

  .brand {
    display: flex;
    flex: 1;
    min-width: 0;
    gap: 10px;
  }

  .soundboard-title {
    font-size: 1.1rem;
    margin-bottom: 0;
  }

  .status-row {
    flex-shrink: 0;
    width: auto;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .header-toggle-btn,
  .user-action-btn,
  .user-badge {
    width: 44px;
    height: 44px;
    padding: 0;
    flex-shrink: 0;
  }

  .header-toggle-btn .toggle-text,
  .user-action-btn .btn-text,
  .user-badge .badge-text {
    display: none;
  }

  .header-extra {
    margin-top: 14px;
  }

  .filter-toggle-row {
    flex-direction: column;
    gap: 18px;
  }

  .filter-row {
    justify-content: center;
    gap: 8px;
  }

  .toggle-row {
    justify-content: space-between;
    align-items: center;
    margin-top: 0;
  }
}

.sound-btn.flo {
    background: url('/soundboard/img/flo.jpg') no-repeat;
    background-size: cover;
    background-position: center;
}

/* Der coole Hover-Effekt */
@media (hover: hover) {
  .sound-btn:hover {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    transform: translateY(-5px) scale(1.05);
    border-color: transparent;
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.4);
  }
}

/* Animation beim Draufklicken */
.sound-btn:active {
  transform: scale(0.9);
  filter: brightness(1.2);
  box-shadow: 0 0 30px rgba(157, 80, 187, 0.6);
}

/* Kleine pulsierende Anzeige für "Click-Me" Feeling */
.sound-btn::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 6px;
  height: 6px;
  background: var(--accent-blue);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-blue);
  opacity: 0.6;
}
.sound-btn.playing {
  background: linear-gradient(135deg, #00fbff, #9d50bb);
  box-shadow: 0 0 30px rgba(0, 210, 255, 0.8);
  transform: scale(1.05);
  border-color: #fff;
  z-index: 10;
  animation: pulse-playing 1.5s infinite;
}

@keyframes pulse-playing {
  0% { box-shadow: 0 0 20px rgba(0, 210, 255, 0.6); }
  50% { box-shadow: 0 0 40px rgba(0, 210, 255, 0.9); }
  100% { box-shadow: 0 0 20px rgba(0, 210, 255, 0.6); }
}

.upload-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 20px;
    background: var(--glass-bg);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

#sound-name {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: white;
    box-sizing: border-box;
}


#drop-zone {
    border: 2px dashed var(--accent-blue);
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: background 0.3s;
}

#drop-zone.hover {
    background: rgba(0, 210, 255, 0.1);
}

.form-group {
    margin: 20px 0;
    box-sizing: border-box;
}

.styled-input {
    width: 100%;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    color: white;
    border-radius: 8px;
    margin-top: 5px;
    font-family: inherit;
    box-sizing: border-box;
}

.styled-input::placeholder {
    color: rgba(255,255,255,0.5);
}

#upload-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    text-decoration: none;
}

#upload-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 210, 255, 0.3);
}

#upload-btn:disabled {
    background: rgba(100, 100, 100, 0.5);
    cursor: not-allowed;
    opacity: 0.6;
}

#waveform-container {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 18px;
    padding: 16px 16px 6px 16px;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}

#waveform {
    width: 100%;
}

.hint {
    font-size: 0.85rem;
    color: var(--accent-blue);
    text-align: center;
    margin-top: 10px;
    flex: 1;
}

.hint-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.waveform-volume-row {
    display: flex;
    gap: 20px;
    align-items: stretch;
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
}

.waveform-column {
    display: flex;
    flex-direction: column;
}


.volume-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 45px;
    padding: 5px 0;
    gap: 5px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px;
}


.preview-controls {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    padding: 0;
    white-space: nowrap;
}

.play-btn {
    background: linear-gradient(135deg, rgba(0,210,255,0.95), rgba(157,80,187,0.95));
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.play-btn:hover {
    transform: translateY(-2px);
}

.play-btn:active {
    transform: translateY(0);
}

#play-pause-preview {
    width: 40px;
    padding: 10px;
    background: none;
    border: none;
}

.volume-icon {
    font-size: 1rem;
    color: rgba(255,255,255,0.8);
}

#volume-track {
    position: relative;
    width: 12px;
    height: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    cursor: pointer;
    overflow: visible;
}

#volume-track::before {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 100%;
    background: linear-gradient(to top, rgba(0,210,255,0.15), transparent 60%);
    border-radius: 999px;
}

#volume-fill {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    background: linear-gradient(180deg, var(--accent-purple), var(--accent-blue));
    transition: height 0.1s ease;
    border-radius: 0 0 999px 999px;
}

#volume-knob {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--accent-blue);
    filter: drop-shadow(0 0 8px rgba(0,210,255,0.45));
    z-index: 1;
}

.volume-status {
    display: none;
}

.vol-unit {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
}

.secondary-btn {
    background: var(--glass-bg);
    border: 1px solid var(--accent-blue);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.secondary-btn:hover {
    background: rgba(0, 210, 255, 0.1);
}

#vol-value {
    margin-left: 10px;
    color: var(--accent-blue);
    font-weight: bold;
}

label {
    display: block;
    color: white;
    font-weight: 600;
    margin-bottom: 5px;
    width: 100%;
    box-sizing: border-box;
}

#volume-slider {
    width: 100%;
}

.volume-title {
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (max-width: 1000px) {
  .soundboard {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 5px;
  }
  
  .sound-btn {
    border-radius: 12px;
    font-size: 0.8rem; 
    padding: 8px;
    line-height: 1.2;
    
    white-space: normal; 
    word-wrap: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  }
}

@media (max-width: 1000px) {
  .soundboard {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 5px;
  }
  
  .sound-btn {
    border-radius: 12px;
    font-size: 0.8rem; 
    padding: 8px;
    line-height: 1.2;
    
    white-space: normal; 
    word-wrap: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  }
  .favorite-star {
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  font-size: 0.8rem;
}
}
