/* Batch 1 Christmas Atmosphere, Gift-Box Doors, 24-Bulb Progress Bar,
   Slim Single-Screen Hero, Dynamic Theme Wardrobe & Single-Step Focus Mode */

/* ── Ambient Festive Atmosphere ── */
.masthead {
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, #fffaf0 0%, #fbf2e3 100%);
  border-bottom: 1px solid #dfd0ba;
}

.masthead .nav {
  min-height: 62px;
}

.festive-garland {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -18px;
  height: 24px;
  pointer-events: none;
  overflow: hidden;
  z-index: 3;
}

.festive-garland svg {
  display: block;
  width: 100%;
  height: 100%;
}

.garland-bulb {
  filter: drop-shadow(0 0 3px rgba(255, 209, 102, 0.72));
  animation: garland-twinkle 4.2s ease-in-out infinite;
}

.garland-bulb:nth-of-type(2n) { animation-delay: 1.1s; }
.garland-bulb:nth-of-type(3n) { animation-delay: 2.3s; }

@keyframes garland-twinkle {
  0%, 100% { opacity: 0.92; }
  50% { opacity: 0.56; }
}

/* Gentle, subtle falling snow layer (non-distracting, WCAG-safe) */
.festive-snow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.snow-flake {
  position: absolute;
  top: -12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(235, 215, 190, 0.45) 70%, transparent 100%);
  opacity: 0.52;
  animation: snow-fall 14s linear infinite;
}

.snow-flake[data-flake="1"]  { left: 4%;  width: 5px; height: 5px; animation-duration: 13s; animation-delay: -2s; }
.snow-flake[data-flake="2"]  { left: 11%; width: 7px; height: 7px; animation-duration: 16s; animation-delay: -7s; }
.snow-flake[data-flake="3"]  { left: 18%; width: 4px; height: 4px; animation-duration: 12s; animation-delay: -4s; }
.snow-flake[data-flake="4"]  { left: 25%; width: 6px; height: 6px; animation-duration: 18s; animation-delay: -11s; }
.snow-flake[data-flake="5"]  { left: 32%; width: 5px; height: 5px; animation-duration: 15s; animation-delay: -1s; }
.snow-flake[data-flake="6"]  { left: 39%; width: 4px; height: 4px; animation-duration: 14s; animation-delay: -9s; }
.snow-flake[data-flake="7"]  { left: 46%; width: 6px; height: 6px; animation-duration: 17s; animation-delay: -5s; }
.snow-flake[data-flake="8"]  { left: 53%; width: 5px; height: 5px; animation-duration: 13.5s; animation-delay: -12s; }
.snow-flake[data-flake="9"]  { left: 60%; width: 7px; height: 7px; animation-duration: 19s; animation-delay: -3s; }
.snow-flake[data-flake="10"] { left: 67%; width: 4px; height: 4px; animation-duration: 12.5s; animation-delay: -8s; }
.snow-flake[data-flake="11"] { left: 74%; width: 6px; height: 6px; animation-duration: 16.5s; animation-delay: -6s; }
.snow-flake[data-flake="12"] { left: 81%; width: 5px; height: 5px; animation-duration: 15.5s; animation-delay: -10s; }
.snow-flake[data-flake="13"] { left: 87%; width: 4px; height: 4px; animation-duration: 14.5s; animation-delay: -1.5s; }
.snow-flake[data-flake="14"] { left: 93%; width: 6px; height: 6px; animation-duration: 17.5s; animation-delay: -13s; }
.snow-flake[data-flake="15"] { left: 28%; width: 5px; height: 5px; animation-duration: 20s; animation-delay: -15s; }
.snow-flake[data-flake="16"] { left: 71%; width: 5px; height: 5px; animation-duration: 18.5s; animation-delay: -4.5s; }

