:root {
  --bg: #1a0f2e;
  --bg-2: #2a1540;
  --panel: #2d1845;
  --gold: #d4af37;
  --gold-soft: #f0d98a;
  --rose: #e8a0b4;
  --text: #f5ecff;
  --muted: #c9b8e0;
  --locked: #5a4a7a;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #0a0412;
  color: var(--text);
  font-family: "Cormorant Garamond", Georgia, serif;
  min-height: 100vh;
}

body {
  background-image:
    linear-gradient(180deg, rgba(10,4,18,0.5) 0%, rgba(10,4,18,0.78) 55%, rgba(10,4,18,0.94) 100%),
    url('images/background.png'),
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.5) 0, transparent 100%),
    radial-gradient(1px 1px at 70% 60%, rgba(255,255,255,0.4) 0, transparent 100%),
    radial-gradient(1.5px 1.5px at 40% 80%, rgba(212,175,55,0.6) 0, transparent 100%),
    radial-gradient(1px 1px at 85% 20%, rgba(255,255,255,0.35) 0, transparent 100%);
  background-size: cover, cover, auto, auto, auto, auto;
  background-position: center top, center center, 20% 30%, 70% 60%, 40% 80%, 85% 20%;
  background-attachment: fixed, fixed, fixed, fixed, fixed, fixed;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
}

.hero {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  position: relative;
}

.lang-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.3rem;
  z-index: 10;
}
.lang-btn {
  background: rgba(45,24,69,0.7);
  border: 1px solid rgba(212,175,55,0.4);
  color: var(--muted);
  border-radius: 8px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  font-family: "Cinzel", serif;
  font-size: 0.8rem;
}
.lang-btn.is-active {
  background: var(--gold);
  color: #1a0f2e;
  border-color: var(--gold);
}

.hero__title {
  font-family: "Cinzel", serif;
  font-size: clamp(2rem, 6vw, 3.5rem);
  margin: 0;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold), var(--rose));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.08em;
  text-shadow: 0 0 30px rgba(212,175,55,0.25);
}

.hero__subtitle {
  color: var(--muted);
  font-style: italic;
  font-size: 1.6rem;
  margin: 0.5rem 0 1.5rem;
  font-weight: 600;
}

.scoreboard {
  display: inline-flex;
  gap: 0.6rem;
  align-items: center;
  background: rgba(45,24,69,0.7);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 0.4rem 1.2rem;
  font-family: "Cinzel", serif;
  font-size: 0.9rem;
}

