/* mysanta: slice 6 (reveal + my santa). */

/* ---- reveal ---- */
.reveal { min-height: 70vh; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.reveal-wait { font-size: 28px; color: var(--soft); }
.reveal-sub { color: var(--soft); }
.reveal-back { color: var(--red); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }

.paper-ball {
  width: 120px; height: 120px; border: 0; padding: 0; cursor: pointer;
  border-radius: 46% 54% 50% 50% / 52% 46% 54% 48%;
  background: conic-gradient(from 20deg at 40% 40%, #fffaf0, #e9e1d2, #fffaf0, #d9cfbd, #fffaf0, #e9e1d2, #f6efe0, #d9cfbd, #fffaf0);
  box-shadow: inset -10px -12px 20px oklch(0.7 0.03 70 / 0.5), 0 14px 16px -8px oklch(0.3 0.03 50 / 0.4);
  animation: ball-wobble 0.6s ease-in-out infinite alternate;
}
@keyframes ball-wobble { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }

.reveal .note {
  position: absolute; left: 50%; top: 18%; width: 100%; max-width: 330px;
  padding: 34px 26px 40px; text-align: center; overflow: hidden;
  background-color: var(--tag);
  background-image: repeating-linear-gradient(transparent 0 33px, oklch(0.82 0.05 240 / 0.55) 33px 34px);
  box-shadow: 0 14px 22px -10px oklch(0.3 0.03 50 / 0.45);
  opacity: 0; pointer-events: none;
  transform: translateX(-50%) scale(0.1) rotate(200deg) skewX(30deg);
  clip-path: inset(38% 38% 38% 38% round 50%);
}
.note-lead { color: var(--soft); margin-top: 6px; }
.note-name { font-size: 64px; line-height: 1.05; color: oklch(0.3 0.08 255); overflow-wrap: anywhere; margin-top: 6px; }
.crease { position: absolute; left: -10%; right: -10%; height: 2px; background: oklch(0.6 0.03 70 / 0.5); box-shadow: 0 1px 0 #fff8; }
.crease.c1 { top: 22%; transform: rotate(-8deg); }
.crease.c2 { top: 55%; transform: rotate(5deg); }
.crease.c3 { top: 80%; transform: rotate(-3deg); }

.reveal-after { position: absolute; left: 0; right: 0; bottom: 0; opacity: 0; pointer-events: none; display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.reveal-shh { color: var(--soft); font-family: var(--hand); font-size: 26px; }

.reveal.open .paper-ball { animation: ball-pop 0.35s ease-in forwards; pointer-events: none; }
.reveal.open .note { animation: note-open 1.1s cubic-bezier(.2,.8,.2,1) 0.2s forwards; pointer-events: auto; }
.reveal.open .crease { animation: crease-fade 1.4s ease-out 1s forwards; }
.reveal.open .reveal-after { animation: fade-in 0.5s ease 1.3s forwards; pointer-events: auto; }
@keyframes ball-pop { to { transform: scale(0.2); opacity: 0; } }
@keyframes note-open {
  60% { opacity: 1; transform: translateX(-50%) scale(1.04) rotate(-4deg) skewX(-3deg); clip-path: inset(0 0 0 0 round 6px); }
  to { opacity: 1; transform: translateX(-50%) scale(1) rotate(-2deg) skewX(0); clip-path: inset(0 0 0 0 round 4px); }
}
@keyframes crease-fade { to { opacity: 0; } }
@keyframes fade-in { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .paper-ball { animation: none; }
  .reveal.open .paper-ball { animation: none; opacity: 0; }
  .reveal .note { transform: translateX(-50%) rotate(-2deg); clip-path: none; }
  .reveal.open .note { animation: fade-in 0.4s ease forwards; }
  .reveal.open .crease { animation: none; opacity: 0; }
  .reveal.open .reveal-after { animation: fade-in 0.4s ease 0.3s forwards; }
}

/* ---- my santa ---- */
.ms { margin: -64px -20px 0; }
.ms-head { position: relative; padding: 84px 20px 28px 26px; display: flex; align-items: center; gap: 12px; }
.ms-tag { flex: 1; min-width: 0; transform: rotate(-2deg); }
.ms-tag .tag { padding: 14px 16px 16px 52px; }
.ms-name { font-size: 40px; line-height: 1.05; margin-top: 2px; color: oklch(0.3 0.08 255); overflow-wrap: anywhere; }
.ms-name.scribbled { letter-spacing: 0.2em; color: var(--soft); text-decoration: line-through wavy var(--red); text-decoration-thickness: 2px; }
.ms-hide {
  flex: none; min-height: 44px; min-width: 64px; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--tag); color: var(--ink); font-weight: 600; cursor: pointer;
  box-shadow: 0 3px 0 oklch(0.8 0.03 75), 0 8px 10px -6px #0006;
}

.ms-details { margin: 20px 20px 0; }
.ms-plan {
  margin: 20px 20px 0; padding: 16px 16px 12px; background: var(--tag);
  box-shadow: 0 10px 18px -10px oklch(0.3 0.03 50 / 0.4); transform: rotate(0.4deg);
}
.plan-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.plan-priv { font-size: 13px; color: var(--soft); }
.plan-list { list-style: none; margin: 0; padding: 0; }
.plan-row { display: flex; align-items: center; gap: 4px; min-height: 46px; border-bottom: 1px solid oklch(0.82 0.05 240 / 0.6); }
.plan-check { position: relative; width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.plan-check input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.plan-check .box { width: 24px; height: 24px; border: 2px solid var(--ink); border-radius: 5px; background: #fff; display: block; }
.plan-check input:checked + .box { background: var(--pine); border-color: var(--pine); }
.plan-check input:checked + .box::after { content: "✓"; color: #fff; display: block; text-align: center; font-size: 16px; line-height: 20px; }
.plan-check input:focus-visible + .box { outline: 3px solid var(--gold); outline-offset: 2px; }
.plan-text { flex: 1; min-width: 0; font-size: 26px; line-height: 1.1; overflow-wrap: anywhere; }
.plan-row.done .plan-text { text-decoration: line-through; color: var(--soft); }
.plan-x { flex: none; width: 44px; height: 44px; border: 0; background: none; color: var(--soft); font-size: 24px; cursor: pointer; }
.plan-add { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.plan-input { flex: 1; min-width: 0; min-height: 44px; border: 0; border-bottom: 2px dashed var(--kraft-dark); background: transparent; font-size: 24px; padding: 0 4px; }
.plan-input:focus { outline: none; border-bottom-color: var(--red); }
.plan-plus { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--red); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; box-shadow: 0 3px 0 var(--red-dark); }
.plan-plus:disabled { opacity: 0.5; }
.ms-hidden { text-align: center; color: var(--soft); font-family: var(--hand); font-size: 26px; padding: 22px 0; }

#notes-mount { margin: 22px 20px 0; }
@media (prefers-reduced-motion: reduce) { .ms-plan, .ms-tag { transform: none; } }

/* organiser: quiet reshuffle link + inline confirm tag */
.ms-members { margin: 18px 20px 0; }
.ms-members[hidden] { display: none; }
.ms-reshuffle { margin: 4px 20px 0; }
.ms-reshuffle[hidden] { display: none; }
.ms-rs-link {
  min-height: 44px; padding: 0 2px; border: 0; background: none; cursor: pointer;
  color: var(--soft); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
.ms-rs-tag { margin-top: 10px; transform: rotate(-0.8deg); }
.ms-rs-card { padding: 16px 18px 18px 52px; display: flex; flex-direction: column; gap: 6px; }
.ms-rs-text { font-size: 24px; line-height: 1.15; color: oklch(0.3 0.08 255); }
.ms-rs-err { color: var(--red-dark); font-size: 14px; }
.ms-rs-actions { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.ms-rs-cancel { min-height: 44px; padding: 0 8px; border: 0; background: none; color: var(--soft); font-weight: 600; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .ms-rs-tag { transform: none; } }

/* tabs: Plan | Notes | In the box (distinct from the notes' own smaller segmented switch) */
.ms-tabs { display: flex; gap: 6px; margin: 22px 20px 0; padding: 0 2px; border-bottom: 3px solid var(--kraft-deep); }
.ms-tab {
  position: relative; flex: 1; min-height: 48px; padding: 0 8px; border: 0;
  border-radius: 12px 12px 0 0; background: var(--kraft-dark); color: var(--kraft-deep);
  font: 600 15px/1.1 var(--body); cursor: pointer; margin-bottom: -3px;
  box-shadow: inset 0 -6px 8px -6px #0003;
}
.ms-tab.is-on {
  background: var(--tag); color: var(--ink); border: 3px solid var(--kraft-deep); border-bottom-color: var(--tag);
  box-shadow: none; font-family: var(--serif); font-weight: 400; font-size: 16px;
}
.ms-dot { position: absolute; top: 8px; right: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--kraft-dark); }
.ms-dot[hidden], .ms-panel[hidden] { display: none; }
#notes-mount { margin-top: 18px; }

/* tree leaderboard */
/* leaderboard game switch + the Games cards */
.ms-games-h { margin-top: 20px; }
.ms-games { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
@media (max-width: 340px) { .ms-games { grid-template-columns: 1fr; } }
.ms-game {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 96px; padding: 12px 8px 10px; cursor: pointer;
  border: 2px solid var(--kraft); border-radius: 16px; background: var(--tag); color: var(--ink); text-align: center;
  box-shadow: 0 3px 0 var(--kraft-dark);
}
.ms-game:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--kraft-dark); }
.ms-game-emoji { font-size: 30px; line-height: 1.1; }
.ms-game-title { font: 400 17px/1.15 var(--serif); }
.ms-game-best { font-size: 13px; font-weight: 600; color: var(--soft); }
.ms-tree .ms-game-title { color: var(--red); }
.ms-members { padding-bottom: 28px; }

/* share leaderboard: secondary action under "Decorate your tree", plus its toast */
.ms-toast { position: fixed; left: 50%; bottom: 64px; transform: translateX(-50%); z-index: 50; white-space: nowrap; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 999px; background: var(--ink); color: var(--tag); font-size: 15px; font-weight: 600; box-shadow: 0 8px 20px -8px #0008; }
.ms-toast a { color: var(--gold); }
