/* ══════════════════════════════════════════
   JUKEBOX eCARD — 70er RETRO STYLESHEET
   Layout: gestaffelt (Viewer oben, Tasten unten)
   Responsive: Desktop + Handy 1:1
══════════════════════════════════════════ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  padding: 20px 0;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family, 'Nunito', Arial, sans-serif);
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Hintergrundbild (wie beim Fahrstuhl) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -2;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(212,169,74,0.15), transparent 55%),
    radial-gradient(ellipse at 70% 80%, rgba(198,106,58,0.18), transparent 55%);
  z-index: -1;
  pointer-events: none;
}

/* ── APP WRAPPER ── */
#app {
  width: 90%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 10px 0 20px;
}

/* ══════════════════════════════════════════
   JUKEBOX-GEHÄUSE
══════════════════════════════════════════ */
#jukebox {
  width: 100%;
  background:
    linear-gradient(180deg, #5a3220 0%, #3a2014 50%, #2a1810 100%);
  border: 3px solid var(--color-gold, #d4a94a);
  border-radius: 32px 32px 14px 14px;
  position: relative;
  padding: 0 12px 12px;
  box-shadow:
    0 12px 40px rgba(0,0,0,0.65),
    inset 0 0 30px rgba(0,0,0,0.4),
    inset 0 2px 0 rgba(245,217,131,0.15);
}

#jukebox::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 29px 29px 11px 11px;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0px,
      transparent 22px,
      rgba(0,0,0,0.08) 22px,
      rgba(0,0,0,0.08) 23px
    );
  pointer-events: none;
  z-index: 0;
}

/* ── KRONE ── */
#crown {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 6px 8px;
  position: relative;
  z-index: 1;
}

.crown-tube {
  flex: 1;
  height: 10px;
  background: linear-gradient(180deg,
    rgba(245,217,131,0.9) 0%,
    rgba(212,169,74,0.6) 50%,
    rgba(198,106,58,0.8) 100%);
  border-radius: 5px;
  box-shadow:
    0 0 10px rgba(245,217,131,0.6),
    inset 0 1px 0 rgba(255,255,255,0.4);
  animation: tube-glow 2.8s ease-in-out infinite;
}
.tube-right { animation-delay: 1.4s; }

@keyframes tube-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(245,217,131,0.6), inset 0 1px 0 rgba(255,255,255,0.4); }
  50%      { box-shadow: 0 0 18px rgba(245,217,131,0.95), inset 0 1px 0 rgba(255,255,255,0.5); }
}

.crown-brand {
  font-family: 'Abril Fatface', serif;
  font-size: 13px;
  color: var(--color-gold-light, #f5d983);
  letter-spacing: 1.5px;
  white-space: nowrap;
  text-shadow:
    0 0 8px rgba(245,217,131,0.6),
    0 0 16px rgba(245,217,131,0.3);
  padding: 0 4px;
}

/* ══════════════════════════════════════════
   ANZEIGE-FENSTER
══════════════════════════════════════════ */
#viewer {
  position: relative;
  width: 100%;
  height: 340px;
  background: radial-gradient(ellipse at center,
    #2a1810 0%,
    #1a0a05 60%,
    #0a0502 100%);
  border: 2px solid rgba(212,169,74,0.6);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    inset 0 0 40px rgba(0,0,0,0.9),
    inset 0 0 6px rgba(212,169,74,0.2),
    0 4px 12px rgba(0,0,0,0.5);
  z-index: 1;
}

#viewer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(255,255,255,0.08) 0%,
    transparent 40%,
    transparent 60%,
    rgba(255,255,255,0.04) 100%);
  pointer-events: none;
  z-index: 30;
}

