/*
 * Homepage v2 — design tokens, base and section styles.
 *
 * Everything is scoped under `.home-v2` so the new design cannot leak into the
 * rest of the site, which is still tuned for Tajawal and the legacy palette.
 *
 * Colour tokens (`--tw-*`) and their light/dark values come from
 * twelve-ui.css, which every page loads.
 */

/* ── Base ───────────────────────────────────────────────────────────── */

.home-v2 {
    --hv2-max: 1280px;
    --hv2-gutter: 18px;
    --hv2-radius: 18px;
    --hv2-radius-sm: 12px;
    font-family: var(--tw-font);
    background: var(--tw-bg);
    color: var(--tw-ink);
    transition: background 0.4s, color 0.4s;
    position: relative;
}

/* :where() keeps this at element specificity so component classes win. */
:where(.home-v2) a {
    color: var(--tw-ink);
    text-decoration: none;
}

:where(.home-v2) a:hover {
    color: var(--tw-brand);
}

.home-v2 *,
.home-v2 *::before,
.home-v2 *::after {
    box-sizing: border-box;
}

/* Full-bleed paper grain behind the page. */
.home-v2__noise {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.04;
    background: var(--tw-ink);
    -webkit-mask-image: url('../images/home-v2/page-noise.png');
    mask-image: url('../images/home-v2/page-noise.png');
    -webkit-mask-size: cover;
    mask-size: cover;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.home-v2__wrap {
    max-width: var(--hv2-max);
    margin: 0 auto;
    padding-inline: var(--hv2-gutter);
    position: relative;
    z-index: 1;
}

/* ── Section heading ────────────────────────────────────────────────── */

.hv2-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.hv2-head__title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 19px;
    font-weight: 700;
    margin: 0;
}

.hv2-head__sub {
    font-size: 12.5px;
    color: var(--tw-ink2);
    margin: 3px 0 0;
}

.hv2-head__more {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--tw-brand);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Reusable pieces ────────────────────────────────────────────────── */

.hv2-card {
    background: var(--tw-surface);
    border: 1px solid var(--tw-line);
    border-radius: var(--hv2-radius);
    box-shadow: var(--tw-shadow);
}

.hv2-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--tw-chip);
    border-radius: 999px;
    padding: 5px 11px;
    font-size: 11.5px;
    font-weight: 700;
}

.hv2-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--tw-brand), var(--tw-brand-2));
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(var(--tw-brand-rgb), 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.hv2-btn:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(var(--tw-brand-rgb), 0.4);
}

/* Horizontal rail that scrolls on touch and snaps. */
.hv2-rail {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.hv2-rail::-webkit-scrollbar {
    display: none;
}

.hv2-rail > * {
    scroll-snap-align: start;
    flex: 0 0 auto;
}

/* ── Motion ─────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .home-v2 *,
    .home-v2 *::before,
    .home-v2 *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ── Keyframes (from the design bundle) ─────────────────────────────── */

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes flame {
    0%,100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.1) rotate(-4deg);
    }
}

@keyframes fillIn {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes travel {
    0% {
        right: -4px;
        opacity: 0;
    }
    12% {
        opacity: 1;
    }
    88% {
        opacity: 1;
    }
    100% {
        right: calc(100% - 4px);
        opacity: 0;
    }
}

@keyframes pop {
    0% {
        transform: scale(.3);
        opacity: 0;
    }
    60% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes glowPulse {
    0%,100% {
        box-shadow: 0 0 0 0 rgba(var(--tw-brand-rgb),.28);
    }
    50% {
        box-shadow: 0 0 0 9px rgba(var(--tw-brand-rgb),0);
    }
}

@keyframes tp-glow {
    0%,100% {
        box-shadow: 0 0 0 0 rgba(246,130,31,0);
    }
    50% {
        box-shadow: 0 0 20px 2px rgba(246,130,31,.35);
    }
}

@keyframes tp-wiggle {
    0%,100% {
        transform: rotate(0);
    }
    25% {
        transform: rotate(-10deg);
    }
    75% {
        transform: rotate(10deg);
    }
}

@keyframes riseB {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes wink {
    0%,100% {
        transform: scaleY(1);
    }
    25%,60% {
        transform: scaleY(.12);
    }
}

@keyframes otpIn {
    0% {
        transform: scale(.5);
        box-shadow: 0 0 0 0 rgba(var(--tw-brand-rgb),.45);
    }
    55% {
        transform: scale(1.16);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(var(--tw-brand-rgb),0);
    }
}

@keyframes otpOk {
    0%,100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-7px);
    }
}

@keyframes caretPulse {
    0%,100% {
        box-shadow: 0 0 0 0 rgba(var(--tw-brand-rgb),.3);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(var(--tw-brand-rgb),.1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes ddIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes dotRing {
    0% {
        box-shadow: 0 0 0 0 rgba(46,224,124,.45);
    }
    100% {
        box-shadow: 0 0 0 7px rgba(46,224,124,0);
    }
}

@keyframes barIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

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

@keyframes floatUp {
    0% {
        transform: translateY(18px) scale(.55);
        opacity: 0;
    }
    18% {
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        transform: translateY(-20px) scale(1.05);
        opacity: 0;
    }
}

@keyframes payWave {
    0% {
        opacity: 0;
        transform: scale(.35);
    }
    35% {
        opacity: .9;
    }
    100% {
        opacity: 0;
        transform: scale(1.25);
    }
}

@keyframes cardTap {
    0%,55%,100% {
        transform: rotate(-8deg) translateY(0);
    }
    70%,85% {
        transform: rotate(-8deg) translateY(-3px);
    }
}

@keyframes dropIn {
    0% {
        transform: translateY(-16px) scale(.5) rotate(45deg);
        opacity: 0;
    }
    22% {
        opacity: 1;
    }
    45%,62% {
        transform: translateY(1px) scale(1) rotate(45deg);
        opacity: 1;
    }
    78%,100% {
        transform: translateY(1px) scale(1) rotate(45deg);
        opacity: 0;
    }
}

@keyframes sparklePing {
    0%,48% {
        transform: scale(0);
        opacity: 0;
    }
    60% {
        transform: scale(1.25);
        opacity: 1;
    }
    78% {
        transform: scale(.85);
        opacity: .7;
    }
    95%,100% {
        transform: scale(0);
        opacity: 0;
    }
}

@keyframes drawCheck {
    from {
        stroke-dashoffset: 14;
    }
    to {
        stroke-dashoffset: 0;
    }
}

/* ── Hero: banner + side slot ───────────────────────────────────────── */

.hv2-hero {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 16px;
    margin-top: 18px;
}

.hv2-banner {
    position: relative;
    border-radius: var(--hv2-radius);
    overflow: hidden;
    height: 300px;
}

.hv2-banner__slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    padding: 0 48px;
    color: #fff;
    background-size: cover;
    background-position: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease;
}

.hv2-banner__slide.is-active {
    opacity: 1;
    visibility: visible;
}

/* Scrim so the slider artwork never eats the copy. */
.hv2-banner__slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to left, rgba(10, 10, 14, 0.6), rgba(10, 10, 14, 0) 62%);
}

[dir='ltr'] .hv2-banner__slide::before {
    background: linear-gradient(to right, rgba(10, 10, 14, 0.6), rgba(10, 10, 14, 0) 62%);
}

.hv2-banner__slide:not(.has-copy)::before {
    display: none;
}

.hv2-banner__slide > * {
    position: relative;
}

.hv2-banner__tag {
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 99px;
    padding: 5px 14px;
    width: fit-content;
}

.hv2-banner__title {
    font-size: 34px;
    font-weight: 700;
    line-height: 1.3;
    max-width: 520px;
    margin: 0;
}

.hv2-banner__sub {
    font-size: 15px;
    opacity: 0.85;
    max-width: 460px;
    margin: 0;
}

.hv2-banner__cta {
    margin-top: 6px;
    height: 42px;
    padding: 0 24px;
    border-radius: 11px;
    border: none;
    background: #fff;
    color: #18181b;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    width: fit-content;
    display: inline-flex;
    align-items: center;
}

.hv2-banner__cta:hover {
    color: #18181b;
}

.hv2-banner__dots {
    position: absolute;
    bottom: 16px;
    inset-inline-end: 48px;
    display: flex;
    gap: 6px;
    z-index: 2;
}

.hv2-banner__dot {
    width: 7px;
    height: 7px;
    border-radius: 99px;
    border: none;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    padding: 0;
    transition: all 0.3s;
}

.hv2-banner__dot.is-active {
    width: 22px;
    background: #fff;
}

.hv2-hero--solo {
    grid-template-columns: 1fr;
}

/* ── Quick categories ───────────────────────────────────────────────── */

.hv2-cats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 24px;
}

