/* ===== FIGMA LAYERED LAYOUT (PC 1920×1200 / MB 440×956) ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --vh: 1vh;
    --main-color: #53e07d;
    --secondary-color: #229133;
    --main-gradient: linear-gradient(to right, var(--main-color), var(--secondary-color));
    --gold: #e7c878;
    --gold-soft: #f4e6b6;
    --gold-deep: #b88a32;
}

html {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    background: #05060a;
    color: #fff;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    overflow-y: auto;
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
}

.viewport {
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
    background: #05060a;
}

.viewport--pc {
    background: #f0f8f0;
}

.viewport--mb {
    display: none;
    background: #f0f8f0;
}

.design-frame {
    position: relative;
    flex-shrink: 0;
    transform-origin: top left;
    will-change: transform;
    overflow: hidden;
    background: #05060a;
}

.design-frame[data-w="1920"] { width: 1920px; height: 1200px; }
.design-frame[data-w="440"]  { width: 440px;  height: 956px; }
.design-frame.scene--mb { background: #fff; }

/* ---- Generic layer ---- */
.layer {
    position: absolute;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.bg-main {
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* ===================== PC YG88 LAYER POSITIONS (Figma node 278:575) ===================== */
.scene--pc { background: #fff; }

.scene--pc .bg-yg88 {
    left: -10px;
    top: -181px;
    width: 1930px;
    height: 1482px;
    object-fit: cover;
    z-index: 1;
}

.decor-yg88 {
    z-index: 3;
    overflow: hidden;
    pointer-events: none;
}
.decor-yg88 img {
    position: absolute;
    max-width: none;
    pointer-events: none;
    user-select: none;
}
.decor-yg88--left {
    left: 0;
    top: 0;
    width: 797px;
    height: 700px;
    opacity: 0.6;
}
.decor-yg88--left img {
    width: 143.04%;
    height: 244.29%;
    left: -43.04%;
    top: -144.21%;
}
.decor-yg88--right {
    left: 1097px;
    top: 109px;
    width: 767px;
    height: 1091px;
    z-index: 4;
}
.decor-yg88--right img {
    width: 100%;
    height: 105.45%;
    left: 0;
    top: -0.02%;
}

.scene--pc .card-yg88 {
    left: 187px;
    top: 267px;
    width: 626px;
    height: 793px;
    object-fit: cover;
    z-index: 8;
    filter: drop-shadow(0 12px 28px rgba(0,0,0,0.12));
}

.scene--pc .logo-yg88 {
    left: 301px;
    top: 341px;
    width: 373px;
    height: 79px;
    object-fit: cover;
    z-index: 12;
    filter: drop-shadow(0 4px 4px rgba(0,0,0,0.25));
}

.stage-wrap { position: absolute; overflow: hidden; pointer-events: none; }
.stage-img { position: absolute; max-width: none; pointer-events: none; user-select: none; }

/* ===================== MB YG88 LAYER POSITIONS (Figma node 276:376) ===================== */
.scene--mb { background: #fff; }

.scene--mb .bg-yg88-mb {
    left: -203px;
    top: -68px;
    width: 1424px;
    height: 1094px;
    object-fit: cover;
    z-index: 1;
}

.scene--mb .decor-yg88-mb {
    left: -496px;
    top: -171px;
    width: 936px;
    height: 1405px;
    object-fit: cover;
    z-index: 2;
    opacity: 0.85;
}

.star-yg88 {
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.star-yg88 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}
.star-yg88--1 {
    left: 339px;
    top: 57px;
    width: 88px;
    height: 88px;
}
.star-yg88--1 img { transform: rotate(-46deg); width: 62px; height: 62px; }
.star-yg88--2 {
    left: 9px;
    top: 99px;
    width: 86px;
    height: 86px;
}
.star-yg88--2 img { transform: rotate(-46deg); width: 61px; height: 61px; }

.scene--mb .card-yg88-mb {
    left: 17px;
    top: 219px;
    width: 408px;
    height: 517px;
    object-fit: cover;
    z-index: 8;
    filter: drop-shadow(0 8px 20px rgba(0,0,0,0.12));
}

.scene--mb .logo-yg88-mb {
    left: 52px;
    top: 274px;
    width: 311px;
    height: 66px;
    object-fit: cover;
    z-index: 12;
    filter: drop-shadow(0 4px 4px rgba(0,0,0,0.25));
}

/* ===================== HOME BUTTON ===================== */
.btn-home {
    position: absolute;
    z-index: 25;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 0 18px;
    border-radius: 12px;
    text-decoration: none;
    background: linear-gradient(180deg, #2a2f36, #0d0f12);
    border: 1.5px solid rgba(231, 200, 120, 0.55);
    box-shadow: 0 6px 16px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.08);
    transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.btn-home-text {
    color: #fff;
    font-weight: 700;
    letter-spacing: 1px;
    white-space: nowrap;
}

.btn-home-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: linear-gradient(180deg, #f4e6b6, #c79a3e);
    color: #1a1206;
}

.btn-home:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 10px 22px rgba(0,0,0,0.5), 0 0 14px rgba(231,200,120,0.25);
}

.btn-home--pc { left: 71px; top: 68px; height: 41px; }
.scene--pc .btn-home-text { font-size: 18px; }
.scene--pc .btn-home-icon { width: 34px; height: 34px; font-size: 15px; }

.btn-home--yg88 {
    position: absolute;
    width: 201px;
    height: 41px;
    padding: 0 10px 0 24px;
    gap: 8px;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(180deg, #53e07d 0%, #229133 100%);
    box-shadow:
        0 10px 12px rgba(37, 144, 193, 0.45),
        inset 0 0 0 2px rgba(118, 181, 92, 0.85);
}
.btn-home--yg88::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 67%;
    background: linear-gradient(160deg, rgba(255,255,255,0.35) 0%, rgba(192,192,192,0.45) 55%, rgba(48,56,59,0.2) 100%);
    clip-path: polygon(28% 0, 100% 0, 100% 100%, 0 100%);
    mix-blend-mode: screen;
    pointer-events: none;
}
.btn-home--yg88 .btn-home-text {
    position: relative;
    z-index: 2;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 0.5px;
}
.btn-home--yg88 .btn-home-icon {
    position: relative;
    z-index: 2;
    width: 28px;
    height: 28px;
    margin-left: auto;
    margin-right: 4px;
    background: none;
    color: #fff;
    font-size: 16px;
}
.btn-home--yg88 .btn-home-icon img {
    display: none;
}
.btn-home--yg88:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow:
        0 12px 16px rgba(37, 144, 193, 0.5),
        inset 0 0 0 2px rgba(118, 181, 92, 0.9);
}

.btn-home--mb.btn-home--yg88 {
    left: 50%;
    top: 164px;
    transform: translateX(calc(-50% - 12.5px));
    width: 201px;
    height: 41px;
}
.btn-home--mb.btn-home--yg88:hover {
    transform: translateX(calc(-50% - 12.5px)) translateY(-1px);
}

/* ===================== FORM PANEL ===================== */
.panel {
    position: absolute;
    z-index: 18;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 40px 12px 40px 12px;
    background:
        radial-gradient(120% 80% at 50% 0%, rgba(70,78,92,0.45), transparent 60%),
        #1c2125;
    border: 4px solid transparent;
    background-clip: padding-box;
    box-shadow:
        0 25px 60px rgba(0,0,0,0.55),
        inset 0 1px 0 rgba(255,255,255,0.05);
}

.panel::before {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    padding: 4px;
    background: linear-gradient(144deg, #ffffff 1%, #fff5d7 4%, #f4db8d 28%, #f4db8d 74%, #fff5d7 96%, #ffffff 99%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.panel--pc { left: 187px; top: 497px; width: 610px; padding: 0; }
.panel--mb { left: 30px; top: 236px; width: 380px; padding: 22px 24px 20px; }

.panel--yg88 {
    height: 324px;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    z-index: 15;
}
.panel--yg88::before { display: none; }

.panel--yg88 .panel-title {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    color: #2bb628;
    font-size: 36px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.36px;
    line-height: 38px;
    text-shadow: 0 4px 4px rgba(0,0,0,0.25);
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
}

.panel--yg88 .panel-form {
    position: absolute;
    top: 142px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    filter: drop-shadow(0 4px 2px rgba(0,0,0,0.25));
}

.panel--yg88 .panel-label {
    color: #fffd04;
    font-size: 25px;
    font-weight: 700;
    text-align: center;
    align-self: center;
    margin: 0;
    letter-spacing: -0.5px;
}

.panel--yg88 .field-code {
    width: 519px;
    max-width: 90%;
    height: 51px;
    border-radius: 5px;
    border: none;
    padding: 0 20px;
    text-align: center;
    font-size: 19px;
    font-weight: 500;
    color: #1f2733;
    background: linear-gradient(to bottom, #fdfeff, #eaedfc);
    box-shadow:
        0 0 5px rgba(69,121,188,0.25),
        inset 0 -4px 1px #fff,
        inset 0 4px 3px #fff;
}
.panel--yg88 .field-code::placeholder { color: #8da6c3; font-weight: 500; }
.panel--yg88 .field-code:focus {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(43,182,40,0.3),
        0 0 5px rgba(69,121,188,0.25),
        inset 0 -4px 1px #fff,
        inset 0 4px 3px #fff;
}

.panel--yg88 .btn-submit--yg88 {
    position: absolute;
    top: 262px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 228px;
    height: 50px;
    margin: 0;
    padding: 0 16px;
    border: 3px solid transparent;
    border-radius: 25px;
    background:
        linear-gradient(180deg, #42bf5a 23%, #048022 100%) padding-box,
        linear-gradient(180deg, #d9f7a5 0%, #77c182 100%) border-box;
    box-shadow: 0 4px 2px rgba(0,0,0,0.25);
    overflow: hidden;
    cursor: pointer;
}
.panel--yg88 .btn-submit--yg88::before {
    content: "";
    position: absolute;
    top: 10.82%;
    right: 5.89%;
    bottom: 41.87%;
    left: 5.25%;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.45) 0%, rgba(124,133,142,0.35) 100%);
    mix-blend-mode: screen;
    pointer-events: none;
}
.panel--yg88 .btn-submit--yg88::after { display: none; }
.panel--yg88 .btn-submit--yg88 .btn-submit-text {
    position: relative;
    z-index: 2;
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,50,103,0.65);
    text-transform: uppercase;
    letter-spacing: -0.47px;
    line-height: 1;
}
.panel--yg88 .btn-submit--yg88:hover {
    transform: translateX(-50%) translateY(-2px);
    filter: brightness(1.05);
    box-shadow: 0 6px 4px rgba(0,0,0,0.3);
}
.panel--yg88 .btn-submit--yg88:active {
    transform: translateX(-50%) translateY(0);
}
.panel--yg88 .btn-submit--yg88:disabled {
    cursor: wait;
    filter: brightness(0.95);
}

.panel--yg88 .panel-links {
    position: absolute;
    top: 327px;
    left: 85px;
    width: 440px;
    margin: 0;
    gap: 8px;
}

.panel--yg88 .btn-link {
    flex: 1;
    height: auto;
    padding: 12.67px 18.67px;
    background: #65cb66;
    border: 1px solid #fffa01;
    border-radius: 10px;
    font-size: 14px;
    color: #fff;
    box-shadow: 0 5px 7.5px rgba(77,166,255,0.1);
}
.panel--yg88 .btn-link:nth-child(2) { border-color: #fef501; }
.panel--yg88 .btn-link:hover {
    filter: brightness(1.1);
    box-shadow: 0 8px 12px rgba(77,166,255,0.2);
}

.panel--yg88 .btn-event {
    position: absolute;
    top: 388px;
    left: 85px;
    width: 440px;
    margin: 0;
    height: auto;
    padding: 12.67px 18.67px;
    background: rgba(150,160,170,0.4);
    border: 1px solid #faefb2;
    color: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.panel--yg88 .btn-event:hover {
    filter: brightness(1.1);
    box-shadow: 0 8px 18px rgba(0,0,0,0.15);
}

/* ---- Mobile YG88 panel overrides ---- */
.panel--mb.panel--yg88 {
    left: 0;
    top: 358px;
    width: 440px;
    height: 322px;
    padding: 0;
}

.panel--mb.panel--yg88 .panel-title {
    font-size: 20px;
    letter-spacing: -0.2px;
    line-height: 38px;
}

.panel--mb.panel--yg88 .panel-form {
    top: 106px;
}

.panel--mb.panel--yg88 .panel-label {
    color: #fff200;
    font-size: 12px;
    letter-spacing: -0.24px;
}

.panel--mb.panel--yg88 .field-code {
    width: 247px;
    max-width: 72%;
    height: 38px;
    font-size: 10px;
}
.panel--mb.panel--yg88 .field-code::placeholder { color: #858585; }

.panel--mb.panel--yg88 .btn-submit--yg88 {
    top: 174px;
    width: auto;
    min-width: 129px;
    height: 32px;
    padding: 0 12px;
    border-radius: 16px;
    border-width: 2px;
}
.panel--mb.panel--yg88 .btn-submit--yg88::before {
    border-radius: 14px;
}
.panel--mb.panel--yg88 .btn-submit--yg88 .btn-submit-text {
    font-size: 11px;
    letter-spacing: -0.2px;
    white-space: nowrap;
}
.panel--mb.panel--yg88 .btn-submit--yg88:hover {
    transform: translateX(-50%) translateY(-1px);
}

.panel--mb.panel--yg88 .panel-links {
    top: 217px;
    left: 67px;
    width: 306px;
    gap: 6px;
}

.panel--mb.panel--yg88 .btn-link {
    padding: 10px 12px;
    background: rgba(0,0,0,0.7);
    border: 1px solid #fff500;
    border-radius: 10px;
    font-size: 8px;
    box-shadow: 0 5px 15px rgba(77,166,255,0.1);
}
.panel--mb.panel--yg88 .btn-link:nth-child(2) { border-color: #fff701; }
.panel--mb.panel--yg88 .btn-link i { font-size: 10px; }

.panel--mb.panel--yg88 .btn-event {
    top: 271px;
    left: 67px;
    width: 306px;
    padding: 10px 14px;
    font-size: 10px;
}

/* ---- Head: badge + title + subtitle ---- */
.panel-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.panel-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff6da, #f4db8d 45%, #cf9b3a 100%);
    color: #3a2600;
    box-shadow: 0 6px 16px rgba(207,155,58,0.4), inset 0 2px 3px rgba(255,255,255,0.6);
}
.scene--mb .panel:not(.panel--yg88) .panel-badge { width: 38px; height: 38px; font-size: 17px; margin-bottom: 6px; }

.panel-title {
    color: #ffffff;
    font-weight: 800;
    text-align: center;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
    background: linear-gradient(180deg, #ffffff 0%, #ffeeba 130%);
    -webkit-background-clip: text;
    background-clip: text;
}
.scene--mb .panel:not(.panel--yg88) .panel-title { font-size: 18px; letter-spacing: 0.2px; }

.panel-sub {
    color: rgba(255,255,255,0.55);
    text-align: center;
    font-weight: 500;
}
.scene--mb .panel:not(.panel--yg88) .panel-sub { font-size: 11px; margin-top: 3px; margin-bottom: 12px; }

.panel-label {
    align-self: flex-start;
    color: #f4db8d;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-align: left;
}
.scene--mb .panel:not(.panel--yg88) .panel-label { font-size: 13px; margin-bottom: 6px; }

/* ---- Field with leading icon ---- */
.panel-field {
    position: relative;
    width: 100%;
}
.field-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #b9892f;
    pointer-events: none;
}
.scene--pc .field-icon { left: 22px; font-size: 18px; }
.scene--mb .field-icon { left: 16px; font-size: 15px; }

.field-code {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.7);
    border-radius: 14px;
    background: linear-gradient(to bottom, #ffffff, #eef1fa);
    color: #1f2733;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    text-align: left;
    box-shadow:
        0 4px 14px rgba(0,0,0,0.25),
        inset 0 -3px 1px rgba(255,255,255,0.8),
        inset 0 3px 4px #ffffff;
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}
.field-code::placeholder { color: #9aa7bd; font-weight: 500; }
.field-code:focus {
    outline: none;
    border-color: #f4db8d;
    box-shadow:
        0 0 0 3px rgba(244,219,141,0.35),
        0 6px 18px rgba(231,200,120,0.35),
        inset 0 -3px 1px rgba(255,255,255,0.8),
        inset 0 3px 4px #ffffff;
}
.scene--mb .panel:not(.panel--yg88) .field-code { height: 46px; font-size: 15px; padding: 0 16px 0 42px; }

.panel-divider {
    width: 86%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(231,200,120,0.5), transparent);
}
.scene--mb .panel-divider { margin: 16px 0; }

.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    border: 1px solid #ffe9a8;
    border-radius: 14px;
    background: linear-gradient(180deg, #fff6d6 0%, #f6dd8f 42%, #e3b04f 78%, #cf9837 100%);
    color: #3a2600;
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease;
    box-shadow: 0 8px 20px rgba(207,152,55,0.4), inset 0 2px 2px rgba(255,255,255,0.7), inset 0 -3px 4px rgba(150,100,20,0.3);
}
.btn-submit i { font-size: 0.95em; }
.btn-submit::after {
    content: "";
    position: absolute;
    top: 0; left: -60%;
    width: 40%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,0.6), transparent);
    transform: skewX(-20deg);
    animation: btnShine 3.4s ease-in-out infinite;
}
.btn-submit:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 12px 26px rgba(207,152,55,0.5), inset 0 2px 2px rgba(255,255,255,0.7); }
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled { cursor: wait; filter: brightness(0.95) saturate(0.85); }
.scene--mb .panel:not(.panel--yg88) .btn-submit { height: 46px; font-size: 14px; margin-top: 12px; }

@keyframes btnShine {
    0%, 60% { left: -60%; }
    100% { left: 130%; }
}

.panel-links {
    display: flex;
    gap: 14px;
    width: 100%;
    justify-content: center;
}
.scene--mb .panel:not(.panel--yg88) .panel-links { margin-top: 12px; gap: 10px; }

.btn-link, .btn-event {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    border-radius: 10px;
    background: rgba(0,0,0,0.7);
    border: 1px solid rgba(77,166,255,0.3);
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
    transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease;
    box-shadow: 0 5px 15px rgba(77,166,255,0.1);
}
.btn-link { flex: 1; }
.btn-link i, .btn-event i { color: #ffffff; transition: transform 0.16s ease; }
.btn-link:hover, .btn-event:hover {
    transform: translateY(-2px);
    filter: brightness(1.12);
    box-shadow: 0 8px 18px rgba(77,166,255,0.25);
}
.btn-link:hover i, .btn-event:hover i { transform: translateX(3px); }

.scene--mb .panel:not(.panel--yg88) .btn-link { height: 40px; font-size: 10px; padding: 0 6px; letter-spacing: 0; gap: 5px; }
.scene--mb .panel:not(.panel--yg88) .btn-link i { font-size: 9px; }

.btn-event {
    width: 100%;
    background: rgba(150,160,170,0.4);
    border: 1px solid #faefb2;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.scene--mb .panel:not(.panel--yg88) .btn-event { height: 40px; font-size: 12px; margin-top: 10px; }

/* Barcode ticket strip */
.panel-barcode {
    width: 100%;
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff, #e9ecf2);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.35);
}
.scene--pc .panel-barcode { height: 60px; margin-top: 16px; }
.scene--mb .panel-barcode { height: 50px; margin-top: 12px; }
.panel-barcode span {
    display: block;
    width: 82%;
    height: 62%;
    background-image: repeating-linear-gradient(90deg,
        #111 0, #111 2px, transparent 2px, transparent 4px,
        #111 4px, #111 7px, transparent 7px, transparent 9px,
        #111 9px, #111 10px, transparent 10px, transparent 13px,
        #111 13px, #111 16px, transparent 16px, transparent 18px);
}

/* ===================== ANIMATIONS ===================== */
@media (prefers-reduced-motion: no-preference) {
    .anim-float       { animation: floatY 6s ease-in-out infinite; }
    .anim-float2      { animation: floatY 7.5s ease-in-out infinite; animation-delay: -1.2s; }
    .anim-bob         { animation: bobY 5s ease-in-out infinite; }
    .anim-bob2        { animation: bobY 6.2s ease-in-out infinite; animation-delay: -0.8s; }
    .anim-float-soft  { animation: floatSoft 5.5s ease-in-out infinite; }
    .anim-fly         { animation: flyMove 8s ease-in-out infinite; }
    .anim-fly2        { animation: flyMove2 9.5s ease-in-out infinite; animation-delay: -2s; }
    .anim-twinkle     { animation: twinkle 3s ease-in-out infinite; }
    .anim-twinkle2    { animation: twinkle 4.2s ease-in-out infinite; animation-delay: -1.5s; }
    .anim-breathe     { animation: breathe 5s ease-in-out infinite; }
    .anim-breathe-slow{ animation: breathe 9s ease-in-out infinite; }
    .anim-sway        { animation: sway 7s ease-in-out infinite; }
    .anim-sway-rev    { animation: swayRev 7.5s ease-in-out infinite; }
    .anim-glow        { animation: glowPulse 4s ease-in-out infinite; }
}

@keyframes floatY {
    0%, 100% { translate: 0 0; }
    50%      { translate: 0 -16px; }
}
@keyframes bobY {
    0%, 100% { translate: 0 0; }
    50%      { translate: 0 -8px; }
}
@keyframes floatSoft {
    0%, 100% { translate: 0 0; scale: 1; }
    50%      { translate: 0 -8px; scale: 1.015; }
}
@keyframes flyMove {
    0%, 100% { translate: 0 0; rotate: -4deg; }
    50%      { translate: 14px -22px; rotate: 4deg; }
}
@keyframes flyMove2 {
    0%, 100% { translate: 0 0; rotate: 3deg; }
    50%      { translate: -16px -18px; rotate: -3deg; }
}
@keyframes twinkle {
    0%, 100% { opacity: 0.35; scale: 0.9; }
    50%      { opacity: 1; scale: 1.1; }
}
@keyframes breathe {
    0%, 100% { opacity: 0.6; }
    50%      { opacity: 1; }
}
@keyframes sway {
    0%, 100% { rotate: -2deg; }
    50%      { rotate: 2deg; }
}
@keyframes swayRev {
    0%, 100% { rotate: 2deg; }
    50%      { rotate: -2deg; }
}
@keyframes glowPulse {
    0%, 100% { filter: brightness(1) drop-shadow(0 0 6px rgba(231,200,120,0.4)); }
    50%      { filter: brightness(1.15) drop-shadow(0 0 18px rgba(231,200,120,0.7)); }
}
/* Modal kết quả kiểm tra code */
.result-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
}

.result-modal-content {
    position: relative;
    background: rgba(8, 28, 12, 0.96);
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    overflow: hidden;
    padding: 0;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 20px rgba(83, 224, 125, 0.35);
    border: 1px solid rgba(83, 224, 125, 0.45);
    animation: modalFadeIn 0.4s ease;
    color: #ffffff;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close-modal {
    position: absolute;
    top: 12px;
    right: 15px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    z-index: 5;
    transition: all 0.2s ease;
    height: 30px;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
}

.close-modal:hover {
    color: #ffffff;
    background: rgba(83, 224, 125, 0.35);
    transform: scale(1.1);
}

.result-header {
    background: linear-gradient(135deg, var(--main-color), var(--secondary-color));
    padding: 22px 20px;
    text-align: center;
    position: relative;
    border-bottom: none;
}

.result-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.result-logo {
    max-width: 100px;
    margin-bottom: 12px;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
}

.result-header h2 {
    margin: 0;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-size: 18px;
    letter-spacing: 1px;
    font-weight: 700;
}

.result-body {
    padding: 25px 20px;
    background: rgba(8, 28, 12, 0.96);
}

.result-info {
    margin-bottom: 25px;
}

.result-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.result-table tr {
    transition: all 0.2s ease;
    position: relative;
}

.result-table tr:hover {
    background: rgba(83, 224, 125, 0.08);
}

.result-table tr::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(83, 224, 125, 0.2), transparent);
}

.result-table tr:last-child::after {
    display: none;
}

.result-table td {
    padding: 12px 10px;
    font-size: 15px;
    vertical-align: middle;
}

.result-table td:first-child {
    width: 40%;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 13px;
}

.result-table td:last-child {
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.3px;
}

#result-code {
    color: var(--main-color);
    font-weight: 700;
    letter-spacing: 1px;
}

#result-status {
    font-weight: 700;
}

#result-points, #result-money {
    font-weight: 700;
    color: var(--main-color);
}

.username-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(83, 224, 125, 0.45);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    background: rgba(0, 0, 0, 0.3);
    color: #ffffff;
    transition: all 0.3s ease;
}

.username-input:focus {
    border-color: var(--main-color);
    box-shadow: 0 0 8px rgba(83, 224, 125, 0.5);
    background: rgba(0, 0, 0, 0.5);
}

.username-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.result-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
    gap: 12px;
}

.result-button {
    padding: 12px 0;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    margin: 0;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.result-button.confirm {
    background: linear-gradient(to right, var(--main-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(83, 224, 125, 0.35);
}

.result-button.cancel {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.result-button:hover {
    transform: translateY(-3px);
}

.result-button.confirm:hover {
    background: linear-gradient(to right, var(--secondary-color), var(--main-color));
    box-shadow: 0 6px 18px rgba(83, 224, 125, 0.45);
}

.result-button.cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Màu sắc cho các trạng thái */
.status-valid {
    color: #53e07d !important;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(83, 224, 125, 0.4);
}

.status-expired {
    color: #F39C12 !important;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(243, 156, 18, 0.3);
}

.status-invalid {
    color: #E74C3C !important;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(231, 76, 60, 0.3);
}

.status-used {
    color: #65cb66 !important;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(101, 203, 102, 0.4);
}

.status-limit {
    color: #42bf5a !important;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(66, 191, 90, 0.4);
}

/* Style cho phần hạn sử dụng hết hạn */
.expired-date {
    text-decoration: line-through;
    color: #F39C12 !important;
    font-weight: 700;
    opacity: 0.8;
}

/* CSS cho các trạng thái modal — tất cả header xanh lá tươi */
.result-header.valid {
    background: linear-gradient(to right, #53e07d, #229133);
}

.result-header.expired {
    background: linear-gradient(to right, #65cb66, #2bb628);
}

.result-header.invalid {
    background: linear-gradient(to right, #42bf5a, #048022);
}

.result-header.used {
    background: linear-gradient(to right, #53e07d, #2bb628);
}

.result-header.limit-reached {
    background: linear-gradient(to right, #65cb66, #229133);
}

/* Cập nhật màu sắc wave cho các trạng thái */
.result-header.valid::after {
    background-image: linear-gradient(45deg, transparent 33.333%, #53e07d 33.333%, #53e07d 66.667%, transparent 66.667%);
}

.result-header.expired::after {
    background-image: linear-gradient(45deg, transparent 33.333%, #65cb66 33.333%, #65cb66 66.667%, transparent 66.667%);
}

.result-header.invalid::after {
    background-image: linear-gradient(45deg, transparent 33.333%, #42bf5a 33.333%, #42bf5a 66.667%, transparent 66.667%);
}

.result-header.used::after {
    background-image: linear-gradient(45deg, transparent 33.333%, #53e07d 33.333%, #53e07d 66.667%, transparent 66.667%);
}

.result-header.limit-reached::after {
    background-image: linear-gradient(45deg, transparent 33.333%, #65cb66 33.333%, #65cb66 66.667%, transparent 66.667%);
}

/* Responsive cho modal */
@media screen and (max-width: 480px) {
    .result-modal-content {
        width: 95%;
        max-width: 340px;
    }
    
    .result-header h2 {
        font-size: 16px;
    }
    
    .result-logo {
        max-width: 80px;
    }
    
    .result-button {
        font-size: 13px;
        padding: 10px 0;
    }
    
    .result-table td {
        padding: 10px 5px;
        font-size: 14px;
    }
    
    .result-table td:first-child {
        font-size: 12px;
    }
    
    .result-body {
        padding: 20px 15px;
    }
}

/* ===== MAINTENANCE OVERLAY ===== */
#maintenance-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    justify-content: center;
    align-items: center;
}

#maintenance-overlay.active {
    display: flex;
    animation: maintFadeIn 0.5s ease forwards;
}

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

.maint-box {
    position: relative;
    background: rgba(8, 28, 12, 0.96);
    border: 1px solid rgba(83, 224, 125, 0.5);
    border-radius: 24px;
    padding: 50px 40px 40px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    box-shadow:
        0 0 0 1px rgba(83, 224, 125, 0.12),
        0 25px 60px rgba(0, 0, 0, 0.7),
        0 0 50px rgba(83, 224, 125, 0.18);
    animation: maintSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    overflow: hidden;
}

@keyframes maintSlideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.maint-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(83, 224, 125, 0.08) 0%, transparent 60%);
    pointer-events: none;
    border-radius: inherit;
}

.maint-spinner-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.maint-spinner {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(83, 224, 125, 0.18), rgba(34, 145, 51, 0.1));
    border: 3px solid rgba(83, 224, 125, 0.2);
    border-top-color: #53e07d;
    border-right-color: #229133;
    animation: maintSpin 1.2s linear infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(83, 224, 125, 0.35), inset 0 0 15px rgba(83, 224, 125, 0.08);
    position: relative;
}

.maint-spinner i {
    font-size: 28px;
    background: linear-gradient(135deg, #53e07d, #229133);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: maintSpinReverse 1.2s linear infinite;
}

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

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

.maint-logo {
    max-width: 160px;
    height: auto;
    margin-bottom: 24px;
    filter: drop-shadow(0 0 12px rgba(83, 224, 125, 0.55));
    animation: pulse-zoom 2s infinite alternate ease-in-out;
}

.maint-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(90deg, #53e07d, #ffffff, #229133);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: maintShine 3s linear infinite;
    margin-bottom: 14px;
}

@keyframes maintShine {
    to { background-position: 200% center; }
}

.maint-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #53e07d, #229133);
    border-radius: 2px;
    margin: 0 auto 20px;
    box-shadow: 0 0 10px rgba(83, 224, 125, 0.55);
}

.maint-desc {
    color: rgba(255, 255, 255, 0.72);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 28px;
}

.maint-desc strong {
    color: #53e07d;
}

.maint-progress-wrap {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    height: 6px;
    overflow: hidden;
    margin-bottom: 28px;
}

.maint-progress-bar {
    height: 100%;
    width: 15%;
    background: linear-gradient(90deg, #53e07d, #229133, #53e07d);
    background-size: 200% auto;
    border-radius: 50px;
    animation: maintProgress 3s ease-in-out infinite, maintShine 2s linear infinite;
}

@keyframes maintProgress {
    0%   { width: 15%; }
    50%  { width: 85%; }
    100% { width: 15%; }
}

.maint-contact {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.maint-contact a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: 1px solid rgba(83, 224, 125, 0.4);
    background: rgba(0, 0, 0, 0.5);
    color: #53e07d;
}

.maint-contact a:hover {
    background: rgba(83, 224, 125, 0.22);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(83, 224, 125, 0.3);
    color: #ffffff;
}

.maint-dots {
    position: absolute;
    top: 18px;
    left: 22px;
    display: flex;
    gap: 7px;
}

.maint-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: block;
}

.maint-dots span:nth-child(1) { background: #53e07d; }
.maint-dots span:nth-child(2) { background: #65cb66; }
.maint-dots span:nth-child(3) { background: #229133; }

@media screen and (max-width: 480px) {
    .maint-box {
        padding: 42px 22px 32px;
    }
    .maint-title {
        font-size: 18px;
    }
    .maint-desc {
        font-size: 14px;
    }
    .maint-logo {
        max-width: 120px;
    }
    .maint-spinner {
        width: 64px;
        height: 64px;
    }
    .maint-spinner i {
        font-size: 22px;
    }
}
/* ===== END MAINTENANCE OVERLAY ===== */
