/* ===== LUỒNG MỚI =====
   Vòng quay may mắn dùng preset (theme_mode = 'preset'): nền trang theo preset và
   2 kiểu hiển thị mới Lật bài (.lsg-cards) / Nhấn giữ (.lsg-slider, .lsg-hold).
   Bản cho người chơi của CMS public/backend/css/luckyspin/game-preview.css — sửa
   giao diện ở đây thì nhớ sửa preview bên CMS cho khớp.
   Màu lấy từ biến --lsg-* do LuckySpinView đặt theo theme (features/lucky-spin/theme.ts). */

/* .lsg-root là stacking context riêng (isolation) để lớp nền cố định .lsg-page-bg
   (z-index -1) nằm trên nền .page/.game-page của sự kiện — các nền đó có !important
   và một số theme sự kiện ẩn luôn .page:before, nên không vẽ nền lên chúng được. */
.lsg-root {
    position: relative;
    isolation: isolate;
    color: var(--lsg-text, #fff);
    font-family: var(--font-inter), Inter, 'Be Vietnam Pro', sans-serif;
}
.lsg-root button { font-family: inherit; }

/* Trang preset không có bottom nav: bỏ khoảng chừa của .game-page .page-main để
   cột nội dung cao đúng một màn hình, vòng quay canh giữa theo chiều cao. */
.game-page .page-main:has(> .lsg-root) { margin-bottom: 0; }

.lsg-page-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--ls-page-bg);
    pointer-events: none;
}

.lsg-column {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    max-width: 480px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 32px;
}

/* ---------- Thanh trên: quay lại | thể lệ, lịch sử ---------- */
.lsg-topbar { display: flex; align-items: center; gap: 10px; }
.lsg-grow { flex: 1 1 auto; }
.lsg-ico {
    position: relative;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--lsg-text, #fff);
    background: rgba(255, 255, 255, .14);
    -webkit-backdrop-filter: blur(11.7px);
    backdrop-filter: blur(11.7px);
    box-shadow: inset 5px -4px 5.5px rgba(214, 214, 214, .08);
    cursor: pointer;
}
/* Viền 1px gradient theo Figma (border-image không bo tròn nên vẽ bằng mask). */
.lsg-ico::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(178.75deg, rgba(255, 255, 255, .66) -36.79%, rgba(153, 153, 153, 0) 132.22%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    pointer-events: none;
}
.lsg-ico:hover { color: var(--lsg-text, #fff); filter: brightness(1.15); }

.lsg-logo { margin: 10px auto 18px; text-align: center; }
.lsg-logo img { display: inline-block; max-width: 62%; max-height: 72px; object-fit: contain; }

.lsg-status { margin: 40px 0; text-align: center; font-size: 16px; font-weight: 600; }

/* Màn chơi chiếm phần còn lại của cột, nội dung canh giữa theo chiều cao. */
.lsg-stage {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    box-sizing: border-box;
    width: 100%;
    max-width: 480px;
    margin: 0 auto 12px;
    -webkit-user-select: none;
    user-select: none;
}

/* ---------- Vòng quay ----------
   Khung theo Figma (điện thoại 393px): nhóm 380px, đĩa kính 326.9px lệch vào 26.59px
   (7%), các ô màu nằm trong đĩa (radius PRESET_WHEEL_RADIUS = 0.75 của khung).
   Giới hạn theo chiều cao để màn thấp vẫn thấy nút Quay. */
.lsg-stage #wheelOfFortune {
    flex: 0 0 auto;
    width: min(calc(100vw - 12px), 420px, 58vh);
    max-width: none;
    overflow: visible;
    border-radius: 50%;
}
.lsg-stage #wheelOfFortune::before,
.lsg-stage #wheelOfFortune::after {
    content: '';
    position: absolute;
    inset: 7%;
    border-radius: 50%;
    pointer-events: none;
}
/* Đĩa kính: background #0C0C0C87, inner shadow 0 -5 16.4 #65656573, blur 20.5, drop 0 0 4 #00000040. */
.lsg-stage #wheelOfFortune::before {
    background: rgba(12, 12, 12, .53);
    box-shadow: inset 0 -5px 16.4px rgba(101, 101, 101, .45), 0 0 4px rgba(0, 0, 0, .25);
    -webkit-backdrop-filter: blur(20.5px);
    backdrop-filter: blur(20.5px);
}
/* Viền 1px gradient 200.52deg (trắng .59 → xám 0) — vẽ bằng mask vì border-image không bo tròn. */
.lsg-stage #wheelOfFortune::after {
    z-index: 1;
    padding: 1px;
    background: linear-gradient(200.52deg, rgba(255, 255, 255, .59) 5.73%, rgba(153, 153, 153, 0) 93.08%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.lsg-stage #wheelOfFortune .wheel-1 { position: relative; z-index: 2; }
.lsg-stage #wheelOfFortune #btnSpin {
    z-index: 3;
    width: 22%;
    height: 22%;
    margin: 0;
    padding: 0;
    transform: translate(-50%, -50%);
}
/* Không chuyển xám lúc đang quay (spin_game.css cho #btnSpin:disabled). */
.lsg-stage #wheelOfFortune #btnSpin:disabled { filter: none; }