.hv2-cat {
    background: var(--tw-surface);
    border: 1px solid var(--tw-line);
    border-radius: 14px;
    padding: 10px 13px;
    display: flex;
    align-items: center;
    gap: 11px;
    transition: all 0.2s;
    min-width: 0;
    position: relative;
    overflow: hidden;
}

.hv2-cat:hover {
    border-color: var(--tw-brand);
    transform: translateY(-2px);
    box-shadow: var(--tw-shadow);
}

/* Dotted corner wash — decorative. */
.hv2-cat::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.14;
    background: radial-gradient(rgba(120, 120, 130, 0.45) 1.2px, transparent 1.2px) 0 0 / 11px 11px;
    -webkit-mask: radial-gradient(130px 90px at 0% 100%, #000, transparent 72%);
    mask: radial-gradient(130px 90px at 0% 100%, #000, transparent 72%);
}

.hv2-cat__body {
    flex: 1;
    min-width: 0;
}

.hv2-cat__label {
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hv2-cat__chev {
    color: var(--tw-ink2);
    font-size: 14px;
    flex-shrink: 0;
}

/* ── Homepage promo banner (single image + link, dashboard-managed) ──── */

.hv2-promo-banner {
    margin-top: 34px;
    border-radius: var(--hv2-radius);
    overflow: hidden;
    line-height: 0;
}

.hv2-promo-banner img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--hv2-radius);
}

.hv2-promo-banner__link {
    display: block;
    transition: opacity 0.2s;
}

.hv2-promo-banner__link:hover {
    opacity: 0.94;
}

/* ── Exclusive offers ───────────────────────────────────────────────── */

.hv2-deals {
    margin-top: 34px;
    border-radius: 22px;
    padding: 24px;
    background: radial-gradient(rgba(120, 120, 130, 0.18) 1px, transparent 1px) 0 0 / 16px 16px, var(--tw-surface);
    border: 1px solid var(--tw-line);
    position: relative;
    overflow: hidden;
}

.hv2-deals__head {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    position: relative;
}

.hv2-deals__icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--tw-brand-soft);
    display: grid;
    place-items: center;
    font-size: 19px;
    animation: flame 2.4s ease-in-out infinite;
}

.hv2-deals__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
    gap: 10px;
    margin-top: 18px;
    position: relative;
}

.hv2-deal {
    background: var(--tw-surface2);
    border: 1px solid var(--tw-line);
    border-radius: 16px;
    padding: 13px 14px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    transition: all 0.2s;
    min-width: 0;
}

.hv2-deal:hover {
    transform: translateY(-3px);
    border-color: var(--tw-brand);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}

.hv2-deal__top {
    display: flex;
    align-items: center;
    gap: 11px;
}

