:root {
  /* базовая палитра */
  --bg-dark: #05130a;
  --bg-mid: #0d4b28;
  --bg-light: #31a36a;

  --text-main: #f7fbff;
  --text-muted: #c7e0d4;

  /* карточки дней */
  --day-rare-bg: #083820;
  --day-rare-shadow: rgba(0, 0, 0, 0.45);

  --day-epic-bg: linear-gradient(90deg, #6a1b9a, #9c27b0);
  --day-epic-shadow: rgba(108, 52, 131, 0.75);

  --day-legendary-bg: repeating-linear-gradient(
    135deg,
    #FFB700 0%,
    #FFEF66 25%,
    #FFB700 50%,
    #FFEF66 75%,
    #FFB700 100%
  );
  --day-legendary-shadow: rgba(255, 213, 79, 0.8);
  --day-legendary-text: #3e2723;

  /* модалки */
  --modal-bg: rgba(6, 22, 14, 0.96);

  /* кнопки */
  --btn-red: #f44336;
  --btn-red-hover: #ff5252;
  --pill-green: #19a55b;
}

/* ===== Шрифты Gilroy ===== */

@font-face {
  font-family: "GilroyExtraBold";
  src: url("fonts/Gilroy-ExtraBold.otf") format("opentype");
  font-weight: 800;
  font-style: normal;
}

@font-face {
  font-family: "GilroyLight";
  src: url("fonts/Gilroy-Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
}

/* Сброс */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "GilroyLight", system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  color: var(--text-main);
  background: radial-gradient(circle at 20% 0, #2bbf7d, var(--bg-mid) 40%, var(--bg-dark) 80%);
  position: relative;
  overflow-x: hidden;
}

/* ===== JS-снег (случайные хлопья) ===== */

.snow-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.snowflake {
  position: absolute;
  top: -10px;
  color: #ffffff;
  opacity: 0.9;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.8));
  animation-name: snow-fall-js;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes snow-fall-js {
  0% {
    transform: translateY(-10vh);
  }
  100% {
    transform: translateY(110vh);
  }
}

/* ===== Снеговая волна снизу ===== */

.snow-ground {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 150px;
  pointer-events: none;
  z-index: 1;

  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z' opacity='.25' fill='%23ffffff' transform='scale(1 -1) translate(0 -120)'/%3E%3Cpath d='M0,0V15.81C13,36.92,27.64,56.86,47.69,72.05,99.41,111.27,165,111,224.58,91.58c31.15-10.15,60.09-26.07,89.67-39.8,40.92-19,84.73-46,130.83-49.67,36.26-2.85,70.9,9.42,98.6,31.56,31.77,25.39,62.32,62,103.63,73,40.44,10.79,81.35,6.36,119.13-6.29,33.69-11.18,66.52-27,98.75-43.86,23.43-12.34,46.85-24.68,70.28-37L1200,52.47V0Z' opacity='.5' fill='%23ffffff' transform='scale(1 -1) translate(0 -120)'/%3E%3Cpath d='M0,0V5.63C149.93,59,314.09,71.32,475.83,42.57c43-7.64,84.23-20.12,127.61-26.46,59-8.63,112.48,12.24,165.56,35.4C827.93,77.22,886,95.24,951.2,90c86.53-7,172.46-45.71,248.8-84.81V0Z' fill='%23ffffff' transform='scale(1 -1) translate(0 -120)'/%3E%3C/svg%3E");
  background-size: 100% 100px;
  background-repeat: no-repeat;
  background-position: bottom;
}

/* Страница поверх снега */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  position: relative;
  z-index: 2;
}

/* Универсальная карточка */
.glass-card {
  background: rgba(3, 16, 9, 0.85);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

/* ===== Top bar ===== */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 12px;
}

.top-bar-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.logo {
  font-family: "GilroyExtraBold", system-ui, sans-serif;
  font-weight: 800;
  font-size: 60px;
  color: #ffffff;
}

.subtitle {
  font-size: 24px;
  color: #ffffff;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.today-pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--pill-green);
  color: #ffffff;
  font-weight: 500;
  border: none;
}

.logout-link {
  color: #ffffff;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--btn-red);
  border: none;
  transition: background 0.12s ease, transform 0.12s.ease;
}

.logout-link:hover {
  background: var(--btn-red-hover);
  transform: translateY(-1px);
}