/* Nút mặc định button-spin.png (62x82, tâm nút tròn ở y=52, mũi kim phía trên).
   Ảnh bán trong suốt và hiệu ứng làm mờ nền (background blur) của Figma không xuất
   vào ảnh được: vẽ lớp làm mờ bằng ::before (đúng vòng tròn r=29.1 của nút) rồi đặt
   ảnh lên trên bằng ::after. Đẩy nút lên 63.4% để tâm nút trùng tâm vòng quay. */
.lsg-stage #wheelOfFortune #btnSpin.is-knob {
    width: 19%;
    height: auto;
    aspect-ratio: 62 / 82;
    background: none;
    transform: translate(-50%, -63.4%);
}
.lsg-stage #wheelOfFortune #btnSpin.is-knob::before,
.lsg-stage #wheelOfFortune #btnSpin.is-knob::after {
    content: '';
    position: absolute;
    pointer-events: none;
}
.lsg-stage #wheelOfFortune #btnSpin.is-knob::before {
    left: 0;
    top: 27.9%;
    width: 93.9%;
    height: 71%;
    border-radius: 50%;
    -webkit-backdrop-filter: blur(8.4px);
    backdrop-filter: blur(8.4px);
}
.lsg-stage #wheelOfFortune #btnSpin.is-knob::after {
    inset: 0;
    background: url('/frontend/images/button-spin.png') center / 100% 100% no-repeat;
}

/* Bố cục vòng quay theo thiết kế: logo ngay dưới thanh trên, vòng quay sát dưới logo,
   nút Quay ở khoảng 3/4 chiều cao màn hình (đáy chừa ~14vh). */
/* Đáy dòng "Bạn có xx lượt quay" ở ~83% chiều cao như thiết kế (cột còn padding đáy 32px). */
.lsg-stage--wheel { justify-content: flex-start; margin-bottom: 0; padding-bottom: max(0px, calc(17vh - 32px)); }
.lsg-stage--wheel #wheelOfFortune { margin-top: 1vh; }
.lsg-stage.lsg-stage--wheel .lsg-footer { margin-top: auto; padding-top: 24px; }

.lsg-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 18px;
    text-align: center;
}
.lsg-stage .lsg-footer { margin-top: 4px; }

.lsg-note { font-size: 14px; font-weight: 600; }
.lsg-hint {
    min-height: 42px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
}

.lsg-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--lsg-text, #fff);
    font: inherit;
    font-weight: 400;
    text-decoration: underline;
    cursor: pointer;
}

/* ---------- Quà: ảnh + tên ---------- */
.lsg-prize-img {
    display: block;
    width: 46%;
    aspect-ratio: 1 / 1;
    margin: 0 auto 8px;
    background: center / contain no-repeat;
}
.lsg-prize-img.is-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
}
.lsg-prize-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

/* ---------- Nút Quay (vòng quay dùng preset) ---------- */
.lsg-btn {
    min-width: 140px;
    padding: 10px 26px;
    border-radius: 10px;
    border: 1px solid var(--lsg-btn-border);
    background: var(--lsg-btn-bg);
    color: var(--lsg-btn-text);
    font: 700 15px/1.3 var(--font-inter), Inter, sans-serif;
    cursor: pointer;
    transition: filter .15s;
}
.lsg-btn:hover { filter: brightness(1.15); }
.lsg-btn:disabled { opacity: .6; cursor: default; }
.lsg-btn.is-busy { filter: brightness(1.35) saturate(1.3); cursor: default; }

