/* Secret Santa - Nordic paper-cut: forest night, cream paper, cranberry foil. */

.ss {
    --ss-bg1: #0e2a24; --ss-bg2: #07161a; --ss-paper: #f6efe2; --ss-ink: #f6efe2; --ss-dim: rgba(246, 239, 226, .76);
    --ss-gold: #e8b04a; --ss-cran: #b5263b; --ss-line: rgba(232, 176, 74, .25);
    position: relative;
    background: radial-gradient(120% 90% at 30% 15%, var(--ss-bg1) 0%, var(--ss-bg2) 100%);
    color: var(--ss-ink);
    overflow: hidden;
    isolation: isolate;
}
/* a row of paper hills along the bottom edge - CSS only */
.ss::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 70px; z-index: -1; pointer-events: none;
    background:
        radial-gradient(60% 120% at 20% 100%, #235747 60%, transparent 61%),
        radial-gradient(55% 110% at 75% 100%, #2c6a56 60%, transparent 61%),
        radial-gradient(80% 90% at 50% 120%, #f6efe2 60%, transparent 61%);
    opacity: .9;
}
.ss .fx-eyebrow { color: var(--ss-gold); }
.ss .fx-btn--primary, .ss a.fx-btn--primary, .ss a.fx-btn--primary:visited { background: linear-gradient(180deg, #ffd27a, #e8b04a); color: #2a1206; border-color: transparent; }
.ss a.fx-btn, .ss a.fx-btn:visited { color: var(--ss-ink); }
.ss .fx-input { border-color: var(--ss-line); }
.ss select.fx-input { appearance: auto; background-color: #0f2c26; }
.ss select.fx-input option { color: #111; background: #fff; }
.ss input[type=date].fx-input { color-scheme: dark; }

.ss--studio { border-radius: 22px; margin: 0 0 22px; padding: 28px 18px 90px; box-shadow: 0 30px 60px -30px rgba(10, 10, 30, .6); }
.ss--receive { min-height: 100vh; min-height: 100svh; padding: 48px 16px 110px; }

.ss-sheet { max-width: 560px; margin: 0 auto; }
.ss--receive .ss-sheet { text-align: center; }
.ss-brand { position: absolute; right: 14px; top: 12px; font: 700 .78rem/1 var(--fx-ui); letter-spacing: .04em; color: var(--ss-dim); text-decoration: none; }
.ss-title { font-size: clamp(1.7rem, 6vw, 2.5rem); line-height: 1.12; margin: .3rem 0 .8rem; font-weight: 600; }
.ss-title em { font-style: normal; color: var(--ss-gold); }
.ss-lede { color: var(--ss-dim); margin: 0 0 1.2rem; font-size: 1.05rem; }
.ss-small { color: var(--ss-dim); font-size: .86rem; margin: .2rem 0 .6rem; }
.ss-h2 { font-size: 1.15rem; margin: 0 0 .5rem; font-weight: 700; }
.ss-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 1rem 0 0; }
.ss--studio .ss-actions { justify-content: flex-start; }
.ss-link { background: none; border: 0; padding: 6px 0; color: var(--ss-gold); font: 600 .9rem var(--fx-ui); text-decoration: underline; cursor: pointer; min-height: 44px; }
.ss-privacy { margin: 1.6rem 0 0; font-size: .84rem; color: var(--ss-dim); line-height: 1.5; }

/* --- organiser form */
.ss-form .fx-field + .fx-field, .ss-form .fx-field + fieldset, .ss-form fieldset + .ss-two, .ss-two + .fx-field { margin-top: .9rem; }
.ss-rules { border: 1px dashed var(--ss-line); border-radius: 14px; padding: .8rem .9rem; margin: .9rem 0 0; }
.ss-rules legend { padding: 0 .3rem; margin: 0; width: auto; float: none; }
.ss-rule-row { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 8px; align-items: center; }
.ss-rule-row .fx-btn { min-height: 46px; padding: .5rem 1rem; }
.ss-chips { list-style: none; padding: 0; margin: .6rem 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ss-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border-radius: 999px; background: rgba(181, 38, 59, .35); border: 1px solid rgba(246, 239, 226, .25); font-size: .9rem; }
.ss-chip-x { border: 0; background: transparent; color: inherit; font-size: 1.2rem; line-height: 1; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; }
.ss-chip-x:hover { background: rgba(246, 239, 226, .15); }
.ss-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ss-two .fx-field + .fx-field { margin-top: 0; }
@media (max-width: 420px) {
    .ss-two { grid-template-columns: 1fr; }
    .ss-rule-row { grid-template-columns: 1fr 1fr; }
    .ss-rule-row > span[aria-hidden] { display: none; }
    .ss-rule-row .fx-btn { grid-column: 1 / -1; }
}

/* --- result list */
.ss-result { margin-top: .4rem; }
.ss-result .ss-h2 { font-size: 1.4rem; outline: none; }
.ss-warn { background: rgba(181, 38, 59, .3); border: 1px solid rgba(246, 239, 226, .25); border-radius: 12px; padding: .7rem .9rem; font-size: .92rem; }
.ss-links { list-style: none; padding: 0; margin: .9rem 0 0; display: grid; gap: 8px; counter-reset: ss; }
.ss-link-row {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
    padding: 10px 12px; border-radius: 14px; background: rgba(246, 239, 226, .07); border: 1px solid var(--ss-line);
}
.ss-link-row.is-sent { border-color: rgba(122, 196, 140, .7); }
.ss-link-row.is-sent .ss-link-name::after { content: " ✓ sent"; color: #9be0ad; font-weight: 600; font-size: .8rem; }
.ss-link-name { font-weight: 700; overflow-wrap: anywhere; }
.ss-link-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ss-btn-sm { min-height: 44px; padding: .45rem .9rem; font-size: .88rem; }

/* --- the scratch card */
.ss-scratch {
    position: relative; margin: 1.2rem auto .4rem; width: min(100%, 420px); aspect-ratio: 7 / 4;
    border-radius: 18px; overflow: hidden; background: var(--ss-paper); color: #1d3b32;
    box-shadow: 0 2px 0 rgba(0, 0, 0, .15), 0 18px 34px -16px rgba(0, 0, 0, .6);
}
.ss-match { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 14px; gap: 6px; }
.ss-match-label { font-size: .9rem; color: #49685d; }
.ss-match-name { font-size: clamp(1.8rem, 9vw, 2.8rem); line-height: 1.05; color: #b5263b; overflow-wrap: anywhere; font-weight: 600; }
.ss-foil { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; transition: opacity .5s ease; }
.ss-foil.is-gone { opacity: 0; }
.ss-scratch.is-open .ss-match-name { animation: ss-pop .6s var(--fx-spring, ease) both; }
@keyframes ss-pop { from { transform: scale(.85); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .ss-scratch.is-open .ss-match-name { animation: none; }
    .ss-foil { transition: none; }
}
.ss-hint { color: var(--ss-dim); font-size: .9rem; margin: .3rem 0 0; }

.ss-details { margin-top: 1rem; text-align: left; }
.ss-facts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 0 .8rem; }
.ss-facts div { padding: 8px 14px; border-radius: 12px; background: rgba(246, 239, 226, .08); border: 1px solid var(--ss-line); text-align: center; }
.ss-facts dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ss-gold); }
.ss-facts dd { margin: 2px 0 0; font-weight: 600; }
.ss-note-org { text-align: center; margin: 0 0 1rem; }
.ss-box { padding: 14px 16px; border-radius: 16px; background: rgba(246, 239, 226, .07); border: 1px solid var(--ss-line); margin-top: 10px; }
.ss-box h2 em { font-style: normal; color: var(--ss-gold); }
.ss-wish { margin: 0; white-space: pre-line; font-size: 1.02rem; overflow-wrap: anywhere; }
.ss-wish.is-empty { color: var(--ss-dim); font-style: italic; }
.ss-box .fx-btn { margin-top: .6rem; }
.fx-msg.is-error { color: #ffb4a8; }

.ss-how ol { padding-left: 1.2rem; }
