/* Calendario de regalos: el día actual tiene prioridad sin ocultar la semana. */
#gift-modal {
    padding: 16px !important;
}

#gift-modal .gift-modal-backdrop {
    background: rgba(0, 0, 0, .76);
    backdrop-filter: blur(7px);
}

#gift-modal .gift-modal-panel {
    box-sizing: border-box;
    width: min(930px, 100%) !important;
    max-height: calc(100dvh - 32px) !important;
    border: 1px solid #776035;
    border-radius: 18px;
    background: #090a09;
    box-shadow: 0 28px 90px #000b, 0 0 0 1px #ffffff09 inset;
}

#gift-modal .gift-modal-head {
    display: flex;
    flex-wrap: nowrap !important;
    min-height: 0;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 23px 26px 19px;
    border-bottom: 0;
    background: #0d0d0b;
}

#gift-modal .gift-modal-head > .flex {
    flex: 1 1 0;
    min-width: 0;
    gap: 15px;
}

#gift-modal .gift-modal-head > .flex > div:last-child { min-width: 0; }

#gift-modal .gift-title-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border: 1px solid #7d612e;
    border-radius: 13px;
    background: #2b220f;
    color: #f1c768;
}

#gift-modal .gift-modal-kicker {
    display: block;
    margin-bottom: 4px;
    color: #dbb766;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .16em;
}

#gift-modal .gift-modal-head h2 {
    overflow: visible;
    margin: 0;
    color: #f6f2e8;
    font-size: clamp(24px, 2.5vw, 32px) !important;
    line-height: 1.05;
    letter-spacing: .025em;
    text-overflow: clip;
    white-space: normal;
}

#gift-modal .gift-modal-subtitle {
    margin-top: 5px;
    color: #aaa69c;
    font-size: 12px !important;
    font-weight: 600;
}

#gift-modal .gift-modal-head .app-icon-button {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border: 1px solid #33332e;
    border-radius: 10px;
    background: #171815;
    color: #ddd7ca;
}

#gift-modal .gift-progress {
    height: 3px;
    margin: 0 !important;
    background: #24221c;
}

#gift-modal .gift-progress span {
    border-radius: 0 3px 3px 0;
    background: linear-gradient(90deg, #a87b30, #efca76);
}

#gift-modal .gift-week-guide {
    display: flex;
    flex: 0 0 auto;
    align-items: baseline;
    gap: 12px;
    padding: 20px 26px 0;
}

#gift-modal .gift-week-guide strong {
    color: #f3e6ca;
    font: 700 19px/1.1 Oswald, sans-serif;
    text-transform: uppercase;
}

#gift-modal .gift-week-guide span {
    color: #aaa69c;
    font-size: 11px;
    line-height: 1.4;
}

#gift-modal .gift-week-grid {
    display: grid !important;
    min-height: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-auto-columns: auto !important;
    grid-auto-flow: row !important;
    gap: 10px !important;
    align-content: start;
    padding: 15px 26px 22px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    scroll-snap-type: none !important;
    touch-action: pan-y !important;
    cursor: auto;
    user-select: auto;
    scrollbar-width: thin;
}

#gift-modal .gift-day {
    box-sizing: border-box;
    display: grid !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 140px !important;
    grid-template-columns: 47px minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    column-gap: 11px;
    align-content: start;
    padding: 15px !important;
    border: 1px solid #30302a;
    border-radius: 12px;
    background: #12100d;
    color: #a8a499;
    box-shadow: none;
    scroll-snap-align: none;
}

#gift-modal .gift-day.locked { opacity: 1; }

#gift-modal .gift-day.next,
#gift-modal .gift-day.today {
    border-color: #a68039;
    background: #1c1911;
    color: #d9bc7b;
    box-shadow: 0 0 0 1px #e2b6541c inset;
}

#gift-modal .gift-day.today {
    order: -1;
    grid-row: span 2;
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    padding: 19px !important;
}

#gift-modal .gift-day-glow { display: none; }
#gift-modal .gift-day::before,
#gift-modal .gift-day::after { display: none !important; content: none !important; }

#gift-modal .gift-day-head {
    display: flex;
    width: 100%;
    min-height: 0;
    grid-column: 1 / -1;
    align-items: flex-start;
    justify-content: space-between;
    padding-right: 0;
}

#gift-modal .gift-day-head h3 {
    color: #e4ded0;
    font-size: 16px !important;
    line-height: 1.05;
}

