:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
  color: #1b1c1f;
  background: #f6f3ed;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
}

button,
input {
  font: inherit;
}

.login-view,
.calendar-shell,
.content-shell {
  min-height: 100vh;
  padding: 32px;
}

.login-view {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 236, 188, 0.38), transparent 18%),
    linear-gradient(160deg, rgba(134, 22, 43, 0.72), transparent 38%),
    linear-gradient(24deg, rgba(17, 82, 64, 0.88), rgba(11, 36, 41, 0.96) 58%),
    #092f30;
}

.login-panel {
  position: relative;
  z-index: 2;
  width: min(720px, 100%);
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.92);
  box-shadow: 0 26px 80px rgba(2, 18, 20, 0.42);
}

.login-panel h1 {
  max-width: 620px;
  margin-bottom: 16px;
  color: #791c2a;
}

.login-copy {
  max-width: 500px;
  margin-bottom: 28px;
  color: #405348;
  font-size: 1.12rem;
}

.gift-mark {
  position: relative;
  width: 58px;
  height: 52px;
  margin-bottom: 22px;
  border-radius: 7px;
  background:
    linear-gradient(90deg, transparent 41%, #f4d17d 41%, #f4d17d 59%, transparent 59%),
    linear-gradient(#bd273e, #8f1e31);
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.1);
}

.gift-mark::before {
  content: "";
  position: absolute;
  top: 19px;
  left: -4px;
  width: 66px;
  height: 10px;
  border-radius: 4px;
  background: #f4d17d;
}

.gift-mark span::before,
.gift-mark span::after {
  content: "";
  position: absolute;
  top: -16px;
  width: 25px;
  height: 22px;
  border: 6px solid #f4d17d;
  border-radius: 50% 50% 4px 50%;
}

.gift-mark span::before {
  left: 6px;
  transform: rotate(28deg);
}

.gift-mark span::after {
  right: 6px;
  transform: scaleX(-1) rotate(28deg);
}

.winter-lights {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.winter-lights span {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffe7a6;
  box-shadow: 0 0 22px 8px rgba(255, 219, 137, 0.58);
}

.winter-lights span:nth-child(1) {
  top: 12%;
  left: 14%;
}

.winter-lights span:nth-child(2) {
  top: 20%;
  right: 18%;
}

.winter-lights span:nth-child(3) {
  top: 68%;
  left: 10%;
}

.winter-lights span:nth-child(4) {
  right: 12%;
  bottom: 18%;
}

.winter-lights span:nth-child(5) {
  top: 9%;
  left: 52%;
}

.winter-scene {
  position: absolute;
  inset: auto 0 0;
  height: min(34vh, 270px);
  pointer-events: none;
}

.winter-scene::after {
  content: "";
  position: absolute;
  inset: auto -5% -42px;
  height: 118px;
  border-radius: 50% 50% 0 0;
  background: rgba(255, 255, 255, 0.92);
}

.tree {
  position: absolute;
  bottom: 30px;
  width: 0;
  height: 0;
  border-right: 72px solid transparent;
  border-bottom: 166px solid rgba(9, 78, 59, 0.88);
  border-left: 72px solid transparent;
  filter: drop-shadow(0 20px 24px rgba(2, 18, 20, 0.32));
}

.tree::before,
.tree::after {
  content: "";
  position: absolute;
  left: -56px;
  width: 0;
  height: 0;
  border-right: 56px solid transparent;
  border-bottom: 124px solid rgba(13, 96, 69, 0.94);
  border-left: 56px solid transparent;
}

.tree::before {
  top: 36px;
}

.tree::after {
  top: 74px;
  border-right-width: 46px;
  border-bottom-width: 98px;
  border-left-width: 46px;
  left: -46px;
}

.tree-left {
  left: max(24px, 7vw);
}

.tree-right {
  right: max(20px, 8vw);
  bottom: 16px;
  transform: scale(0.78);
}

.eyebrow {
  margin: 0 0 8px;
  color: #6b5f56;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 680px;
  margin-bottom: 28px;
  font-size: clamp(2.2rem, 7vw, 5.2rem);
  line-height: 0.94;
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(1.6rem, 4vw, 3rem);
  line-height: 1;
}

.door,
.primary-button,
.secondary-button {
  border: 1px solid rgba(27, 28, 31, 0.16);
  background: rgba(255, 255, 255, 0.76);
  color: inherit;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.door:hover,
.primary-button:hover,
.secondary-button:hover {
  border-color: var(--accent);
  box-shadow: 0 14px 30px rgba(27, 28, 31, 0.12);
  transform: translateY(-1px);
}

.login-form {
  width: min(560px, 100%);
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  color: #4d4945;
  font-weight: 800;
}

.login-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.login-row input {
  min-width: 0;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid rgba(27, 28, 31, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: #1b1c1f;
}

.login-row input:focus {
  border-color: #b83246;
  box-shadow: 0 0 0 3px rgba(184, 50, 70, 0.16);
  outline: none;
}

.primary-button {
  min-height: 52px;
  padding: 0 20px;
  border-radius: 8px;
  background: #8f1e31;
  color: #fff;
  font-weight: 900;
}

.form-error {
  margin: 10px 0 0;
  color: #9d2436;
  font-weight: 800;
}

.calendar-shell {
  background:
    radial-gradient(circle at top left, rgba(180, 39, 59, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), transparent 320px),
    #f4efe6;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto 26px;
}

.topbar h1 {
  margin-bottom: 0;
  color: var(--accent);
}

.secondary-button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  background: #fff;
  font-weight: 800;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
}

.door-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(92px, 1fr));
  gap: 12px;
}

.door {
  position: relative;
  display: flex;
  aspect-ratio: 1;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px;
  border-radius: 8px;
  overflow: hidden;
  isolation: isolate;
}

.door span {
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  font-weight: 900;
  line-height: 0.9;
}

.door small {
  align-self: flex-end;
  color: #6b5f56;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.door.is-open {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 247, 231, 0.96)),
    #fff;
}

.door.is-locked {
  color: rgba(255, 255, 255, 0.78);
  cursor: default;
  background:
    linear-gradient(90deg, transparent 48%, rgba(244, 209, 125, 0.58) 48%, rgba(244, 209, 125, 0.58) 52%, transparent 52%),
    linear-gradient(0deg, transparent 47%, rgba(244, 209, 125, 0.48) 47%, rgba(244, 209, 125, 0.48) 53%, transparent 53%),
    linear-gradient(145deg, #8f1e31, #4f1720);
  box-shadow: inset 0 -12px 22px rgba(0, 0, 0, 0.18);
}

.door.is-locked:hover {
  border-color: rgba(27, 28, 31, 0.16);
  box-shadow: inset 0 -12px 22px rgba(0, 0, 0, 0.18);
  transform: none;
}

.door.is-locked small {
  color: rgba(255, 255, 255, 0.74);
}

.door.is-selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.detail-panel {
  display: flex;
  flex-direction: column;
  min-height: 340px;
  padding: 22px;
  border: 1px solid rgba(27, 28, 31, 0.14);
  border-radius: 8px;
  background: #fff;
}

.door-detail {
  display: flex;
  min-height: 100%;
  flex-direction: column;
}

.detail-open-button {
  align-self: flex-end;
  margin-top: auto;
}

.door-detail p:last-child,
.empty-state {
  margin-bottom: 0;
  color: #4d4945;
  font-size: 1.05rem;
}

.content-shell {
  background:
    radial-gradient(circle at top right, rgba(36, 107, 87, 0.1), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), transparent 340px),
    #f4efe6;
}

.content-topbar,
.content-page {
  max-width: 980px;
  margin: 0 auto;
}

.content-topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 22px;
}

