/* /gift/ (the form) and /gift/<code>/ (a gift). The shared styles are in /commons/growth/growth.css. */

.intro h1 {
    margin-top: 10px;
    font-size: 34px;
    line-height: 1.2;
}

/* The form */

.gift-form {
    display: grid;
    gap: 28px;
}

.step {
    margin: 0;
    padding: 22px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(12, 22, 64, 0.78);
    min-width: 0;
}

.step legend {
    float: left;
    width: 100%;
    margin-bottom: 18px;
    padding: 0;
    font-size: 18px;
    font-weight: 600;
}

.step legend + * {
    clear: both;
}

.step-number {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--violet);
    font-size: 14px;
    vertical-align: 1px;
}

.choice-group + .choice-group {
    margin-top: 12px;
}

.choice-group summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 2px;
    font-weight: 600;
    color: var(--text-soft);
    cursor: pointer;
    list-style: none;
}

.choice-group summary::-webkit-details-marker {
    display: none;
}

.choice-group summary::after {
    content: "";
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-3px);
    transition: transform 0.15s ease;
}

.choice-group[open] summary::after {
    transform: rotate(-135deg) translateY(-3px);
}

.choices {
    display: grid;
    gap: 8px;
    max-height: 372px;
    margin-top: 6px;
    padding: 2px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.choice {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 8px 8px 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
}

.choice:has(input:checked) {
    border-color: var(--violet-bright);
    background: rgba(123, 43, 255, 0.16);
}

.choice:has(input:focus-visible) {
    outline: 2px solid var(--violet-bright);
    outline-offset: 2px;
}

.choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choice img {
    flex: none;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--night-high);
}

.choice-text {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 2px;
}

.choice-title {
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.choice-meta {
    font-size: 13px;
    color: var(--text-faint);
}

.choice-listen {
    position: relative;
    flex: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
}

.choice-listen svg {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.choice-listen .icon-play {
    transform: translateX(1px);
}

.choice-listen .icon-pause,
.choice-listen--playing .icon-play {
    display: none;
}

.choice-listen--playing .icon-pause {
    display: block;
}

.choice-listen--playing {
    border-color: var(--violet-bright);
    color: #fff;
    background: var(--violet);
}

.step .chips {
    margin-bottom: 4px;
}

.gift-form .fine-print {
    margin-top: -12px;
}

/* A gift */

.sender h2 {
    margin-top: 8px;
    font-size: 28px;
    line-height: 1.25;
}

.sender-copy {
    margin-top: 8px;
    color: var(--text-soft);
}

.link-box {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 18px 0 14px;
    padding: 6px 6px 6px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-small);
    background: rgba(0, 0, 0, 0.2);
}

.link-box-url {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-box-copy {
    flex: none;
    padding: 8px 14px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    font-weight: 600;
    cursor: pointer;
}

.link-box-copy:hover {
    background: rgba(255, 255, 255, 0.16);
}

.sender-note {
    margin-top: 14px;
    font-size: 14px;
    color: var(--text-faint);
}

.sender-divider {
    position: relative;
    margin: 26px -22px -22px;
    padding: 14px 22px;
    border-top: 1px solid var(--line);
    font-size: 13px;
    text-align: center;
    color: var(--text-faint);
}

/* The gift tag: who it's for, the note, who it's from */
.tag {
    position: relative;
    padding: 30px 26px 26px;
    border-radius: var(--radius);
    background:
        radial-gradient(120% 90% at 0% 0%, rgba(255, 207, 115, 0.16) 0%, rgba(255, 207, 115, 0) 60%),
        linear-gradient(165deg, #1d2a72 0%, #0c1640 70%);
    border: 1px solid rgba(255, 207, 115, 0.25);
    box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
}

.tag::before {
    content: "";
    position: absolute;
    top: 16px;
    right: 18px;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 207, 115, 0.6);
    border-radius: 50%;
}

.tag-for {
    font-size: 30px;
    line-height: 1.2;
    color: var(--gold);
    overflow-wrap: anywhere;
}

.tag-note {
    margin: 16px 0 0;
    font-family: var(--serif);
    font-style: italic;
    font-size: 20px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.tag-note--quiet {
    color: var(--text-soft);
}

.tag-from {
    margin-top: 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-soft);
    overflow-wrap: anywhere;
}

.gift-content {
    margin-top: 28px;
}

.gift-artwork {
    margin-bottom: 20px;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--night-raised);
}

.gift-artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pass-on h2 {
    font-size: 24px;
    line-height: 1.3;
}

.pass-on p {
    margin-top: 8px;
    color: var(--text-soft);
}

.pass-on {
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.pass-on--glow {
    border-color: var(--violet-bright);
    box-shadow: 0 0 0 4px rgba(123, 43, 255, 0.2);
}

.report {
    font-size: 13px;
    text-align: center;
    color: var(--text-faint);
}

@media (min-width: 880px) {
    .intro h1 {
        font-size: 44px;
    }

    .step {
        padding: 26px 24px;
    }

    .tag {
        padding: 38px 36px 32px;
    }

    .tag-for {
        font-size: 36px;
    }
}

/* How long a gift plays, and what shows once it has finished */

.gift-time {
    margin-top: 12px;
    font-size: 14px;
    color: var(--faint);
}

.gift-ended {
    margin-top: 24px;
    padding: 22px;
    border: 1px solid rgba(255, 207, 115, 0.32);
    border-radius: var(--radius);
    background: rgba(255, 207, 115, 0.07);
}

.page .gift-ended h2 {
    font-size: 26px;
    line-height: 1.2;
}

.gift-ended p {
    margin-top: 8px;
    color: var(--haze);
}

.sender-copy + .btn {
    margin-top: 20px;
}