#gift-modal .gift-day-head [data-gift-status] {
    min-height: 0;
    margin-top: 4px;
    color: #a7a095;
    font-size: 10px !important;
    line-height: 1.25;
    letter-spacing: .07em;
}

#gift-modal .gift-day.today .gift-day-head h3 { color: #f5db9b; }
#gift-modal .gift-day.today .gift-day-head [data-gift-status] { color: #d9b56e; }

#gift-modal .gift-today-tag {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    margin-right: 27px;
    padding: 3px 8px;
    border-radius: 5px;
    background: #d8ab51;
    color: #171309;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .07em;
}

#gift-modal .gift-claimed-check {
    top: 0;
    right: 0;
    box-shadow: none;
}

#gift-modal .gift-reward-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    grid-column: 1;
    grid-row: 2 / 4;
    margin: 17px 0 0;
    border: 1px solid #51432a;
    border-radius: 10px;
    background: #211e15;
    font-size: 20px;
    box-shadow: none;
}

#gift-modal .gift-reward-icon img {
    width: 34px;
    height: 34px;
}

#gift-modal .gift-day > strong {
    grid-column: 2;
    grid-row: 2;
    margin-top: 18px;
    color: #f0eade;
    font-size: 12px !important;
    line-height: 1.3;
    letter-spacing: 0;
    text-align: left;
    overflow-wrap: anywhere;
}

#gift-modal .gift-day > small {
    grid-column: 2;
    grid-row: 3;
    margin-top: 5px;
    color: #aaa69c;
    font-size: 10px !important;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0;
    text-align: left;
    text-transform: none;
    overflow-wrap: anywhere;
}

#gift-modal .gift-day.today .gift-reward-icon {
    width: 82px;
    height: 82px;
    flex: 0 0 82px;
    margin: auto 0 14px;
    border-radius: 16px;
    background: #302611;
}

#gift-modal .gift-day.today .gift-reward-icon img { width: 64px; height: 64px; }
#gift-modal .gift-day.today > strong { margin: 0; font-size: 20px !important; line-height: 1.2; }
#gift-modal .gift-day.today > small { margin-top: 7px; font-size: 11px !important; }

#gift-modal .gift-modal-actions {
    display: flex;
    min-height: 75px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 26px !important;
    border-top: 1px solid #292923;
    background: #0d0e0c;
}

#gift-modal .gift-modal-actions button {
    min-width: 200px;
    min-height: 46px;
    border-radius: 9px;
    font-size: 11px !important;
}

#gift-modal #gift-claim-feedback {
    max-width: 390px;
    color: #b3aa96;
    font-size: 11px !important;
    text-align: right;
}

@media (max-width: 760px) {
    #gift-modal { padding: 10px !important; }
    #gift-modal .gift-modal-panel { max-height: calc(100dvh - 20px) !important; border-radius: 14px; }
    #gift-modal .gift-modal-head { gap: 9px !important; padding: 16px !important; }
    #gift-modal .gift-modal-head > .flex { gap: 10px; }
    #gift-modal .gift-title-icon { width: 40px !important; height: 40px !important; flex-basis: 40px; font-size: 18px; }
    #gift-modal .gift-modal-kicker { margin-bottom: 3px; font-size: 8px; }
    #gift-modal .gift-modal-head h2 { font-size: clamp(20px, 5.6vw, 25px) !important; }
    #gift-modal .gift-modal-subtitle { font-size: 10px !important; }
    #gift-modal .gift-week-guide { display: block; padding: 14px 16px 0; }
    #gift-modal .gift-week-guide strong { font-size: 17px; }
    #gift-modal .gift-week-guide span { display: block; margin-top: 3px; font-size: 10px; }
    #gift-modal .gift-week-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        padding: 12px 16px 16px !important;
        scrollbar-width: thin;
    }
    #gift-modal .gift-day { min-height: 125px !important; padding: 11px !important; column-gap: 7px; grid-template-columns: 38px minmax(0,1fr); }
    #gift-modal .gift-day.today {
        grid-column: 1 / -1;
        grid-row: auto;
        min-height: 130px !important;
        display: grid !important;
        grid-template-columns: 82px minmax(0,1fr);
        grid-template-rows: auto 1fr auto;
        column-gap: 12px;
        align-items: center;
        padding: 14px !important;
    }
    #gift-modal .gift-day.today .gift-day-head { grid-column: 2; grid-row: 1; }
    #gift-modal .gift-day.today .gift-reward-icon { grid-column: 1; grid-row: 1 / 4; margin: 0; }
    #gift-modal .gift-day.today > strong { grid-column: 2; grid-row: 2; font-size: 16px !important; }
    #gift-modal .gift-day.today > small { grid-column: 2; grid-row: 3; font-size: 10px !important; }
    #gift-modal .gift-day-head h3 { font-size: 14px !important; }
    #gift-modal .gift-day-head [data-gift-status] { font-size: 9px !important; }
    #gift-modal .gift-reward-icon { width: 36px; height: 36px; flex-basis: 36px; margin-top: 13px; }
    #gift-modal .gift-reward-icon img { width: 29px; height: 29px; }
    #gift-modal .gift-day > strong { margin-top: 13px; font-size: 10px !important; }
    #gift-modal .gift-day > small { font-size: 9px !important; }
    #gift-modal .gift-modal-actions { min-height: 0; flex-direction: column; align-items: stretch; gap: 7px !important; padding: 11px 16px 14px !important; }
    #gift-modal .gift-modal-actions button { width: 100%; min-height: 44px; }
    #gift-modal #gift-claim-feedback { max-width: none; text-align: center; }
}