.content-topbar h1 {
  margin-bottom: 0;
  color: var(--accent);
}

.content-page {
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid rgba(27, 28, 31, 0.14);
  border-radius: 8px;
  background: #fff;
}

.full-door-detail {
  min-height: 520px;
}

.door-media,
.door-audio {
  display: block;
  width: 100%;
  margin-top: 18px;
  border-radius: 8px;
}

.door-media {
  max-height: 420px;
  object-fit: contain;
  background: #151515;
}

.door-audio {
  min-height: 44px;
}

.door-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 14px;
  margin-top: 20px;
}

.gallery-item {
  margin: 0;
}

.gallery-media,
.gallery-audio {
  display: block;
  width: 100%;
  border-radius: 8px;
}

.gallery-media {
  aspect-ratio: 4 / 3;
  background: #151515;
  object-fit: cover;
}

.gallery-audio {
  min-height: 44px;
}

.gallery-item figcaption {
  margin-top: 8px;
  color: #6b5f56;
  font-size: 0.92rem;
  font-weight: 800;
}

.hangman-game {
  display: grid;
  min-height: 520px;
  grid-template-rows: auto minmax(120px, 1fr) auto auto;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(27, 28, 31, 0.12);
}

.game-completed,
.quiz-game {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(27, 28, 31, 0.12);
}