.hv2-deal__tile {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--tw-chip);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.hv2-deal__tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hv2-deal__name {
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hv2-deal__pack {
    font-size: 10.5px;
    color: var(--tw-ink2);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hv2-deal__off {
    background: var(--tw-brand-soft);
    color: var(--tw-brand);
    font-size: 10.5px;
    font-weight: 700;
    border-radius: 99px;
    padding: 3px 9px;
    direction: ltr;
    flex-shrink: 0;
}

.hv2-deal__price {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hv2-deal__now {
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

.hv2-deal__now small {
    font-size: 11px;
    color: var(--tw-ink2);
    font-weight: 600;
}

.hv2-deal__was {
    font-size: 10.5px;
    color: var(--tw-ink2);
    text-decoration: line-through;
    flex-shrink: 0;
}

/* Countdown */
.hv2-countdown {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--tw-surface2);
    border: 1px solid var(--tw-line);
    border-radius: 11px;
    padding: 7px 13px;
}

.hv2-countdown__label {
    font-size: 11.5px;
    color: var(--tw-ink2);
    font-weight: 700;
}

.hv2-countdown__clock {
    display: flex;
    gap: 4px;
    font-size: 13px;
    font-weight: 700;
    direction: ltr;
    align-items: flex-start;
}

.hv2-countdown__unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.hv2-countdown__unit b {
    background: var(--tw-ink);
    color: var(--tw-bg);
    border-radius: 6px;
    padding: 2px 7px;
}

.hv2-countdown__unit span {
    font-size: 8.5px;
    color: var(--tw-ink2);
    font-weight: 600;
}

.hv2-countdown__sep {
    color: var(--tw-ink2);
}

/* ── Coupons ────────────────────────────────────────────────────────── */

.hv2-coupons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.hv2-coupon {
    background: var(--tw-surface);
    border: 1px solid var(--tw-line);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.hv2-coupon__pct {
    text-align: center;
    flex-shrink: 0;
    border-inline-start: 1.5px dashed var(--tw-line);
    padding-inline-start: 14px;
}

.hv2-coupon__pct b {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--tw-brand);
    direction: ltr;
}

.hv2-coupon__pct span {
    font-size: 10px;
    color: var(--tw-ink2);
    font-weight: 700;
    letter-spacing: 1px;
}

.hv2-coupon__name {
    flex: 1;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.5;
}

.hv2-coupon__btn {
    flex-shrink: 0;
    height: 32px;
    padding: 0 14px;
    border-radius: 9px;
    border: none;
    background: var(--tw-brand);
    color: #fff;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
}

/* ── Trend / newest rails ───────────────────────────────────────────── */

.hv2-rails {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 34px;
}

.hv2-railbox {
    background: radial-gradient(rgba(120, 120, 130, 0.18) 1px, transparent 1px) 0 0 / 16px 16px, var(--tw-surface);
    border: 1px solid var(--tw-line);
    border-radius: 20px;
    padding: 20px 22px;
}

.hv2-railbox__head {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
}

.hv2-railbox__title {
    font-size: 17px;
    font-weight: 700;
}

.hv2-railbox__more {
    font-size: 12px;
    color: var(--tw-ink2);
    font-weight: 600;
    margin-inline-start: auto;
}

.hv2-railbox__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.hv2-game {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 14px;
    transition: background 0.15s;
    min-width: 0;
    overflow: hidden;
}

.hv2-game:hover {
    background: var(--tw-chip);
}

.hv2-game__body {
    flex: 1;
    min-width: 0;
    text-align: end;
}

.hv2-game__name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    unicode-bidi: plaintext;
}

.hv2-game__sub {
    display: block;
    font-size: 10.5px;
    color: var(--tw-ink2);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    unicode-bidi: plaintext;
}

.hv2-game__price {
    font-weight: 700;
    color: var(--tw-ink);
    unicode-bidi: isolate;
}

.hv2-game__thumb {
    position: relative;
    flex-shrink: 0;
}

.hv2-game__tile {
    width: 62px;
    height: 62px;
    border-radius: 17px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: var(--tw-chip);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.hv2-game__tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hv2-game__rank {
    position: absolute;
    top: -6px;
    inset-inline-start: -6px;
    background: #ffd166;
    color: #4a3200;
    font-size: 9.5px;
    font-weight: 700;
    border-radius: 99px;
    padding: 2px 7px;
    direction: ltr;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* ── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .hv2-hero {
        grid-template-columns: 1fr;
    }

    .hv2-rails {
        grid-template-columns: 1fr;
    }

    .hv2-railbox__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .home-v2 {
        --hv2-gutter: 14px;
    }

    .hv2-banner {
        height: 210px;
    }

    .hv2-banner__slide {
        padding: 0 22px;
    }

    .hv2-banner__title {
        font-size: 22px;
    }

    .hv2-banner__sub {
        font-size: 13px;
    }

    .hv2-banner__dots {
        inset-inline-end: 22px;
    }

    .hv2-deals {
        padding: 18px 14px;
    }

    /* .hv2-deals__head packs icon + title/subtitle + countdown into one
       row — on a phone that's tight even before flex-wrap drops the
       countdown under the title (the mockup keeps it on the title's
       own row). .hv2-countdown is reused by the competition section,
       so its label is hidden only under .hv2-deals__head. */
    .hv2-deals__head .hv2-countdown {
        gap: 5px;
        padding: 5px 9px;
    }

    .hv2-deals__head .hv2-countdown__label {
        display: none;
    }

    .hv2-deals__head .hv2-countdown__clock {
        gap: 3px;
        font-size: 11px;
    }

    /* Mockup shows the deal row as a horizontal scroller on phones, not a
       wrapping grid — a fixed card width plus scroll-snap instead of the
       auto-fill grid used at wider sizes. */
    .hv2-deals__grid {
        display: flex;
        grid-template-columns: none;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        margin: 18px calc(var(--hv2-gutter) * -1) 0;
        padding: 0 var(--hv2-gutter) 4px;
    }

    .hv2-deals__grid .hv2-deal {
        flex: 0 0 230px;
        scroll-snap-align: start;
    }

    .hv2-railbox__grid {
        grid-template-columns: 1fr;
    }

    .hv2-cats {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* ── Mobile section order ──────────────────────────────────────────────
   index.blade.php stacks these as plain block siblings under
   .home-v2__wrap (no order: property anywhere before this), except
   _banner + _quick-buy which share a CSS-grid parent, .hv2-hero, for the
   desktop side-by-side layout. To match the mobile mockup's order —
   banner, last order, categories, quick-buy, offers, coupons, rails,
   how-it-works, events — without touching desktop or reordering the Blade
   includes (which would reorder desktop too): turn the wrap into a flex
   column here and assign `order` to each section's root element.
   `.hv2-hero { display: contents }` removes it from the box tree so its
   two children (banner, quick-buy) become direct flex items of
   `.home-v2__wrap` and can take their own `order` independently of each
   other, instead of only reordering as a pair.
   _competition and _landing-sections aren't part of the mockup's 9-section
   list (they're separate features — a gamified competition banner and
   admin-curated product rails) — placed next to the existing section
   closest to them in spirit (competition next to the offers/deals urgency
   content, the landing rails next to the trending/newest rails) rather
   than guessing a position the mockup doesn't specify.
   _promo-banner (dashboard-managed image banner) is likewise not part of
   the mockup — placed right after quick-buy per explicit request, instead
   of falling through to its unset default `order: 0`, which would jump it
   to the very top of the page, ahead of even the hero banner. */
@media (max-width: 640px) {
    .home-v2__wrap {
        display: flex;
        flex-direction: column;
    }

    .hv2-hero {
        display: contents;
    }

    .hv2-banner { order: 1; }
    .hv2-last { order: 2; }
    .hv2-cats { order: 3; }
    .hv2-qb { order: 4; }
    .hv2-promo-banner { order: 5; }
    .hv2-comp { order: 6; }
    .hv2-deals { order: 7; }
    .hv2-head:has(+ .hv2-coupons) { order: 8; }
    .hv2-coupons { order: 8; }
    .hv2-rails:not(.hv2-rails--landing) { order: 9; }
    .hv2-rails--landing { order: 10; }
    .hv2-how { order: 11; }
    .hv2-events { order: 12; }
}

/* ── How it works ───────────────────────────────────────────────────── */

.hv2-how {
    margin-top: 36px;
    background: var(--tw-surface);
    border: 1px solid var(--tw-line);
    border-radius: 20px;
    padding: 24px 30px;
    display: flex;
    align-items: center;
    gap: 34px;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

.hv2-how__intro {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-width: 220px;
}

.hv2-how__title {
    font-size: 18px;
    font-weight: 700;
}

.hv2-how__sub {
    font-size: 12px;
    color: var(--tw-ink2);
    line-height: 1.7;
}

.hv2-how__chip {
    display: flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    padding: 5px 12px;
    border-radius: 99px;
    background: var(--tw-chip);
    font-size: 11px;
    font-weight: 700;
    color: var(--tw-ink2);
}

.hv2-how__pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--tw-good);
    animation: flame 1.6s ease-in-out infinite;
}

.hv2-how__steps {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 380px;
}

.hv2-how__item {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}

.hv2-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    min-width: 0;
    text-align: center;
}

.hv2-step__icon {
    position: relative;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

.hv2-step__ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: conic-gradient(var(--tw-brand), transparent 70%);
    animation: spin 1.3s linear infinite;
    opacity: 0;
    transition: opacity 0.4s;
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4.5px), #000 calc(100% - 3.5px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 4.5px), #000 calc(100% - 3.5px));
}

.hv2-step__disc {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--tw-chip);
    border: 1px solid var(--tw-line);
    display: grid;
    place-items: center;
    transition: all 0.4s;
}

.hv2-step.is-active .hv2-step__ring {
    opacity: 1;
}

.hv2-step.is-active .hv2-step__disc {
    background: var(--tw-brand-soft);
    border-color: rgba(var(--tw-brand-rgb), 0.35);
    transform: scale(1.08);
    animation: glowPulse 1.6s ease-in-out infinite;
}

.hv2-step__badge {
    position: absolute;
    bottom: -3px;
    left: -3px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: var(--tw-good);
    border: 2px solid var(--tw-surface);
    display: none;
    place-items: center;
}

.hv2-step.is-done .hv2-step__badge {
    display: grid;
    animation: pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.hv2-step.is-done .hv2-step__badge path {
    animation: drawCheck 0.5s 0.15s ease both;
}

.hv2-step__title {
    font-size: 13px;
    font-weight: 700;
    color: var(--tw-ink);
    white-space: nowrap;
    transition: color 0.3s;
}

.hv2-step.is-active .hv2-step__title {
    color: var(--tw-brand);
}

.hv2-step__sub {
    font-size: 10px;
    color: var(--tw-ink2);
    white-space: nowrap;
    margin-top: 1px;
}

.hv2-step__state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    margin-top: 2px;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--tw-ink2);
    white-space: nowrap;
    transition: color 0.3s;
}

