@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700&display=swap");

:root {
  --bg: radial-gradient(circle at 20% 20%, #0a2f1a 0, transparent 25%), radial-gradient(circle at 80% 10%, #0f4d2d 0, transparent 22%), radial-gradient(circle at 50% 80%, #103a24 0, transparent 30%), #07160d;
  --card: rgba(255, 255, 255, 0.07);
  --card-strong: rgba(255, 255, 255, 0.12);
  --accent: #f2d16b;
  --accent-strong: #ffcf5e;
  --text: #fdf7ec;
  --muted: #d3d6dd;
  --locked: #5c6b73;
  --shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
  --holiday-red: #ba1b2c;
  --holiday-green: #0f5a2f;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

.app {
  max-width: 1500px;
  margin: 0 auto;
  padding: 20px 16px 48px;
  position: relative;
  z-index: 2;
}

.topbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  text-align: center;
}

.topbar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: clamp(24px, 3vw, 32px);
}

.subtitle {
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
}

.subtitle--loading {
  visibility: hidden;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.26);
  transform: translateY(-1px);
}

.icon-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.icon-button svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.calendar {
  background: #0f2418;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
  position: relative;
}

.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(90px, 1fr));
  gap: 8px;
  grid-auto-rows: 90px;
}

.window {
  position: relative;
  border-radius: 14px;
  padding: 14px 12px;
  background: linear-gradient(135deg, #0f5a2f, #0a3e21);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
  cursor: pointer;
  min-height: 80px;
  display: grid;
  grid-template-rows: min-content 1fr min-content;
  gap: 10px;
}

.snow-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.snowflake {
  position: absolute;
  top: -10vh;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  opacity: 0;
  animation: snow-fall var(--duration, 12s) linear infinite;
  animation-delay: var(--delay, 0s);
  animation-fill-mode: both;
  --scale: 1;
  --spin-offset: 0deg;
  width: var(--size, 4px);
  height: var(--size, 4px);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.15));
}

.snowflake--branch {
  background: none;
  width: var(--size, 10px);
  height: var(--thickness, 2px);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 2px;
  position: absolute;
  top: -10vh;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.2));
}

.snowflake--branch::before,
.snowflake--branch::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 2px;
}

.snowflake--branch::before {
  transform: rotate(60deg);
}

.snowflake--branch::after {
  transform: rotate(-60deg);
}

.snowflake--easter {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 6px;
  --scale: 0.56;
  transform-origin: 50% 50%;
}

.snowflake--easter::before,
.snowflake--easter::after {
  content: "";
}

.snowflake--candy-cane {
  --cane-thickness: calc(var(--size, 4px) * 0.3);
  --hook-size: calc(var(--size, 4px) * 0.9);
  --scale: 0.52;
  position: absolute;
  display: block;
  background: transparent;
  width: calc(var(--size, 4px) * 0.95);
  height: calc(var(--size, 4px) * 1.7);
  transform-origin: 50% 50%;
}

.snowflake--candy-cane::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(var(--hook-size) * 0.5 - var(--cane-thickness) * 0.5);
  transform: translateX(-50%);
  width: var(--cane-thickness);
  height: calc(var(--hook-size) * 1.8);
  background: rgba(255, 255, 255, 0.95);
  border-radius: calc(var(--cane-thickness) * 0.7);
}

.snowflake--candy-cane::after {
  content: "";
  position: absolute;
  top: 0;
  left: calc(var(--cane-thickness) * -0.5);
  width: var(--hook-size);
  height: var(--hook-size);
  background: conic-gradient(
      from 270deg,
      rgba(255, 255, 255, 0.95) 0deg 240deg,
      transparent 240deg 360deg
    );
  border-radius: 50%;
  -webkit-mask: radial-gradient(
    closest-side,
    transparent calc(100% - var(--cane-thickness)),
    #000 calc(100% - var(--cane-thickness) + 1px)
  );
  mask: radial-gradient(
    closest-side,
    transparent calc(100% - var(--cane-thickness)),
    #000 calc(100% - var(--cane-thickness) + 1px)
  );
}

.snowflake--tree {
  clip-path: polygon(
    50% 0%,
    68% 24%,
    56% 24%,
    78% 48%,
    60% 48%,
    82% 74%,
    60% 74%,
    60% 100%,
    40% 100%,
    40% 74%,
    18% 74%,
    40% 48%,
    22% 48%,
    44% 24%,
    32% 24%
  );
  --scale: 1.2;
  width: calc(var(--size, 4px) * 1.1);
  height: calc(var(--size, 4px) * 1.1);
  transform-origin: 50% 55%;
}

.snowflake--heart {
  clip-path: none;
  --scale: 0.5;
  --spin-offset: -45deg;
  width: calc(var(--size, 4px) * 1);
  height: calc(var(--size, 4px) * 1);
  transform-origin: 50% 50%;
}

.snowflake--heart::before,
.snowflake--heart::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
}

.snowflake--heart::before {
  top: -50%;
  left: 0;
}

.snowflake--heart::after {
  top: 0;
  left: 50%;
}

