.xgift {
    --xgift-green: #12382c;
    --xgift-green-deep: #071611;
    --xgift-gold: #e8c872;
    --xgift-gold-deep: #a87432;
    --xgift-red: #9b2030;
    --xgift-cream: #fff8ee;
    color: #1c1917;
    background-color: #fffaf6;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='none' stroke='%23c4a15a' stroke-width='1' opacity='.28'%3E%3Cpath d='M30 18v10M25 23h10M28 20l4 6M32 20l-4 6'/%3E%3Cpath d='M140 46v8M136 50h8'/%3E%3Cpath d='M78 150v9M74 154.5h8'/%3E%3Ccircle cx='150' cy='140' r='2.2' fill='%23b23a48' stroke='none' opacity='.22'/%3E%3Ccircle cx='48' cy='96' r='1.6' fill='%23c4a15a' stroke='none' opacity='.35'/%3E%3Cpath d='M110 28c2 4 2 7 0 10-3-2-3-6 0-10z' fill='%23145c38' stroke='none' opacity='.16'/%3E%3C/g%3E%3C/svg%3E"),
        radial-gradient(circle at 8% 12%, rgba(232, 200, 114, .16), transparent 28%),
        radial-gradient(circle at 92% 80%, rgba(155, 32, 48, .06), transparent 26%);
    background-size: 180px 180px, auto, auto;
}

.xgift-hero {
    position: relative;
    overflow: hidden;
    margin: 0;
    background: #6d1224;
    color: var(--xgift-cream);
}

.xgift-hero__banner {
    display: block;
    width: 100%;
    height: clamp(230px, 34vw, 440px);
    object-fit: cover;
    object-position: center;
}

.xgift-hero__copy {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.4rem 1.2rem;
}

.xgift-kicker {
    margin: 0 0 .45rem;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--xgift-gold);
    text-shadow: 0 2px 12px rgba(40, 0, 8, .45);
}

.xgift-hero h1 {
    margin: 0 auto .7rem;
    max-width: 16ch;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
    font-size: clamp(2rem, 5vw, 3.3rem);
    line-height: 1.12;
    text-shadow: 0 2px 18px rgba(40, 0, 8, .4);
}

.xgift-lead {
    margin: 0 auto;
    max-width: 34rem;
    color: rgba(255, 248, 238, .94);
    font-size: 1.05rem;
    text-shadow: 0 2px 14px rgba(40, 0, 8, .4);
}

.xgift-board {
    width: min(1080px, calc(100% - 1.5rem));
    margin: 1.6rem auto 3rem;
    position: relative;
    z-index: 2;
}

.xgift-note,
.xgift-success,
.xgift-error {
    margin: 0 0 1rem;
    padding: .9rem 1rem;
    border-radius: 16px;
}

.xgift-note {
    background: #fff;
    border: 1px solid rgba(168, 116, 50, .28);
    color: #3a2a14;
}

.xgift-success {
    background: #f3faf4;
    border: 1px solid #b7e4c7;
    color: #14532d;
}

.xgift-error {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
}

.xgift-rule + .xgift-rule {
    margin-top: 1.6rem;
}

.xgift-rule__head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: end;
    margin: 0 0 .8rem;
}

.xgift-rule__head h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
    font-size: 1.55rem;
}

.xgift-rule__count {
    color: var(--xgift-gold-deep);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.xgift-group {
    margin-bottom: 1rem;
}

.xgift-group__title {
    margin: 0 0 .55rem;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #57534e;
}

.xgift-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: .9rem;
}

.xgift-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    margin: 0;
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(201, 162, 39, .45);
    box-shadow: 0 14px 34px rgba(7, 22, 17, .06);
    cursor: pointer;
}

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

.xgift-card__media {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .7rem .7rem .15rem;
    background: #fff;
}

.xgift-card__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #fff;
    border: 2px solid #c9a227;
    border-radius: 14px;
    box-shadow: 0 0 0 1px rgba(232, 200, 114, .55);
}

.xgift-card__body {
    padding: .85rem .9rem 1rem;
}

.xgift-card__tag {
    display: inline-block;
    margin-bottom: .35rem;
    color: var(--xgift-red);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.xgift-card__name {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.05rem;
    line-height: 1.3;
}

.xgift-card:has(input:checked),
.xgift-card.is-on {
    border-color: #c9a227;
    box-shadow: 0 0 0 2px #e8c872, 0 16px 36px rgba(168, 116, 50, .18);
}

.xgift-card:has(input:checked) .xgift-card__media img,
.xgift-card.is-on .xgift-card__media img {
    border-color: #a87432;
    box-shadow: 0 0 0 3px #e8c872;
}

.xgift-card:has(input:focus-visible) {
    outline: 2px solid var(--xgift-green);
    outline-offset: 3px;
}

.xgift-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    margin-top: 1.15rem;
}

