/*
 * Holiday theme: string lights, snow, snow caps and ornaments.
 * Everything seasonal lives here and in holiday.js — remove both tags
 * from index.html to switch it off.
 */

/* ---------- layers ---------- */

#garland    { z-index: 2; }  /* behind the world, under the name ropes */
#ropeLights { z-index: 4; }  /* same layer as #strings, drawn after it */
#snow       { z-index: 5; }  /* falls in front of everything but the UI */
#drift      { z-index: 2; }

#garland, #ropeLights, #snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#garland .wire {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.8;
}

/* ---------- bulbs ---------- */

.bulb .bod  { stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.bulb .cap  { fill: #6d6457; stroke: var(--ink); stroke-width: 1.2; }
.bulb .shine { fill: #fff; opacity: 0.75; }

.bulb .glow {
  animation: twinkle var(--dur, 2.6s) ease-in-out var(--delay, 0s) infinite alternate;
}

.bulb .bod {
  animation: flicker var(--dur, 2.6s) ease-in-out var(--delay, 0s) infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.15; }
  to   { opacity: 1; }
}

@keyframes flicker {
  from { opacity: 0.72; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .bulb .glow, .bulb .bod { animation: none; }
}

/* ---------- snow drift along the floor ---------- */

#drift {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 24px;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='24'%3E%3Cpath d='M0 11 Q20 3 40 9 T80 8 T120 10 T160 11 V24 H0Z' fill='%23ffffff'/%3E%3Cpath d='M0 11 Q20 3 40 9 T80 8 T120 10 T160 11' fill='none' stroke='%232b2620' stroke-width='2' stroke-linecap='round' stroke-opacity='0.7'/%3E%3C/svg%3E") repeat-x left bottom;
}

/* ---------- snow caps ---------- */

/* mounds: a white cap over the crown, its lower edge inked */
.mound { overflow: hidden; }

.mound::after {
  content: '';
  position: absolute;
  left: -10%;
  width: 120%;
  top: -30%;
  height: 39%;
  background: #fff;
  border-bottom: 2.5px solid var(--ink);
  border-radius: 50%;
}

/* letter tiles and dangling buttons wear a lumpy drift on top; holiday.js
   draws a different shape for each one (--snow) and places it (--snow-x/w) */
.letter.snowy::before,
.dangler.snowy::before {
  content: '';
  position: absolute;
  top: -12px;
  left: var(--snow-x);
  width: var(--snow-w);
  height: 24px;
  background: var(--snow) no-repeat left top;
  pointer-events: none;
}

/* seesaw plank: a thin layer of snow along the top */
.plank::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 6%;
  right: 9%;
  height: 8px;
  background: #fff;
  border: 2px solid var(--ink);
  border-bottom: 0;
  border-radius: 10px 12px 0 0 / 7px 7px 0 0;
  pointer-events: none;
}

/* ---------- toy balls become ornaments ---------- */

.toy.ball       { background-color: #ffa9a4; }
.toy.ball.b0    { background-color: #ffa9a4; }
.toy.ball.b1    { background-color: #c8e4ff; }
.toy.ball.b2    { background-color: #ffe08a; }
.toy.ball.b3    { background-color: #b5e5ab; }

.toy.ball {
  background-image: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.9) 0 11%, transparent 13%);
}

/* the metal cap */
.toy.ball::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  width: 32%;
  min-width: 9px;
  height: 7px;
  transform: translateX(-50%);
  background: #d8b74a;
  border: 2px solid var(--ink);
  border-radius: 3px 3px 1px 1px;
}

/* the wire loop */
.toy.ball::after {
  content: '';
  position: absolute;
  top: -13px;
  left: 50%;
  width: 8px;
  height: 8px;
  transform: translateX(-50%);
  border: 2px solid var(--ink);
  border-radius: 50%;
}

/* ---------- snowman ---------- */

.snowball {
  position: absolute;
  left: 0;
  top: 0;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
}

.snowball svg { display: block; pointer-events: none; }

/* ---------- "new!" sign for Buffet Battle ---------- */

.dangler.sign {
  flex-direction: column;
  gap: 0;
  line-height: 1.05;
  padding: 4px 8px 2px;
  text-align: center;
}

.sign .sign-new {
  font-family: 'Gochi Hand', cursive;
  font-size: 15px;
  color: #d23b33;
  letter-spacing: 0.5px;
}

.sign .sign-name {
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: 25px;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .sign .sign-name { font-size: 21px; }
}

/* the doodle arrow follows the sign (holiday.js places it each frame);
   its transform pivots on the arrow's tip */
.doodle.arrow.on-sign {
  top: 0;
  left: 0;
  transform-origin: 56.67% 78%;
  opacity: 0.6;
}