@media (max-width: 390px) {
    #gift-modal .gift-modal-head { padding: 13px !important; }
    #gift-modal .gift-modal-head h2 { font-size: 18px !important; }
    #gift-modal .gift-modal-head .app-icon-button { width: 36px; height: 36px; flex-basis: 36px; }
    #gift-modal .gift-week-grid { padding-inline: 12px !important; }
    #gift-modal .gift-day { padding: 9px !important; grid-template-columns: 32px minmax(0,1fr); column-gap: 6px; }
    #gift-modal .gift-reward-icon { width: 31px; height: 31px; flex-basis: 31px; }
    #gift-modal .gift-reward-icon img { width: 25px; height: 25px; }
    #gift-modal .gift-day.today { grid-template-columns: 70px minmax(0,1fr); }
    #gift-modal .gift-day.today .gift-reward-icon { width: 70px; height: 70px; flex-basis: 70px; }
    #gift-modal .gift-day.today .gift-reward-icon img { width: 55px; height: 55px; }
}

/* The heading must retain its real height when a reward description wraps. */
#gift-modal .gift-day:not(.today) { grid-template-rows: minmax(34px, auto) auto auto; }
#gift-modal .gift-day-head { min-height: 34px; height: auto; }
#gift-modal .gift-day > small { display: block; max-height: none; overflow: visible; -webkit-line-clamp: unset; font-size: 11px !important; line-height: 1.5; }

#gift-modal .gift-day.claimed {
    border-color: #49a879;
    background: linear-gradient(145deg, #173326, #0d2118);
    color: #a7e9c4;
    box-shadow: 0 0 0 1px #64d69922 inset;
}

#gift-modal .gift-day.claimed .gift-day-head h3,
#gift-modal .gift-day.claimed .gift-day-head [data-gift-status] {
    color: #a7e9c4;
}

#gift-modal .gift-day.claimed > strong { color: #e1f8e9; }
#gift-modal .gift-day.claimed .gift-reward-icon {
    border-color: #419569;
    background: #123424;
}

#gift-modal .gift-day.claimed .gift-today-tag,
#gift-modal .gift-day.claimed .gift-claimed-check {
    border-color: #92e4b4;
    background: #83dfab;
    color: #102a1c;
}

#gift-modal .gift-key-notice {
    --gift-key-accent: #ffb5ad;
    display: grid;
    flex: 0 1 315px;
    grid-template-columns: 31px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid #933e39;
    border-radius: 10px;
    background: #261412;
    color: var(--gift-key-accent);
}

#gift-modal .gift-key-notice[data-state="ready"] {
    --gift-key-accent: #ffda89;
    border-color: #886930;
    background: #261f12;
}

#gift-modal .gift-key-notice:is([data-state="used"], [data-state="closed"]) {
    --gift-key-accent: #e4ddce;
    border-color: #484339;
    background: #1a1814;
}

#gift-modal .gift-key-emblem {
    display: grid;
    width: 31px;
    height: 31px;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 8px;
    background: #0a0a09;
    font-size: 13px;
}

