@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=Space+Grotesk:wght@400;600&display=swap');

:root {
  --bg-1: #0b0f14;
  --bg-2: #111826;
  --bg-3: #141b24;
  --ink: #f4f1e9;
  --muted: rgba(244, 241, 233, 0.65);
  --accent: #d2b25f;
  --glass: rgba(12, 15, 19, 0.6);
  --rotation-ms: 30000ms;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 800px at 10% 15%, #1c2431 0%, transparent 60%),
    radial-gradient(900px 900px at 90% 20%, #1b1f17 0%, transparent 55%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2) 45%, var(--bg-3) 100%);
  overflow: hidden;
}

.loading {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(18px, 2vw, 24px);
  letter-spacing: 0.08em;
  color: var(--muted);
}

.hidden {
  opacity: 0;
  pointer-events: none;
}

.app {
  position: relative;
  height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2px, 0.6vw, 8px);
}

.app::before {
  content: "";
  position: absolute;
  inset: -20%;
  background-image: radial-gradient(circle at 30% 30%, rgba(210, 178, 95, 0.18), transparent 45%),
    radial-gradient(circle at 70% 70%, rgba(105, 135, 155, 0.18), transparent 45%);
  filter: blur(30px);
  opacity: 0.5;
  pointer-events: none;
}

.strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(6px, 1.2vw, 12px);
  width: 100%;
  height: 100%;
}

.app.single .strip {
  grid-template-columns: minmax(0, 1fr);
}

.app.single #slot-1 {
  display: none;
}

.slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.slot img,
.slot .html-memo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  border-radius: 0;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.32));
  transition: opacity 700ms ease, transform 1200ms ease;
}

.slot img {
  object-fit: contain;
  z-index: 1;
}

.slot .html-memo {
  z-index: 1;
  padding: clamp(22px, 2.8vw, 40px);
  background: #fdfbf7;
  color: #1a1a1a;
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  font-size: clamp(16px, 1.4vw, 20px);
  line-height: 1.55;
  overflow: hidden;
  opacity: 0;
  transform: scale(1.02);
  box-shadow: inset 0 0 0 1px rgba(20, 20, 20, 0.08);
}

.slot .html-memo h1,
.slot .html-memo h2,
.slot .html-memo h3 {
  font-family: "Fraunces", "Times New Roman", serif;
  margin-top: 0;
}

.slot .html-memo p {
  margin: 0 0 0.8em;
}

.badge {
  position: absolute;
  bottom: clamp(10px, 1.2vw, 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: clamp(30px, 3.6vw, 40px);
  height: clamp(30px, 3.6vw, 40px);
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: clamp(14px, 1.6vw, 18px);
  color: #fff2f2;
  background: #c63b3b;
  box-shadow: 0 12px 28px rgba(198, 59, 59, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.65);
  pointer-events: none;
}

.overlay {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  font-family: "Fraunces", "Times New Roman", serif;
  letter-spacing: 0.02em;
}

.overlay.paused {
  opacity: 0.65;
}

.page-indicator {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 16px;
}

.page-label {
  font-weight: 700;
}


.timer {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
}

.timer svg {
  width: 26px;
  height: 26px;
}

.timer .track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 2.4;
}

.timer .progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 62.83;
  stroke-dashoffset: 62.83;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  animation: countdown var(--rotation-ms) linear infinite;
}

.overlay.paused .progress {
  animation: none;
}

@keyframes countdown {
  from {
    stroke-dashoffset: 62.83;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@media (max-width: 980px) {
  .strip {
    grid-template-columns: minmax(0, 1fr);
  }

  #slot-1 {
    display: none;
  }

  .overlay {
    top: 12px;
    right: 12px;
  }
}
