/* Kris Kringle generator */
#tet-kris-kringle { --kk-red: #C8433A; --kk-red-dark: #9E3029; position: relative; }

.kk-intro { text-align: center; margin-bottom: 18px; }
.kk-count { font-size: 14px; font-weight: 600; color: var(--c-accent); }

/* Shaking the hat overlay */
.kk-shake { position: fixed; inset: 0; z-index: 99999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(250, 247, 242, .96); }
.kk-shake-emoji { font-size: 84px; animation: kk-shake .35s ease-in-out infinite alternate; }
.kk-shake p { font-size: 20px; font-weight: 700; color: var(--c-ink); }
@keyframes kk-shake { from { transform: rotate(-14deg) translateY(0); } to { transform: rotate(14deg) translateY(-8px); } }

/* Results list */
.kk-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.kk-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--c-line); }
.kk-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--c-line); }
.kk-item-name { font-weight: 700; color: var(--c-ink); font-size: 16px; display: flex; align-items: center; gap: 8px; }
.kk-item-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.kk-sent { background: var(--c-sage); color: var(--c-hover); }
.kk-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* Pass the phone */
.kk-names { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.kk-name-btn { min-height: 60px; border-radius: 14px; font-size: 17px; }
.kk-name-btn[disabled] { opacity: .55; cursor: default; border-color: var(--c-line); color: var(--c-text); }

/* Reveal */
.kk-reveal { text-align: center; padding: 28px 20px 24px; background: var(--c-white); border: 1px solid var(--c-line); border-radius: 20px; overflow: hidden; }
.kk-hello { font-size: 28px; margin-bottom: 2px; }
.kk-tap { font-size: 16px; margin-bottom: 0; }

.kk-gift { position: relative; display: block; width: 170px; height: 170px; margin: 26px auto 18px; padding: 0; border: 0; background: none; cursor: pointer; animation: kk-wiggle 2.4s ease-in-out infinite; -webkit-tap-highlight-color: transparent; }
.kk-gift:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 6px; border-radius: 12px; }
.kk-box { position: absolute; left: 14px; right: 14px; bottom: 0; height: 108px; background: var(--kk-red); border-radius: 8px; transition: transform .5s, opacity .5s; }
.kk-box::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 22px; margin-left: -11px; background: var(--c-wattle); }
.kk-lid { position: absolute; left: 4px; right: 4px; top: 34px; height: 36px; background: var(--kk-red-dark); border-radius: 8px; transition: transform .6s cubic-bezier(.3,1.6,.5,1), opacity .6s; z-index: 2; }
.kk-lid::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 22px; margin-left: -11px; background: var(--c-wattle); }
.kk-bow { position: absolute; left: 50%; top: -28px; width: 0; height: 0; }
.kk-bow::before, .kk-bow::after { content: ""; position: absolute; top: 0; width: 38px; height: 30px; border: 8px solid var(--c-wattle); border-radius: 50% 50% 50% 50%; }
.kk-bow::before { right: 0; transform: rotate(-20deg); }
.kk-bow::after { left: 0; transform: rotate(20deg); }
@keyframes kk-wiggle { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(-6deg); } 80% { transform: rotate(6deg); } 85% { transform: rotate(-4deg); } 90% { transform: rotate(3deg); } }

.kk-reveal.is-open .kk-gift { animation: none; cursor: default; }
.kk-reveal.is-open .kk-lid { transform: translateY(-110px) rotate(-28deg); opacity: 0; }
.kk-reveal.is-open .kk-box { transform: scale(.6) translateY(40px); opacity: 0; }

.kk-result { display: none; }
.kk-reveal.is-open .kk-result { display: block; animation: kk-pop .5s .25s both cubic-bezier(.3,1.6,.5,1); }
.kk-reveal.is-open .kk-tap { display: none; }
.kk-reveal.is-open .kk-gift { height: 0; margin: 0; }
@keyframes kk-pop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
.kk-buying { font-size: 16px; margin: 6px 0 0; }
.kk-match { font-size: clamp(40px, 9vw, 64px); font-weight: 800; line-height: 1.05; color: var(--c-accent); margin: 4px 0 16px; word-break: break-word; }
.kk-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 14px; }
.kk-fact { padding: 6px 14px; border-radius: 999px; background: var(--c-sand); border: 1px solid var(--c-line); font-size: 15px; color: var(--c-ink); }
.kk-note { background: var(--c-sand); border-radius: 12px; padding: 12px 16px; font-size: 15px; margin: 0 auto 14px; max-width: 460px; white-space: pre-wrap; }
.kk-idea { min-height: 28px; font-size: 17px; font-weight: 600; color: var(--c-ink); margin: 10px 0 4px; }
.kk-reveal-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.kk-own { margin-top: 18px; font-size: 14px; }
.kk-own a { color: var(--c-accent); font-weight: 600; }

/* Confetti */
.kk-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 99998; overflow: hidden; }
.kk-confetti i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px; animation: kk-fall linear forwards; }
@keyframes kk-fall { to { transform: translateY(110vh) rotate(720deg); } }

@media (prefers-reduced-motion: reduce) {
	.kk-gift, .kk-shake-emoji { animation: none; }
	.kk-lid, .kk-box { transition: none; }
}
@media (max-width: 600px) {
	.tet-panel { padding: 18px; }
	.kk-item-actions { width: 100%; }
	.kk-item-actions .tet-btn { flex: 1; }
}