.xgift-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 1.3rem;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, #f6e3b2, #d7b56a);
    color: #3a2208;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-size: .74rem;
    text-decoration: none;
    cursor: pointer;
}

.xgift-btn:hover {
    color: #3a2208;
    filter: brightness(1.05);
}

.xgift-btn--ghost {
    background: transparent;
    color: var(--xgift-green);
    border: 1px solid rgba(18, 56, 44, .35);
    letter-spacing: .08em;
}

.xgift-btn--ghost:hover {
    color: var(--xgift-green);
}

.xgift-empty {
    padding: 2rem 1rem;
    text-align: center;
    background: #fff;
    border-radius: 18px;
}

@keyframes xgiftSnow {
    to { transform: translate3d(var(--drift, 10px), 280px, 0); }
}

@keyframes xgiftBlink {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.7); }
}

@media (max-width: 640px) {
    .xgift-hero__banner { height: 210px; }
    .xgift-hero h1 { font-size: 1.7rem; }
    .xgift-lead { font-size: .92rem; }
    .xgift-kicker { letter-spacing: .16em; }
    .xgift-rule__head { display: block; }
    .xgift-grid { grid-template-columns: 1fr 1fr; }
}

.xgift-win {
    position: fixed;
    inset: 0;
    z-index: 14000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
    background:
        radial-gradient(circle at 50% 20%, rgba(232, 200, 114, .28), transparent 42%),
        rgba(7, 22, 17, .82);
    backdrop-filter: blur(6px);
}

.xgift-win[hidden] { display: none !important; }

.xgift-win__burst,
.xgift-win__snow {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.xgift-win__burst:before,
.xgift-win__burst:after {
    content: "";
    position: absolute;
    left: 50%;
    top: 42%;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 2px solid rgba(232, 200, 114, .7);
    transform: translate(-50%, -50%) scale(.2);
    animation: xgiftBurst 1.6s ease-out infinite;
}

.xgift-win__burst:after { animation-delay: .45s; }

.xgift-win__snow {
    background-image:
        radial-gradient(circle, #fff 0 1.5px, transparent 2px),
        radial-gradient(circle, #fff 0 1px, transparent 1.6px);
    background-size: 120px 180px, 80px 140px;
    animation: xgiftDrift 7s linear infinite;
    opacity: .7;
}

.xgift-win__panel {
    position: relative;
    width: min(420px, 100%);
    padding: 1.6rem 1.3rem 1.3rem;
    text-align: center;
    color: #fff8ee;
    border-radius: 24px;
    background:
        radial-gradient(120% 80% at 50% 0%, rgba(255, 214, 140, .22), transparent 48%),
        linear-gradient(180deg, #1b4a36, #071611);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .45), 0 0 0 1px rgba(232, 197, 122, .7);
    animation: xgiftPop .7s cubic-bezier(.16, .84, .28, 1);
}

.xgift-win__kicker {
    margin: 0 0 .6rem;
    color: #e8c872;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .24em;
    text-transform: uppercase;
}

.xgift-win__img {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 18px;
    margin: 0 auto .8rem;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .35), 0 0 0 3px rgba(232, 200, 114, .8);
    animation: xgiftFloat 2.8s ease-in-out infinite;
}

.xgift-win__title {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
    font-size: 2rem;
}

.xgift-win__name {
    margin: .35rem 0 .7rem;
    font-size: 1.05rem;
}

.xgift-win__note {
    margin: 0 0 1rem;
    color: rgba(255, 248, 238, .86);
}

.xgift-win__actions { justify-content: center; }
.xgift-win .xgift-btn--ghost { color: #fff8ee; border-color: rgba(232, 200, 114, .75); }
.xgift-win .xgift-btn--ghost:hover { color: #fff8ee; }

html.xgift-win-open { overflow: hidden; }

@keyframes xgiftPop {
    from { opacity: 0; transform: translateY(24px) scale(.86); }
    to { opacity: 1; transform: none; }
}

@keyframes xgiftBurst {
    to { transform: translate(-50%, -50%) scale(3.2); opacity: 0; }
}

@keyframes xgiftDrift {
    to { background-position: 40px 180px, -20px 140px; }
}

@keyframes xgiftFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@media (prefers-reduced-motion: reduce) {
    .xgift-hero__flake,
    .xgift-hero__bulb,
    .xgift-win__burst:before,
    .xgift-win__burst:after,
    .xgift-win__snow,
    .xgift-win__img,
    .xgift-win__panel { animation: none; }
}
