.giveaways-page {
    --giveaway-gold: #f7ce8b;
    --giveaway-ink: #211609;
    --giveaway-muted: #bab4a7;
    --giveaway-line: #e8d2ab25;
    --giveaway-inset: clamp(17px, 3vw, 30px);
    max-width: 1100px;
    margin-inline: auto;
}

.giveaways-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    margin: 0 0 7px;
    padding: 3px 8px 3px 0;
    color: #bcb9ae;
    font-size: 13px;
    font-weight: 700;
}

.giveaways-back svg { width: 16px; height: 16px; transform: rotate(180deg); }

.giveaways-hero {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: flex-end;
    min-height: clamp(250px, 34vw, 355px);
    overflow: hidden;
    padding: clamp(23px, 4.4vw, 53px);
    border: 1px solid #e6be8340;
    border-radius: clamp(20px, 3vw, 31px);
    background: radial-gradient(ellipse at 76% 59%, #302115, #1a140f 74%);
    box-shadow: inset 0 1px #ffe8bc14, 0 18px 38px #0003;
}

.giveaways-hero::before {
    position: absolute;
    z-index: -2;
    top: 50%;
    right: 0;
    height: 145%;
    aspect-ratio: 3 / 2;
    transform: translateY(-50%);
    background: url('/miniapp/assets/giveaways-cover.webp') center / cover no-repeat;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 38%);
    mask-image: linear-gradient(90deg, transparent, #000 38%);
    pointer-events: none;
    content: '';
}

.giveaways-hero::after {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    border-radius: inherit;
    background:
        linear-gradient(90deg, #ffe1a4a1, #ffdc9b10 56%, transparent) 28px 0 / min(48%, 260px) 1px no-repeat,
        linear-gradient(90deg, #1a140fbb, #1a140f6b 33%, #1a140f08 67%, transparent),
        linear-gradient(0deg, #130e0b8c, transparent 43%);
    content: '';
}

.giveaways-hero-copy { position: relative; width: min(60%, 510px); }

.giveaways-hero-mark {
    display: grid;
    place-items: center;
    width: clamp(38px, 5vw, 52px);
    aspect-ratio: 1;
    margin-bottom: clamp(15px, 2.3vw, 25px);
    border: 1px solid #f8d6a04d;
    border-radius: 14px;
    background: linear-gradient(145deg, #f8d6a024, #f8d6a00b), #21180f99;
    box-shadow: inset 0 1px #fff4d91a, 0 5px 18px #100b0855;
    color: var(--giveaway-gold);
}

.giveaways-hero-mark svg { width: 58%; height: 58%; }

.giveaways-hero h1 {
    margin: 0;
    color: #fff2d9;
    font-size: clamp(36px, 7vw, 83px);
    font-weight: 850;
    line-height: .99;
    letter-spacing: -.073em;
    text-shadow: 0 4px 25px #110905bd;
}

.giveaways-hero p {
    max-width: 31ch;
    margin: clamp(11px, 2vw, 18px) 0 0;
    color: #e3cbb0;
    font-size: clamp(13px, 1.8vw, 17px);
    font-weight: 600;
    line-height: 1.48;
    text-wrap: pretty;
}

.giveaways-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: clamp(17px, 3vw, 29px) 0 clamp(13px, 2.5vw, 20px);
}

.giveaways-filters {
    display: inline-flex;
    gap: 4px;
    min-width: 0;
    padding: 4px;
    border: 1px solid var(--giveaway-line);
    border-radius: 14px;
    background: #1b1a15;
}

.giveaways-filters button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    min-width: 0;
    padding: 6px clamp(8px, 2vw, 16px);
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--giveaway-muted);
    font-size: clamp(12px, 1.8vw, 14px);
    font-weight: 750;
    white-space: nowrap;
    transition: color .2s, background .2s, border-color .2s;
}

.giveaways-filters button[aria-pressed='true'] {
    border-color: #f3cb8842;
    background: #f7ce8b16;
    color: #ffdfa8;
    box-shadow: inset 0 1px #fff2c711;
}

.giveaways-filters button span:not([hidden]) {
    min-width: 19px;
    padding: 1px 5px;
    border-radius: 6px;
    background: #dcd3be16;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.giveaways-filters button[aria-pressed='true'] span { background: #f7ce8b25; }

.giveaways-refresh {
    display: grid;
    flex: 0 0 44px;
    place-items: center;
    height: 44px;
    padding: 0;
    border: 1px solid var(--giveaway-line);
    border-radius: 13px;
    background: #1b1a15;
    color: #dac8ae;
    transition: background .2s, color .2s;
}

.giveaways-refresh svg { width: 17px; height: 17px; }
.giveaways-refresh[aria-busy='true'] svg { animation: giveaways-spin .9s linear infinite; }
.giveaways-refresh[aria-disabled='true'] { cursor: wait; }

.giveaways-live {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.giveaways-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.giveaway-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--giveaway-line);
    border-radius: clamp(19px, 3vw, 25px);
    background: linear-gradient(155deg, #241f17 0%, #1d1c16 48%, #191913 100%);
    box-shadow: inset 0 1px #fff7e109, 0 10px 26px #0002;
    scroll-margin-top: calc(20px + var(--tg-safe-top, 0px));
}

.giveaway-card.is-featured { grid-column: 1 / -1; }
.giveaway-card[data-giveaway-status='active'] { border-color: #f1d19c35; }
.giveaway-card:focus-visible { outline: 2px solid var(--giveaway-gold); outline-offset: 3px; }
.giveaway-card-main { min-width: 0; padding: var(--giveaway-inset); }

.giveaway-card-heading {
    position: relative;
    isolation: isolate;
    min-width: 0;
    padding-bottom: 17px;
}

.giveaway-card-heading > :not(.giveaway-card-art) { position: relative; }

.giveaway-card-art {
    position: absolute;
    z-index: -2;
    top: calc(-1 * var(--giveaway-inset));
    right: calc(-1 * var(--giveaway-inset));
    bottom: 0;
    width: calc(78% + var(--giveaway-inset));
    height: calc(100% + var(--giveaway-inset));
    opacity: .52;
    object-position: center;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 54%), linear-gradient(0deg, transparent, #000 48%);
    mask-image: linear-gradient(90deg, transparent, #000 54%), linear-gradient(0deg, transparent, #000 48%);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
    pointer-events: none;
}

.giveaway-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    min-height: 25px;
    margin-bottom: 12px;
    padding: 3px 9px;
    border: 1px solid #e8ceaa31;
    border-radius: 999px;
    background: #231e15e0;
    color: #e4d0b3;
    font-size: 11px;
    font-weight: 750;
}

.giveaway-status svg { width: 13px; height: 13px; }
.giveaway-status.is-active { background: #28311fe8; border-color: #c8ef8841; color: #cfeaa6; }
.giveaway-status.is-active i { width: 6px; height: 6px; margin-inline: 2px; border-radius: 50%; background: #d2f89b; box-shadow: 0 0 7px #c8ff8a76; }
.giveaway-status.is-scheduled { color: #ffdb9e; }
.giveaway-status.is-finished { color: #c6d0be; }

.giveaway-card-heading h2 {
    margin: 0;
    color: #ffefd3;
    font-size: clamp(23px, 3.4vw, 41px);
    font-weight: 850;
    line-height: 1.06;
    letter-spacing: -.055em;
    overflow-wrap: anywhere;
    text-wrap: pretty;
}

.giveaway-card-heading p {
    margin: 10px 0 0;
    color: #d7cbb8;
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.giveaway-prize {
    display: flex;
    align-items: center;
    gap: clamp(9px, 2vw, 14px);
    min-width: 0;
    padding: clamp(10px, 2vw, 15px);
    border: 1px solid #efc27b3c;
    border-radius: 14px;
    background: linear-gradient(105deg, #e9ad5625, #b57b2f0a 76%), #282116;
    box-shadow: inset 0 1px #fff1cb0d;
}

.giveaway-prize-icon {
    display: grid;
    flex: 0 0 clamp(36px, 6vw, 45px);
    place-items: center;
    aspect-ratio: 1;
    border: 1px solid #ffe2a93a;
    border-radius: 10px;
    background: #f5d09218;
    color: var(--giveaway-gold);
}

.giveaway-prize-icon svg { width: 55%; height: 55%; }
.giveaway-prize div { display: grid; gap: 2px; min-width: 0; }
.giveaway-prize div > span { color: #e0bc87; font-size: 11px; font-weight: 700; }
.giveaway-prize strong { color: #fff0cc; font-size: clamp(15px, 2.1vw, 20px); font-weight: 850; line-height: 1.25; overflow-wrap: anywhere; }

.giveaway-meta {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    margin: 15px 0 11px;
    padding: 0;
    border: 1px solid #f0dfc119;
    border-radius: 12px;
    background: #140f0a3f;
}

.giveaway-meta > div { display: flex; flex-direction: column; min-width: 0; padding: clamp(8px, 1.7vw, 12px); }
.giveaway-meta > div + div { border-left: 1px solid #f0dfc119; }

.giveaway-meta dt,
.giveaway-date {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--giveaway-muted);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.25;
}

.giveaway-meta svg, .giveaway-date svg { width: 14px; height: 14px; color: #cfad7c; }
.giveaway-meta dt { flex: 1; align-items: flex-start; }

.giveaway-meta dd {
    margin: 3px 0 0;
    color: #fff0d8;
    font-size: clamp(14px, 2.2vw, 19px);
    font-weight: 850;
    font-variant-numeric: tabular-nums;
    line-height: 1.24;
    overflow-wrap: anywhere;
}

.giveaway-timer dd { color: var(--giveaway-gold); }
.giveaway-date { gap: 7px; margin: 0; line-height: 1.45; }
.giveaway-date time { color: #e7d5b8; }

.giveaway-card-detail {
    display: grid;
    align-content: start;
    gap: 12px;
    min-width: 0;
    height: 100%;
    padding: clamp(15px, 2.5vw, 22px) var(--giveaway-inset) var(--giveaway-inset);
    border-top: 1px solid #f0dfc119;
    background: #faf0d103;
}

.giveaway-card-detail:not(:has(> *)) { display: none; }
.giveaway-rules, .giveaway-winners { border: 1px solid #efdfbe25; border-radius: 12px; background: #15120f69; }

.giveaway-rules summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: inherit;
    color: #eee4d2;
    font-size: 13px;
    font-weight: 800;
    list-style: none;
    cursor: pointer;
}

.giveaway-rules summary::-webkit-details-marker { display: none; }
.giveaway-rules summary span { flex: 1; }
.giveaway-rules summary svg, .giveaway-winners h3 svg { width: 16px; height: 16px; color: #ddb77d; }
.giveaway-rules summary svg:last-child { width: 13px; transform: rotate(90deg); transition: transform .2s; }
.giveaway-rules[open] summary svg:last-child { transform: rotate(-90deg); }

.giveaway-rules p {
    margin: 0;
    padding: 1px 12px 12px;
    color: #d7ccba;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.giveaway-sponsors h3, .giveaway-winners h3 { margin: 0 0 8px; color: #ece1cb; font-size: 13px; font-weight: 800; letter-spacing: -.01em; }
.giveaway-sponsors ul, .giveaway-winners ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }

.giveaway-sponsor :is(a, div) {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    min-height: 47px;
    padding: 5px 9px;
    border: 1px solid #e8d2ab25;
    border-radius: 10px;
    background: #181811;
    transition: border-color .2s, background .2s;
}

.giveaway-sponsor.is-missing :is(a, div) { border-color: #e89b545c; background: #332416; }

.giveaway-sponsor-icon {
    display: grid;
    flex: 0 0 31px;
    height: 31px;
    place-items: center;
    border-radius: 8px;
    background: #34434c;
    color: #a4ddfc;
}

.giveaway-sponsor-icon svg { width: 16px; height: 16px; }
.giveaway-sponsor-copy { display: grid; flex: 1; gap: 1px; min-width: 0; line-height: 1.25; }
.giveaway-sponsor-copy strong { color: #f3e8d7; font-size: 12px; overflow-wrap: anywhere; }
.giveaway-sponsor-copy small { color: #c9bca7; font-size: 10px; }
.giveaway-sponsor.is-missing small { color: #f5b584; }
.giveaway-sponsor-out { width: 15px; height: 15px; color: #d7b989; }

.giveaway-action { align-self: end; margin-top: 2px; }

.giveaway-join {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 46px;
    padding: 9px 13px;
    border: 1px solid #ffdeaa;
    border-radius: 11px;
    background: linear-gradient(110deg, #f1bc77, #ffe2a7);
    box-shadow: inset 0 1px #fff4dd82, 0 5px 17px #ca873c23;
    color: var(--giveaway-ink);
    font-size: 13px;
    font-weight: 850;
    line-height: 1.2;
    text-align: left;
    transition: filter .2s, transform .2s;
}

.giveaway-join svg { width: 17px; height: 17px; stroke-width: 2; }
.giveaway-join[aria-disabled='true'] { cursor: wait; filter: saturate(.6); }

.giveaway-joined, .giveaway-error {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    margin: 0;
    padding: 7px 11px;
    border: 1px solid #c9ef8b3d;
    border-radius: 10px;
    background: #28341d;
    color: #dfedc9;
    font-size: 12px;
    font-weight: 800;
}

.giveaway-joined svg { width: 17px; height: 17px; color: #d5fba0; }
.giveaway-error { margin-bottom: 9px; border-color: #ed9c7155; background: #362419; color: #fdd1b9; font-weight: 650; }
.giveaway-error[hidden] { display: none; }

.giveaway-winners { padding: 11px; }
.giveaway-winners h3 { display: flex; align-items: center; gap: 7px; }
.giveaway-winners p { margin: 0; color: #d3c8b5; font-size: 12px; }
.giveaway-winners .giveaway-winner-message { margin-bottom: 8px; color: #ffdf9d; font-weight: 800; }
.giveaway-winners li { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 7px; border-radius: 8px; background: #e8d2ab0e; }
.giveaway-winners li.is-viewer { color: #ffe6bb; background: #f3c77324; }
.giveaway-winners li span { display: grid; place-items: center; flex: 0 0 24px; height: 24px; color: #e9bd81; }
.giveaway-winners li svg { width: 15px; height: 15px; }
.giveaway-winners li strong { min-width: 0; font-size: 12px; overflow-wrap: anywhere; }
.giveaway-winners li small { margin-left: auto; color: #ebc88e; font-size: 11px; }

.giveaways-message, .giveaways-skeleton {
    min-height: 194px;
    padding: 23px;
    border: 1px solid var(--giveaway-line);
    border-radius: 20px;
    background: radial-gradient(ellipse at 50% 0, #f9d68e10, transparent 72%), #1b1a15;
}

.giveaways-message { display: grid; justify-items: center; align-content: center; gap: 8px; text-align: center; }
.giveaways-message > span { display: grid; place-items: center; width: 39px; height: 39px; margin-bottom: 3px; border-radius: 10px; background: #f9d68e1b; color: var(--giveaway-gold); }
.giveaways-message > span svg { width: 20px; height: 20px; }
.giveaways-message h2 { color: #f8e8cd; font-size: clamp(19px, 3vw, 23px); }
.giveaways-message p { margin: 0; color: var(--giveaway-muted); font-size: 13px; }
.giveaways-message .button { margin-top: 6px; }

.giveaways-skeleton { display: grid; align-content: center; gap: 13px; }
.giveaways-skeleton > * { height: 14px; width: min(240px, 62%); border-radius: 8px; background: #eadbc027; animation: giveaways-skeleton 1.4s ease-in-out infinite alternate; }
.giveaways-skeleton i { width: 126px; height: 20px; }
.giveaways-skeleton b { width: min(330px, 85%); height: 29px; }
.giveaways-skeleton span:last-child { width: min(400px, 92%); height: 44px; }

.giveaways-page :is(button, a, summary):focus-visible { outline: 2px solid var(--giveaway-gold); outline-offset: 3px; }

@media (hover: hover) {
    .giveaways-back:hover { color: var(--giveaway-gold); }
    .giveaways-filters button:hover, .giveaways-refresh:hover { color: #ffdfa8; background: #f7ce8b16; }
    .giveaway-sponsor a:hover { border-color: #edcf9760; background: #332919; }
    .giveaway-join:hover { filter: brightness(1.09); transform: translateY(-1px); }
}

@media (min-width: 970px) {
    .giveaway-card.is-featured:has(.giveaway-card-detail > *) { display: grid; grid-template-columns: minmax(0, 1.21fr) minmax(0, .94fr); }
    .giveaway-card.is-featured .giveaway-card-detail:has(> *) { display: flex; flex-direction: column; padding: var(--giveaway-inset); border-top: 0; border-left: 1px solid #f0dfc119; }
    .giveaway-card.is-featured .giveaway-action { align-self: stretch; margin-top: auto; padding-top: 6px; }
}

@media (max-width: 830px) {
    .giveaways-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 580px) {
    .giveaways-back { margin-bottom: 3px; }
    .giveaways-hero { min-height: 233px; }
    .giveaways-hero::before { height: 108%; right: clamp(-63px, calc(24vw - 135px), -28px); }
    .giveaways-hero::after {
        background:
            linear-gradient(90deg, #ffe1a4a1, transparent) 16px 0 / min(48%, 185px) 1px no-repeat,
            linear-gradient(90deg, #1a140fe0, #1a140f9c 39%, #1a140f1a 77%),
            linear-gradient(0deg, #130e0bba, transparent 53%);
    }
    .giveaways-hero-copy { width: min(94%, 350px); }
    .giveaways-hero h1 { font-size: clamp(31px, 9.5vw, 53px); }
    .giveaways-hero p { max-width: 25ch; }
}

@media (max-width: 375px) {
    .giveaways-hero { min-height: 209px; padding-inline: 16px; }
    .giveaway-meta dt { font-size: 10px; }
    .giveaway-meta dt svg { width: 12px; height: 12px; }
}

@keyframes giveaways-spin { to { transform: rotate(360deg); } }
@keyframes giveaways-skeleton { from { opacity: .5; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
    .giveaways-page *, .giveaways-page *::after { animation: none !important; transition: none !important; }
}