#gift-modal .gift-key-copy { min-width: 0; }
#gift-modal .gift-key-copy strong,
#gift-modal .gift-key-copy span { display: block; line-height: 1.3; }
#gift-modal .gift-key-copy strong { font-size: 12px; font-weight: 800; }
#gift-modal .gift-key-copy span { margin-top: 3px; font-size: 11px; }

#gift-modal .gift-key-count {
    padding: 4px 6px;
    border-radius: 5px;
    background: #0006;
    font-size: 11px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

#gift-modal #gift-reward-view[hidden] { display: none !important; }
#gift-modal #gift-claim-form button:disabled { opacity: .6; cursor: not-allowed; }

#gift-modal [data-gift-seal] .gift-reward-icon {
    position: relative;
    overflow: hidden;
}

#gift-modal .gift-sunday-seal {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: #0d0c0b60;
    pointer-events: none;
}

#gift-modal .gift-sunday-chains {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 2px #000);
}

#gift-modal .gift-sunday-padlock {
    position: relative;
    width: 46%;
    height: 48%;
    color: #edbd64;
    filter: drop-shadow(0 2px 3px #000);
}

#gift-modal .gift-sunday-unlock-key {
    position: absolute;
    width: 34%;
    height: 34%;
    color: #ffe6a8;
    opacity: 0;
    filter: drop-shadow(0 0 4px #000);
}

#gift-modal [data-gift-seal="ready"] .gift-sunday-padlock { color: #ffe59e; }
#gift-modal :is([data-gift-seal="used"], [data-gift-seal="closed"]) .gift-sunday-seal { display: none; }
#gift-modal [data-gift-seal="locked"].today [data-gift-status] { color: #ffb5ad; }

@media (prefers-reduced-motion: no-preference) {
    #gift-modal [data-state="ready"] .gift-key-emblem { animation: gift-key-earned .68s ease-out both; }
    #gift-modal [data-gift-seal="opening"] .gift-sunday-seal { animation: gift-seal-fade .78s ease-out both; }
    #gift-modal [data-gift-seal="opening"] .gift-chain-left { animation: gift-chain-left .66s .12s ease-in both; }
    #gift-modal [data-gift-seal="opening"] .gift-chain-right { animation: gift-chain-right .66s .12s ease-in both; }
    #gift-modal [data-gift-seal="opening"] .gift-sunday-padlock { animation: gift-lock-drop .78s ease-in both; }
    #gift-modal [data-gift-seal="opening"] .gift-sunday-unlock-key { animation: gift-insert-key .42s ease-out both; }
    #gift-modal [data-gift-seal="opening"] .gift-lock-shackle {
        transform-box: fill-box;
        transform-origin: left bottom;
        animation: gift-lock-open .24s .15s ease-out both;
    }
}

@keyframes gift-key-earned {
    0% { transform: rotate(-25deg) scale(.75); box-shadow: 0 0 0 #e8bf6800; }
    50% { transform: rotate(8deg) scale(1.14); box-shadow: 0 0 16px #e8bf6870; }
    100% { transform: none; box-shadow: 0 0 0 #e8bf6800; }
}
@keyframes gift-seal-fade { 100% { background: transparent; } }
@keyframes gift-chain-left { 100% { transform: translate(-65px, 18px) rotate(14deg); opacity: 0; } }
@keyframes gift-chain-right { 100% { transform: translate(65px, 18px) rotate(-14deg); opacity: 0; } }
@keyframes gift-lock-open { 100% { transform: rotate(-28deg) translateY(-2px); } }
@keyframes gift-insert-key {
    0% { transform: translate(68%, -45%) rotate(-40deg); opacity: 0; }
    45% { transform: translate(10%, 4%) rotate(-16deg); opacity: 1; }
    75% { transform: translate(10%, 4%) rotate(25deg); opacity: 1; }
    100% { transform: translate(10%, 4%) rotate(25deg); opacity: 0; }
}
@keyframes gift-lock-drop {
    30% { transform: translateY(-12%) rotate(-10deg); }
    100% { transform: translateY(130%) rotate(24deg); opacity: 0; }
}

@media (max-width: 760px) {
    #gift-modal .gift-modal-head {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }
    #gift-modal .gift-key-notice { grid-column: 1 / -1; grid-row: 2; }
    #gift-modal .gift-modal-head .app-icon-button { grid-column: 2; grid-row: 1; }
    #gift-modal .gift-day.today[data-gift-seal] { row-gap: 4px; }
}