.snowflake--snowman {
  --snowman-size: var(--size, 4px);
  --snowman-height: calc(var(--snowman-size) * 1.5);
  --snowman-head-radius: calc(var(--snowman-size) * 0.32);
  --snowman-head-center: calc(var(--snowman-size) * 0.38);
  --snowman-base-radius: calc(var(--snowman-size) * 0.475);
  --snowman-base-center: var(--snowman-size);
  --scale: 0.52;
  width: var(--snowman-size);
  height: var(--snowman-height);
  background:
    radial-gradient(
      circle at 50% var(--snowman-head-center),
      rgba(255, 255, 255, 0.95) 0 var(--snowman-head-radius),
      transparent calc(var(--snowman-head-radius) + 1px)
    ),
    radial-gradient(
      circle at 50% var(--snowman-base-center),
      rgba(255, 255, 255, 0.95) 0 var(--snowman-base-radius),
      transparent calc(var(--snowman-base-radius) + 1px)
    );
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

@keyframes snow-fall {
  0% {
    transform: translate3d(var(--start-x, 0), -10vh, 0) rotate(calc(0deg + var(--spin-offset, 0deg))) scale(var(--scale, 1));
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--end-x, 0), 110vh, 0) rotate(calc(360deg + var(--spin-offset, 0deg))) scale(var(--scale, 1));
    opacity: 0.9;
  }
}

.window:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, #0f6a37, #0c4526);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
}

.window__label {
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.04em;
  color: #ffffff;
  position: absolute;
  top: 10px;
  right: 10px;
}

.window__content {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 600;
}

.window--locked {
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, #0c4a28, #0d321d);
  color: var(--text);
}

.window--locked:hover {
  transform: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.28);
}

.window--locked::before,
.window--locked::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.window--locked::before {
  background:
    linear-gradient(to right, transparent 47%, #d02a30 47%, #d02a30 53%, transparent 53%),
    linear-gradient(to bottom, transparent 47%, #d02a30 47%, #d02a30 53%, transparent 53%);
  opacity: 0.85;
}

.window--locked::after {
  width: 36px;
  height: 36px;
  background: radial-gradient(circle at 50% 50%, #f6d374 0, #f6d374 45%, #d02a30 46%, #d02a30 70%, transparent 72%);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 8px rgba(208, 42, 48, 0.15);
}

.window--ready {
  background: linear-gradient(135deg, #174f2c, #0f351f);
}

.window--ready::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 60%);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
  pointer-events: none;
}

.window--opened {
  background: linear-gradient(180deg, #1a1a1a 0%, #111 40%, #0b0b0b 100%);
  border-color: rgba(255, 255, 255, 0.18);
}

.window--opened::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 32px;
  background: repeating-linear-gradient(
    -45deg,
    #f8f0dc,
    #f8f0dc 10px,
    #e4c995 10px,
    #e4c995 18px
  );
  box-shadow: inset 0 8px 12px rgba(0, 0, 0, 0.35);
}

.window--opened .window__label {
  color: var(--accent-strong);
}

.window--opened .window__content {
  color: var(--muted);
}

.window__pill {
  grid-row: 3;
  justify-self: start;
  align-self: end;
  margin: 0;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 4px;
  background: #ffffff;
  color: #111111;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  clip-path: polygon(0 0, 86% 0, 100% 50%, 86% 100%, 0 100%);
  position: relative;
  z-index: 2;
}

.window__pill::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #111111;
  transform: translateY(-50%);
}

.window--locked .window__pill {
  background: #ffffff;
  color: #111111;
}

.window--opened .window__pill {
  background: #ffffff;
  color: #111111;
}

.hero {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 50;
}

.hero.hidden {
  display: none;
}

.hero__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 12, 20, 0.75);
  backdrop-filter: blur(5px);
}

.hero__card {
  position: relative;
  width: min(960px, 92vw);
  background: #7d0e19;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.55);
  z-index: 1;
  display: grid;
  gap: 18px;
}

.hero__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  transition: background 140ms ease, transform 140ms ease;
}

.hero__close:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.04);
}

.hero__meta {
  display: grid;
  gap: 4px;
}

.hero__day {
  margin: 0;
  font-weight: 700;
  color: var(--accent-strong);
  letter-spacing: 0.04em;
}

.hero__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.hero__message {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 600;
}

.hero__player {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 14px;
  overflow: hidden;
  background: #0b1828;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.hero__player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 12px;
}

.button {
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #f2d16b, #ffbb33);
  color: #111;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 12px 16px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.28);
}

.button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.button--ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.button--ghost:hover {
  background: rgba(255, 255, 255, 0.14);
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 60;
}

.modal.hidden {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 12, 20, 0.7);
  backdrop-filter: blur(4px);
}

.modal__card {
  position: relative;
  width: min(520px, 92vw);
  background: #0f2418;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55);
  z-index: 1;
  display: grid;
  gap: 14px;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.modal__title {
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 18px;
}

.modal__close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  transition: background 140ms ease, transform 140ms ease;
}

.modal__close:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: scale(1.02);
}

.modal__form {
  display: grid;
  gap: 12px;
}

.modal__field {
  display: grid;
  gap: 6px;
  text-align: left;
  color: var(--muted);
  font-weight: 600;
}

.modal__field span {
  color: var(--text);
  font-weight: 700;
}

.modal__field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-weight: 600;
}

.modal__helper {
  font-size: 12px;
  color: var(--muted);
  opacity: 0.9;
  line-height: 1.4;
}

.modal__error {
  font-size: 12px;
  color: #f6a4a9;
  line-height: 1.4;
  display: none;
}

.modal__field--invalid input {
  border-color: #f6a4a9;
  background: rgba(246, 164, 169, 0.08);
}

.modal__field--invalid .modal__error {
  display: block;
}

.modal__field input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .window {
    min-height: 90px;
  }

  .hero__card {
    padding: 18px;
  }
}