.hv2-step.is-active .hv2-step__state {
    color: var(--tw-brand);
}

.hv2-step.is-done .hv2-step__state {
    color: var(--tw-good);
}

.hv2-step__link {
    flex: 1;
    min-width: 30px;
    height: 2px;
    margin: 0 12px 34px;
    position: relative;
    border-radius: 99px;
    background: var(--tw-chip);
}

.hv2-step__fill {
    position: absolute;
    inset: 0;
    border-radius: 99px;
    background: linear-gradient(270deg, var(--tw-brand), var(--tw-brand-2));
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.6s ease;
}

[dir='ltr'] .hv2-step__fill {
    transform-origin: left;
}

.hv2-step__link.is-filled .hv2-step__fill {
    transform: scaleX(1);
}

.hv2-step__dot {
    display: none;
    position: absolute;
    top: 50%;
    margin-top: -4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tw-brand);
    box-shadow: 0 0 10px 2px rgba(var(--tw-brand-rgb), 0.55);
    animation: travel 1.6s ease-in-out infinite;
}

[dir='ltr'] .hv2-step__dot {
    animation-name: hv2-travel-ltr;
}

.hv2-step__link.has-dot .hv2-step__dot {
    display: block;
}

@keyframes hv2-travel-ltr {
    0% {
        left: -4px;
        opacity: 0;
    }
    12% {
        opacity: 1;
    }
    88% {
        opacity: 1;
    }
    100% {
        left: calc(100% - 4px);
        opacity: 0;
    }
}

/* Step illustrations — sizes and timings copied from the design. */
.hv2-vis,
.hv2-vis * {
    box-sizing: content-box;
}

.hv2-vis {
    display: block;
    position: relative;
    transition: filter 0.4s;
}

.hv2-step:not(.is-active):not(.is-done) .hv2-vis {
    filter: grayscale(1) opacity(0.55);
}

.hv2-vis--product {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    overflow: hidden;
}

.hv2-float {
    position: absolute;
    bottom: -2px;
    border-radius: 6px;
    color: #fff;
    display: grid;
    place-items: center;
    opacity: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    animation: floatUp 3.4s linear infinite;
}