.game-completed {
  padding: 18px;
  border-radius: 8px;
  background: #f6f3ed;
}

.game-completed p:last-child {
  margin-bottom: 0;
}

.game-completed-mark {
  margin-bottom: 6px;
  color: #246b57;
  font-weight: 900;
  text-transform: uppercase;
}

.hangman-prompt {
  color: #4d4945;
  font-weight: 800;
}

.hangman-stage {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 14px 0;
}

.hangman-playfield {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 220px);
  gap: 20px;
  align-items: end;
  margin-top: auto;
}

.hangman-playfield .hangman-stage {
  margin-top: 0;
}

.hangman-playfield .hangman-figure {
  align-self: end;
  justify-self: end;
}

.hangman-form {
  justify-self: center;
  width: min(420px, 100%);
  margin: 14px 0;
}

.hangman-form label {
  display: block;
  margin-bottom: 8px;
  color: #6b5f56;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.hangman-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.hangman-input-row input {
  min-width: 0;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid rgba(27, 28, 31, 0.18);
  border-radius: 8px;
  background: #fff;
  color: #1b1c1f;
  font-size: 1.4rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.hangman-input-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184, 50, 70, 0.14);
  outline: none;
}

.hangman-figure {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  background: #f6f3ed;
}

.hangman-figure line,
.hangman-figure circle,
.hangman-figure path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 7;
}

.hangman-figure .gallows {
  stroke: #6b5f56;
}

.hangman-figure .person {
  stroke: #8f1e31;
}

.hangman-figure .is-hidden {
  opacity: 0;
}

.hangman-stage span {
  color: #8f1e31;
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
}

.hangman-stage small {
  color: #6b5f56;
  font-weight: 800;
}

.hangman-word {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: clamp(3px, 0.8vw, 12px);
  align-self: center;
  width: 100%;
  margin: 18px 0;
  padding: clamp(14px, 4vw, 34px);
  border-radius: 8px;
  background: #f6f3ed;
  color: #1b1c1f;
  overflow: hidden;
}