/* ===== Auth ===== */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 360px;
  padding: 24px 24px 28px;
}

.auth-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-family: "GilroyExtraBold", system-ui, sans-serif;
}

.auth-subtitle {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-error {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(244, 67, 54, 0.15);
  color: #ffcdd2;
  font-size: 13px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-label {
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-input {
  border-radius: 10px;
  border: none;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  outline: none;
  font-size: 14px;
}

.auth-input:focus {
  background: rgba(255, 255, 255, 0.18);
}

.auth-button {
  margin-top: 8px;
  border-radius: 999px;
  border: none;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(135deg, #ff7043, #f44336);
  color: #fff;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.auth-button:hover {
  filter: brightness(1.05);
}

.auth-button:active {
  transform: translateY(1px);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.55);
}

/* ===== Main / calendar ===== */
.main-content {
  display: flex;
}

.calendar-card {
  width: 100%;
  padding: 20px 12px 10px;
  background: transparent;
}

.calendar-title,
.calendar-subtitle {
  display: none;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 14px;
}

.day-card {
  position: relative;
  border-radius: 16px;
  padding: 22px 10px 18px;
  min-height: 120px;
  background: var(--day-rare-bg);
  box-shadow: 0 18px 30px var(--day-rare-shadow);
  color: var(--text-main);
  text-align: center;
  cursor: default;
  outline: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.day-card .day-number {
  font-size: 48px;
  font-weight: 800;
}

.day-icon-wrapper,
.day-name {
  display: none;
}

.rarity-rare {
  background: var(--day-rare-bg);
  box-shadow: 0 18px 30px var(--day-rare-shadow);
  border: 2px solid rgba(255, 255, 255, 0.08);
}

.rarity-epic {
  background: var(--day-epic-bg);
  box-shadow: 0 18px 32px var(--day-epic-shadow);
  border: 2px solid rgba(180, 60, 180, 1);
}

@keyframes legendary-flow {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 85% 85%;
  }
}

.rarity-legendary {
  background: var(--day-legendary-bg);
  background-size: 250% 250%;
  animation: legendary-flow 1s linear infinite;
  box-shadow: 0 18px 32px var(--day-legendary-shadow);
  color: var(--day-legendary-text);
  border: 2px solid rgba(255, 255, 100, 1);
}

.day-locked {
  opacity: 0.4;
}

.day-unlocked {
  cursor: pointer;
}

.day-unlocked:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.7);
}

.day-unlocked.day-available {
  animation: available-blink 1.4s ease-in-out infinite;
}

.rarity-badge {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 0px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: none;
  transition: all 0.3s ease;
  overflow: hidden;
  border: 0px;
}

.rarity-badge.rarity-epic {
  background: none;
  color: #e6d8ff;
  box-shadow: none;
  animation: none;
}

.rarity-badge.rarity-legendary {
  background: none;
  color: #000000;
  box-shadow: none;
  animation: none;
}

/* ===== Modal overlay ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, rgba(4, 18, 10, 0.92), rgba(1, 4, 2, 0.98));
  z-index: 1000;
}

.modal-overlay.is-visible {
  display: flex;
}

.modal {
  width: min(780px, 100% - 24px);
  max-height: calc(100vh - 40px);
  overflow: hidden;
}

/* ===== Reveal modal ===== */
.reveal-modal-card {
  padding: 56px 48px 44px;
  text-align: center;
  background: var(--modal-bg);
  font-size: 30px;
}

.reveal-strip-wrapper {
  position: relative;
  margin-bottom: 32px;
  padding: 32px 160px;
  overflow: hidden;
  border-radius: 36px;
  background: linear-gradient(135deg, #0f3b21, #1c6840);
}

.reveal-strip {
  display: flex;
  justify-content: flex-start;
  gap: 24px;
  will-change: transform;
}

/* элемент в ленте */
.reveal-strip-icon {
  width: 132px;
  height: 112px;
  border-radius: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 70px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.45);
  opacity: 0.85;
  transition: box-shadow 0.12s ease, opacity 0.12s ease;
}

/* текущий (по центру) — чуть ярче */
.reveal-strip-icon.is-center {
  opacity: 1;
  box-shadow: 0 0 36px rgba(255, 255, 255, 0.4);
}

/* выигрышный — большой попап + мигающая белая тень */
.reveal-strip-icon.win {
  animation: win-scale 0.6s ease-out forwards, win-glow 1s ease-in-out infinite;
}

/* низ модалки: один текст и одна кнопка */
.reveal-text {
  font-size: 30px;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.reveal-type-label {
  font-size: 36px;
  font-family: "GilroyExtraBold", system-ui, sans-serif;
}

.reveal-type-win {
  animation: prize-pop 0.45s ease-out;
}

.reveal-button {
  border-radius: 999px;
  border: none;
  padding: 20px 40px;
  font-size: 30px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #ff7043, #f44336);
  color: #ffffff;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
}

.reveal-button:hover:not(:disabled) {
  filter: brightness(1.05);
}

.reveal-button:disabled {
  opacity: 0.6;
  cursor: default;
}

.reveal-button-secondary {
  background: linear-gradient(135deg, #43a047, #2e7d32);
}

/* мигающая белая тень у выигрышного элемента */
@keyframes win-glow {
  0% {
    box-shadow: 0 0 36px rgba(255, 255, 255, 0.0), 0 0 24px rgba(0, 0, 0, 0.45);
  }
  50% {
    box-shadow: 0 0 72px rgba(255, 255, 255, 0.9), 0 0 36px rgba(0, 0, 0, 0.5);
  }
  100% {
    box-shadow: 0 0 36px rgba(255, 255, 255, 0.0), 0 0 24px rgba(0, 0, 0, 0.45);
  }
}

/* ===== Gift modal ===== */
.gift-modal-card {
  padding: 22px 22px 24px;
  background: var(--modal-bg);
  font-size: 15px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.modal-title-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-type-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1e4022;
  color: #2b1406;
  font-size: 40px;
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.6);
}

.modal-title {
  margin: 0;
  font-size: 35px;
  font-family: "GilroyExtraBold", system-ui, sans-serif;
}

.modal-close {
  border: none;
  outline: none;
  border-radius: 999px;
  background: rgba(244, 67, 54, 0.18);
  color: #ffcccb;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.12s.ease;
}

.modal-close:hover {
  background: rgba(244, 67, 54, 0.4);
  transform: translateY(-1px);
}

.modal-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 25px;
  margin-bottom: 12px;
  color: var(--text-muted);
}

.modal-day {
  font-weight: 500;
}

.modal-rarity-pill {
  padding: 5px 14px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.32);
  color: #fff3e0;
}