.scoreboard__label { color: var(--muted); }
.scoreboard__reset {
  background: none;
  border: 1px solid var(--gold);
  color: var(--gold-soft);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

.countdown {
  margin-top: 1rem;
  font-family: "Cinzel", serif;
  font-size: 1.4rem;
  color: var(--gold-soft);
  letter-spacing: 0.05em;
  text-shadow: 0 0 30px rgba(212,175,55,0.4);
}
.countdown__unit { display: inline-block; margin: 0 0.4rem; }
.countdown__num { font-size: 1em; font-weight: 700; }
.countdown__suffix { font-size: 1em; margin-left: 0.15em; }

.calendar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) {
  .calendar { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .calendar { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .door__number { font-size: clamp(3rem, 12vw, 4.5rem); }
  .door__title { font-size: 1.2rem; }
  .door__label { font-size: 1rem; }
}
@media (max-width: 400px) {
  .calendar { grid-template-columns: 1fr; }
  .door__number { font-size: clamp(3.5rem, 18vw, 5rem); }
  .door__title { font-size: 1.35rem; }
  .door__label { font-size: 1.1rem; }
}

.door {
  position: relative;
  aspect-ratio: 3 / 4;
  background: linear-gradient(160deg, #3a2055, #1e1033);
  border: 1px solid rgba(212,175,55,0.4);
  border-radius: var(--radius);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  user-select: none;
}

.door:hover:not(.door--locked) {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(212,175,55,0.25);
  border-color: var(--gold);
}

.door--locked {
  cursor: not-allowed;
  opacity: 0.7;
  background: linear-gradient(160deg, #2a1a3a, #150a22);
}

.door--today {
  border-color: var(--rose);
  box-shadow: 0 0 0 2px var(--rose), 0 8px 24px rgba(232,160,180,0.3);
}

.door__number {
  font-family: "Cinzel", serif;
  font-size: clamp(2.8rem, 7vw, 4rem);
  color: var(--gold-soft);
  text-shadow: 0 0 12px rgba(212,175,55,0.5);
  line-height: 1;
}

.door__result {
  position: absolute;
  bottom: 8px;
  left: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.door__result--ok { background: #6fcf97; color: #0a2a14; }
.door__result--no { background: #e07070; color: #2a0a0a; }

.door__title {
  font-size: 1.05rem;
  color: var(--text);
  text-align: center;
  margin-top: 0.5rem;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
  padding: 0 0.2rem;
}

.door__label {
  margin-top: 0.5rem;
  font-size: 1rem;
  color: var(--muted);
  text-align: center;
  font-style: italic;
}

.door__cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.25;
  filter: blur(1px);
  transition: opacity 0.3s ease;
}

.door:hover:not(.door--locked) .door__cover { opacity: 0.45; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}
.modal.is-open { display: block; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10,4,18,0.85);
  backdrop-filter: blur(4px);
}

.modal__panel {
  position: relative;
  max-width: 820px;
  width: 92%;
  margin: 4vh auto;
  background: linear-gradient(160deg, #2d1845, #1a0f2e);
  border: 1px solid var(--gold);
  border-radius: 20px;
  padding: 1.5rem;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.modal__close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: var(--gold-soft);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}

.modal__content {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 600px) {
  .modal__content { grid-template-columns: 1fr; }
}

.modal__cover {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(212,175,55,0.4);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  background: #2a1540;
}

.modal__cover--placeholder {
  aspect-ratio: 2 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  font-family: "Cinzel", serif;
  color: var(--gold-soft);
  background: linear-gradient(160deg, #3a2055, #1e1033);
}

.modal__title {
  font-family: "Cinzel", serif;
  font-size: 2.2rem;
  margin: 0 0 0.3rem;
  color: var(--gold-soft);
}

.modal__author {
  color: var(--rose);
  font-style: italic;
  font-size: 1.3rem;
  margin: 0 0 1rem;
}

.modal__series {
  color: var(--muted);
  font-size: 1.15rem;
  margin: -0.6rem 0 1rem;
}

.modal__blurb {
  font-size: 1.25rem;
  line-height: 1.5;
  margin: 0 0 1rem;
}

.modal__quote {
  border-left: 3px solid var(--gold);
  padding: 0.5rem 1rem;
  font-style: italic;
  font-size: 1.2rem;
  color: var(--gold-soft);
  margin: 0 0 1.5rem;
  background: rgba(212,175,55,0.05);
}

.modal__finnish {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.riddle {
  background: rgba(45,24,69,0.6);
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: 12px;
  padding: 1rem;
}

.riddle__q {
  font-weight: 600;
  font-size: 1.25rem;
  margin: 0 0 0.8rem;
  color: var(--gold-soft);
}

.riddle__options {
  list-style: none;
  padding: 0;
  margin: 0 0 0.8rem;
}

.riddle__options li {
  margin-bottom: 0.4rem;
}

.riddle__options label {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  cursor: pointer;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.riddle__options label:hover {
  background: rgba(212,175,55,0.1);
  border-color: rgba(212,175,55,0.3);
}

.riddle__options input { accent-color: var(--gold); }

.riddle__submit {
  background: linear-gradient(135deg, var(--gold), var(--rose));
  color: #1a0f2e;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.4rem;
  font-family: "Cinzel", serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.riddle__result {
  margin-top: 0.8rem;
  padding: 0.7rem;
  border-radius: 8px;
  font-weight: 600;
}

.riddle__result.is-correct { background: rgba(120,200,120,0.15); color: #b8e6b8; }
.riddle__result.is-wrong { background: rgba(220,100,100,0.15); color: #f0b0b0; }

.riddle__explanation {
  margin-top: 0.5rem;
  font-style: italic;
  color: var(--muted);
  font-weight: 400;
}

.footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
}

.footer h3 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 400;
  font-style: italic;
  color: var(--gold-soft);
  text-shadow: 0 0 8px rgba(212,175,55,0.3);
  letter-spacing: 0.02em;
}

.footer__notice {
  margin: 0 0 0.8rem;
  font-size: 0.95rem;
  color: var(--muted);
  font-style: italic;
}

.badge-share {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
}
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
}
body.countdown-only .hero {
  width: 100%;
  padding: 0 1rem;
  text-align: center;
}
body.countdown-only .countdown {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin-top: 0;
  text-align: center;
  z-index: 5;
}

@media (prefers-reduced-motion: reduce) {
  .door, .door__cover { transition: none; }
  .door:hover:not(.door--locked) { transform: none; }
}
