* {
  box-sizing: border-box;
}

:root {
  --night-top: #14345c;
  --night-mid: #274f7e;
  --night-bottom: #456c97;

  --snow-main: #eef7ff;
  --snow-soft: #e8f2fb;

  --card-bg: rgba(255, 255, 255, 0.14);
  --card-border: rgba(255, 255, 255, 0.24);
  --box-bg: rgba(255, 255, 255, 0.18);
  --box-border: rgba(255, 255, 255, 0.28);

  --text-main: #ffffff;
  --text-soft: #edf6ff;

  --message-bg: rgba(176, 35, 52, 0.8);

  --tree-dark: #1f6d4d;
  --tree-light: #2b845c;
  --tree-trunk: #7a5231;

  --house-red: #d44747;
  --house-dark: #7a2328;
  --window-glow: #ffeaa0;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text-main);
  background: linear-gradient(
    to bottom,
    var(--night-top) 0%,
    var(--night-mid) 45%,
    var(--night-bottom) 100%
  );
}

.page-shell {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:  24px 24px 44px;
}

.countdown-card {
  width: min(980px, 100%);
  padding: 24px 18px 10px;
  border-radius: 0;
  border: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  text-align: center;
  transform: translateY(-28px);
}

.hero-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.28em;
  font-size: 3.8rem;
  line-height: 1;
  margin-bottom: 8px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--text-soft);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.1;
}

.target-date {
  margin: 12px 0 28px;
  color: var(--text-soft);
  font-size: 1.25rem;
}


.festive-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: -12px 0 24px;
}

.festive-control {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.festive-control[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.23);
  border-color: rgba(255, 255, 255, 0.42);
}

.festive-control:focus-visible {
  outline: 3px solid rgba(255, 234, 160, 0.8);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .festive-control:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
  }
}