/* ---------- Lật bài ---------- */
.lsg-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 380px;
}
.lsg-cards--12 { max-width: 330px; }

.lsg-card {
    padding: 0;
    border: 0;
    background: none;
    aspect-ratio: 1 / 1;
    perspective: 700px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.lsg-cards.is-picked .lsg-card { cursor: default; }

.lsg-card-inner {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform .6s cubic-bezier(.3, 1.4, .5, 1);
}
/* backdrop-filter: blur(20.5px) của Figma đặt ở khung thẻ, KHÔNG ở mặt thẻ: trên mặt thẻ
   nó làm phẳng 3D, lật bị lộ mặt sau. Thẻ đang mở/đã lật thì bỏ để không còn ô mờ
   đứng yên phía sau thẻ đang xoay. */
.lsg-card { border-radius: 12px; }
.lsg-card:not(.is-flipped):not(.is-loading) {
    -webkit-backdrop-filter: blur(20.5px);
    backdrop-filter: blur(20.5px);
}
.lsg-cards:not(.is-picked) .lsg-card:hover .lsg-card-back { filter: brightness(1.12); }
/* ---- Hiệu ứng lật (3 nhịp) ----
   1. Chọn thẻ (đang gọi API): thẻ nhấc lên, rung nhẹ, vệt sáng quét qua mặt úp; các thẻ
      khác lùi xuống và mờ đi để dồn chú ý.
   2. Lật: thẻ phóng to, lật qua quá 180° rồi nảy về (cảm giác có quán tính).
   3. Lộ quà: tia sáng xoay + quầng sáng bung sau thẻ, hạt lấp lánh bắn ra, ảnh quà nảy. */
.lsg-cards .lsg-card { transition: opacity .45s ease, transform .45s ease, filter .45s ease; }
.lsg-cards.is-picked .lsg-card:not(.is-chosen) { opacity: .38; transform: scale(.92); filter: saturate(.5); }
.lsg-card.is-chosen { position: relative; z-index: 5; }

.lsg-card.is-loading .lsg-card-inner { animation: lsg-charge .7s ease-in-out infinite; }
.lsg-card.is-flipped .lsg-card-inner { animation: lsg-flip .9s cubic-bezier(.25, .8, .3, 1) forwards; }

@keyframes lsg-charge {
    0%, 100% { transform: translateY(-6px) scale(1.08) rotateZ(-1.5deg); }
    50%      { transform: translateY(-9px) scale(1.1) rotateZ(1.5deg); }
}
@keyframes lsg-flip {
    0%   { transform: translateY(-6px) scale(1.08) rotateY(0deg); }
    40%  { transform: translateY(-14px) scale(1.32) rotateY(110deg); }
    70%  { transform: translateY(-6px) scale(1.16) rotateY(196deg); }
    85%  { transform: translateY(0) scale(1.14) rotateY(174deg); }
    100% { transform: translateY(0) scale(1.15) rotateY(180deg); }
}

/* Vệt sáng quét qua mặt úp lúc đang mở. */
.lsg-card-back::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .55) 48%, transparent 66%) -150% 0 / 250% 100% no-repeat;
    opacity: 0;
    pointer-events: none;
}
.lsg-card.is-loading .lsg-card-back::before { opacity: 1; animation: lsg-shine .9s ease-in-out infinite; }
@keyframes lsg-shine { to { background-position: 150% 0; } }

