:root{
  --bg1:#0b1020;
  --bg2:#101b3a;
  --paper:#f7f3e9;
  --ink:#101010;
  --muted:#6c6c6c;
  --accent:#d94b4b;
  --shadow: 0 24px 60px rgba(0,0,0,.35);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  color:#eaeaea;
  font-family: system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background: radial-gradient(1200px 800px at 20% 10%, #1c2a60 0%, var(--bg1) 55%),
              radial-gradient(1000px 700px at 80% 90%, #3a1c2a 0%, var(--bg2) 60%);
}

/* Overlay */
.overlay{
  position:fixed; inset:0;
  display:flex; align-items:center; justify-content:center;
  padding:24px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  z-index: 50;
}
.authCard{
  width:min(520px, 100%);
  background: rgba(20,20,25,.92);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px 20px;
}
.authTitle{
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .04em;
  margin-bottom: 8px;
}
.authDesc{
  margin: 0 0 14px 0;
  color: rgba(255,255,255,.82);
  line-height: 1.6;
}
.authForm{ display:grid; gap: 12px; }
.field span{
  display:block;
  font-size: 12px;
  color: rgba(255,255,255,.75);
  margin-bottom: 6px;
}
.field input{
  width:100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color:#fff;
  outline:none;
}
.field input:focus{
  border-color: rgba(217,75,75,.65);
  box-shadow: 0 0 0 4px rgba(217,75,75,.18);
}
.primaryBtn{
  padding: 12px 14px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  background: linear-gradient(180deg, #f06868, var(--accent));
  color: #1b0b0b;
}
.primaryBtn:hover{ filter: brightness(1.04); }
.authError{
  min-height: 18px;
  color: #ffb4b4;
  font-size: 13px;
}
.authFootnote{
  margin-top: 12px;
  font-size: 12px;
  color: rgba(255,255,255,.55);
}

/* Page */
.page{
  width:min(980px, 100%);
  margin:0 auto;
  padding: 22px 16px 40px;
}
.topBar{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.smallNote{
  font-size: 12px;
  color: rgba(255,255,255,.65);
}
.recipientLine{
  font-size: 14px;
  color: rgba(255,255,255,.85);
}

/* Stage */
.stage{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap: 14px;
  padding-top: 10px;
}

/* Postcard 3D */
.postcardShell{
  width: min(760px, 100%);
  aspect-ratio: 16 / 10;
  position: relative;
  perspective: 1200px;
  cursor: pointer;
}
.postcard{
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

/* The two faces occupy same space */
.card{
  position:absolute; inset:0;
  background: var(--paper);
  border-radius: 18px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,.08);
  color: var(--ink);
  backface-visibility: hidden;
  overflow:hidden;
}

/* Entrance animation: drop from top */
.postcardShell{
  transform: translateY(-120vh);
  opacity: 0;
}
.postcardShell.start{
  animation: dropIn 1.1s cubic-bezier(.2,.9,.2,1) forwards;
}
@keyframes dropIn{
  0%{ transform: translateY(-120vh); opacity: 0; }
  70%{ transform: translateY(10px); opacity: 1; }
  100%{ transform: translateY(0); opacity: 1; }
}

/* Flip */
.postcard.flip{
  transform: rotateY(180deg);
}
.postcard{
  transition: transform 1s cubic-bezier(.25,.8,.25,1);
  transform-origin: center center;
}

.front{
  transform: rotateY(0deg);
  background-image: url("./assets/image/front.png");
  background-size: cover;
  background-position: center;
}
.back{
  transform: rotateY(180deg);
  background-image: url("./assets/image/rear.png");
  background-size: cover;
  background-position: center;
}

/* Front layout */
.addressName{
  position:absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 700;
  font-family: "Yuji Syuku", "Hiragino Mincho ProN", "Yu Mincho", serif;
  letter-spacing: .08em;
  color: #1a1a1a;
  text-shadow: 0 2px 6px rgba(255,255,255,.7);
  white-space: nowrap;
}
.otoshidamaQuiz{
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-top: 1px solid rgba(0,0,0,.2);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, sans-serif;
  color: rgba(0,0,0,.72);
  background: rgba(255,255,255,.55);
  border-radius: 10px;
  font-size: 12px;
}
.quizTitle{
  font-weight: 700;
  letter-spacing: .08em;
}
.quizQuestion{
  font-size: 11px;
}

/* Back layout */
.onAirBtn{
  position:absolute;
  left: 22px;
  bottom: 22px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.85);
  background: rgba(15,15,15,.8);
  color: #fff;
  font-weight: 800;
  letter-spacing: .08em;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 6px 16px rgba(0,0,0,.35);
}
.onAirBtn:hover{ filter: brightness(1.08); }
.onAirBtn.is-playing{
  background: rgba(217,75,75,.9);
  border-color: rgba(255,255,255,.95);
  box-shadow: 0 0 16px rgba(217,75,75,.65);
}

/* Lyrics overlay */
.lyricsOverlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: none;
  align-items:center;
  justify-content:center;
  padding: 24px;
  z-index: 40;
}
.lyricsOverlay.show{
  display: flex;
}
.lyricsCard{
  width: min(760px, 100%);
  background: rgba(5,5,12,.85);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.18);
  padding: 20px 18px;
  color: #fff;
  box-shadow: 0 30px 70px rgba(0,0,0,.45);
  position: relative;
  overflow: hidden;
}
.lyricsCard::before{
  content: "";
  position: absolute;
  inset: -30% 50% auto -30%;
  height: 160%;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.16), transparent 55%);
  opacity: .8;
  pointer-events: none;
}
.lyricsCard::after{
  content: "";
  position: absolute;
  inset: 60% -20% -30% 40%;
  background: radial-gradient(circle at 80% 80%, rgba(217,75,75,.35), transparent 60%);
  pointer-events: none;
}
.lyricsHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-weight: 700;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}
.seekBarRow{
  display:flex;
  align-items:center;
  gap: 10px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}
.timeLabel{
  font-size: 12px;
  color: rgba(255,255,255,.7);
  min-width: 44px;
  text-align: center;
}
.seekBar{
  flex: 1;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  outline: none;
}
.seekBar::-webkit-slider-thumb{
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f06868;
  border: 2px solid rgba(255,255,255,.9);
  box-shadow: 0 4px 10px rgba(0,0,0,.35);
}
.seekBar::-moz-range-thumb{
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f06868;
  border: 2px solid rgba(255,255,255,.9);
  box-shadow: 0 4px 10px rgba(0,0,0,.35);
}
.seekBar::-moz-range-track{
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
}
.lyricsHint{
  font-size: 12px;
  color: rgba(255,255,255,.65);
}
.lyrics{
  max-height: min(360px, 50vh);
  overflow:auto;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  padding: 14px;
  white-space: pre-wrap;
  color: rgba(255,255,255,.9);
  font-family: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 15px;
  line-height: 1.8;
  position: relative;
  z-index: 1;
}
.lyrics strong{
  color: #ffd0d0;
}
.lyricsOverlay.show .lyricsCard{
  animation: lyricsGlow 1.2s ease-out;
}
@keyframes lyricsGlow{
  0%{ transform: scale(.96); opacity: 0; }
  100%{ transform: scale(1); opacity: 1; }
}

.footer{
  margin-top: 18px;
  text-align:center;
  color: rgba(255,255,255,.55);
  font-size: 12px;
}
.footerCredit{
  margin-top: 6px;
  font-style: italic;
  color: rgba(255,255,255,.45);
}
