:root{
    --primary:#00aaff;
    --secondary:#ff6b6b;
    --dark:#0a0e1a;
    --glass:rgba(16, 22, 40, 0.83);
    --glass-hover:rgba(45, 104, 191, 0.2);
    --snow:#fff;
    --star:#ffd700;
}
*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:Poppins,sans-serif;
}

/* NỀN */
body{
    min-height:100vh;
    display:flex;
    justify-content:center;
    align-items:center;
        padding:1rem;            /* gọn */
    overflow-x:hidden;       /* chặn ngang */
    overflow-y:auto;         /* ✅ cho cuộn dọc */
    position:relative;
   
    color:#fff;
    background:#0a0e1a url("../IMAGE/bg-index.jpg") center/cover no-repeat fixed;
    background-attachment:fixed;
    background-image:
        radial-gradient(circle at 20% 80%,rgba(0,170,255,.18) 0,transparent 55%),
        radial-gradient(circle at 80% 20%,rgba(255,107,107,.18) 0,transparent 55%),
        radial-gradient(circle at 50% 30%,rgba(120,80,160,.12) 0,transparent 65%);
    animation:bgPulse 18s ease-in-out infinite;
}
@keyframes bgPulse{
    0%,100%{
        background-image:
            radial-gradient(circle at 20% 80%,rgba(0,170,255,.18) 0,transparent 55%),
            radial-gradient(circle at 80% 20%,rgba(255,107,107,.18) 0,transparent 55%),
            radial-gradient(circle at 50% 30%,rgba(120,80,160,.12) 0,transparent 65%);
    }
    50%{
        background-image:
            radial-gradient(circle at 30% 75%,rgba(0,170,255,.25) 0,transparent 55%),
            radial-gradient(circle at 75% 25%,rgba(255,107,107,.25) 0,transparent 55%),
            radial-gradient(circle at 50% 30%,rgba(120,80,160,.16) 0,transparent 65%);
    }
}

/* Sao */
.stars{
    position:absolute;
    inset:0;
    pointer-events:none;
    z-index:0;
}
.star{
    position:absolute;
    background:var(--star);
    border-radius:50%;
    box-shadow:0 0 8px var(--star);
    animation:twinkle 3s infinite alternate;
}
@keyframes twinkle{
    0%{opacity:.3;transform:scale(.8)}
    100%{opacity:1;transform:scale(1.2)}
}
/* Ảnh icon nằm trong vòng tròn logo */
.logo-img{
    width: 62%;
    height: 62%;
    object-fit: contain;
    display: block;
    pointer-events: none;
    user-select: none;

    /* làm ảnh sáng + nổi hơn trên nền gradient */
    filter: drop-shadow(0 0 12px rgba(255,255,255,0.25));
}

/* Tuyết */
.snowflake{
    position:absolute;
    top:-10px;
    color:var(--snow);
    font-size:.8em;
    user-select:none;
    pointer-events:none;
    animation:fall linear infinite;
    opacity:.7;
    z-index:1;
}
@keyframes fall{
    to{
        transform:translateY(100vh);
        opacity:0;
    }
}

/* Đèn */
.christmas-lights{
    position:absolute;
    top:0;left:0;
    width:100%;height:50px;
    pointer-events:none;
    z-index:1;
    overflow:hidden;
}
.light{
    position:absolute;
    width:10px;height:10px;
    border-radius:50%;
    animation:blink 1.8s infinite alternate;
}
.light:nth-child(odd){
    background:#e74c3c;
    animation-delay:.3s;
}
.light:nth-child(even){
    background:#27ae60;
    animation-delay:.9s;
}
@keyframes blink{
    0%{opacity:.5;transform:scale(.7)}
    100%{opacity:1;transform:scale(1.1)}
}

/* KHUNG CHÍNH – có ánh sáng phía sau */
.card{
    width:100%;
    max-width:380px;
    padding:1.7rem 1.3rem 1.4rem;
    background:radial-gradient(circle at 0% 0%, rgba(255,255,255,0.08), transparent 60%),
                radial-gradient(circle at 100% 100%, rgba(0,172,255,0.16), transparent 60%),
                var(--glass);
    border-radius:24px;
    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);
    border:1px solid rgba(255,255,255,.16);
    box-shadow:
        0 18px 55px rgba(0,0,0,.7),
        0 0 40px rgba(56,189,248,.35);
    text-align:center;
    position:relative;
    overflow:hidden;
    display:flex;
    flex-direction:column;
    gap:.55rem;
    z-index:10;
}

.card::after{
    content:'';
    position:absolute;
    inset:-40px;
    background:
        radial-gradient(circle at 20% 0%, rgba(56,189,248,0.5), transparent 60%),
        radial-gradient(circle at 80% 100%, rgba(251,191,36,0.45), transparent 60%),
        radial-gradient(circle at 50% 50%, rgba(248,250,252,0.25), transparent 55%);
    filter:blur(20px);
    opacity:0.9;
    z-index:-1;
}