/* Mặt quà sau khi lật: viền sáng ấm, ảnh quà nảy lên, tên quà hiện sau. */
.lsg-card.is-flipped .lsg-card-front {
    box-shadow: 0 0 4px rgba(0, 0, 0, .25), inset 3px -5px 16.4px rgba(0, 0, 0, .45), 0 0 24px rgba(255, 226, 160, .5);
}
.lsg-card.is-flipped .lsg-card-front .lsg-prize-img { animation: lsg-prize-pop .6s cubic-bezier(.3, 1.6, .5, 1) .5s both; }
.lsg-card.is-flipped .lsg-card-front .lsg-prize-label { animation: lsg-fade-up .4s ease-out .75s both; }
@keyframes lsg-prize-pop { from { opacity: 0; transform: scale(.3) rotate(-12deg); } to { opacity: 1; transform: none; } }
@keyframes lsg-fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Lớp trang trí sau thẻ (z-index -1 trong .is-chosen). */
.lsg-card-fx { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.lsg-card-sparks { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.lsg-card-rays {
    position: absolute;
    inset: -75%;
    border-radius: 50%;
    background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .22) 0deg 6deg, transparent 6deg 24deg);
    -webkit-mask: radial-gradient(circle, #000 16%, transparent 62%);
    mask: radial-gradient(circle, #000 16%, transparent 62%);
    animation: lsg-rays-in .6s ease-out .35s both, lsg-rays-spin 10s linear infinite;
}
.lsg-card-glow {
    position: absolute;
    inset: -35%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 236, 190, .85) 0, rgba(255, 214, 140, .35) 35%, transparent 65%);
    animation: lsg-glow 1.2s ease-out .35s both;
}
.lsg-spark {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6px;
    height: 6px;
    margin: -3px 0 0 -3px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 6px 2px rgba(255, 230, 160, .9);
    opacity: 0;
    animation: lsg-spark .9s ease-out calc(.4s + var(--t, 0ms)) forwards;
}
@keyframes lsg-rays-in { from { opacity: 0; scale: .3; } to { opacity: 1; scale: 1; } }
@keyframes lsg-rays-spin { to { rotate: 360deg; } }
@keyframes lsg-glow {
    0%   { opacity: 0; transform: scale(.4); }
    35%  { opacity: 1; transform: scale(1.15); }
    100% { opacity: .55; transform: scale(1); }
}
@keyframes lsg-spark {
    0%   { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(1.2); }
    100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-1 * var(--d))) scale(0); }
}

@media (prefers-reduced-motion: reduce) {
    .lsg-card.is-loading .lsg-card-inner,
    .lsg-card.is-loading .lsg-card-back::before { animation: none; }
    .lsg-card.is-flipped .lsg-card-inner { animation: none; transform: rotateY(180deg); }
    .lsg-card-fx,
    .lsg-card-sparks { display: none; }
}

/* Ô thẻ theo Figma: nền gradient xám 50%, viền 1px gradient (vẽ bằng ::after + mask vì
   border-image không bo tròn), bóng ngoài 0 0 4 #00000040, bóng trong 3 -5 16.4 #00000073.
   Màu cố định theo thiết kế, không theo card_color/card_border của preset; có ảnh mặt
   úp (card_back_image) thì ảnh thay nền gradient. */
.lsg-card-face {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    background: linear-gradient(216.48deg, rgba(99, 99, 99, .5) 19.11%, rgba(193, 193, 193, .5) 45.86%, rgba(206, 206, 206, .5) 78.55%) center / cover no-repeat;
    box-shadow: 0 0 4px rgba(0, 0, 0, .25), inset 3px -5px 16.4px rgba(0, 0, 0, .45);
    transition: filter .15s;
}
.lsg-card-face::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(210deg, rgba(255, 255, 255, .48) -29.52%, rgba(153, 153, 153, 0) 113.27%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    pointer-events: none;
}
.lsg-card-front {
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px;
    color: var(--lsg-text, #fff);
}
.lsg-card-front .lsg-prize-img { width: 52%; margin-bottom: 4px; }
.lsg-card-front .lsg-prize-label { font-size: 11.5px; }

/* ---------- Nhấn giữ ---------- */
/* Rộng bằng màn hình (tối đa 640px) để thẻ hai bên chạy ra sát mép như thiết kế;
   .lsg-stage canh giữa nên phần tràn chia đều hai bên. */
.lsg-slider {
    position: relative;
    flex: 0 0 auto;
    width: min(100vw, 640px);
    height: 300px;
    overflow: hidden;
}
.lsg-slide {
    position: absolute;
    top: 50%;
    left: 50%;
    /* Vị trí mặc định (căn giữa) khi chưa có JS xếp ô, VD HTML server vừa render. */
    transform: translate(-50%, -50%);
    width: 58%;
    max-width: 270px;
    aspect-ratio: 1 / 1.02;
    box-sizing: border-box;
    padding: 20px 12px 14px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(208.43deg, rgba(214, 214, 214, .49) 4.79%, rgba(208, 208, 208, .41) 93.75%);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 8px 22px rgba(0, 0, 0, .14);
    will-change: transform;
}
/* Viền gradient theo Figma (vẽ bằng mask vì border-image không bo tròn). */
.lsg-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(200.52deg, rgba(255, 255, 255, .59) 5.73%, rgba(153, 153, 153, 0) 93.08%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    pointer-events: none;
}
.lsg-slide:not(.is-center) { opacity: .75; }
.lsg-slide .lsg-prize-label { font-size: 15px; }
.lsg-slider.is-win .lsg-slide.is-center { animation: lsg-win 1.1s ease-in-out 2; }

@keyframes lsg-win {
    0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 0 0 rgba(255,255,255,0); }
    50%      { box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 0 0 4px rgba(255,255,255,.55), 0 0 30px rgba(255,255,255,.45); }
}