.hangman-word span {
  display: inline-grid;
  width: min(72px, calc((100% - 9 * clamp(3px, 0.8vw, 12px)) / 10));
  min-width: 0;
  min-height: clamp(38px, 8vw, 96px);
  place-items: center;
  border-bottom: clamp(3px, 0.7vw, 8px) solid #1b1c1f;
  font-size: clamp(1.4rem, 6vw, 5.6rem);
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.hangman-retry {
  justify-self: center;
  margin-top: 14px;
}

.hangman-misses {
  min-height: 24px;
  margin: 0 0 8px;
  color: #6b5f56;
  font-weight: 800;
}

.hangman-last {
  margin: 0;
  color: #4d4945;
  font-weight: 900;
}

.hangman-status {
  min-height: 28px;
  margin: 14px 0 0;
  color: #4d4945;
  font-weight: 800;
  text-align: center;
}

.quiz-progress {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 16px;
}

.quiz-progress span {
  color: #246b57;
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
}

.quiz-progress small {
  color: #6b5f56;
  font-weight: 800;
}

.quiz-question {
  min-width: 0;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.quiz-question legend {
  margin-bottom: 10px;
  color: #4d4945;
  font-weight: 900;
}

.quiz-choices {
  display: grid;
  gap: 8px;
}

.quiz-audio {
  width: 100%;
  min-height: 44px;
  margin: 0 0 10px;
}

.quiz-choice {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(27, 28, 31, 0.16);
  border-radius: 8px;
  background: #fff;
  color: #1b1c1f;
  cursor: pointer;
  font-weight: 800;
  text-align: left;
}

.quiz-choice:hover:not(:disabled) {
  border-color: var(--accent);
  box-shadow: 0 8px 18px rgba(27, 28, 31, 0.1);
}

.quiz-choice:disabled {
  cursor: default;
}

.quiz-choice.is-selected {
  border-color: var(--accent);
}

.quiz-choice.is-correct {
  border-color: #246b57;
  background: rgba(36, 107, 87, 0.1);
}

.quiz-choice.is-wrong {
  border-color: #b83246;
  background: rgba(184, 50, 70, 0.1);
}

.quiz-status {
  min-height: 28px;
  margin-bottom: 0;
  color: #4d4945;
  font-weight: 800;
}

.video-match-game {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(27, 28, 31, 0.12);
}

.video-match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 14px;
}

.video-match-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(27, 28, 31, 0.14);
  border-radius: 8px;
  background: #fff;
  cursor: grab;
}

.video-match-card p {
  margin-bottom: 0;
  color: #4d4945;
  font-weight: 900;
}

.video-match-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184, 50, 70, 0.14);
}

.video-match-card.is-correct {
  border-color: #246b57;
  background: rgba(36, 107, 87, 0.08);
}

.video-match-card.is-wrong {
  border-color: #b83246;
  background: rgba(184, 50, 70, 0.08);
}

.video-match-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #151515;
}

.video-match-current {
  padding: 10px 12px;
  border: 1px solid rgba(27, 28, 31, 0.12);
  border-radius: 8px;
  background: rgba(27, 28, 31, 0.04);
  color: #1b1c1f;
  font-weight: 900;
  text-align: center;
}

.video-match-answers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 14px;
}

.video-match-answer {
  min-height: 44px;
  padding: 10px 14px;
  border: 2px dashed rgba(27, 28, 31, 0.22);
  border-radius: 8px;
  background: #fff;
  color: #1b1c1f;
  cursor: pointer;
  font-weight: 900;
  text-align: center;
}

.video-match-answer span,
.video-match-answer small {
  display: block;
}

.video-match-answer small {
  margin-top: 4px;
  color: #6b5f56;
  font-size: 0.74rem;
  letter-spacing: 0;
  text-transform: none;
}

.video-match-answer.is-used {
  border-style: solid;
  border-color: var(--accent);
}

.locked-detail {
  color: rgba(27, 28, 31, 0.62);
}

@media (max-width: 860px) {
  .login-view,
  .calendar-shell,
  .content-shell {
    padding: 20px;
  }

  .topbar,
  .calendar-layout {
    display: block;
  }

  .topbar {
    margin-bottom: 20px;
  }

  .secondary-button {
    margin-top: 14px;
  }

  .door-grid {
    grid-template-columns: repeat(4, minmax(64px, 1fr));
  }

  .detail-panel {
    min-height: auto;
    margin-top: 14px;
  }

  .content-topbar {
    display: block;
  }

  .video-match-answers {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .login-row {
    grid-template-columns: 1fr;
  }

  .door-grid {
    grid-template-columns: repeat(3, minmax(64px, 1fr));
  }

  .door {
    padding: 10px;
  }

  .hangman-playfield {
    grid-template-columns: 1fr;
  }

  .hangman-playfield .hangman-figure {
    justify-self: center;
    max-width: 220px;
  }

  .hangman-input-row {
    grid-template-columns: 1fr;
  }
}
