:root{
    --bg: rgba(0, 0, 0, 0.76);
    --text: #e9e9e9;
    --muted: #cfcfcf;
    --radius: 44px;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #162f42;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
    overflow: hidden;
    font-family: Inter;
    font-style: normal;
}
.mobile-placeholder {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #162f42;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.mobile-placeholder-content {
    text-align: center;
    color: var(--text);
    max-width: 400px;
}
.mobile-placeholder-content h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--muted);
}
.mobile-placeholder-content p {
    font-size: 18px;
    line-height: 1.5;
    color: var(--text);
}
.sound-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 30000;
    cursor: pointer;
}
.sound_icon {
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}
.sound_icon:hover {
    opacity: 0.8;
}
.main {
    width: 100vw;
    height: 100vh;
    background: url('./img/bg.png') no-repeat center center;
    background-size: cover;
    object-fit: contain;
}
.gifts  {
    position: absolute;
    bottom: 0%;
    left: 50%;
    transform: translateX(-50%);
    object-fit: contain;
    pointer-events: none;
    z-index: 30000;
    transform-origin: center bottom;
}
.tree-container {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    z-index: 100;
    transform-origin: center bottom;
}
.tree {
    object-fit: contain;
    pointer-events: none;
    position: relative;
    left: -2%;
}
.tree_light {
    position: absolute;
    bottom: 0;
    left: 55%;
    transform: translateX(-50%);
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    z-index: 10;
    animation: tree_light_animation 3s linear infinite;
}