.lsg-arrows { display: flex; gap: 26px; }
.lsg-arrow {
    width: 32px;
    height: 32px;
    border: 0;
    background: none;
    color: var(--lsg-text, #fff);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.lsg-hold {
    position: relative;
    width: 86%;
    max-width: 340px;
    height: 48px;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--lsg-btn-bg);
    color: var(--lsg-btn-text);
    cursor: pointer;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}
/* Viền gradient + bóng trong theo Figma, nằm trên thanh tiến trình. */
.lsg-hold { border: 0; box-shadow: inset 5px -4px 5.5px rgba(214, 214, 214, .08); }
.lsg-hold::after {
    z-index: 2;
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(178.75deg, rgba(255, 255, 255, .66) -36.79%, rgba(153, 153, 153, 0) 132.22%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    pointer-events: none;
}
.lsg-hold-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, var(--lsg-prog-from, rgba(0, 68, 255, 0)) 0%, var(--lsg-prog-to, #00edb5) 100%);
}
.lsg-hold-fill.is-reset { transition: width .5s ease-out; }
.lsg-hold-text {
    position: relative;
    font: 700 15px/48px var(--font-inter), Inter, sans-serif;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}

/* =====================================================================
   Popup: thể lệ, lịch sử quay, chi tiết quà (sheet) và trúng thưởng/thông báo
   (dialog). Điện thoại: sheet phủ toàn màn hình; máy tính: hộp giữa màn hình.
   ===================================================================== */
.lsg-overlay {
    position: fixed;
    inset: 0;
    z-index: 1090;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: rgba(0, 0, 0, .35);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #fff;
    font-family: var(--font-inter), Inter, 'Be Vietnam Pro', sans-serif;
    animation: lsg-fade .2s ease-out;
}
.lsg-overlay.is-center { align-items: center; padding: 20px; }

@keyframes lsg-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lsg-pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }

.lsg-sheet {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    background: linear-gradient(180deg, rgba(40, 70, 120, .55), rgba(8, 18, 28, .78));
    -webkit-backdrop-filter: blur(26px);
    backdrop-filter: blur(26px);
}
@media all and (min-width: 769px) {
    .lsg-overlay:not(.is-center) { align-items: center; padding: 24px; }
    .lsg-sheet {
        width: 440px;
        height: min(780px, 90vh);
        border-radius: 34px;
        border: 1px solid rgba(255, 255, 255, .18);
        box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
        overflow: hidden;
        animation: lsg-pop .22s ease-out;
    }
}

/* Cuộn ẩn thanh cuộn; nội dung mờ dần ở mép trên và dưới (chỗ nút đóng) thay cho
   thanh cuộn mặc định. */
.lsg-sheet-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 36px, #000 calc(100% - 30px), transparent calc(100% - 84px));
    mask-image: linear-gradient(180deg, transparent 0, #000 36px, #000 calc(100% - 30px), transparent calc(100% - 84px));
    padding: 52px 22px 112px;
}
.lsg-sheet-title {
    margin: 0 0 28px;
    text-align: center;
    font-size: 30px;
    font-weight: 700;
    color: #fff;
}

.lsg-close {
    position: absolute;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    width: 54px;
    height: 54px;
    padding: 0;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .26);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
    cursor: pointer;
}