.modal-rarity-pill.rarity-epic {
  background: rgba(123, 31, 162, 0.9);
}

.modal-rarity-pill.rarity-legendary {
  background: rgba(255, 213, 79, 0.95);
  color: #3e2723;
}

/* контент модалки */
.modal-body {
  max-height: calc(100vh - 170px);
  overflow: auto;
  padding-right: 4px;
  font-size: 20px;
  line-height: 1.55;
}

.modal-body p {
  margin: 0 0 10px;
}

.modal-body a {
  color: #ffcc80;
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 204, 128, 0.7);
}

.modal-body a:hover {
  border-bottom-style: solid;
}

.modal-body img {
  max-width: 100%;
  display: block;
  border-radius: 12px;
  margin: 10px 0;
}

.modal-body video {
  width: 100%;
  max-height: 360px;
  border-radius: 12px;
  margin: 10px 0;
}

.hidden {
  display: none !important;
}

/* Animations */
@keyframes available-blink {
  0% {
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
    transform: scale(1, 1);
  }
  50% {
    box-shadow: 0 0 100px rgba(255, 255, 255, 0.95);
    transform: scale(1.1, 1.1);
  }
  100% {
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
    transform: scale(1, 1);
  }
}

/* попап текста выигрыша */
@keyframes prize-pop {
  0% {
    transform: scale(0.9);
  }
  60% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}

/* попап иконки выигрыша */
@keyframes win-scale {
  0% {
    transform: scale(1);
  }
  65% {
    transform: scale(1.9);
  }
  100% {
    transform: scale(1.5);
  }
}

@media (max-width: 640px) {
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .calendar-card {
    padding: 16px 4px 10px;
  }

  .calendar-grid {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  }

  .logo {
    font-size: 34px;
  }

  .modal {
    width: min(100%, 100% - 12px);
  }

  .reveal-strip-wrapper {
    padding: 12px 40px;
  }

  .reveal-strip-icon {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }
}