@keyframes snow-fall {
  0%   { transform: translate3d(0, -10px, 0); opacity: 0; }
  10%  { opacity: 0.48; }
  90%  { opacity: 0.44; }
  100% { transform: translate3d(18px, 102vh, 0); opacity: 0; }
}

main.shell,
footer.site-footer {
  position: relative;
  z-index: 2;
}

/* ── Slim Single-Screen Festive Hero (Home) ── */
.festive-hero {
  display: grid;
  gap: 1.25rem;
  padding: 1.35rem 0 1.4rem;
  align-items: start;
}

.festive-hero-left {
  display: grid;
  gap: 0.9rem;
  min-width: 0;
}

.festive-hero-heading {
  display: grid;
  gap: 0.45rem;
}

.festive-hero-heading h1 {
  margin-top: 0;
  font-family: "Instrument Serif", "Advent Heading Fallback", Georgia, serif;
  font-size: clamp(2.35rem, 3.85vw, 3.55rem);
  line-height: 0.96;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.festive-hero-heading h1 em {
  display: inline;
  color: var(--red);
  font-style: italic;
}

.festive-hero-sub {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
  max-width: 48ch;
}

/* Live 24-door Christmas gift-box preview wall */
.hero-preview-wall {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 0.9rem 0.95rem 1.05rem;
  background: radial-gradient(circle at 1px 1px, #fff2ce24 0, #fff2ce24 1px, transparent 1.45px) 0 0 / 26px 26px,
              var(--dyn-board, #4b1c2c);
  color: var(--dyn-ink, #ffebce);
  border: 1px solid rgba(56, 20, 30, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 22px 42px -28px rgba(42, 12, 22, 0.65);
  outline: 1px solid color-mix(in srgb, var(--dyn-accent, #f2bd78) 42%, transparent);
  outline-offset: -7px;
  --door: color-mix(in srgb, var(--dyn-board, #4b1c2c) 76%, #ffffff);
  --door-txt: var(--dyn-ink, #ffebce);
  --board-accent: var(--dyn-accent, #f2bd78);
}

.hero-preview-wall[data-theme="snowy"] {
  background: radial-gradient(circle at 14px 14px, #e8f9fd35 1px, transparent 1.6px) 0 0 / 30px 28px,
              radial-gradient(ellipse at top, #245d7a, #15384e 64%);
  --door: #21516b;
  --door-txt: #e6f8ff;
  --board-accent: #a8d7eb;
}

.hero-preview-wall[data-theme="candy"] {
  background: repeating-linear-gradient(135deg, transparent 0 18px, #ffc5d714 18px 26px), #691939;
  --door: #872c4c;
  --door-txt: #fff0f4;
  --board-accent: #ffc5d7;
}

.hero-preview-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.45rem;
}

.hero-preview-title {
  font-family: var(--heading);
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  line-height: 1.05;
  color: var(--door-txt);
  overflow-wrap: anywhere;
}

.hero-preview-badge {
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  color: var(--door-txt);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid color-mix(in srgb, var(--board-accent) 48%, transparent);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.hero-preview-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.34rem;
}

.hero-preview-grid[data-length="12"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hero-preview-grid[data-length="7"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hero-preview-grid .preview-door {
  min-height: 70px;
  padding: 0.24rem;
  pointer-events: none;
}

.hero-preview-grid .preview-door .door-number {
  font-size: 1.15rem;
}

.hero-preview-grid .preview-door .door-state,
.hero-preview-grid .preview-door .opened-sender {
  font-size: 0.62rem;
}

.hero-preview-grid .preview-door .gift-sender-pill {
  padding: 0.08rem 0.24rem;
  gap: 0.14rem;
}

.hero-preview-grid .preview-door .gift-sender-pill .door-motif {
  font-size: 0.68rem;
}

.hero-preview-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-size: 0.74rem;
  color: var(--door-txt);
  opacity: 0.92;
}

/* Ultra-clean Right Creation Card */
.festive-create {
  padding: 1.25rem 1.35rem;
  background: linear-gradient(180deg, #fffdf8 0%, #fff7e8 100%);
  border: 1px solid #dec3a3;
  box-shadow: 0 2px 4px rgba(90, 42, 42, 0.07), 0 18px 38px -24px rgba(90, 42, 42, 0.42);
}

.festive-create h2 {
  font-size: 1.95rem;
  margin-bottom: 0.7rem;
}

.festive-create > label {
  margin-top: 0;
  margin-bottom: 0.3rem;
}

.festive-create fieldset {
  margin: 0.75rem 0;
}

.festive-create legend {
  margin-bottom: 0.35rem;
  font-size: 0.84rem;
}

.festive-create .theme-picker {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.festive-create .theme-swatch {
  min-height: 64px;
  padding: 0.35rem 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.festive-create .theme-swatch span {
  font-size: 1.25rem;
}

/* Compact single-row day-count toggle */
.length-toggle-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.22rem;
  border-radius: 12px;
  background: #f3e4cd;
  border: 1px solid #dfc5a6;
}

.length-pill {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.28rem 0.3rem;
  border-radius: 9px;
  cursor: pointer;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 750;
  text-align: center;
  line-height: 1.15;
  transition: background-color 0.16s, color 0.16s, box-shadow 0.16s;
}

.length-pill small {
  font-size: 0.67rem;
  font-weight: 600;
  color: var(--muted);
}

.length-pill input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.length-pill:has(:checked) {
  background: #fffdf8;
  color: var(--red);
  box-shadow: 0 1px 3px rgba(60, 34, 34, 0.14), inset 0 0 0 1.5px var(--red);
}

.length-pill:has(:checked) small {
  color: var(--ink);
}

.length-pill:has(:focus-visible) {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

.festive-create-cta {
  margin-top: 0.45rem;
  min-height: 48px;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
}

.create-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin-top: 0.65rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}

.create-footer-links .subtle-link {
  color: var(--red);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
  padding: 0.2rem 0;
  min-height: 36px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.create-footer-links .subtle-link:hover {
  color: var(--red-hover);
}

.inline-join-drawer {
  margin-top: 0.6rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: #f4eedf;
  border: 1px solid #d9cbb0;
}

.inline-join-drawer label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.inline-join-drawer .input-row {
  margin-top: 0;
}

.inline-join-drawer input {
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
}

.inline-join-drawer .button {
  width: auto;
  min-height: 42px;
  padding: 0.45rem 0.9rem;
}

/* My calendars (hidden completely when user has none) */
.my-calendars-band {
  margin: 0.5rem 0 1.25rem;
}

.my-calendars-band .panel.mine {
  padding: 1rem 1.25rem;
}

@media (min-width: 920px) {
  .festive-hero {
    grid-template-columns: minmax(0, 1.18fr) minmax(355px, 0.82fr);
    gap: 1.75rem;
    padding: 1.35rem 0 1.2rem;
    align-items: start;
  }

  .festive-hero-right {
    position: sticky;
    top: 1rem;
  }
}

@media (max-width: 919px) {
  .festive-hero {
    gap: 1rem;
    padding: 1rem 0 1.25rem;
  }

  .festive-hero-left {
    display: contents;
  }

  .festive-hero-heading {
    order: 1;
  }

  .festive-hero-right {
    order: 2;
  }

  .hero-preview-wall {
    order: 3;
  }

  .hero-preview-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ── 24-Bulb Glowing Christmas String-Light Progress Bar ── */
.bulb-progress-bar {
  position: relative;
  margin: 0 0 0.85rem;
  padding: 0.35rem 0.65rem 0.45rem;
  border-radius: 14px;
  background: rgba(14, 7, 12, 0.34);
  border: 1px solid color-mix(in srgb, var(--board-accent, #f2bd78) 32%, transparent);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.bulb-garland-track {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 4px;
}

.bulb-wire-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 18px;
  color: var(--board-accent, #f2bd78);
  pointer-events: none;
}

.bulb-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  align-items: start;
  gap: 2px;
  padding-top: 6px;
}

.bulb-row[data-count="12"] {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.bulb-row[data-count="7"] {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.string-bulb {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.string-bulb:nth-child(2n) {
  margin-top: 3px;
}

.bulb-socket {
  width: 5px;
  height: 4px;
  border-radius: 1px 1px 0 0;
  background: #3d302c;
}

.bulb-glass {
  width: 10px;
  height: 13px;
  border-radius: 46% 46% 52% 52%;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.string-bulb.is-unlit .bulb-glass {
  background: radial-gradient(circle at 35% 32%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06) 55%, rgba(0, 0, 0, 0.35) 100%);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.string-bulb.is-lit.bulb-amber .bulb-glass {
  background: radial-gradient(circle at 38% 30%, #fff7d6, #ffd166 55%, #d68d1a 100%);
  box-shadow: 0 0 8px 2px rgba(255, 209, 102, 0.85), 0 0 16px 3px rgba(255, 193, 71, 0.42);
}

.string-bulb.is-lit.bulb-ruby .bulb-glass {
  background: radial-gradient(circle at 38% 30%, #ffe0e4, #ff6370 55%, #c22536 100%);
  box-shadow: 0 0 8px 2px rgba(255, 99, 112, 0.82), 0 0 16px 3px rgba(255, 89, 100, 0.4);
}

.string-bulb.is-lit.bulb-emerald .bulb-glass {
  background: radial-gradient(circle at 38% 30%, #e0ffef, #5be39b 55%, #1d8a52 100%);
  box-shadow: 0 0 8px 2px rgba(91, 227, 155, 0.8), 0 0 16px 3px rgba(76, 217, 140, 0.38);
}

.string-bulb.is-lit.bulb-ice .bulb-glass {
  background: radial-gradient(circle at 38% 30%, #eefaff, #7cd8ff 55%, #2b89ba 100%);
  box-shadow: 0 0 8px 2px rgba(124, 216, 255, 0.82), 0 0 16px 3px rgba(114, 214, 255, 0.38);
}

.string-bulb.is-lit.bulb-candle .bulb-glass {
  background: radial-gradient(circle at 38% 30%, #fff3d6, #ffb85c 55%, #c96f18 100%);
  box-shadow: 0 0 8px 2px rgba(255, 184, 92, 0.85), 0 0 16px 3px rgba(255, 165, 66, 0.42);
}

.string-bulb.bulb-just-lit .bulb-glass {
  animation: bulb-ignite 1.4s ease-out 1;
}

@keyframes bulb-ignite {
  0%   { transform: scale(0.7); filter: brightness(0.7); }
  35%  { transform: scale(1.48); filter: brightness(1.55); }
  100% { transform: scale(1); filter: brightness(1); }
}

.bulb-meta {
  flex: none;
  display: flex;
  align-items: center;
}

.bulb-status-text {
  font-size: 0.74rem;
  font-weight: 800;
  color: #fff8eb;
  background: rgba(20, 8, 14, 0.56);
  border: 1px solid color-mix(in srgb, var(--board-accent, #f2bd78) 52%, transparent);
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hero-preview-wall .bulb-progress-bar {
  margin-bottom: 0.55rem;
  padding: 0.25rem 0.45rem 0.32rem;
}

.hero-preview-wall .bulb-glass {
  width: 8px;
  height: 10px;
}

.hero-preview-wall .bulb-status-text {
  font-size: 0.68rem;
  padding: 0.16rem 0.42rem;
}

@media (max-width: 540px) {
  .bulb-progress-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
    padding: 0.3rem 0.45rem 0.4rem;
  }

  .bulb-row {
    grid-template-columns: repeat(24, minmax(0, 1fr));
    gap: 1px;
  }

  .bulb-row[data-count="12"] {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .bulb-row[data-count="7"] {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .bulb-socket {
    width: 4px;
    height: 3px;
  }

  .bulb-glass {
    width: 7px;
    height: 10px;
  }

  .bulb-meta {
    justify-content: flex-end;
  }
}

/* ── Tactile 3D SVG Christmas Gift-Box Doors, Empty Pockets & Opened Keepsake Cards ── */
.door-board {
  padding-bottom: clamp(1.3rem, 3.8vw, 2.25rem);
}

.board-evergreens {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36px;
  pointer-events: none;
  color: var(--board-accent, #f2bd78);
  z-index: 0;
}

.board-evergreens svg {
  display: block;
  width: 100%;
  height: 100%;
}

.doors,
.board-header,
.board-note,
.bulb-progress-bar {
  position: relative;
  z-index: 1;
}

.door {
  min-height: 98px;
  padding: 0.34rem 0.36rem;
  border-radius: 13px;
}

@media (min-width: 630px) {
  .door {
    min-height: 112px;
    padding: 0.38rem 0.4rem;
  }
}

/* State 1: Cozy dashed pocket for empty doors */
.door[data-visual-state="empty"] {
  display: grid;
  grid-template: 1fr auto / minmax(0, 1fr) auto;
  border: 1.5px dashed color-mix(in srgb, var(--board-accent, #f2bd78) 52%, transparent);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.22) 0%, rgba(255, 255, 255, 0.04) 100%),
              color-mix(in srgb, var(--door) 88%, #000);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.28), 0 1px 0 rgba(255, 255, 255, 0.08);
  color: var(--door-txt);
}

.door[data-visual-state="empty"]:hover {
  border-color: var(--board-accent, #f2bd78);
  background: color-mix(in srgb, var(--door-hover) 92%, #fff 8%);
}

.door-pocket-stitch {
  position: absolute;
  inset: 4px;
  border-radius: 9px;
  border: 1px dotted rgba(255, 245, 224, 0.16);
  pointer-events: none;
}

.door[data-visual-state="empty"] .door-state {
  opacity: 0.88;
  font-size: 0.72rem;
}

/* State 2: Wrapped / Ready 3D SVG Christmas Gift Box */
.door[data-visual-state="wrapped"],
.door[data-visual-state="ready"] {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.22rem;
  padding: 0.22rem 0.24rem 0.28rem;
  background: radial-gradient(ellipse at 50% 24%, rgba(255, 245, 220, 0.16), rgba(0, 0, 0, 0.18));
  border: 1px solid rgba(255, 232, 185, 0.34);
  box-shadow: 0 8px 16px -8px rgba(0, 0, 0, 0.55);
  color: #fffaf0;
}

.door[data-visual-state="wrapped"]:hover,
.door[data-visual-state="ready"]:hover {
  background: radial-gradient(ellipse at 50% 20%, rgba(255, 245, 220, 0.26), rgba(0, 0, 0, 0.14));
  transform: translateY(-3px);
}

.door[data-visual-state="ready"] {
  border-color: #ffe28a;
  box-shadow: 0 0 0 2px #ffd872, 0 0 20px -2px rgba(255, 214, 102, 0.75);
}

.gift-box-wrap {
  display: block;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
}

.gift-box-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 78px;
  filter: drop-shadow(0 4px 5px rgba(18, 6, 10, 0.34));
}

.gift-sender-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  width: 100%;
  padding: 0.14rem 0.3rem;
  border-radius: 7px;
  background: #fffaf0;
  color: #3c1b22;
  border: 1px solid rgba(112, 62, 42, 0.22);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  min-width: 0;
}

.gift-sender-pill .door-motif {
  padding-top: 0;
  font-size: 0.78rem;
  line-height: 1;
  flex: none;
  color: #3c1b22;
}

.gift-sender-pill .door-state {
  grid-column: auto;
  align-self: center;
  font-size: 0.71rem;
  font-weight: 800;
  line-height: 1.15;
  color: #3c1b22;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 480px) {
  .door-board {
    padding-inline: 0.68rem;
  }

  .doors {
    gap: 0.28rem;
  }

  .door[data-visual-state="wrapped"],
  .door[data-visual-state="ready"] {
    padding: 0.18rem 0.18rem 0.24rem;
  }

  .gift-sender-pill {
    padding: 0.1rem 0.16rem;
    gap: 0.12rem;
  }

  .gift-sender-pill .door-motif {
    font-size: 0.68rem;
  }

  .gift-sender-pill .door-state {
    font-size: 0.64rem;
    letter-spacing: -0.015em;
  }

  .door[data-visual-state="opened"] {
    padding: 0.26rem 0.28rem 0.3rem;
  }

  .opened-sender {
    font-size: 0.68rem;
    letter-spacing: -0.01em;
  }

  .door[data-visual-state="opened"] .door-state {
    font-size: 0.61rem;
  }
}

/* State 3: Opened warm keepsake message card */
.door[data-visual-state="opened"] {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.2rem;
  padding: 0.34rem 0.42rem 0.38rem;
  background: linear-gradient(180deg, #fffdf7 0%, #f8ebd4 100%);
  color: #3c2222;
  border: 1.5px solid #d4af7a;
  box-shadow: inset 0 1px 0 #ffffff, 0 6px 14px -8px rgba(32, 12, 18, 0.48);
  overflow: hidden;
}

.door[data-visual-state="opened"]:hover {
  background: linear-gradient(180deg, #ffffff 0%, #fbf0dd 100%);
}

.opened-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 16px;
  color: #9b6b43;
  pointer-events: none;
}

.opened-flap-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.opened-card-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  width: 100%;
  margin-top: 0.22rem;
}

.door[data-visual-state="opened"] .door-number {
  font-size: clamp(1.25rem, 2.3vw, 1.7rem);
  color: #7c2032;
}

.door[data-visual-state="opened"] .door-motif {
  padding-top: 0;
  font-size: clamp(0.95rem, 1.7vw, 1.25rem);
  color: #3c2222;
}

.opened-card-foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.06rem;
  width: 100%;
  min-width: 0;
}

.opened-sender {
  font-size: 0.76rem;
  font-weight: 800;
  color: #3c2222;
  line-height: 1.15;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.door[data-visual-state="opened"] .door-state {
  font-size: 0.67rem;
  font-weight: 750;
  color: #732034;
  line-height: 1.1;
}

/* Dynamic theme fallback support for future PR #33 8-theme Holiday Plus catalog */
.calendar-page[data-dynamic-theme="true"] {
  --board: var(--dyn-board, #4b1c2c);
  --door: color-mix(in srgb, var(--dyn-board, #4b1c2c) 82%, #ffffff);
  --door-hover: color-mix(in srgb, var(--dyn-board, #4b1c2c) 72%, #ffffff);
  --door-txt: var(--dyn-ink, #ffebce);
  --board-accent: var(--dyn-accent, #f2bd78);
  --filled: color-mix(in srgb, var(--dyn-ink, #ffebce) 88%, var(--dyn-accent, #f2bd78));
  --filled-ink: var(--dyn-board, #4b1c2c);
}

/* ── Dedicated Theme Wardrobe (Calendar View) ── */
.theme-wardrobe-section {
  margin-top: 0.9rem;
  background: linear-gradient(170deg, #fffdf8 0%, #faebd2 100%);
  border: 1px solid #dfc198;
}

.wardrobe-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.75rem;
}

.wardrobe-header h2 {
  font-size: var(--title-sm);
}

.wardrobe-header p {
  font-size: 0.84rem;
  color: var(--muted);
}

.wardrobe-group + .wardrobe-group {
  margin-top: 0.85rem;
}

.wardrobe-group-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.wardrobe-grid {
  display: grid;
  gap: 0.5rem;
}

.wardrobe-grid-free {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Responsive auto-fill grid: renders 3, 6, 8, or 12+ Holiday Plus themes cleanly! */
.wardrobe-grid-paid {
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
}

@media (max-width: 480px) {
  .wardrobe-grid-free {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

.wardrobe-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border-radius: 12px;
  border: 1.5px solid #d9bfa0;
  background: #fffdf8;
  color: var(--ink);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.wardrobe-card:hover {
  transform: translateY(-2px);
  border-color: var(--red);
  box-shadow: 0 8px 18px -12px rgba(73, 22, 36, 0.55);
}

.wardrobe-card[aria-pressed="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 2px var(--red);
}

.wardrobe-chip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.55rem;
  min-height: 46px;
  background: radial-gradient(circle at 80% 20%, color-mix(in srgb, var(--swatch-accent, #f2bd78) 28%, transparent), transparent 60%),
              var(--swatch-board, #491624);
  color: var(--swatch-ink, #fff3db);
}

.wardrobe-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.wardrobe-mini-dots {
  display: inline-flex;
  gap: 3px;
}

.wardrobe-mini-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--swatch-accent, #f2bd78);
  opacity: 0.9;
}

.wardrobe-mini-dots i:nth-child(2) {
  background: var(--swatch-ink, #fff3db);
  opacity: 0.78;
}

.wardrobe-mini-dots i:nth-child(3) {
  opacity: 0.55;
}

.wardrobe-meta {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.42rem 0.5rem 0.48rem;
}

.wardrobe-meta strong {
  font-size: 0.8rem;
  font-weight: 750;
  color: var(--ink);
  line-height: 1.2;
}

.wardrobe-badge {
  font-size: 0.7rem;
  font-weight: 750;
  color: var(--muted);
}

.wardrobe-card[data-locked="true"] .wardrobe-badge {
  color: #7c2032;
}

.wardrobe-card[aria-pressed="true"] .wardrobe-badge {
  color: var(--red);
}

.wardrobe-upgrade-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-top: 0.9rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: #fff9ee;
  border: 1px solid #d9b580;
}

.wardrobe-upgrade-bar p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink);
  flex: 1 1 16rem;
}

.wardrobe-upgrade-btn {
  flex: none;
  max-width: 100%;
  white-space: normal;
  text-align: center;
}

/* ── Single-Step Focus Mode (Post-Create & Post-Fill) ── */
.focus-step-card {
  margin: 0.85rem 0 1.05rem;
  padding: 1.15rem 1.35rem;
  border-radius: 18px;
  background: linear-gradient(165deg, #fffdf8 0%, #f9ebd2 100%);
  border: 1.5px solid #d9b37c;
  box-shadow: 0 14px 32px -20px rgba(73, 22, 36, 0.35);
}

.focus-step-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 0.75rem;
  margin-bottom: 0.35rem;
}

.focus-step-pill {
  margin: 0;
}

.focus-code-chip {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--red);
  background: #fffaf0;
  border: 1px dashed #c89f7c;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
}

.focus-step-title {
  font-size: clamp(1.65rem, 3.1vw, 2.25rem);
  line-height: 1.05;
  color: var(--ink);
  margin: 0.1rem 0 0.35rem;
}

.focus-step-desc {
  color: var(--muted);
  font-size: 0.93rem;
  max-width: 60ch;
  margin: 0 0 0.85rem;
}

.focus-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.focus-action-row .button {
  min-height: 45px;
  max-width: 100%;
  white-space: normal;
  text-align: center;
}

.focus-ext-slot:empty {
  display: none;
}

.focus-ext-slot:not(:empty) {
  margin-top: 0.75rem;
}

.focus-step-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid #e4cca9;
}

.focus-more-toggle,
.focus-wardrobe-shortcut {
  padding-inline: 0.25rem;
  min-height: 40px;
  max-width: 100%;
  white-space: normal;
  text-align: left;
  font-size: 0.86rem;
}

/* Hide redundant mobile plus strip when Theme Wardrobe is rendered directly under the board */
.calendar-board:has(#theme-wardrobe:not([hidden])) #mobile-plus {
  display: none !important;
}

/* Fold secondary panels cleanly while Focus Mode is collapsed */
.calendar-page[data-focus-collapsed="true"] .calendar-layout {
  grid-template-columns: minmax(0, 1fr);
}

.calendar-page[data-focus-collapsed="true"] .calendar-aside,
.calendar-page[data-focus-collapsed="true"] #theme-wardrobe,
.calendar-page[data-focus-collapsed="true"] #comments,
.calendar-page[data-focus-collapsed="true"] #mobile-plus,
.calendar-page[data-focus-collapsed="true"] #send-empty-invite,
.calendar-page[data-focus-collapsed="true"] #jump-share,
.calendar-page[data-focus-collapsed="true"] #leave-note,
.calendar-page[data-focus-collapsed="true"] #calendar-make-own {
  display: none !important;
}

/* ── Celebration Particle Burst (1.5–2s auto-cleaned) ── */
.festive-burst-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.festive-burst-layer.burst-in-dialog {
  position: absolute;
  inset: 0;
  z-index: 20;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}

.friend-reminder-panel .reminder-opt-in {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.festive-particle {
  position: absolute;
  left: var(--burst-x, 50%);
  top: var(--burst-y, 38%);
  font-size: 1.05rem;
  line-height: 1;
  font-weight: 700;
  opacity: 0;
  will-change: transform, opacity;
  animation: particle-pop var(--dur, 1650ms) cubic-bezier(0.16, 0.82, 0.28, 1) var(--delay, 0ms) forwards;
}

.festive-particle.tone-gold    { color: #f5b942; text-shadow: 0 0 8px rgba(245, 185, 66, 0.75); }
.festive-particle.tone-crimson { color: #c9334b; text-shadow: 0 0 6px rgba(201, 51, 75, 0.55); }
.festive-particle.tone-pine    { color: #2b8a5b; text-shadow: 0 0 6px rgba(43, 138, 91, 0.5); }
.festive-particle.tone-cream   { color: #fff4d6; text-shadow: 0 0 8px rgba(255, 224, 140, 0.9); }
.festive-particle.tone-ice     { color: #67c4f0; text-shadow: 0 0 8px rgba(103, 196, 240, 0.75); }

@keyframes particle-pop {
  0% {
    opacity: 0;
    transform: translate3d(-50%, -50%, 0) scale(0.4) rotate(0deg);
  }
  14% {
    opacity: 1;
    transform: translate3d(calc(-50% + var(--dx) * 0.38), calc(-50% + var(--dy) * 0.38), 0) scale(1.18) rotate(calc(var(--rot) * 0.35));
  }
  75% {
    opacity: 0.92;
    transform: translate3d(calc(-50% + var(--dx) * 0.94), calc(-50% + var(--dy) * 0.94 + 18px), 0) scale(0.95) rotate(calc(var(--rot) * 0.85));
  }
  100% {
    opacity: 0;
    transform: translate3d(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 46px), 0) scale(0.55) rotate(var(--rot));
  }
}

/* ── Reduced Motion Guarantee ── */
@media (prefers-reduced-motion: reduce) {
  .festive-snow,
  .festive-burst-layer {
    display: none !important;
  }

  .garland-bulb,
  .string-bulb.bulb-just-lit .bulb-glass,
  .festive-particle {
    animation: none !important;
  }

  .wardrobe-card:hover,
  .door[data-visual-state="wrapped"]:hover,
  .door[data-visual-state="ready"]:hover {
    transform: none !important;
  }
}
