.ics-icon-wrap {
  position: relative;
  display: inline-block;
}
.ics-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--color-secondary);
  color: #1a2e2c;
  font-family: 'Caveat', cursive;
  font-size: 1.5rem;
  font-weight: 700;
  padding: .1rem .6rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}

#copy-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1300;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 1.25rem;
  min-width: 240px;
  background: var(--color-surface);
  border: 1.5px solid var(--color-primary);
  border-radius: 12px;
  box-shadow: 0 8px 28px var(--color-shadow);
  color: var(--color-text);
  font-size: .9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
#copy-toast i[data-lucide] { color: var(--color-primary); flex-shrink: 0; width: 18px; height: 18px; }
#copy-toast.show { opacity: 1; pointer-events: auto; }

/* ── Calendar import buttons ────────────────────────── */
.ics-cal-wrap {
  position: relative;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  padding: .85rem 1rem;
  margin-top: 1.5rem;
}

.ics-cal-bell {
  position: absolute;
  top: -24px;
  right: 1.25rem;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #F9B338;
  transform-origin: center top;
  animation: bellSwing 5s ease-in-out infinite;
  cursor: pointer;
}
.ics-cal-bell svg { width: 54px; height: 54px; pointer-events: none; }

/* GSAP takes over rotation — suppress idle CSS animation */
.ics-cal-bell.bell-js-active { animation: none; }

.bell-wave {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid #F9B338;
  opacity: 0;
  pointer-events: none;
  animation: bellWave 5s ease-out infinite;
}
.bell-wave-2 { animation-delay: 0.25s; }
.bell-wave-3 { animation-delay: 0.5s; }

/* Immediate wave burst on click/touch */
.ics-cal-bell.bell-ringing .bell-wave   { animation: bellWaveHit 0.95s ease-out forwards; }
.ics-cal-bell.bell-ringing .bell-wave-2 { animation-delay: 0.15s; }
.ics-cal-bell.bell-ringing .bell-wave-3 { animation-delay: 0.30s; }

@keyframes bellWaveHit {
  0%   { transform: scale(0.3); opacity: 0; }
  10%  { opacity: 0.75; }
  100% { transform: scale(2.4); opacity: 0; }
}

@keyframes bellWave {
  0%, 57%  { transform: scale(0.4); opacity: 0; }
  63%      { opacity: 0.65; }
  82%      { transform: scale(2.1); opacity: 0; }
  100%     { opacity: 0; }
}

html.reduce-motion .bell-wave { animation: none; }
@media (prefers-reduced-motion: reduce) { .bell-wave { animation: none; } }

@keyframes bellSwing {
  0%, 58%, 100% { transform: rotate(0deg); }
  63%  { transform: rotate(22deg); }
  70%  { transform: rotate(-18deg); }
  77%  { transform: rotate(13deg); }
  83%  { transform: rotate(-8deg); }
  88%  { transform: rotate(4deg); }
  92%  { transform: rotate(-2deg); }
  96%  { transform: rotate(1deg); }
}
.ics-cal-label {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-text-muted);
  margin-bottom: .6rem;
}
.ics-cal-btn {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  padding: .28rem .7rem;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  border: 1.5px solid var(--ics-btn-clr);
  color: var(--ics-btn-clr);
  background: transparent;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
  transition: background .15s, color .15s;
}
.ics-cal-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.ics-cal-btn:hover,
.ics-cal-btn:focus-visible {
  background: var(--ics-btn-clr);
  color: #fff;
  text-decoration: none;
}
.ics-cal-google      { --ics-btn-clr: #EA4335; }
.ics-cal-outlook     { --ics-btn-clr: #0078D4; }
.ics-cal-apple       { --ics-btn-clr: var(--color-text); }
.ics-cal-apple:hover,
.ics-cal-apple:focus-visible { color: var(--color-bg); }
.ics-cal-yahoo       { --ics-btn-clr: #6001D2; }
.ics-cal-thunderbird { --ics-btn-clr: #FF8A00; }

/* ── ICS Puzzle ──────────────────────────────────────── */
.puzzle-heading {
  color: var(--color-secondary);
}
.puzzle-question-mark {
  display: inline-block;
  font-size: 1.3em;
  margin-right: .25rem;
  animation: puzzlePop 3s ease-in-out infinite;
  transform-origin: bottom center;
}
.ics-puzzle {
  border: 2px solid var(--color-border);
  border-radius: 16px;
  padding: 1.5rem 1.25rem 1.25rem;
  background: var(--color-surface);
  box-shadow: 0 2px 12px var(--color-shadow);
  transition: border-color .5s ease, box-shadow .5s ease;
}
.ics-puzzle.solved {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(var(--color-primary-rgb), .12), 0 6px 24px rgba(var(--color-primary-rgb), .2);
}

.ics-spinner-row {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: .3rem;
  justify-content: center;
  row-gap: 1rem;
}

.spinner-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
}

.spinner {
  border: 2px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  transition: border-color .4s ease;
}
.ics-puzzle.solved .spinner {
  border-color: var(--color-primary);
}

.spinner-btn {
  min-height: 52px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  padding: 0;
  width: 100%;
  transition: background .12s;
  touch-action: none;
}
.spinner-btn svg { width: 24px; height: 24px; pointer-events: none; }
.spinner-btn:hover  { background: var(--color-primary-light); }
.spinner-btn:active { background: var(--color-primary); color: #fff; }

.spinner-val {
  font-size: 2.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: 'Courier New', Courier, monospace;
  text-align: center;
  padding: .1rem .5rem;
  min-width: 3ch;
  color: var(--color-text);
  line-height: 1.15;
  user-select: none;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
[data-field="year"] .spinner-val { min-width: 4.4ch; }

.spinner-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--color-text);
  opacity: .55;
}

/* Success state */
.ics-puzzle-success {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-top: 1.25rem;
  color: var(--color-primary);
  font-weight: 600;
}
.ics-puzzle-success svg { width: 22px; height: 22px; flex-shrink: 0; }