/* ── PLATTE ── */
.record {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 240px;
  height: 240px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
    #2a1810 0%,
    #2a1810 18%,
    var(--color-record, #1a0a05) 19%,
    var(--color-record, #1a0a05) 100%);
  box-shadow:
    0 4px 20px rgba(0,0,0,0.8),
    inset 0 0 20px rgba(0,0,0,0.5);
  transition: opacity 0.4s ease;
  z-index: 5;
}

.record-grooves {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    repeating-radial-gradient(
      circle at center,
      rgba(245,217,131,0.04) 0px,
      rgba(245,217,131,0.04) 1px,
      transparent 1px,
      transparent 4px
    );
  pointer-events: none;
}

.record.spinning { animation: spin 2.5s linear infinite; }
@keyframes spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

.record.exit {
  transform: translate(150%, -50%);
  transition: transform 0.55s cubic-bezier(0.5, 0, 0.75, 0);
  animation: none;
}
.record.enter-start {
  transform: translate(-250%, -50%);
  transition: none;
  animation: none;
}
.record.enter {
  transform: translate(-50%, -50%);
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.record-label {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 128px;
  height: 128px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%,
    var(--color-gold-light, #f5d983) 0%,
    var(--color-gold, #d4a94a) 50%,
    #a0782a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8% 6%;
  text-align: center;
  box-shadow:
    inset 0 0 20px rgba(0,0,0,0.3),
    0 0 4px rgba(0,0,0,0.4);
  overflow: hidden;
}

.label-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  transform: translate(-50%, -50%);
  background: #0a0502;
  border-radius: 50%;
  box-shadow: 0 0 2px rgba(0,0,0,0.8);
}

.label-emoji {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 4px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}

.label-title {
  font-family: 'Abril Fatface', serif;
  font-size: 13px;
  color: #2a1810;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.3px;
  padding: 0 2px;
}

.label-subtitle {
  font-size: 9px;
  color: #5a3220;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 3px;
}

/* ── TONARM ── */
#tonearm {
  position: absolute;
  top: 8%;
  right: 6%;
  z-index: 10;
  transform-origin: top right;
  transform: rotate(35deg);
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
#tonearm.playing { transform: rotate(5deg); }

.tonearm-base {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #e8d5b0, #a0782a 70%, #5a3220 100%);
  box-shadow: 0 2px 4px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.3);
  z-index: 2;
}

.tonearm-rod {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 3px;
  height: 110px;
  background: linear-gradient(180deg, #e8d5b0, #a0782a);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.5);
  transform-origin: top right;
  transform: rotate(-180deg) translateX(-1px);
}

.tonearm-head {
  position: absolute;
  top: 108px;
  right: -3px;
  width: 11px;
  height: 16px;
  background: linear-gradient(180deg, #3a2014, #1a0a05);
  border-radius: 3px;
  border: 1px solid #a0782a;
  transform: rotate(-180deg);
}
.tonearm-head::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 2px;
  height: 4px;
  background: #f5d983;
  transform: translateX(-50%);
  border-radius: 1px;
  box-shadow: 0 0 3px rgba(245,217,131,0.6);
}

/* ── INHALTS-OVERLAY ── */
#content-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 14px;
  text-align: center;
  background: rgba(30, 18, 10, 0.92);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
  z-index: 15;
  overflow-y: auto;
}
#content-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.content-emoji {
  font-size: 32px;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 8px rgba(212,169,74,0.5));
}
.content-title {
  font-family: 'Abril Fatface', serif;
  font-size: 16px;
  color: var(--color-gold, #d4a94a);
  font-weight: 400;
  margin-bottom: 6px;
  letter-spacing: 0.4px;
  text-shadow: 0 0 10px rgba(212,169,74,0.4);
}
.content-highlight {
  color: var(--color-gold-light, #f5d983);
  font-size: 13px;
  margin: 6px 0;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-shadow: 0 0 8px rgba(245,217,131,0.3);
}
.content-text {
  font-size: 13px;
  color: var(--color-text, #e8d5b0);
  line-height: 1.5;
  width: 100%;
  padding: 0 4px;
}

/* Konfetti-Canvas */
#konfetti-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 25;
  display: none;
}

/* ══════════════════════════════════════════
   NOW PLAYING
══════════════════════════════════════════ */
#now-playing {
  margin: 8px 2px 6px;
  padding: 4px 10px;
  background: linear-gradient(180deg, #1a0a05, #0a0502);
  border: 1.5px solid rgba(212,169,74,0.5);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Courier New', monospace;
  box-shadow:
    inset 0 0 10px rgba(0,0,0,0.8),
    0 0 6px rgba(212,169,74,0.15);
  position: relative;
  z-index: 1;
}

.np-label {
  font-size: 8px;
  color: var(--color-accent, #c66a3a);
  letter-spacing: 1.5px;
  font-weight: 700;
  flex-shrink: 0;
}

#np-title {
  font-size: 11px;
  color: var(--color-gold-light, #f5d983);
  letter-spacing: 0.5px;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(245,217,131,0.6);
  flex: 1;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: opacity 0.3s;
}

/* ══════════════════════════════════════════
   TASTENFELD (2-Spalten-Grid)
══════════════════════════════════════════ */
#keypad {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 2px 0 0;
  position: relative;
  z-index: 1;
}

.song-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  background: linear-gradient(180deg, #4a2a18 0%, #3a2010 100%);
  border: 2px solid var(--color-gold, #d4a94a);
  border-radius: 8px;
  color: var(--color-gold-light, #f5d983);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.15s;
  box-shadow:
    0 2px 5px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(245,217,131,0.2);
  position: relative;
  overflow: hidden;
  min-height: 38px;
}

.song-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(245,217,131,0.12), transparent 60%);
  pointer-events: none;
}

.song-btn:hover {
  background: linear-gradient(180deg, #5a3220 0%, #4a2a18 100%);
  box-shadow:
    0 0 14px rgba(212,169,74,0.5),
    inset 0 1px 0 rgba(245,217,131,0.25);
  transform: translateY(-1px);
}

.song-btn:active {
  transform: translateY(1px);
  box-shadow:
    0 1px 3px rgba(0,0,0,0.5),
    inset 0 2px 4px rgba(0,0,0,0.4);
}

.song-btn.active {
  background: linear-gradient(180deg, #d4a94a 0%, #a0782a 100%);
  color: #2a1810;
  box-shadow:
    0 0 18px rgba(245,217,131,0.7),
    inset 0 1px 0 rgba(255,255,255,0.4);
  border-color: var(--color-gold-light, #f5d983);
}
.song-btn.active .btn-title,
.song-btn.active .btn-code {
  color: #2a1810;
  text-shadow: none;
}

.btn-code {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  font-weight: bold;
  color: var(--color-gold, #d4a94a);
  background: rgba(10, 5, 2, 0.6);
  padding: 2px 5px;
  border-radius: 3px;
  min-width: 22px;
  text-align: center;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  box-shadow: inset 0 0 4px rgba(0,0,0,0.5);
}

.btn-title {
  font-family: 'Abril Fatface', serif;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.2px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hidden-btn { border-color: var(--color-accent, #c66a3a); }
.hidden-btn .btn-code {
  color: var(--color-accent, #c66a3a);
  background: rgba(42, 16, 8, 0.7);
}
.hidden-btn:hover {
  box-shadow:
    0 0 14px rgba(198,106,58,0.55),
    inset 0 1px 0 rgba(245,183,138,0.3);
}

@keyframes btn-blink {
  0%, 100% {
    box-shadow: 0 0 18px rgba(245,217,131,0.8), inset 0 1px 0 rgba(245,217,131,0.3);
    border-color: var(--color-gold-light, #f5d983);
  }
  50% {
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    border-color: var(--color-gold, #d4a94a);
  }
}
.btn-blink {
  animation: btn-blink 1.5s ease-in-out infinite;
}

/* ══════════════════════════════════════════
   RSVP-FORMULAR
══════════════════════════════════════════ */
.rsvp-form {
  width: 100%;
  max-width: 260px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rsvp-form input[type="text"],
.rsvp-form textarea {
  width: 100%;
  padding: 6px 8px;
  background: rgba(20, 10, 6, 0.7);
  border: 1px solid rgba(212,169,74,0.5);
  border-radius: 6px;
  color: var(--color-gold-light, #f5d983);
  font-family: inherit;
  font-size: 12px;
  outline: none;
}
.rsvp-form input:focus,
.rsvp-form textarea:focus {
  border-color: var(--color-gold-light, #f5d983);
  box-shadow: 0 0 8px rgba(245,217,131,0.3);
}
.rsvp-form textarea { resize: none; min-height: 40px; }

.rsvp-form > label {
  font-size: 9px;
  color: rgba(245,217,131,0.7);
  text-align: left;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: -3px;
  font-weight: 700;
}
.rsvp-radio-group { display: flex; gap: 5px; justify-content: center; }
.rsvp-radio-group label {
  flex: 1;
  text-align: center;
  padding: 5px 3px;
  background: rgba(20, 10, 6, 0.5);
  border: 1px solid rgba(212,169,74,0.35);
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  color: var(--color-text, #e8d5b0);
  margin: 0;
  transition: all 0.15s;
  font-weight: 700;
}
.rsvp-radio-group input[type="radio"] { display: none; }
.rsvp-radio-group label:has(input:checked) {
  background: linear-gradient(180deg, #f5d983, #d4a94a);
  border-color: #f5d983;
  color: #2a1810;
  box-shadow: 0 0 10px rgba(245,217,131,0.4);
}
.rsvp-submit {
  margin-top: 3px;
  padding: 7px 14px;
  background: linear-gradient(180deg, #d4a94a, #a0782a);
  border: 2px solid var(--color-gold-light, #f5d983);
  border-radius: 8px;
  color: #2a1810;
  font-family: 'Abril Fatface', serif;
  font-size: 13px;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow:
    0 3px 10px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.3);
  transition: all 0.15s;
}
.rsvp-submit:hover {
  background: linear-gradient(180deg, #f5d983, #d4a94a);
  box-shadow:
    0 0 16px rgba(245,217,131,0.6),
    inset 0 1px 0 rgba(255,255,255,0.4);
}
.rsvp-submit:active { transform: translateY(1px); }

/* ══════════════════════════════════════════
   MUSIK-NOTE (klickbar, zentriert unter Tasten)
══════════════════════════════════════════ */
#music-toggle {
  margin: 10px auto 0;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
  transition: all 0.2s;
}
#music-toggle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
#music-toggle:hover {
  transform: scale(1.08);
  filter: drop-shadow(0 0 12px rgba(245,217,131,0.8));
}
#music-toggle:active {
  transform: scale(0.95);
}
#music-toggle.muted {
  opacity: 0.75;
}

/* ══════════════════════════════════════════
   FUSSLEISTE
══════════════════════════════════════════ */
#baseline {
  margin-top: 8px;
  padding: 4px 4px 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  z-index: 1;
}
.base-stripe {
  height: 3px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--color-accent, #c66a3a) 20%,
    var(--color-gold, #d4a94a) 50%,
    var(--color-accent, #c66a3a) 80%,
    transparent 100%);
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(198,106,58,0.4);
}
.stripe-2 { opacity: 0.5; height: 2px; }

/* ══════════════════════════════════════════
   HINT + SHAKE
══════════════════════════════════════════ */
#hint {
  margin-top: 12px;
  font-size: 10px;
  color: rgba(245,217,131,0.5);
  letter-spacing: 2px;
  font-weight: 700;
}

@keyframes shake-mild {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-2px); }
  75%      { transform: translateX(2px); }
}
.shaking { animation: shake-mild 0.12s ease-in-out 3; }

/* ══════════════════════════════════════════
   RESPONSIVE — sehr kleine Handys
══════════════════════════════════════════ */
@media (max-width: 400px) {
  #app            { width: 88%; padding: 8px 0 16px; }
  #jukebox        { border-radius: 24px 24px 10px 10px; padding: 0 10px 10px; }
  #jukebox::before{ border-radius: 21px 21px 7px 7px; }
  #crown          { padding: 8px 4px 6px; gap: 6px; }
  .crown-brand    { font-size: 11px; letter-spacing: 1px; }
  .crown-tube     { height: 8px; }
  #viewer         { height: 320px; border-radius: 10px; }
  .record         { width: 220px; height: 220px; }
  .record-label   { width: 118px; height: 118px; }
  .label-emoji    { font-size: 28px; }
  .label-title    { font-size: 12px; }
  .label-subtitle { font-size: 8px; }
  .tonearm-rod    { height: 100px; }
  .tonearm-head   { top: 98px; }
  .content-emoji  { font-size: 30px; margin-bottom: 6px; }
  .content-title  { font-size: 16px; margin-bottom: 6px; }
  .content-text   { font-size: 13px; line-height: 1.5; }
  .content-highlight{ font-size: 13px; margin: 6px 0; }
  #now-playing    { margin: 6px 2px 4px; padding: 3px 8px; }
  .np-label       { font-size: 7px; }
  #np-title       { font-size: 10px; }
  .song-btn       { padding: 5px 7px; gap: 5px; min-height: 34px; }
  .btn-code       { font-size: 10px; padding: 2px 4px; min-width: 20px; }
  .btn-title      { font-size: 10px; }
  .rsvp-form input, .rsvp-form textarea { font-size: 11px; padding: 5px 7px; }
  .rsvp-submit    { font-size: 12px; padding: 6px 10px; }
  #baseline       { margin-top: 6px; }
  #hint           { font-size: 9px; margin-top: 8px; }
}

@media (max-width: 360px) {
  #app            { width: 86%; }
  .crown-brand    { font-size: 10px; }
  #viewer         { height: 300px; }
  .record         { width: 195px; height: 195px; }
  .record-label   { width: 105px; height: 105px; }
  .label-emoji    { font-size: 24px; }
  .tonearm-rod    { height: 88px; }
  .tonearm-head   { top: 86px; }
  .content-title  { font-size: 15px; }
  .content-text   { font-size: 12px; }
  .btn-title      { font-size: 9.5px; }
  .song-btn       { padding: 5px 6px; min-height: 32px; }
}