.hv2-float svg {
    display: block;
}

.hv2-float__amazon {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    margin-top: -1px;
    font-size: 10px;
    font-weight: 800;
}

.hv2-vis--pay {
    width: 34px;
    height: 30px;
}

.hv2-card {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 27px;
    height: 18px;
    padding: 3px;
    border-radius: 5px;
    background: linear-gradient(135deg, #2b2e3a, #141417);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transform: rotate(-8deg);
    animation: cardTap 2.4s ease-in-out infinite;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 2.5px;
}

.hv2-card__chip {
    width: 7px;
    height: 5px;
    border-radius: 1.5px;
    background: #f7b733;
}

.hv2-card__line {
    width: 85%;
    height: 2px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.4);
}

.hv2-wave {
    position: absolute;
    top: -2px;
    left: -2px;
    border-radius: 50%;
    border: 2px solid var(--tw-brand);
    border-bottom-color: transparent;
    border-right-color: transparent;
    transform: rotate(-45deg);
    opacity: 0;
    animation: payWave 2.4s ease-out infinite;
}

.hv2-vis--receive {
    width: 34px;
    height: 32px;
}

.hv2-drop {
    position: absolute;
    top: 3px;
    left: 11px;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: linear-gradient(135deg, var(--tw-brand), var(--tw-brand-2));
    box-shadow: 0 2px 5px rgba(var(--tw-brand-rgb), 0.4);
    opacity: 0;
    animation: dropIn 2.6s ease-in-out infinite;
}

.hv2-box {
    position: absolute;
    bottom: 0;
    left: 5px;
    width: 24px;
    height: 15px;
    border-radius: 4px 4px 5px 5px;
    background: linear-gradient(180deg, #2b2e3a, #141417);
    border: 1px solid rgba(255, 255, 255, 0.16);
    overflow: hidden;
}

.hv2-box__ribbon {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    margin-left: -2px;
    background: rgba(255, 255, 255, 0.25);
}

.hv2-lid {
    position: absolute;
    bottom: 14px;
    left: 1px;
    width: 32px;
    height: 4.5px;
    border-radius: 2.5px;
    background: linear-gradient(180deg, #3a3e4c, #23262f);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hv2-spark {
    position: absolute;
    color: #f7b733;
    line-height: 1;
    opacity: 0;
    animation: sparklePing 2.6s ease-in-out infinite;
}

/* Mobile: title only, compact circles and short connectors (design mobile). */
@media (max-width: 640px) {
    .hv2-how {
        display: block;
        padding: 16px;
    }

    .hv2-how__intro {
        max-width: none;
        margin-bottom: 12px;
    }

    .hv2-how__title {
        font-size: 14.5px;
    }

    .hv2-how__sub,
    .hv2-how__chip {
        display: none;
    }

    .hv2-how__steps {
        min-width: 0;
        align-items: flex-start;
    }

    .hv2-step {
        flex: 1;
        gap: 6px;
    }

    .hv2-step__icon {
        width: 44px;
        height: 44px;
    }

    .hv2-step__ring {
        inset: -5px;
        -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
        mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
    }

    .hv2-vis--product {
        width: 36px;
        height: 36px;
    }

    .hv2-step__badge {
        bottom: -2px;
        left: -2px;
        width: 15px;
        height: 15px;
    }

    .hv2-step__badge svg {
        width: 8px;
        height: 8px;
    }

    .hv2-step__title {
        font-size: 10.5px;
    }

    .hv2-step__sub {
        font-size: 8.5px;
        margin-top: -3px;
    }

    .hv2-step__state {
        font-size: 9px;
        margin-top: 0;
    }

    .hv2-step__link {
        flex: 0 0 22px;
        min-width: 0;
        margin: 0 2px 30px;
    }

    .hv2-step__dot {
        display: none !important;
    }
}

/* ── Page frame ─────────────────────────────────────────────────────── */

/* The Twelve UI header is fixed; the homepage starts below it. */
.home-v2--page {
    padding-top: calc(var(--tw-header-h) + 20px);
    padding-bottom: 12px;
}

.hv2-hero--split {
    grid-template-columns: 1fr 300px;
}

/* ── Quick buy ──────────────────────────────────────────────────────── */

.hv2-qb {
    background: var(--tw-surface);
    border: 1px solid var(--tw-line);
    border-radius: 18px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.hv2-qb__top,
.hv2-qb__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.hv2-qb__title {
    font-weight: 700;
    font-size: 14px;
}

.hv2-qb__step {
    font-size: 10.5px;
    color: var(--tw-ink2);
    font-weight: 700;
}

.hv2-qb__bar {
    height: 4px;
    border-radius: 99px;
    background: var(--tw-chip);
    overflow: hidden;
}

.hv2-qb__bar span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: linear-gradient(270deg, var(--tw-brand), var(--tw-brand-2));
    transition: width 0.4s ease;
}

.hv2-qb__label {
    font-size: 12px;
    font-weight: 700;
    color: var(--tw-ink2);
}

.hv2-qb__back {
    border: none;
    background: var(--tw-chip);
    color: var(--tw-ink2);
    border-radius: 8px;
    padding: 3px 10px;
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 700;
    cursor: pointer;
}

.hv2-qb__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: rise 0.3s ease both;
}

.hv2-qb__search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    background: var(--tw-surface2);
    border: 1px solid var(--tw-line);
    color: var(--tw-ink2);
}

.hv2-qb__search input,
.hv2-qb__input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 12px;
    color: var(--tw-ink);
}

.hv2-qb__input {
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    background: var(--tw-surface2);
    border: 1px solid var(--tw-line);
    text-align: start;
    transition: border-color 0.15s;
}

.hv2-qb__input::placeholder {
    color: var(--tw-ink2);
    opacity: 1;
}

.hv2-qb__input:focus {
    border-color: var(--tw-brand);
}

.hv2-qb__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.hv2-qb__grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hv2-qb__opt {
    border: 1px solid var(--tw-line);
    background: var(--tw-surface2);
    border-radius: 11px;
    padding: 9px 4px;
    font-family: inherit;
    color: var(--tw-ink);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    min-width: 0;
    transition: all 0.15s;
}