.card::before{
    content:'';
    position:absolute;
    inset:-1px;
    border-radius:inherit;
    padding:1px;
    background:conic-gradient(from 140deg,
        rgba(0,170,255,.9),
        rgba(255,107,107,.9),
        rgba(128,90,255,.9),
        rgba(0,170,255,.9));
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite:xor;
    mask-composite:exclude;
    opacity:.7;
    pointer-events:none;
}

.logo-wrap{
    position:relative;
    display:flex;
    justify-content:center;
    margin-bottom:.1rem;
}
.logo-bg{
    position:absolute;
    width:80px;height:80px;
    background:radial-gradient(circle,rgba(0,170,255,.5),transparent 70%);
    filter:blur(16px);
    top:6px;
    z-index:-1;
}
.logo{
    width:58px;height:58px;
    background:linear-gradient(135deg,#00c3ff,#ff7b7b);
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:1.6rem;
    color:#fff;
    box-shadow:0 0 18px rgba(0,170,255,.7);
    animation:pulse 2.2s infinite;
    border:2px solid rgba(255,255,255,.8);
}
@keyframes pulse{
    0%,100%{transform:scale(1);box-shadow:0 0 18px rgba(0,170,255,.7);}
    50%{transform:scale(1.06);box-shadow:0 0 30px rgba(0,170,255,1);}
}

.title{
    font-family:Oswald,sans-serif;
    font-size:1.6rem;
    margin-bottom:.05rem;
    letter-spacing:0.04em;
    text-transform:uppercase;
    background:linear-gradient(90deg,#00f5ff,#ff8a8a);
    -webkit-background-clip:text;
    -webkit-text-fill-color:transparent;
}
.title span{
    display:block;
    font-size:.78rem;
    color:#d6e1ff;
    margin-top:.15rem;
    font-weight:400;
    text-transform:none;
}

.highlight-text{
    font-size:.9rem;
    font-weight:600;
    margin-top:.4rem;
    margin-bottom:.1rem;
    color:#f8f8ff;
}
.highlight-text span{
    color:#ffcf6d;
}
.author{
    font-size:.8rem;
    color:#cbd5ff;
    margin-bottom:.9rem;
}

.divider{
    width:72%;
    height:1px;
    margin:0 auto 1rem;
    background:linear-gradient(90deg,transparent,#6dd5ff,transparent);
    opacity:.7;
}

/* Lưới game */
.game-grid{
    display:grid;
    grid-template-columns:repeat(2, minmax(0,1fr));
    gap:1.05rem 1.35rem;
    margin:0 auto 1.35rem;
    max-width:270px;
}
.game-item{
    background:radial-gradient(circle at 20% 20%,rgba(255,255,255,.16),rgba(0,0,0,.9));
    padding:.6rem .55rem .65rem;
    border-radius:20px;
    box-shadow:0 12px 28px rgba(0,0,0,.65);
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:flex-start;
    transition:
        transform .22s ease,
        box-shadow .22s ease,
        background .22s ease,
        border-color .22s ease;
    cursor:pointer;
    border:1px solid rgba(255,255,255,.08);
}
.game-thumb{
    position:relative;
    border-radius:18px;
    overflow:hidden;
}
.game-thumb::before{
    content:'';
    position:absolute;
    inset:0;
    background:linear-gradient(145deg,rgba(255,255,255,.28),transparent 40%);
    mix-blend-mode:soft-light;
    opacity:.7;
    pointer-events:none;
}
.game-item img{
    width:88px;
    height:88px;
    border-radius:18px;
    object-fit:cover;
    display:block;
}
.game-name{
    margin-top:.45rem;
    font-size:.78rem;
    font-weight:600;
    letter-spacing:.02em;
    color:#ffea7a;
    text-transform:uppercase;
}
.game-tag{
    margin-top:.1rem;
    font-size:.7rem;
    color:#00c98d;
}
.game-item:hover{
    transform:translateY(-4px) scale(1.03) rotate(-1deg);
    box-shadow:0 18px 32px rgba(0,170,255,.45);
    background:radial-gradient(circle at 0% 0%,rgba(0,170,255,.38),rgba(0,0,0,.95));
    border-color:rgba(111,207,255,.9);
}

/* Nút MXH */
.btn-row{
    display:flex;
    gap:.7rem;
    justify-content:center;
    margin-top:.2rem;
}
.btn{
    flex:1;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:.7rem .3rem;
    border-radius:999px;
    font-size:.9rem;
    font-weight:500;
    border:none;
    cursor:pointer;
    text-decoration:none;
    color:#fff;
    box-shadow:0 10px 22px rgba(0,0,0,.55);
    transition:transform .2s ease, box-shadow .2s ease, filter .2s ease;
    white-space:nowrap;
}
.btn i{
    margin-right:.4rem;
    font-size:1.2rem;
}
.btn.fb{
    background:linear-gradient(120deg,#4c6fff,#9b5bff);
}
.btn.tg{
    background:linear-gradient(120deg,#00c98d,#00a1ff);
}
.btn:hover{
    transform:translateY(-2px);
    box-shadow:0 14px 26px rgba(0,0,0,.7);
    filter:brightness(1.07);
}

.footer-note{
    margin-top:.5rem;
    font-size:.72rem;
    color:#b5c3ff;
    opacity:.9;
}
.btn.zalo{
    background:linear-gradient(120deg,#0f9dff,#38bdf8);
}


.icon-zalo{
    width:18px;
    height:18px;
    margin-right:.4rem;
    border-radius:4px;
    object-fit:cover;
}

@media (max-width:480px){
    body{padding:.8rem;}
    .card{
        padding:1.35rem 1.05rem 1.2rem;
        border-radius:20px;
    }
    .logo{
        width:52px;height:52px;
        font-size:1.45rem;
    }
    .title{font-size:1.45rem;}
    .title span{font-size:.74rem;}
    .game-grid{
        gap:.95rem 1.1rem;
        max-width:245px;
    }
    .game-item img{
        width:80px;
        height:80px;
    }
    .btn{
        font-size:.84rem;
    }
}


/* SweetAlert2 custom */
.swal-custom{
    border-radius:20px !important;
    padding:1.1rem 1rem 1rem !important;
    width:min(360px, 92vw) !important;
    box-shadow:0 14px 35px rgba(15,23,42,0.28) !important;
    background:radial-gradient(circle at 0% 0%, #e0f2fe, transparent 55%),
               radial-gradient(circle at 100% 100%, #fee2e2, transparent 55%),
               #f9fafb !important;
    color:#0f172a !important;
}
.swal-title{
    font-size:1.25rem !important;
    font-weight:700 !important;
    color:#0f172a !important;
}
.swal-html{
    font-size:.86rem !important;
    color:#334155 !important;
}
.swal-input{
    border-radius:999px !important;
    border:1px solid #cbd5f5 !important;
    padding:.55rem .9rem !important;
    font-size:.9rem !important;
    outline:none !important;
    box-shadow:none !important;
}
.swal-input:focus{
    border-color:#0ea5e9 !important;
    box-shadow:0 0 0 1px rgba(14,165,233,.4) !important;
}
.swal-confirm{
    border-radius:999px !important;
    padding:.55rem 1.4rem !important;
    font-size:.9rem !important;
    font-weight:600 !important;
    background:linear-gradient(120deg,#0ea5e9,#22c55e) !important;
}
.swal-cancel{
    border-radius:999px !important;
    padding:.55rem 1.2rem !important;
    font-size:.86rem !important;
    font-weight:500 !important;
    background:#e5e7eb !important;
    color:#111827 !important;
}
.swal2-actions{
    gap:.55rem !important;
}
.swal2-icon{
    margin-top:.4rem !important;
}
.swal2-html-container{
    margin-top:.3rem !important;
}

@media (max-width:480px){
    .swal-custom{
        width:92vw !important;
        padding:1rem .9rem .9rem !important;
    }
    .swal-title{
        font-size:1.1rem !important;
    }
    .swal-html{
        font-size:.8rem !important;
    }
    .swal-input{
        font-size:.85rem !important;
    }
    .swal-confirm,
    .swal-cancel{
        width:100% !important;
        justify-content:center !important;
    }
    .swal2-actions{
        flex-direction:column-reverse !important;
    }
}
/* ===== SweetAlert footer dưới input (nhớ key) ===== */
.swal2-footer{
  margin-top:.45rem !important;
  padding-top:0 !important;
  border-top:none !important;
  width:100% !important;
}

.swal-footer-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.6rem;
  width:100%;
  padding:0 .1rem;
}

.remember-label{
  display:flex;
  align-items:center;
  gap:.45rem;
  font-size:.82rem;
  color:#334155;
  cursor:pointer;
  user-select:none;
}

.remember-label input{
  width:16px;
  height:16px;
  accent-color:#0ea5e9;
}

.forget-key-btn{
  border:none;
  background:transparent;
  color:#ef4444;
  font-weight:600;
  font-size:.82rem;
  cursor:pointer;
  padding:.22rem .4rem;
  border-radius:10px;
}

.forget-key-btn:hover{
  background:rgba(239,68,68,.08);
}

@media (max-width:480px){
  .swal-footer-row{
    flex-direction:column;
    align-items:flex-start;
    gap:.35rem;
  }
  .forget-key-btn{
    padding-left:0;
  }
}
