* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background-color: #1a1a1e;
}

body {
  margin: 0;
  height: 100%;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  overscroll-behavior: none;
  background-color: #1a1a1e;
  background: linear-gradient(145deg, #1a1a1e 0%, #2d2d33 50%, #1f1f24 100%);
  font-family: "BJCree", "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
  color: #2a2520;
}

.is-loading .scene,
.is-loading .hint {
  opacity: 0;
  visibility: hidden;
}

.hint {
  font-family: system-ui, sans-serif;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.02em;
  position: absolute;
  bottom: 10px;
  text-align: center;
  width: 100%;
}

.paec {
  position: absolute;
  bottom: 12px;
  left: 12px;
  height: 40px;
  object-fit: cover;
}

.scene {
  perspective: 1400px;
  perspective-origin: 50% 50%;
}

.book {
  position: relative;
  width: min(88vmin, 320px);
  height: min(88vmin, 320px);
  transform-style: preserve-3d;
  transition: transform 3s cubic-bezier(0.4, 0, 0.2, 1);
}

.book.is-locked {
  pointer-events: none;
  cursor: default;
  transform: translateY(40%) scale(0.8);
}

.book.is-locked .page {
  cursor: default;
}

.page {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform-origin: center top;
  transition: transform 3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  /* Top = spine (tight); bottom = free edge (round) */
  border-radius: 2px 2px 6px 6px;
}

.page.flipped {
  /* Positive X: free edge lifts upward from bottom hinge (not folded down into the screen) */
  transform: rotateX(178deg);
}

.face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: inherit;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1.75rem 1.5rem;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.06),
    2px 6px 16px rgba(0, 0, 0, 0.18);
}

.face.front {
  background: linear-gradient(45deg, #141414 0%, #282828 100%);
}

.face.back {
  transform: rotateX(180deg);
  /* Mirror .page radius vertically so the free edge stays rounded after rotateX(180deg) */
  border-radius: 6px 6px 2px 2px;
  background: #1a1a1e;
}

.cover-front {
  background: #000000;
  color: #f5f0e8;
}

.cover-front .face.front {
  background-image: url(./assets/dbjcxxugtcnz5ev2uuo7.avif);
  /* margin: 16px; */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.cover-front .face.back {
  background: linear-gradient(135deg, #141414 0%, #282828 100%);
  color: #d4d4d4;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.06),
    2px 6px 16px rgba(0, 0, 0, 0.18);
}

.sheet-second .face.back {
  background: linear-gradient(160deg, #7a6352 0%, #4a3a30 100%);
  color: #f0ebe3;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    2px 8px 20px rgba(0, 0, 0, 0.28);
}

/* Stretch inner page so the vinyl area can use real height for sizing */
.sheet-second .face.front {
  align-items: stretch;
}

.subtitle--flush {
  margin: 0;
}

h1 {
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
}

.subtitle {
  font-size: 0.85rem;
  opacity: 0.9;
  font-style: italic;
}

.content h2 {
  font-size: 1.05rem;
  font-weight: 400;
  margin: 0 0 1rem;
  color: #d4d4d4;
}

.event-calendar {
  width: 100%;
  margin-bottom: 1rem;
}

.event-calendar__month {
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin: 0 0 0.75rem;
}

.event-calendar__weekdays,
.event-calendar__dates {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.25rem;
  text-align: center;
}

.event-calendar__weekdays {
  margin-bottom: 0.35rem;
}

.event-calendar__weekdays span {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #d4d4d4;
}

.event-calendar__dates {
  margin-bottom: 0rem;
}

.event-calendar__dates span {
  font-size: 1.8rem;
  /* line-height: 2; */
  color: #d4d4d4;
}

.event-calendar__date--selected {
  width: 2.5rem;
  height: 2.5rem;
  line-height: 3;
  border-radius: 999px;
  border: 2px dashed #c30000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.event-calendar__date--selected--number {
  transform: translateY(-3%)
}

.event-calendar__time {
  margin: 0;
  font-size: 2rem;
  letter-spacing: 0.08em;
}

.content p {
  margin: 0.5rem 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #d4d4d4;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
}

.ornament {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.85;
}

.content--vinyl {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
}

.vinyl-hint {
  margin: 0;
  font-size: 0.8rem;
  color: #5c5046;
  font-family: system-ui, sans-serif;
  letter-spacing: 0.02em;
}

.vinyl-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  padding: 0.25rem;
  border-radius: 8px;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  container-type: size;
  container-name: vinylPlayer;
}

.vinyl-player:focus-visible {
  outline: 2px solid #6b5a4a;
  outline-offset: 3px;
}

.book.is-locked .vinyl-player {
  pointer-events: auto;
  cursor: pointer;
}

.vinyl {
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes vinyl-spin {
  to {
    transform: rotate(360deg);
  }
}

.vinyl__disc {
  position: relative;
  width: min(38vmin, 200px);
  width: min(120cqi, 120cqb);
  aspect-ratio: 1;
  height: auto;
  max-width: 100%;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle at center,
    #141414 0 1.5px,
    #222 1.5px 3px
  );
  box-shadow:
    inset 0 0 24px rgba(0, 0, 0, 0.55),
    0 5px 14px rgba(0, 0, 0, 0.28);
  animation: vinyl-spin 2.8s linear infinite;
  animation-play-state: paused;
}

.vinyl-player.is-playing .vinyl__disc {
  animation-play-state: running;
}

.vinyl__text {
  position: absolute;
  top: 35%;
  left: 50%;
  width: 100%;
  height: 36%;
  transform: translate(-50%, -50%);
  color: #000000;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
}

.vinyl__label {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36%;
  height: 36%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  font-size: 12px;
  background: linear-gradient(150deg, #6f0000 0%, #992b2b 55%, #6f0000 100%);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.45),
    inset 0 -2px 4px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(0, 0, 0, 0.15);
}

.vinyl__label::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background-image:
    linear-gradient(
      150deg,
      rgba(111, 0, 0, 0.35) 0%,
      rgba(153, 43, 43, 0.35) 55%,
      rgba(111, 0, 0, 0.35) 100%
    ),
    url("./assets/oqe4i7sftguypxuo49ey.avif");
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}

.vinyl__label::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14%;
  height: 14%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, #2a2520 0%, #0d0c0b 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.invite-audio {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