.hv2-qb__opt:hover,
.hv2-qb__opt.is-selected {
    border-color: var(--tw-brand);
    background: var(--tw-brand-soft);
}

.hv2-qb__opt:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.hv2-qb__opt img {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    object-fit: cover;
}

.hv2-qb__opt-name {
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.hv2-qb__opt-hint {
    font-size: 9.5px;
    color: var(--tw-ink2);
    direction: ltr;
}

.hv2-qb__price {
    direction: ltr;
    unicode-bidi: isolate;
    white-space: nowrap;
}

.hv2-qb__opt--type {
    padding: 14px 8px;
}

.hv2-qb__opt--type .hv2-qb__opt-icon {
    font-size: 20px;
}

/* Account fields: the product page field look, stacked one under another. */
.hv2-qb__account {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hv2-qb__field {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    border-radius: 12px;
    background: var(--tw-surface2);
    border: 1px solid var(--tw-line);
    transition: border-color 0.3s;
}

.hv2-qb__field:hover,
.hv2-qb__field:focus-within {
    border-color: var(--tw-brand);
}

.hv2-qb__field-ico {
    flex-shrink: 0;
    font-size: 13px;
    opacity: 0.5;
}

.hv2-qb__field input,
.hv2-qb__field select {
    flex: 1;
    width: 100%;
    min-width: 0;
    padding: 12px 0;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    color: var(--tw-ink);
}

.hv2-qb__field input::placeholder {
    color: var(--tw-ink2);
    opacity: 1;
}

.hv2-qb__field select {
    cursor: pointer;
}

.hv2-qb__field select option {
    background: var(--tw-surface2);
    color: var(--tw-ink);
}

.hv2-qb__sub {
    margin-top: 2px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--tw-ink2);
}

.hv2-qb__verify {
    width: 100%;
    padding: 12px 18px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(110deg, var(--tw-brand), var(--tw-brand-2));
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s;
}

.hv2-qb__verify:hover {
    transform: translateY(-1px);
}

.hv2-qb__verify:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.hv2-qb__ok {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 11px;
    border-radius: 9px;
    border: 1px solid var(--tw-good);
    background: rgba(34, 197, 94, 0.12);
    font-size: 11px;
    font-weight: 700;
}

.hv2-qb__ok::before {
    content: '✓';
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--tw-good);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 8px;
    flex-shrink: 0;
}

/* Coupon on the confirm step, in the product page coupon look. */
.hv2-qb__coupon {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hv2-qb__coupon-row {
    display: flex;
    gap: 7px;
}

.hv2-qb__coupon-field {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    border-radius: 11px;
    background: var(--tw-surface2);
    border: 1px solid var(--tw-line);
    transition: border-color 0.3s;
}

.hv2-qb__coupon-field:focus-within {
    border-color: var(--tw-brand);
}

.hv2-qb__coupon-sign {
    font-size: 12px;
    opacity: 0.5;
}

.hv2-qb__coupon-field input {
    flex: 1;
    min-width: 0;
    padding: 10px 0;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 12px;
    color: var(--tw-ink);
}

.hv2-qb__coupon-field input::placeholder {
    color: var(--tw-ink2);
    opacity: 1;
}

.hv2-qb__coupon-apply {
    flex-shrink: 0;
    padding: 0 16px;
    border: none;
    border-radius: 11px;
    background: linear-gradient(110deg, var(--tw-brand), var(--tw-brand-2));
    color: #fff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.hv2-qb__coupon-apply:disabled {
    opacity: 0.6;
    cursor: wait;
}

.hv2-qb__coupon-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 11px;
    border-radius: 10px;
    border: 1px solid rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.12);
    color: var(--tw-good);
    font-size: 11px;
    font-weight: 700;
}

.hv2-qb__coupon-note.is-error {
    border-color: rgba(var(--tw-brand-rgb), 0.35);
    background: var(--tw-brand-soft);
    color: var(--tw-brand);
}

.hv2-qb__coupon-remove {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid currentColor;
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}

.hv2-qb__msg {
    font-size: 11px;
    font-weight: 600;
    color: var(--tw-brand);
}

.hv2-qb__summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 12px;
    background: var(--tw-surface2);
    border: 1px solid var(--tw-line);
}

.hv2-qb__summary img {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    object-fit: cover;
    flex-shrink: 0;
}

.hv2-qb__summary-name {
    font-weight: 700;
    font-size: 12px;
}

.hv2-qb__summary-meta {
    font-size: 10px;
    color: var(--tw-ink2);
}

.hv2-qb__summary-pack {
    margin-inline-start: auto;
    font-weight: 700;
    font-size: 13px;
    color: var(--tw-brand);
    flex-shrink: 0;
}

.hv2-qb__buy {
    height: 42px;
    border-radius: 11px;
    border: none;
    background: var(--tw-brand);
    color: #fff;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 5px 14px rgba(var(--tw-brand-rgb), 0.3);
}

.hv2-qb__buy:hover {
    background: var(--tw-brand-2);
}

.hv2-qb__buy:disabled {
    opacity: 0.6;
    cursor: wait;
}

.hv2-qb__reset {
    border: none;
    background: none;
    color: var(--tw-ink2);
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    align-self: center;
}

.hv2-qb__empty {
    font-size: 11.5px;
    color: var(--tw-ink2);
    text-align: center;
    padding: 12px 4px;
}

.hv2-qb__loading {
    display: grid;
    place-items: center;
    padding: 22px 0;
}

.hv2-qb__loading::before {
    content: '';
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2.5px solid var(--tw-line);
    border-top-color: var(--tw-brand);
    animation: spin 0.7s linear infinite;
}

/* ── Last order ─────────────────────────────────────────────────────── */

.hv2-last {
    margin-top: 18px;
    background: var(--tw-surface);
    border: 1px solid var(--tw-line);
    border-radius: 14px;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    width: fit-content;
    max-width: 100%;
}

.hv2-last__thumb {
    position: relative;
    flex-shrink: 0;
}

.hv2-last__thumb img {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.hv2-last__check {
    position: absolute;
    bottom: -3px;
    inset-inline-end: -3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--tw-good);
    border: 2px solid var(--tw-surface);
    display: grid;
    place-items: center;
}