body.snow-disabled .snow-layer {
  display: none;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.time-box {
  min-width: 0;
  padding: 18px 8px 14px;
  border-radius: 18px;
  border: 1px solid var(--box-border);
  background: var(--box-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.time-value {
  font-size: clamp(1.62rem, 4.05vw, 2.92rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.time-label {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.message-box {
  margin-top: 24px;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: var(--message-bg);
  font-size: 1.05rem;
  font-weight: 700;
}

.message-box p {
  margin: 0;
}


.message-box {
  position: relative;
  overflow: visible;
  cursor: pointer;
  user-select: none;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.message-box:hover {
  transform: translateY(-1px);
}

.message-box:active {
  transform: translateY(1px) scale(0.995);
}

.message-box:focus-visible {
  outline: 3px solid rgba(255, 234, 160, 0.9);
  outline-offset: 4px;
}

.confetti-piece {
  position: fixed;
  width: 14px;
  height: 18px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 20;
  opacity: 0.95;
  animation: confetti-burst 1350ms ease-out forwards;
}

.confetti-piece.shape-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.confetti-piece.shape-triangle {
  width: 0;
  height: 0;
  background: transparent !important;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 16px solid currentColor;
}

@keyframes confetti-burst {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 0.98;
  }
  100% {
    transform:
      translate(var(--dx, 0px), var(--dy, 120px))
      rotate(var(--rot, 360deg))
      scale(0.6);
    opacity: 0;
  }
}



.christmas-fact {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 22px;
  padding: 24px 26px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 22px;
  background: rgba(255,255,255,.09);
  text-align: left;
}
.fact-icon {
  font-size: 1.55rem;
  line-height: 1.2;
}
.fact-heading {
  margin: 0 0 7px;
  color: var(--text-soft);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.fact-text {
  margin: 0;
  color: var(--text-main);
  font-size: 1.34rem;
  line-height: 1.45;
}

.footer-note {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  margin: 0;
  width: calc(100% - 28px);
  max-width: 920px;
  text-align: center;
  color: #b8c0ca;
  font-size: 0.86rem;
  line-height: 1.3;
  opacity: 0.95;
  text-shadow: none;
  z-index: 30;
  pointer-events: none;
}

.winter-background {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.moon {
  position: absolute;
  top: 70px;
  right: 110px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 35%,
    #fffef8 0%,
    #f8f1cf 55%,
    #e7ddb4 100%
  );
  box-shadow: 0 0 35px rgba(255, 247, 196, 0.55);
}

.santa-flight {
  position: absolute;
  top: 54px;
  left: 12%;
  width: min(300px, 30vw);
  height: auto;
  opacity: 0.42;
  z-index: 2;
}

.winter-scene {
  position: absolute;
  inset: 0;
}

.hill {
  position: absolute;
  bottom: 0;
  border-radius: 50% 50% 0 0;
  background: var(--snow-main);
}

.hill-1 {
  left: -10%;
  width: 55%;
  height: 18%;
}

.hill-2 {
  left: 28%;
  width: 45%;
  height: 14%;
  background: #f7fbff;
}

.hill-3 {
  right: -8%;
  width: 42%;
  height: 20%;
  background: var(--snow-soft);
}

.tree {
  position: absolute;
  bottom: 85px;
  width: 0;
  height: 0;
  border-left: 28px solid transparent;
  border-right: 28px solid transparent;
  border-bottom: 70px solid var(--tree-dark);
}

.tree::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 18px;
  width: 0;
  height: 0;
  border-left: 22px solid transparent;
  border-right: 22px solid transparent;
  border-bottom: 55px solid var(--tree-light);
}

.tree::after {
  content: "";
  position: absolute;
  left: -5px;
  top: 70px;
  width: 10px;
  height: 18px;
  border-radius: 2px;
  background: var(--tree-trunk);
}

.tree-1 {
  left: 10%;
  transform: scale(0.9);
}

.tree-2 {
  left: 20%;
  bottom: 95px;
  transform: scale(1.15);
}

.tree-3 {
  right: 20%;
  bottom: 92px;
  transform: scale(1);
}

.tree-4 {
  right: 10%;
  bottom: 84px;
  transform: scale(0.82);
}

.house {
  position: absolute;
  width: 120px;
  height: 90px;
  border-radius: 8px;
  background: var(--house-red);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
}

.house-main {
  bottom: 82px;
  left: 50%;
  transform: translateX(-50%);
}

.house-mid {
  bottom: 106px;
  left: 37%;
  transform: translateX(-50%) scale(0.72);
  opacity: 1;
}

.house-small {
  bottom: 74px;
  left: 64%;
  transform: translateX(-50%) scale(0.42);
  opacity: 1;
}

.roof {
  position: absolute;
  left: -10px;
  top: -34px;
  width: 0;
  height: 0;
  border-left: 70px solid transparent;
  border-right: 70px solid transparent;
  border-bottom: 42px solid var(--house-dark);
}

.chimney {
  position: absolute;
  top: -20px;
  left: 80px;
  width: 12px;
  height: 24px;
  border-radius: 2px 2px 0 0;
  background: #6d1d22;
}

.window {
  position: absolute;
  top: 22px;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: var(--window-glow);
  box-shadow: 0 0 14px rgba(255, 232, 160, 0.6);
}

.window-left {
  left: 20px;
}

.window-right {
  right: 20px;
}

.house-main .window-left {
  box-shadow: 0 0 16px rgba(255, 232, 160, 0.62);
}

.house-main .window-right {
  box-shadow: 0 0 12px rgba(255, 232, 160, 0.48);
}

.house-mid .window-left {
  box-shadow: 0 0 10px rgba(255, 232, 160, 0.42);
}

.house-mid .window-right {
  box-shadow: 0 0 15px rgba(255, 232, 160, 0.58);
}

.house-small .window-left {
  box-shadow: 0 0 9px rgba(255, 232, 160, 0.38);
}

.house-small .window-right {
  box-shadow: 0 0 12px rgba(255, 232, 160, 0.46);
}

.door {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 24px;
  height: 38px;
  transform: translateX(-50%);
  border-radius: 5px 5px 0 0;
  background: var(--house-dark);
}

.snow-layer {
  position: absolute;
  inset: -20% 0 0;
  background-repeat: repeat;
  will-change: transform;
}

.snow-back {
  z-index: 1;
  opacity: 0.35;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.9) 1.2px, transparent 1.3px),
    radial-gradient(circle, rgba(255,255,255,0.8) 1px, transparent 1.1px);
  background-size: 120px 120px, 170px 170px;
  background-position: 10px 20px, 50px 80px;
  animation: snowfall-back 18s linear infinite;
}

.snow-mid {
  z-index: 3;
  opacity: 0.55;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.95) 1.8px, transparent 1.9px),
    radial-gradient(circle, rgba(255,255,255,0.85) 1.4px, transparent 1.5px);
  background-size: 140px 140px, 190px 190px;
  background-position: 40px 0, 90px 70px;
  animation: snowfall-mid 12s linear infinite;
}

.snow-front {
  z-index: 6;
  opacity: 0.82;
  background-image:
    radial-gradient(circle, rgba(255,255,255,1) 2.3px, transparent 2.4px),
    radial-gradient(circle, rgba(255,255,255,0.95) 1.8px, transparent 1.9px);
  background-size: 160px 160px, 210px 210px;
  background-position: 0 0, 70px 100px;
  animation: snowfall-front 8s linear infinite;
}

@keyframes snowfall-back {
  from {
    transform: translate3d(0, -60px, 0);
  }
  to {
    transform: translate3d(20px, 100vh, 0);
  }
}

@keyframes snowfall-mid {
  from {
    transform: translate3d(0, -70px, 0);
  }
  to {
    transform: translate3d(-25px, 100vh, 0);
  }
}

@keyframes snowfall-front {
  from {
    transform: translate3d(0, -80px, 0);
  }
  to {
    transform: translate3d(35px, 100vh, 0);
  }
}

@media (max-width: 900px) {
  
.festive-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: -12px 0 24px;
}

.festive-control {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.festive-control[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.23);
  border-color: rgba(255, 255, 255, 0.42);
}

.festive-control:focus-visible {
  outline: 3px solid rgba(255, 234, 160, 0.8);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .festive-control:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
  }
}

body.snow-disabled .snow-layer {
  display: none;
}

.countdown-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .time-box-seconds {
    grid-column: span 2;
  }

  .moon {
    top: 45px;
    right: 35px;
    width: 80px;
    height: 80px;
  }

  .santa-flight {
    top: 58px;
    left: 10%;
    width: min(220px, 38vw);
    opacity: 0.38;
  }

  .house-main {
    bottom: 70px;
    transform: translateX(-50%) scale(0.88);
  }

  .house-mid {
    bottom: 92px;
    left: 34%;
    transform: translateX(-50%) scale(0.62);
  }

  .house-small {
    bottom: 68px;
    left: 66%;
    transform: translateX(-50%) scale(0.38);
  }

  .house-mid .chimney {
    left: 78px;
    top: -22px;
  }
}