@keyframes tree_light_animation {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.horse-container {
    position: absolute;
    bottom: 0;
    left: 74%;
    transform: translateX(-50%);
    transform-origin: center bottom;
}
.horse_body {
    position: relative;
    object-fit: contain;
    pointer-events: none;
}
.horse_head {
    position: absolute;
    top: 120px;
    right: 129px;
    transform: translate(100%, -100%);
    object-fit: contain;
    pointer-events: none;
    animation: horse_head_animation 3s linear infinite;
    transform-origin: 90px 270px;
}
@keyframes horse_head_animation {
    0% {
        transform: translate(100%, -100%) rotate(0deg);
    }
    50% {
        transform: translate(100%, -100%) rotate(25deg);
    }
    100% {
        transform: translate(100%, -100%) rotate(0deg);
    }
}


.snow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 500;
}
.snowflake {
    position: absolute;
    top: -10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    filter: blur(4px);
    opacity: 0.5;
    will-change: transform;
    contain: layout style paint;
    animation-name: fall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
  }
  
  @keyframes fall {
    0% {
      transform: translate3d(0, -10px, 0);
    }
    100% {
      transform: translate3d(var(--drift), 110vh, 0);
    }
  }
  .lantern_1 {
    position: absolute;
    top: 250px;
    right: -50px;
    object-fit: contain;
    pointer-events: none;
    animation: tree_light_animation 3s linear infinite;
    animation-delay: 2s;
}
  .lantern_2 {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 100;
    object-fit: contain;
    pointer-events: none;
    animation: tree_light_animation 3s linear infinite;
    animation-delay: 3s;
}
.tree-ball {
    position: absolute;
    width: 45px;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: pointer;
    z-index: 50;
    transition: transform 0.3s ease-out;
    animation: ball-fade-in 0.2s ease-in forwards;
}
@keyframes ball-fade-in {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}
.tree-ball.falling {
    animation: ball-fall 1.5s ease-in forwards;
}
@keyframes ball-fall {
    0% {
        transform: translate(-50%, -50%) translateX(0) translateY(0) rotate(0deg);
    }
    90% {
        transform: translate(-50%, -50%) translateX(var(--fall-drift, 0px)) translateY(100vh) rotate(720deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) translateX(var(--fall-drift, 0px)) translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}
.hint {
    position: fixed;
    z-index: 500;
    padding: 16px 32px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.76);
    color: #fff;
    white-space: nowrap;
    pointer-events: none;
}
.star {
    object-fit: contain;
    cursor: pointer;
}
.tree-container-stars {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%); 
  z-index: 100;
}
.shufl-text {
  position: absolute;
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  height: 50px;
}
.ball-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1200;
}
.ball-container {
    overflow: hidden;
    position: relative;
    width: 440px;
    height: 520px;
}
.ball-modal-content {
    position: relative;
    gap: 38px;
    max-width: 1200px;
    width: 85%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ball-modal-ball {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.ball-modal-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: cover;
    -webkit-mask-image: radial-gradient(circle, #000 60%, rgba(0,0,0,0) 69%);
    mask-image: radial-gradient(circle, #000 60%, rgba(0,0,0,0) 69%);

    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;

    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
}
.ball-modal-inner-container {
    position: absolute;
    overflow: hidden;
    border-radius: 50%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    aspect-ratio: 1 / 1;
    bottom: 4%;
}
.ball-text {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 32px;
    background: rgba(0, 0, 0, 0.76);
    color: var(--Grey, #D9D9D9);
    font-weight: 700;
    font-size: 24px;
    line-height: normal;
    width: 60%;
    padding: 32px;
    margin-right: 24px;
}
.ball-text-title {
    margin-bottom: 8px;
    font-size: 48px;
}
.ball-text-description {
    font-weight: 400;
    line-height: normal;
}
.ball-close {
    display: flex;
    position: absolute;
    top: -32px;
    right: -26px;
    background: rgba(0, 0, 0, 0.76);
    border-radius: 50%;
    padding: 12px;
    cursor: pointer;
}

.countdown-container {
    position: absolute;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.50);
    width: 100vw;
    height: 100vh;
    /* display: none; */
    display: flex;
    justify-content: center;
    align-items: center;
}
.countdown-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8) url(./img/bg_before.png) no-repeat center center;
  background-size: cover;
  background-blend-mode: multiply;
  filter: blur(15px);
}

.countdown{
    position: absolute;
    z-index: 10001;
    width: min(1200px, 100%);
    background: var(--bg);
    border-radius: var(--radius);
    padding: 34px 44px 30px;
    color: var(--text);
}
.btn-visit {
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  cursor: pointer;
  background: #8BFFFF;
  gap: 10px;
  opacity: 1;
  border-radius: 64px;
  padding: 24px 96px;
  color: #000;
  font-weight: 700;
  font-size: 32px;
  line-height: 1.1;
  text-align: center;
}
  
.title{
  text-align: center;
  font-weight: 700;
  font-size: clamp(26px, 3.2vw, 44px);
  line-height: 1.1;
  margin: 0 0 22px 0;
  color: var(--muted);
}
  
.row{
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
}

.unit{
  min-width: 170px;
  text-align: center;
}

.value{
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: clamp(52px, 7.2vw, 108px);
  line-height: 1;
  letter-spacing: 0.5px;
}

.label{
  margin-top: 10px;
  font-size: clamp(18px, 2.2vw, 38px);
  color: var(--muted);
  letter-spacing: 0.2px;
}

.sep{
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: clamp(52px, 7.2vw, 108px);
  line-height: 1;
  padding-top: 2px;
  opacity: 0.95;
  user-select: none;
}
  
@media (max-width: 1366px){
  .tree-container {
    transform: translateX(-50%) scale(0.75);
  }
  .horse-container {
    transform: translateX(-50%) scale(0.75);
  }
  .gifts {
    transform: translateX(-50%) scale(0.75);
  }
  .lantern_1,
  .lantern_2 {
    transform: scale(0.75);
  }
  .ball-container {
    width: 374px;
    height: 442px;
  }
  .ball-text {
    /* width: 425px; */
    padding: 27px;
    font-size: 20px;
  }
  .ball-text-title {
    font-size: 41px;
  }
  .ball-modal-content {
    gap: 32px;
  }
}

@media (max-width: 1024px){
  .tree-container {
    transform: translateX(-50%) scale(0.6);
  }
  .horse-container {
    transform: translateX(-50%) scale(0.6);
  }
  .gifts {
    transform: translateX(-50%) scale(0.6);
  }
  .lantern_1,
  .lantern_2 {
    transform: scale(0.7);
  }
  .ball-container {
    width: 308px;
    height: 364px;
  }
  .ball-text {
    padding: 22px;
    font-size: 18px;
  }
  .ball-text-title {
    font-size: 34px;
  }
  .ball-modal-content {
    gap: 26px;
  }
}

@media (max-width: 768px){
  .mobile-placeholder {
    display: flex;
  }
  .countdown-container,
  .main,
  .gifts,
  .snow,
  .sound-container,
  .ball-modal {
    display: none !important;
  }
  .countdown{ padding: 26px 20px 22px; border-radius: 28px; }
  .unit{ min-width: 130px; }
  .sep{ display: none; }
  .row{ gap: 16px; }
  .tree-container {
    transform: translateX(-50%) scale(0.5);
  }
  .horse-container {
    transform: translateX(-50%) scale(0.5);
  }
  .gifts {
    transform: translateX(-50%) scale(0.5);
  }
  .lantern_1,
  .lantern_2 {
    transform: scale(0.5);
  }
  .ball-modal-content {
    flex-direction: column;
    gap: 20px;
    padding: 20px;
  }
  .ball-container {
    width: 264px;
    height: 312px;
  }
  .ball-text {
    width: 100%;
    max-width: 300px;
    padding: 20px;
    margin-right: 0;
    font-size: 16px;
  }
  .ball-text-title {
    font-size: 28px;
  }
  .ball-close {
    top: -20px;
    right: -20px;
    padding: 10px;
  }
}