.hv2-last__body {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.hv2-last__tag {
    font-size: 10.5px;
    font-weight: 800;
    color: var(--tw-brand);
    white-space: nowrap;
}

.hv2-last__name {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.hv2-last__meta {
    font-size: 10.5px;
    color: var(--tw-ink2);
    white-space: nowrap;
}

.home-v2 a.hv2-last__again {
    flex-shrink: 0;
    height: 31px;
    padding: 0 16px;
    border-radius: 99px;
    background: var(--tw-brand);
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(var(--tw-brand-rgb), 0.3);
}

.home-v2 a.hv2-last__again:hover {
    color: #fff;
    background: var(--tw-brand-2);
}

/* ── Current order bar ──────────────────────────────────────────────── */

.hv2-orderbar {
    position: fixed;
    bottom: 18px;
    inset-inline: 0;
    margin: 0 auto;
    max-width: 560px;
    z-index: 1020;
    padding: 0 16px;
    font-family: var(--tw-font);
    animation: barIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both, barFloat 3.2s ease-in-out 0.5s infinite;
}

.hv2-orderbar__in {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 15px;
    border-radius: 15px;
    background: var(--tw-surface);
    background: color-mix(in srgb, var(--tw-surface) 88%, transparent);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    backdrop-filter: blur(20px) saturate(1.6);
    border: 1px solid var(--tw-line);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
    color: var(--tw-ink);
}

.hv2-orderbar__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--tw-good);
    flex: none;
    animation: dotRing 1.6s ease-out infinite;
}

.hv2-orderbar__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hv2-orderbar__title {
    font-size: 13px;
    font-weight: 800;
}

.hv2-orderbar__id {
    font-size: 12px;
    font-weight: 700;
    color: var(--tw-ink2);
    margin-inline-start: 6px;
}

.hv2-orderbar__meta {
    font-size: 11.5px;
    color: var(--tw-ink2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hv2-orderbar__status {
    flex: none;
    font-size: 11px;
    font-weight: 800;
    color: var(--tw-good);
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 999px;
    padding: 4px 11px;
    white-space: nowrap;
}

.hv2-orderbar a.hv2-orderbar__details {
    flex: none;
    font-size: 12px;
    font-weight: 800;
    color: var(--tw-brand);
    white-space: nowrap;
}

.hv2-orderbar__close {
    flex: none;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--tw-chip);
    color: var(--tw-ink2);
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 767.98px) {
    .hv2-orderbar {
        bottom: calc(var(--tw-mnav-h) + 10px + env(safe-area-inset-bottom));
    }

    .hv2-orderbar__status {
        display: none;
    }
}

/* ── Competition ────────────────────────────────────────────────────── */

.hv2-comp {
    margin-top: 24px;
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    padding: 20px 22px;
    color: #fff;
    background: linear-gradient(120deg, #141417, #241535 45%, #8b5cf6 130%);
    border: 1px solid var(--tw-line);
}

.hv2-comp__head {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.hv2-comp__icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
    display: grid;
    place-items: center;
    font-size: 19px;
    animation: flame 2.4s ease-in-out infinite;
}

.hv2-comp__title {
    font-size: 19px;
    font-weight: 700;
}

.hv2-comp__types {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
    font-size: 12px;
    opacity: 0.85;
}

.hv2-comp .hv2-countdown {
    margin-inline-start: auto;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.16);
}

.hv2-comp .hv2-countdown__label,
.hv2-comp .hv2-countdown__unit span,
.hv2-comp .hv2-countdown__sep {
    color: rgba(255, 255, 255, 0.75);
}

.hv2-comp .hv2-countdown__unit b {
    background: #fff;
    color: #18181b;
}

.hv2-comp__task {
    margin-top: 14px;
    font-size: 13px;
}

.hv2-comp__task b {
    color: #ffd166;
}

.hv2-comp__steps {
    display: flex;
    align-items: flex-start;
    margin-top: 16px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.hv2-comp__level {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    min-width: 58px;
}

.hv2-comp__dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgba(255, 255, 255, 0.28);
    color: rgba(255, 255, 255, 0.5);
}

.hv2-comp__level.is-done .hv2-comp__dot {
    background: var(--tw-good);
    border-color: var(--tw-good);
    color: #fff;
}

.hv2-comp__score {
    font-size: 10.5px;
    font-weight: 700;
    opacity: 0.9;
    white-space: nowrap;
}

.hv2-comp__link {
    flex: 1;
    min-width: 18px;
    height: 2px;
    margin-top: 14px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.22);
}

.hv2-comp__link.is-done {
    background: var(--tw-good);
}

.hv2-comp__cta {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
}

.hv2-comp__cta .hv2-btn {
    height: 36px;
    font-size: 12.5px;
}

/* ── Events ─────────────────────────────────────────────────────────── */

.hv2-events {
    margin: 36px 0 0;
}