@media (max-width: 600px) {
  body {
    overflow-y: auto;
  }

  .page-shell {
    min-height: 100svh;
    padding: 18px;
  }

  .countdown-card {
    padding: 24px 18px;
    border-radius: 24px;
  }

  .hero-icon {
    gap: 0.2em;
    font-size: 3rem;
  }

  
.festive-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: -12px 0 24px;
}

.festive-control {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.festive-control[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.23);
  border-color: rgba(255, 255, 255, 0.42);
}

.festive-control:focus-visible {
  outline: 3px solid rgba(255, 234, 160, 0.8);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .festive-control:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
  }
}

body.snow-disabled .snow-layer {
  display: none;
}

.countdown-grid {
    gap: 10px;
  }

  .time-box {
    padding: 14px 6px 12px;
    border-radius: 14px;
  }

  .santa-flight {
    top: 62px;
    left: 8%;
    width: min(180px, 48vw);
    opacity: 0.32;
  }

  .tree-1,
  .tree-4 {
    display: none;
  }

  .tree-2 {
    left: 10%;
    bottom: 72px;
  }

  .tree-3 {
    right: 10%;
    bottom: 72px;
  }

  .house-main {
    bottom: 62px;
    left: 50%;
    transform: translateX(-50%) scale(0.75);
  }

  .house-mid {
    bottom: 82px;
    left: 28%;
    transform: translateX(-50%) scale(0.40);
  }

  .house-small {
    bottom: 60px;
    left: 72%;
    transform: translateX(-50%) scale(0.28);
  }

  .house-mid .chimney {
    left: 76px;
    top: -24px;
    width: 11px;
    height: 20px;
  }
}


@media (max-width: 600px) {
  .festive-controls {
    margin-top: -10px;
    margin-bottom: 20px;
  }

  .festive-control {
    min-height: 44px;
    padding: 10px 13px;
    font-size: 0.84rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .snow-back,
  .snow-mid,
  .snow-front {
    animation: none;
  }
}


/* Version A specific refinements */
h1,
.target-date,
.eyebrow,
.footer-note,
.fact-heading,
.fact-text,
.time-label,
.time-value,
.message-box p {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.footer-note {
  margin-bottom: 6px;
}

@media (max-width: 600px) {
  .countdown-card {
    padding: 20px 10px 8px;
  }
}


/* v21 refinements */
@media (max-width: 900px) {
  .countdown-card {
    transform: translateY(-20px);
  }
}

@media (max-width: 600px) {
  .countdown-card {
    transform: translateY(-12px);
  }
}


/* v23 footer note positioning */
@media (max-width: 600px) {
  .footer-note {
    bottom: 8px;
    width: calc(100% - 24px);
    font-size: 0.8rem;
  }
}


/* v24 footer note placement */
@media (max-width: 600px) {
  .footer-note {
    bottom: 8px;
    width: calc(100% - 20px);
    font-size: 0.78rem;
  }
}


/* v27 share-button feedback */
#share-button.share-success {
  background: rgba(58, 167, 109, 0.30);
  border-color: rgba(255, 255, 255, 0.48);
}

#share-button.share-error {
  background: rgba(229, 72, 77, 0.28);
}


/* v35: improve fact-of-the-day readability on narrow/mobile layouts */
.fact-heading,
.fact-text {
  text-shadow: 0 2px 8px rgba(10, 20, 35, 0.45);
}

@media (max-width: 700px) {
  .christmas-fact {
    background: rgba(93, 126, 168, 0.28);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .fact-heading {
    color: #e9eef5;
    text-shadow: 0 2px 10px rgba(5, 12, 24, 0.70);
  }

  .fact-text {
    color: #f2f5f9;
    text-shadow:
      0 2px 10px rgba(5, 12, 24, 0.78),
      0 0 2px rgba(5, 12, 24, 0.45);
    line-height: 1.5;
  }
}
