.ap-root { position: relative; }
.ap-defs-svg { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.ap-sync-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; margin-bottom: 14px; background: #fff8e6;
  border: 1px solid #d69e2e; border-radius: 12px; font-size: 14px; font-weight: 600; color: #241914;
}
.ap-sync-banner[hidden], [hidden] { display: none !important; }
.ap-alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.ap-alert-err { background: #fdecec; border: 1px solid #e5a0a6; color: #8c1c25; }
.ap-alert-ok { background: #eaf7f1; border: 1px solid #8fd1b5; color: #165941; }

.ap-stage {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 46px 22px 24px;
  color: #fffdf7;
  background: radial-gradient(circle at 18% 12%, #5e2236 0%, #341621 52%, #1a2c25 100%);
  box-shadow: 0 16px 40px rgba(28, 16, 14, .22);
  transition: background .35s ease;
}
.ap-stage[data-scene="candy-shop"] { background: radial-gradient(circle at 20% 10%, #8f2d56 0%, #571936 55%, #164843 100%); }
.ap-stage[data-scene="starlit-velvet"] { background: radial-gradient(circle at 22% 10%, #24386e 0%, #111936 56%, #0b1021 100%); }
.ap-stage[data-scene="cozy-cocoa"] { background: radial-gradient(circle at 18% 14%, #6a3824 0%, #3a1f15 56%, #231610 100%); }
.ap-stage[data-scene="frosted-mint"] { background: radial-gradient(circle at 20% 10%, #1e5f58 0%, #123b37 56%, #13252a 100%); }

.ap-garland { position: absolute; top: 0; left: 0; width: 100%; height: 42px; pointer-events: none; z-index: 2; }
.ap-bulb { animation: ap-glow 2.4s ease-in-out infinite alternate; }
.ap-bulb-2 { animation-delay: .8s; }
.ap-bulb-3 { animation-delay: 1.5s; }
@keyframes ap-glow { from { opacity: .65; } to { opacity: 1; } }

.ap-snow {
  position: absolute; inset: 0; pointer-events: none; z-index: 1; opacity: .35;
  background-image:
    radial-gradient(2px 2px at 24px 36px, #fff 90%, transparent),
    radial-gradient(2px 2px at 140px 90px, #ffeaa7 90%, transparent),
    radial-gradient(1.5px 1.5px at 260px 55px, #fff 90%, transparent),
    radial-gradient(2px 2px at 380px 140px, #fff 90%, transparent);
  background-size: 420px 220px;
  animation: ap-drift 18s linear infinite;
}
@keyframes ap-drift { from { background-position: 0 0; } to { background-position: 80px 220px; } }
@media (prefers-reduced-motion: reduce) { .ap-snow, .ap-bulb { animation: none !important; } }

.ap-stage-grid { position: relative; z-index: 3; display: grid; grid-template-columns: 1.72fr 1fr; gap: 20px; align-items: start; }

.ap-cabinet {
  background: #fbf5ea; color: #241914; border-radius: 18px; padding: 18px;
  border: 2px solid rgba(255, 240, 205, .65);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .24), inset 0 0 0 4px #f2e5cf;
}
.ap-stage[data-scene="starlit-velvet"] .ap-cabinet {
  background: #17213b; color: #f8f3e6; border-color: rgba(214, 158, 46, .55); box-shadow: 0 12px 28px rgba(0,0,0,.35), inset 0 0 0 4px #223055;
}
.ap-cab-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.ap-cab-title { font-family: var(--font-display, Georgia, serif); font-size: 26px; margin: 0; line-height: 1.15; }
.ap-cab-sub { font-size: 13px; opacity: .78; margin: 2px 0 0; font-weight: 600; }
.ap-cab-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ap-cab-pill { padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #c8323e; color: #fff; white-space: nowrap; }
.ap-stars-pill { padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #fff3d6; color: #5c3d04; border: 1px solid #d69e2e; white-space: nowrap; }
.ap-sfx-btn { min-height: 32px; padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(128,128,128,.35); background: rgba(255,255,255,.85); color: #241914; font-size: 12px; font-weight: 700; cursor: pointer; }
.ap-countdown-pill { padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #1d6f52; color: #fff; font-variant-numeric: tabular-nums; }
.ap-preview-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; border-radius: 10px; margin-bottom: 10px;
  background: #fff3d6; color: #4a3106; border: 1px solid #e4bc5a; font-size: 13px; font-weight: 600;
}
.ap-elves-bar { padding: 7px 12px; border-radius: 10px; margin-bottom: 10px; background: rgba(29, 111, 82, .11); border: 1px solid rgba(29, 111, 82, .28); font-size: 13px; font-weight: 700; }
.ap-prompt-bar { padding: 9px 12px; border-radius: 10px; margin-bottom: 10px; background: rgba(214, 158, 46, .14); border: 1px dashed rgba(214, 158, 46, .65); font-size: 13px; font-weight: 600; }

.ap-door-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; perspective: 1100px; }
.ap-door { position: relative; border: 0; padding: 0; background: transparent; cursor: pointer; font-family: inherit; border-radius: 12px; min-height: 116px; }
.ap-door-shutter {
  position: relative; width: 100%; height: 100%; min-height: 116px; border-radius: 12px; overflow: hidden;
  transform-origin: left center; transition: transform .42s cubic-bezier(.22, .8, .35, 1), box-shadow .2s ease;
  box-shadow: 0 3px 8px rgba(36, 25, 20, .14);
}
.ap-door:hover .ap-door-shutter { transform: translateY(-2px) rotateY(-8deg); box-shadow: 0 8px 18px rgba(36, 25, 20, .24); }
.ap-door.is-swinging .ap-door-shutter { transform: rotateY(-108deg); }
.ap-door[data-state="ready"] .ap-door-shutter { box-shadow: 0 0 0 2px #f6c954, 0 6px 18px rgba(214, 158, 46, .45); }
.ap-door[data-foil="1"] .ap-door-shutter { box-shadow: 0 0 0 2px #ffe082, 0 8px 20px rgba(214, 158, 46, .52); }
.ap-door-svg { width: 100%; height: 100%; display: block; }
.ap-door-cap {
  position: absolute; left: 6px; right: 6px; bottom: 5px; padding: 2px 6px; border-radius: 999px;
  font-size: 11px; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(255, 253, 246, .92); color: #241914;
}
.ap-door[data-state="empty"] .ap-door-cap { background: transparent; color: #7b6658; }
.ap-stage[data-scene="starlit-velvet"] .ap-door[data-state="empty"] .ap-door-cap { color: #b7c4df; }
.ap-door[data-state="ready"] .ap-door-cap { background: #d69e2e; color: #241914; }
.ap-door-stack { position: absolute; top: 6px; right: 6px; padding: 2px 6px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #241914; color: #fff; }

.ap-side { background: #ffffff; color: #241914; border-radius: 18px; padding: 20px; box-shadow: 0 12px 28px rgba(0, 0, 0, .22); }
.ap-side-head { margin-bottom: 14px; }
.ap-side-h2 { font-family: var(--font-display, Georgia, serif); font-size: 24px; margin: 0 0 4px; color: #241914; }
.ap-side-sub { font-size: 13px; color: #6e5c52; margin: 0; font-weight: 600; }

.ap-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.ap-label { font-size: 13px; font-weight: 700; color: #241914; }
.ap-hint { font-size: 12px; color: #6e5c52; font-weight: 500; }
.ap-input, .ap-textarea {
  width: 100%; padding: 11px 13px; min-height: 44px; border: 1px solid #e0d2be; border-radius: 12px;
  background: #fbf6ee; color: #241914; font-family: inherit; font-size: 15px;
}
.ap-textarea { min-height: 90px; resize: vertical; }
.ap-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ap-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-pill {
  min-height: 44px; padding: 8px 12px; border: 1px solid #e0d2be; border-radius: 10px;
  background: #fbf6ee; color: #241914; font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.ap-pill[aria-pressed="true"] { background: #c8323e; border-color: #c8323e; color: #fff; }

.ap-theme-swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ap-swatch {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; min-height: 44px;
  border: 2px solid #e0d2be; border-radius: 10px; background: #fff; cursor: pointer; font-size: 11px; font-weight: 700; color: #241914;
}
.ap-swatch[aria-pressed="true"] { border-color: #c8323e; background: #fff6f7; }
.ap-swatch-dot { width: 24px; height: 24px; border-radius: 7px; border: 1px solid rgba(0,0,0,.12); }

.ap-opts-details { margin: 12px 0 14px; border: 1px solid #e6d9c6; border-radius: 12px; padding: 10px 12px; background: #fbf6ee; }
.ap-opts-details summary { cursor: pointer; font-size: 13px; font-weight: 700; color: #241914; }
.ap-opts-body { margin-top: 12px; }
.ap-chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ap-chip { padding: 5px 10px; border-radius: 999px; border: 1px solid #e0d2be; background: #fff; font-size: 12px; font-weight: 600; color: #241914; cursor: pointer; }

.ap-code-join { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: #fbf6ee; border: 1px solid #e6d9c6; }
.ap-link-box { display: flex; gap: 6px; margin: 6px 0 8px; }
.ap-link-input { flex: 1; min-width: 0; padding: 9px 10px; border: 1px solid #d9c8b0; border-radius: 10px; background: #fff; font-size: 13px; color: #241914; font-family: ui-monospace, monospace; }

.ap-my-box { margin-top: 14px; padding-top: 12px; border-top: 1px solid #ece0cf; }
.ap-my-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.ap-my-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 10px; background: #fbf6ee; border: 1px solid #e6d9c6; }
.ap-my-item strong { font-size: 14px; display: block; }
.ap-my-meta { font-size: 12px; color: #6e5c52; }

.ap-progress-wrap { margin-bottom: 12px; }
.ap-progress-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.ap-progress-track { height: 10px; border-radius: 999px; background: #efe4d3; overflow: hidden; }
.ap-progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, #c8323e, #d69e2e); transition: width .3s ease; }

.ap-share-hub { background: #fbf6ee; border: 1px solid #e6d9c6; border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.ap-code-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px; background: #fff; border: 1px dashed #d69e2e; margin-bottom: 10px; }
.ap-share-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 10px; }
.ap-share-tile {
  min-height: 44px; padding: 8px 8px; border-radius: 10px; border: 1px solid #dfd0ba;
  background: #fff; color: #241914; font-family: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer; text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
}
.ap-share-tile:hover { border-color: #c8323e; background: #fff6f7; text-decoration: none; }
.ap-plat-wa { border-left: 4px solid #25D366; }
.ap-plat-sms { border-left: 4px solid #34C759; }
.ap-plat-tg { border-left: 4px solid #229ED9; }
.ap-plat-fb { border-left: 4px solid #1877F2; }
.ap-plat-x { border-left: 4px solid #111111; }
.ap-plat-rd { border-left: 4px solid #FF4500; }
.ap-plat-pin { border-left: 4px solid #E60023; }
.ap-plat-mail { border-left: 4px solid #d69e2e; }

.ap-story-cta {
  width: 100%; min-height: 46px; border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, #1d6f52, #268a66); color: #fff;
  font-family: inherit; font-size: 14px; font-weight: 700; margin-bottom: 8px;
}
.ap-cal-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ap-games-nudge {
  display: block; text-align: center; margin-top: 10px; padding: 10px 12px; border-radius: 12px;
  background: #f5ecde; border: 1px solid #dfd0ba; color: #241914; font-size: 13px; font-weight: 700; text-decoration: none;
}
.ap-games-nudge:hover { border-color: #c8323e; text-decoration: none; }
.ap-viral-card { padding: 12px; border-radius: 12px; background: #fff3d6; border: 1px solid #e2bc5c; margin-top: 12px; }
.ap-code-pill { display: inline-block; padding: 6px 10px; border-radius: 8px; background: #f5ecde; font-family: ui-monospace, monospace; font-size: 13px; font-weight: 700; }

.ap-modal-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(20, 14, 11, .68); display: flex; align-items: center; justify-content: center; padding: 16px; }
.ap-modal { position: relative; width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto; background: #fff; color: #241914; border-radius: 18px; padding: 22px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.ap-modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.ap-modal-title { font-family: var(--font-display, Georgia, serif); font-size: 24px; margin: 0; }
.ap-close-btn { min-width: 44px; min-height: 44px; border-radius: 12px; border: 1px solid #e6d9c6; background: #fbf6ee; color: #241914; font-size: 20px; cursor: pointer; }
.ap-sticker-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.ap-sticker-btn { min-height: 44px; padding: 6px; border: 2px solid #e6d9c6; border-radius: 12px; background: #fbf6ee; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ap-sticker-btn[aria-pressed="true"] { border-color: #c8323e; background: #fff; }
.ap-wrap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ap-wrap-btn { min-height: 44px; padding: 6px 8px; border-radius: 12px; border: 2px solid #e6d9c6; cursor: pointer; font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.55); }
.ap-wrap-btn[aria-pressed="true"] { border-color: #241914; box-shadow: 0 0 0 2px #d69e2e; }
.ap-wrap-btn[data-wrap-foil="1"] { border-color: #d69e2e; }

.ap-wax-stage { text-align: center; padding: 24px 16px; border-radius: 16px; background: linear-gradient(145deg, #fbf5ea, #f2e4cc); border: 2px dashed #d69e2e; }
.ap-wax-btn {
  margin: 16px auto 8px; width: 112px; height: 112px; border-radius: 999px; border: 4px solid #fff3c4;
  background: radial-gradient(circle at 35% 30%, #e44a58, #9e1b27); color: #fff;
  font-family: var(--font-display, Georgia, serif); font-size: 18px; font-weight: 700; cursor: pointer;
  box-shadow: 0 10px 24px rgba(158, 27, 39, .38); transition: transform .15s ease;
}
.ap-wax-btn:hover { transform: scale(1.06); }

.ap-reveal-card { border-radius: 16px; padding: 18px; background: #fbf6ee; border: 2px solid #e6d9c6; margin-bottom: 12px; }
.ap-reveal-card[data-wrap="crimson"] { border-color: #c8323e; background: #fff5f6; }
.ap-reveal-card[data-wrap="pine"] { border-color: #1d6f52; background: #f2fbf7; }
.ap-reveal-card[data-wrap="gold"], .ap-reveal-card[data-wrap="gold-foil"] { border-color: #d69e2e; background: #fffaf0; }
.ap-reveal-card[data-wrap="plum"], .ap-reveal-card[data-wrap="aurora-foil"] { border-color: #6b3fa0; background: #f9f5ff; }
.ap-reveal-card[data-wrap="navy"], .ap-reveal-card[data-wrap="holo-foil"] { border-color: #273454; background: #f4f7fc; }
.ap-kind-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #241914; color: #fff; font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.ap-reveal-msg { font-size: 18px; line-height: 1.5; margin: 0 0 12px; white-space: pre-wrap; }
.ap-reveal-extra { padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px dashed #d69e2e; font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.ap-reveal-from { font-size: 14px; font-weight: 700; color: #6e5c52; }
.ap-rx-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.ap-rx-btn { min-height: 44px; padding: 6px 12px; border-radius: 999px; border: 1px solid #e6d9c6; background: #fff; cursor: pointer; font-size: 14px; font-weight: 700; }
.ap-rx-btn[aria-pressed="true"] { border-color: #c8323e; background: #fdecec; }
.ap-reveal-share-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(0,0,0,.08); }
.ap-qr-img { width: 220px; height: 220px; margin: 8px auto 14px; display: block; border-radius: 14px; border: 2px solid #e6d9c6; background: #fff; padding: 10px; }
.ap-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 120; }
.ap-story-preview { width: 100%; max-width: 260px; margin: 0 auto 14px; border-radius: 14px; border: 1px solid #e6d9c6; display: block; }
.ap-cta-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ap-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 130;
  padding: 11px 20px; border-radius: 999px; background: #241914; color: #fffdf7;
  font-size: 14px; font-weight: 700; box-shadow: 0 10px 28px rgba(0,0,0,.32);
}

@media (max-width: 960px) { .ap-stage-grid { grid-template-columns: 1fr; } .ap-door-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px) {
  .ap-stage { padding: 38px 12px 16px; border-radius: 16px; }
  .ap-cabinet, .ap-side, .ap-modal { padding: 14px; }
  .ap-door-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .ap-door, .ap-door-shutter { min-height: 104px; }
  .ap-row-2, .ap-cal-row { grid-template-columns: 1fr; }
  .ap-sticker-grid { grid-template-columns: repeat(4, 1fr); }
  .ap-wrap-grid { grid-template-columns: repeat(3, 1fr); }
  .ap-share-grid { grid-template-columns: repeat(2, 1fr); }
  .ap-theme-swatches { grid-template-columns: repeat(5, 1fr); }
  .ap-cta-row button, .ap-cta-row a { width: 100%; }
}