.hv2-events__head {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.hv2-events__head .hv2-head__title {
    font-size: 21px;
}

.hv2-events__tabs {
    display: flex;
    gap: 4px;
    margin-inline-start: auto;
}

.hv2-events__tab {
    border: none;
    border-radius: 99px;
    padding: 7px 15px;
    background: var(--tw-chip);
    color: var(--tw-ink2);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hv2-events__tab.is-active {
    background: var(--tw-brand);
    color: #fff;
    transform: scale(1.06);
    box-shadow: 0 4px 12px rgba(var(--tw-brand-rgb), 0.3);
}

.hv2-events__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    transition: opacity 0.2s;
}

.hv2-events__grid.is-loading {
    opacity: 0.45;
    pointer-events: none;
}

.home-v2 a.hv2-event {
    display: flex;
    gap: 13px;
    min-width: 0;
    padding: 14px;
    border-radius: 16px;
    background: var(--tw-surface);
    border: 1px solid var(--tw-line);
    color: var(--tw-ink);
    transition: border-color 0.2s;
    animation: rise 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.home-v2 .hv2-events__grid.is-alt a.hv2-event {
    animation-name: riseB;
}

.home-v2 a.hv2-event:hover {
    border-color: var(--tw-brand);
    color: var(--tw-ink);
}

.hv2-event__tile {
    position: relative;
    width: 62px;
    height: 62px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 14px;
    background: var(--tw-chip);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}

.hv2-event__tile img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hv2-event__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hv2-event__top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hv2-event__title {
    font-size: 13.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hv2-event__status {
    flex-shrink: 0;
    border-radius: 99px;
    padding: 3px 9px;
    font-size: 9.5px;
    font-weight: 700;
    background: var(--tw-chip);
    color: var(--tw-ink2);
}

.hv2-event__status--live {
    background: rgba(34, 197, 94, 0.14);
    color: var(--tw-good);
}

.hv2-event__status--upcoming {
    background: rgba(232, 160, 19, 0.14);
    color: #e8a013;
}

.hv2-event__desc {
    height: 38px;
    overflow: hidden;
    font-size: 11.5px;
    line-height: 1.65;
    color: var(--tw-ink2);
}

.hv2-event__date {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--tw-ink2);
}

.hv2-event__day {
    display: inline-block;
    direction: ltr;
}

.hv2-event__cal {
    display: none;
}

.hv2-events__empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 18px 0;
    font-size: 13px;
    color: var(--tw-ink2);
}

/* Mobile: tabs on their own scrolling row, cards scroll sideways (design mobile). */
@media (max-width: 640px) {
    .hv2-events__head {
        row-gap: 11px;
        margin-bottom: 12px;
    }

    .hv2-events__head .hv2-head__title {
        font-size: 16px;
    }

    .hv2-events__tabs {
        flex-basis: 100%;
        gap: 5px;
        margin-inline: calc(var(--hv2-gutter) * -1);
        padding: 2px var(--hv2-gutter);
        overflow-x: auto;
        scrollbar-width: none;
    }

    .hv2-events__tabs::-webkit-scrollbar,
    .hv2-events__grid::-webkit-scrollbar {
        display: none;
    }

    .hv2-events__tab {
        flex-shrink: 0;
        padding: 7px 13px;
        font-size: 11px;
    }

    .hv2-events__grid {
        display: flex;
        gap: 10px;
        margin-inline: calc(var(--hv2-gutter) * -1);
        padding: 0 var(--hv2-gutter) 4px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .home-v2 a.hv2-event {
        flex: 0 0 310px;
        gap: 0;
        padding: 0;
        overflow: hidden;
    }

    .hv2-event__tile {
        width: 86px;
        height: auto;
        align-self: stretch;
        border-radius: 0;
        box-shadow: none;
    }

    .hv2-event__tile::after {
        content: '';
        position: absolute;
        inset: 0;
        background: radial-gradient(circle at 70% 15%, rgba(255, 255, 255, 0.25), transparent 55%);
    }

    .hv2-event__body {
        padding: 11px 13px 12px;
    }

    .hv2-event__top {
        gap: 7px;
    }

    .hv2-event__title {
        flex: 1;
        font-size: 12px;
    }

    .hv2-event__status {
        padding: 2px 8px;
        font-size: 8.5px;
    }

    .hv2-event__desc {
        height: 33px;
        font-size: 10px;
    }

    .hv2-event__date {
        display: flex;
        align-items: center;
        gap: 5px;
        font-size: 9.5px;
    }

    .hv2-event__cal {
        display: inline;
        font-size: 10px;
    }

    .hv2-events__empty {
        padding: 12px var(--hv2-gutter);
    }
}

/* ── Rails: mobile tabs ─────────────────────────────────────────────── */

.hv2-rails__tabs {
    display: none;
}

@media (max-width: 640px) {
    .hv2-rails[data-hv2-rail-tabs] {
        gap: 0;
    }

    .hv2-rails__tabs {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        margin-bottom: 10px;
        scrollbar-width: none;
    }

    .hv2-rails__tabs::-webkit-scrollbar {
        display: none;
    }

    .hv2-rails__tab {
        flex-shrink: 0;
        border: 1px solid var(--tw-line);
        border-radius: 99px;
        padding: 7px 13px;
        background: var(--tw-surface);
        color: var(--tw-ink2);
        font-family: inherit;
        font-size: 11.5px;
        font-weight: 700;
        cursor: pointer;
    }

    .hv2-rails__tab.is-active {
        background: var(--tw-brand);
        border-color: var(--tw-brand);
        color: #fff;
    }

    .hv2-rails[data-hv2-rail-tabs] .hv2-railbox:not(.is-active) {
        display: none;
    }

    .hv2-rails[data-hv2-rail-tabs] .hv2-railbox__head {
        display: none;
    }

    .hv2-hero--split {
        grid-template-columns: 1fr;
    }

    .hv2-last {
        width: 100%;
    }

    .hv2-comp {
        padding: 16px;
    }

    .hv2-comp .hv2-countdown {
        margin-inline-start: 0;
    }
}

@media (max-width: 1024px) {
    .hv2-hero--split {
        grid-template-columns: 1fr;
    }
}

.home-v2--page .hv2-hero {
    margin-top: 0;
}

/* ── Mobile refinements ─────────────────────────────────────────────── */

@media (max-width: 640px) {
    .hv2-cats {
        display: flex;
        overflow-x: auto;
        margin-inline: calc(var(--hv2-gutter) * -1);
        padding: 2px var(--hv2-gutter) 6px;
        scrollbar-width: none;
    }

    .hv2-cats::-webkit-scrollbar {
        display: none;
    }

    .hv2-cat {
        flex: 0 0 150px;
        gap: 9px;
        padding: 9px 11px;
        border-radius: 13px;
    }

    .hv2-cat .tw-cat-tile {
        width: 36px;
        height: 36px;
        border-radius: 11px;
    }

    .hv2-cat .tw-cat-tile img {
        width: 20px;
        height: 20px;
    }

    .hv2-cat__label {
        font-size: 11.5px;
    }

    .hv2-rails--landing .hv2-railbox__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hv2-rails--landing .hv2-game {
        flex-direction: column-reverse;
        gap: 6px;
        padding: 8px 4px;
    }

    .hv2-rails--landing .hv2-game__body {
        text-align: center;
    }

    .hv2-rails--landing .hv2-game__name {
        font-size: 11px;
    }

    .hv2-rails--landing .hv2-game__tile {
        width: 56px;
        height: 56px;
    }
}