.lsg-empty { text-align: center; opacity: .75; }

/* Thể lệ: nội dung HTML do CMS soạn. */
.lsg-rule { font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.lsg-rule p { margin: 0 0 .9em; }
.lsg-rule img { max-width: 100%; height: auto; }
.lsg-rule a { color: #fff; text-decoration: underline; }

/* Lịch sử quay */
.lsg-history { display: flex; flex-direction: column; gap: 18px; }
.lsg-history-item {
    display: flex;
    gap: 14px;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    color: #fff;
    text-align: left;
    cursor: pointer;
}
.lsg-history-thumb {
    flex: 0 0 66px;
    height: 66px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
}
.lsg-history-thumb img { width: 70%; height: 70%; object-fit: contain; }
.lsg-history-item.is-lose .lsg-history-thumb img { filter: grayscale(1); opacity: .7; }
.lsg-history-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lsg-history-title,
.lsg-history-desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
.lsg-history-title { font-size: 14px; font-weight: 700; line-height: 1.35; }
.lsg-history-desc { font-size: 13px; line-height: 1.4; opacity: .72; }
.lsg-history-meta { display: flex; justify-content: flex-end; gap: 10px; font-size: 11px; opacity: .85; }
.lsg-history-meta .is-claimed { color: #3ee08f; }
.lsg-history-meta .is-unclaimed { color: #ff5b5b; }

/* Chi tiết quà: ảnh → thông tin → mã nhận quà */
.lsg-detail { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.lsg-prize-glow {
    display: block;
    width: 150px;
    max-width: 60%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    filter: drop-shadow(0 0 22px rgba(255, 255, 255, .35)) drop-shadow(0 10px 24px rgba(0, 0, 0, .35));
}
.lsg-detail-name { margin: 4px 0 0; font-size: 24px; font-weight: 700; color: #fff; }
.lsg-detail-text { margin: 0; font-size: 14px; line-height: 1.5; opacity: .85; }
.lsg-detail-note { margin: 0; font-size: 12px; opacity: .7; }
.lsg-qr {
    margin-top: 10px;
    padding: 14px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(140, 150, 255, .55), rgba(80, 90, 220, .45));
    border: 1px solid rgba(255, 255, 255, .3);
    box-shadow: 0 0 40px rgba(120, 130, 255, .35);
}
.lsg-qr img { display: block; width: 200px; max-width: 60vw; aspect-ratio: 1 / 1; object-fit: contain; border-radius: 10px; background: #fff; }
.lsg-voucher { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.lsg-voucher-code { font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.lsg-voucher-copy {
    padding: 6px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font: 600 13px/1.3 var(--font-inter), Inter, sans-serif;
    cursor: pointer;
}

/* Dialog trúng thưởng / thông báo */
.lsg-dialog {
    width: min(380px, 100%);
    box-sizing: border-box;
    padding: 24px 20px 20px;
    border-radius: 30px;
    text-align: center;
    color: #fff;
    background: linear-gradient(180deg, rgba(62, 72, 80, .82), rgba(16, 24, 28, .9));
    border: 1px solid rgba(255, 255, 255, .22);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 30px 70px rgba(0, 0, 0, .5);
    animation: lsg-pop .22s ease-out;
}
.lsg-dialog-title { font-size: 16px; font-weight: 600; }
.lsg-dialog-body { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 0 20px; }
.lsg-dialog-btn {
    width: 100%;
    height: 54px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, .2);
    background: rgba(10, 32, 44, .75);
    color: #fff;
    font: 700 16px/1 var(--font-inter), Inter, sans-serif;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
    cursor: pointer;
}
.lsg-dialog-btn:hover { filter: brightness(1.2); }
.lsg-win-img { padding: 0; border: 0; background: none; cursor: pointer; display: flex; justify-content: center; width: 100%; }
.lsg-win-img .lsg-prize-glow { width: 170px; animation: lsg-float 2.4s ease-in-out infinite; }
.lsg-win-name { font-size: 26px; font-weight: 700; line-height: 1.25; }
.lsg-win-hint { font-size: 12px; opacity: .7; }
.lsg-notice { margin: 0; font-size: 16px; line-height: 1.5; }

@keyframes lsg-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.lsg-sheet-body::-webkit-scrollbar { display: none; }
