.contest-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:18px}.contest-home-grid{display:flex;gap:16px;overflow-x:auto;scroll-snap-type:x proximity;padding:8px 2px 18px}.contest-home-grid .contest-card{flex:0 0 280px;scroll-snap-align:start}.contest-card{display:block;background:#fff;color:#10162c;border-radius:18px;box-shadow:0 4px 18px #12234b12;overflow:hidden;text-decoration:none}.contest-media{position:relative;aspect-ratio:4/3;background:#fff;overflow:hidden}.contest-media img{width:100%;height:100%;object-fit:contain;position:absolute;inset:0;opacity:0;transform:translateX(12px) scale(1.015);transition:opacity .65s ease,transform .65s ease}.contest-media img.is-current{opacity:1;transform:translateX(0) scale(1)}.contest-info{padding:14px}.contest-info h3{margin:0 0 8px;font-size:19px}.contest-countdown{color:#d81930;font-weight:800;font-variant-numeric:tabular-nums;direction:ltr;display:inline-block}.contest-winner{position:absolute;inset:auto 0 0;background:#0878f9ee;color:#fff;padding:12px;text-align:center;font-weight:700;z-index:2}.contest-detail-gallery{display:flex;gap:12px;overflow-x:auto;scroll-snap-type:x mandatory}.contest-detail-gallery img{flex:0 0 85%;width:85%;max-height:440px;object-fit:contain;background:#fff;border-radius:16px;scroll-snap-align:center}.contest-rules{white-space:pre-wrap}.contest-form{background:#fff;padding:20px;border-radius:18px;margin:20px 0}.contest-form{position:relative}.contest-trap{position:absolute;inset:0 auto auto 0;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);white-space:nowrap;pointer-events:none}.contest-admin-images{display:flex;flex-wrap:wrap;gap:12px}.contest-admin-images img{width:90px;height:80px;object-fit:contain}.contest-admin-table{overflow-x:auto}.contest-admin-table table{width:100%;border-collapse:collapse;min-width:650px}.contest-admin-table th,.contest-admin-table td{padding:10px;border-bottom:1px solid #e4e8f0;text-align:start}.contest-admin-row{background:#fff;border-radius:14px;padding:16px;margin:12px 0}.contest-admin-actions{display:flex;flex-wrap:wrap;gap:8px}.contest-note{background:#fff5dc;padding:14px;border-radius:12px}.contest-link{color:#0878f9}@media(max-width:430px){.contest-home-grid .contest-card{flex-basis:270px}.contest-grid{grid-template-columns:1fr}.contest-info h3{font-size:20px}}@media(prefers-reduced-motion:reduce){.contest-media img{transition:none;transform:none}}

.contest-receipt{background:#edf7ff;color:#10162c;border:1px solid #0878f9;border-radius:14px;padding:18px;margin:16px 0;font-weight:700}.contest-receipt[hidden]{display:none}

/* Match the new-products row sizing at each breakpoint. */
.reference-home .contest-home-grid{--home-row-gap:clamp(10px,2vw,16px);gap:var(--home-row-gap);align-items:stretch;padding:4px 0 12px;scrollbar-width:none}
.reference-home .contest-home-grid .contest-card{flex:0 0 calc((100% - var(--home-row-gap))/2.15);min-width:0;border:1px solid #e1e6ee;border-radius:23px;box-shadow:0 8px 10px -4px #32323247,0 2px 4px #32323214}
.reference-home .contest-card .contest-media{aspect-ratio:1.7;margin:8px 8px 0}
.reference-home .contest-card .contest-info{padding:8px}
.reference-home .contest-card .contest-info h3{font-size:clamp(12px,2.53vw,20px);line-height:1.3;margin:0 0 4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.reference-home .contest-card .contest-info p{font-size:clamp(11px,2.5vw,14px);line-height:1.4;margin:4px 0}
.contest-countdown,.reference-home .contest-card .contest-info .contest-countdown{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:clamp(15px,4vw,22px);font-weight:900;line-height:1.35;letter-spacing:.3px;color:#c8102e;background:#fff0f2;border:1px solid #f7c5cd;border-bottom:3px solid #d81930;border-radius:9px;padding:6px 8px;margin:6px 0;max-width:100%;box-sizing:border-box;text-align:center}
@media(min-width:700px){.reference-home .contest-home-grid .contest-card{flex-basis:calc((100% - 2 * var(--home-row-gap))/3.15)}}
@media(min-width:1000px){.reference-home .contest-home-grid .contest-card{flex-basis:calc((100% - 3 * var(--home-row-gap))/4.15)}}

/* Blue countdown badge matches the site accent. */
.contest-countdown,.reference-home .contest-card .contest-info .contest-countdown{font-family:Arial,Tajawal,sans-serif;font-size:clamp(14px,3.7vw,19px);font-weight:700;line-height:1.4;letter-spacing:0;color:#fff;background:#0878f9;border:0;border-radius:10px;padding:6px 10px;margin:6px 0;box-shadow:none;white-space:nowrap}

#contest-replay{margin-top:24px;background:#fff;border:1px solid #e1e6ee;border-radius:18px;padding:18px}#contest-replay[hidden]{display:none}.draw-note{font-size:14px;color:#536079;line-height:1.6}.draw-result{font-weight:700;background:#edf7ff;padding:12px;border-radius:10px;overflow-wrap:anywhere}.draw-history-row{border-top:1px solid #e1e6ee;margin-top:12px;padding:12px 0}.draw-history-row p{margin:6px 0}.draw-hash{font-family:monospace;overflow-wrap:anywhere;font-size:12px}#contest-replay details{margin-top:18px}#contest-replay summary{cursor:pointer;font-weight:700}


.contest-card-result{background:#edf7ff;color:#133b67;border-radius:10px;padding:8px;margin:6px 0;text-align:center}.contest-card-result>strong{display:block;font-size:12px;color:#536079}.contest-card-winner,.reference-home .contest-card .contest-info .contest-card-winner{font-weight:700;font-size:clamp(12px,2.8vw,16px);margin:4px 0;line-height:1.5;overflow-wrap:anywhere}.contest-card-winner span{display:block;font-size:12px;font-weight:400}#contest-roster{background:#fff;border:1px solid #e1e6ee;border-radius:16px;padding:16px;margin:18px 0}#contest-roster[hidden]{display:none}.contest-roster-list{list-style:none;margin:12px 0;padding:0;max-height:320px;overflow-y:auto}.contest-roster-list li{display:flex;gap:12px;justify-content:space-between;align-items:center;padding:10px 4px;border-bottom:1px solid #e9edf3}.contest-roster-list strong{overflow-wrap:anywhere;min-width:0}.contest-roster-list span{color:#536079;white-space:nowrap}.contest-roster-nav{display:flex;gap:8px;flex-wrap:wrap}

.contest-roster-list{min-height:96px;max-height:320px;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:stable;-webkit-overflow-scrolling:touch}.contest-roster-list:focus-visible{outline:2px solid #0878f9;outline-offset:4px}
/* Full-roster replay: fixed pointer and seven recycled cards. */
.draw-reel-stage{position:relative;width:100%;height:150px;margin:22px auto;overflow:hidden;direction:ltr;border:1px solid #dbe6f3;border-radius:16px;background:#f4f8fe;contain:layout paint}
.draw-reel-stage::after{content:"";position:absolute;top:32px;bottom:12px;left:50%;width:160px;transform:translateX(-50%);border:2px solid #0878f9;border-radius:12px;pointer-events:none;box-sizing:border-box}
.draw-reel-pointer{position:absolute;top:2px;left:50%;transform:translateX(-50%);z-index:2;font-size:30px;line-height:1;color:#0878f9}
.draw-reel-track{position:absolute;top:34px;left:50%;display:flex;width:1120px;will-change:transform}
.draw-reel-card{flex:0 0 160px;width:160px;height:100px;box-sizing:border-box;padding:10px 8px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:6px;text-align:center;direction:rtl;border-inline:4px solid transparent;background:#fff;background-clip:padding-box;border-radius:12px;color:#10162c}
.draw-reel-card strong{max-width:100%;font-size:14px;line-height:1.35;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.draw-reel-card span{font-size:12px;color:#536079;white-space:nowrap}.draw-reel-card.is-winner{background-color:#edf7ff;color:#0878f9}
@media(prefers-reduced-motion:reduce){.draw-reel-track{will-change:auto}}

.contest-admin-actions .contest-delete-button{color:#b42318;border:1px solid #f3b8b4;background:#fff1f0;min-height:44px}.contest-admin-actions .contest-delete-button:hover{background:#ffe2df}.contest-admin-actions .contest-delete-button:focus-visible{outline:2px solid #b42318;outline-offset:3px}

.contest-form .check-label{display:flex;align-items:flex-start;gap:10px}.contest-form .check-label>input{flex:0 0 auto;width:22px;height:22px;margin:4px 0}.contest-form .check-label>span{flex:1;min-width:0;line-height:1.8}#contest-entry-status{color:#17324d;font-weight:600;line-height:1.7}#contest-entry-status:empty{display:none}


/* Persistent confirmation beside the private registration receipt. */
.contest-success{margin:12px 0 20px;padding:18px;border:2px solid #22c55e;border-radius:14px;background:#dcfce7;color:#14532d;font-size:20px;font-weight:800;line-height:1.6;text-align:center;scroll-margin-block:110px;animation:contest-success-appear .35s ease-out}
.contest-success span{display:block;margin-top:5px;font-size:15px;font-weight:500}.contest-success[hidden]{display:none}
@keyframes contest-success-appear{from{opacity:.4;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.contest-success{animation:none}}


/* Scope changes to the duplicate warning and the administration roster. */
.contest-duplicate{background:#fff5dc;color:#714400;border:2px solid #e5a521;border-radius:14px;padding:16px;font-weight:700;line-height:1.6}
.contest-duplicate[hidden]{display:none}
#contest-participant-total{line-height:1.9;overflow-wrap:anywhere}
.contest-admin-table table{background:var(--card-surface);color:var(--ink)}
.contest-admin-table th,.contest-admin-table td{color:var(--ink);border-color:var(--line)}
.contest-admin-table td{overflow-wrap:anywhere}
@media(max-width:600px){
 .contest-admin-table{overflow:visible}
 .contest-admin-table table{min-width:0;display:block}
 .contest-admin-table table>tr:first-child{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 .contest-admin-table tr:not(:first-child){display:block;background:var(--card-surface);color:var(--ink);border:1px solid var(--line);border-radius:14px;padding:8px 12px;margin:12px 0}
 .contest-admin-table td{display:grid;grid-template-columns:88px minmax(0,1fr);gap:8px;align-items:start;padding:9px 0;min-width:0}
 .contest-admin-table td::before{content:attr(data-label);font-weight:700;color:var(--muted);direction:rtl;text-align:right}
 .contest-admin-table td[dir=ltr]{direction:rtl;text-align:left;unicode-bidi:plaintext}
 .contest-admin-table td:last-child{border:0}
 .contest-admin-table button{min-height:44px;max-width:100%}
}

/* Registration notices keep explicit foreground/background pairs in both themes. */
#contest-entry-status:not(:empty),#contest-status:not(:empty),#contest-duplicate{
 box-sizing:border-box;max-width:100%;margin:12px 0;padding:14px 16px;
 border:2px solid #2563eb;border-radius:14px;background:#eff6ff;color:#17324d;
 font-size:16px;font-weight:700;line-height:1.8;overflow-wrap:anywhere;
 scroll-margin-block:110px;text-align:start;
}
#contest-entry-status[data-kind=error],#contest-status[data-kind=error]{background:#fff1f2;color:#881337;border-color:#be123c}
#contest-status[data-kind=success]{background:#dcfce7;color:#14532d;border-color:#15803d}
#contest-duplicate{background:#fff3c4;color:#542d00;border-color:#c77700;font-weight:800}
#contest-entry-status:empty,#contest-status:empty,#contest-duplicate[hidden]{display:none}
#contest-entry-status:focus-visible,#contest-duplicate:focus-visible{outline:3px solid #2563eb;outline-offset:3px}
#contest-entry button[type=submit]:disabled{opacity:1;background:#e2e8f0;color:#334155;border-color:#94a3b8;cursor:not-allowed}

/* Gift overview precedes registration; queue appears only for a server-assigned future slot. */
.contest-start,.contest-admission{background:var(--card-surface,#fff);color:var(--ink,#10162c);border:1px solid var(--line,#dce6f3);border-radius:18px;padding:20px;margin:20px 0;line-height:1.8}
.contest-start .button{min-height:48px;max-width:100%}
.contest-admission{border-inline-start:4px solid #0878f9}
.contest-price{font-weight:700;line-height:1.8}
#contest-start[hidden],#contest-admission[hidden],#contest-back[hidden],#contest-overview[hidden],#contest-entry[hidden]{display:none}
#contest-start-status:empty{display:none}
#contest-start-status[data-kind=error]{background:#fff1f2;color:#881337;padding:12px;border-radius:10px}
#contest-start-button:disabled{opacity:.7;cursor:wait}
#contest-back{margin-block:12px}
#contest-entry,#contest-register-title{scroll-margin-block:110px}

/* Compact countdown only: preserve the previous badge's height and margins. */
.contest-countdown.contest-clock,.reference-home .contest-card .contest-info .contest-countdown.contest-clock{
 --clock-accent:#0878f9;--clock-text:#075fc9;--clock-muted:#435874;--clock-surface:#edf3fc;--clock-track:#d2dfef;
 position:relative;display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;
 width:100%;height:calc(1.4em + 12px);padding:1px 8px 8px;overflow:hidden;
 color:var(--clock-text);background:var(--clock-surface);border:0;border-radius:10px;
 box-shadow:inset 0 1px 1px #ffffffb3;direction:ltr;white-space:nowrap;
}
.contest-clock-face{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:center;width:100%;gap:4px}
.contest-clock-unit{display:flex;flex-direction:column;align-items:center;min-width:0;gap:0}
.contest-clock-unit b{font-family:ui-rounded,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:.9em;line-height:1;font-weight:800;font-variant-numeric:tabular-nums;letter-spacing:0}
.contest-clock-unit small{font-family:Arial,Tajawal,sans-serif;font-size:9px;line-height:1;color:var(--clock-muted);font-weight:800;direction:rtl}
.contest-clock-track{position:absolute;left:8px;right:8px;bottom:2px;height:6px;background:var(--clock-track);border-radius:9px;overflow:hidden}
.contest-clock-fill{display:block;width:100%;height:100%;background:var(--clock-accent);border-radius:inherit;transform-origin:right center;transition:transform 1s linear,background-color .2s}
.contest-clock-message{display:none;font-size:.76em;direction:rtl}
.contest-clock.is-ended .contest-clock-face{display:none}
.contest-clock.is-ended .contest-clock-message{display:block}
.contest-clock.is-ended .contest-clock-fill{transition:none}
.contest-countdown.contest-clock.is-urgent,.reference-home .contest-card .contest-info .contest-countdown.contest-clock.is-urgent{--clock-accent:#d92d43}
html[data-theme=dark] .contest-countdown.contest-clock,html[data-theme=dark] .reference-home .contest-card .contest-info .contest-countdown.contest-clock{--clock-text:#edf3ff;--clock-muted:#b8c8df;--clock-surface:#1d2e48;--clock-track:#344a67;--clock-accent:#63a9ff;box-shadow:inset 0 1px 1px #ffffff0d}
html[data-theme=dark] .contest-countdown.contest-clock.is-urgent,html[data-theme=dark] .reference-home .contest-card .contest-info .contest-countdown.contest-clock.is-urgent{--clock-accent:#ff7586}
@media(prefers-reduced-motion:reduce){.contest-clock-fill{transition:none}}

/* Keep the draw notice distinct and readable above the countdown. */
.contest-draw-notice,.reference-home .contest-card .contest-info .contest-draw-notice{color:#c43f52}
.contest-draw-notice strong{color:inherit}

/* Optional sharing: local browser APIs only; no registration or database calls. */
.contest-card-link{display:block;color:inherit;text-decoration:none}
.contest-card-link:focus-visible{outline:3px solid #1673ea;outline-offset:-3px;border-radius:inherit}
.contest-share-actions{padding:0 12px 12px}
.contest-share-button{display:block;width:100%;min-height:44px;padding:8px 10px;border:1px solid #1673ea;border-radius:10px;background:#edf5ff;color:#125dbd;font:700 13px/1.5 Arial,Tajawal,sans-serif;cursor:pointer;white-space:normal}
.contest-share-button:focus-visible{outline:3px solid #1673ea;outline-offset:2px}
.contest-share-button:disabled{opacity:.6;cursor:wait}
.contest-share-status{font-size:12px;line-height:1.5;margin:6px 0 0;color:#125dbd}
.contest-share-link{display:block;box-sizing:border-box;width:100%;margin-top:6px;padding:8px;border:1px solid #b8cbe5;border-radius:8px;direction:ltr;font-size:12px}
.contest-share-status[hidden],.contest-share-link[hidden]{display:none}
html[data-theme=dark] .contest-share-button{background:#172b46;border-color:#63a9ff;color:#cce5ff}
html[data-theme=dark] .contest-share-status{color:#cce5ff}
html[data-theme=dark] .contest-share-link{background:#172238;color:#edf3ff;border-color:#52647d}

/* Upcoming giveaway: compact swipeable original photos, no registration. */
.contest-teaser-gallery{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;background:#fff;aspect-ratio:4/3;direction:ltr}
.contest-teaser-gallery img{display:block;flex:0 0 100%;width:100%;min-width:0;height:100%;object-fit:contain;scroll-snap-align:center}
.reference-home .contest-teaser-gallery{aspect-ratio:1.7;margin:8px 8px 0}
.contest-teaser .contest-soon-label{color:#df172b;font-weight:800}


/* Contest listings use the same photo/text split as retail product cards. */
.reference-home #contests-home[hidden]{display:none!important}
.contest-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,240px),1fr));gap:clamp(10px,2vw,16px);align-items:stretch}
.contest-grid>.contest-card{display:flex;flex-direction:column;min-width:0;padding:0;background:#f7f7f7;border:1px solid #e5e5e5;border-radius:12px;box-shadow:none;color:var(--ink,#10162c);overflow:hidden}
.contest-grid .contest-card-link{display:flex;flex-direction:column;flex:1;min-width:0}
.contest-grid .contest-media{flex:none;aspect-ratio:1.5;margin:0;background:#fff;border-radius:0}
.contest-grid .contest-media img{max-height:none;padding:8px;border-radius:0;background:#fff;object-fit:contain}
.contest-grid .contest-info{flex:1;padding:9px;background:#f7f7f7;min-width:0}
.contest-grid .contest-info h3{margin:0 0 8px;min-height:2.9em;font-size:clamp(12px,3.1vw,16px);font-weight:700;line-height:1.45;overflow-wrap:anywhere}
.contest-grid .contest-info p:not(.contest-countdown){font-size:clamp(11px,2.7vw,14px);line-height:1.5;overflow-wrap:anywhere}
.contest-grid .contest-share-actions{padding:0 9px 9px;background:#f7f7f7}
.contest-grid .contest-share-button{font-size:clamp(12px,3vw,15px)}
html[data-theme=dark] .contest-grid>.contest-card,html[data-theme=dark] .contest-grid .contest-info,html[data-theme=dark] .contest-grid .contest-share-actions{background:var(--card-surface);border-color:var(--line);color:var(--ink)}
@media(max-width:600px){.contest-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.contest-grid>.contest-card{border-radius:7px}.contest-grid .contest-media{aspect-ratio:1.25}.contest-grid .contest-media img{padding:6px}.contest-grid .contest-info{padding:7px}.contest-grid .contest-share-actions{padding:0 7px 7px}.contest-grid .contest-share-button{padding:8px 6px;min-height:44px}}

/* Compact contest listing: three cards per mobile row, matching store cards. */
#contest-grid.contest-grid{
 display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;
}
#contest-grid[hidden]{display:none}
#contest-grid .contest-card{
 min-width:0;display:flex;flex-direction:column;border:1px solid #e2e2e2;
 border-radius:8px;box-shadow:none;
}
#contest-grid .contest-media{aspect-ratio:4/3;margin:0;flex-shrink:0}
#contest-grid .contest-info{
 flex:1;min-width:0;padding:6px;background:#f7f7f7;overflow-wrap:anywhere;
}
#contest-grid .contest-info h3{font-size:12px;line-height:1.45;margin:0 0 6px}
#contest-grid .contest-info p{font-size:11px;line-height:1.5;margin:6px 0}
#contest-grid .contest-card-result{padding:5px;margin:6px 0;border-radius:6px}
#contest-grid .contest-card-result>strong,
#contest-grid .contest-card-winner span{font-size:10px;line-height:1.5}
#contest-grid .contest-info .contest-card-winner{font-size:11px;line-height:1.5;margin:4px 0}
#contest-grid .contest-countdown.contest-clock{
 font-size:14px;min-height:36px;height:auto;padding:4px 3px 8px;margin:6px 0;border-radius:6px;
}
#contest-grid .contest-clock-face{gap:1px}
#contest-grid .contest-clock-unit b{font-size:12px}
#contest-grid .contest-clock-unit small{font-size:8px}
#contest-grid .contest-clock-track{left:4px;right:4px}
html[data-theme=dark] #contest-grid .contest-info{background:var(--card-surface,#172238)}
@media(min-width:700px){
 #contest-grid.contest-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
 #contest-grid .contest-info{padding:10px}
 #contest-grid .contest-info h3{font-size:16px}
 #contest-grid .contest-info p,#contest-grid .contest-info .contest-card-winner{font-size:13px}
}

#contest-grid .contest-share-actions{padding:0 6px 6px}
#contest-grid .contest-share-button{font-size:11px;padding:6px 4px;min-height:44px;border-radius:6px}
#contest-grid .contest-teaser-gallery{aspect-ratio:4/3}
