﻿/* ================== RESET ================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

body {
    background: linear-gradient(180deg, #e8f5ff 0%, #dff0fb 46%, #d7eaf7 100%);
    color: #222;
    line-height: 1.6;
}

html {
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
}

/* ================== HEADER ================== */
.header {
    position: relative;
    background: linear-gradient(180deg, rgba(27,89,140,0.9) 0%, rgba(19,70,114,0.88) 100%);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    padding: 18px 40px;
    box-shadow: 0 4px 18px rgba(10,44,74,0.28);
    border-bottom: 1px solid rgba(173,214,246,0.28);
}

#logo {
    width: 56px;
    height: 56px;
    overflow: visible;      /* cho phép tràn */
}

#logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: scale(1.4);
    transform-origin: center;
    border-radius: 50%;
}

.main {
    font-weight: 900;
    letter-spacing: 4px;
    font-size: 38px;
    line-height: 1;
    text-transform: uppercase;
    background: linear-gradient(180deg, #ffe9a3 0%, #ffd24d 35%, #f2b705 60%, #cc8a00 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 4px 10px rgba(255,209,77,0.38), 0 10px 22px rgba(173,111,0,0.35);
    margin-right: 18px;
}

.nav {
    display: flex;
    gap: 28px;
    position: relative;
    margin-left: auto;
    background: rgba(255,255,255,0.72);
    border: 1px solid rgba(47,117,187,0.2);
    border-radius: 16px;
    padding: 10px 16px;
    box-shadow: 0 8px 22px rgba(0,0,0,0.08);
}

.nav a,
.nav .nav-notice-btn {
    text-decoration: none;
    font-weight: 700;
    color: #2d3138;
    cursor: pointer;
    position: relative;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(47,117,187,0.18);
    background: rgba(255,255,255,0.9);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: background .25s, border-color .25s, color .25s, transform .25s, box-shadow .25s;
    font-size: 16px;
}

.nav .nav-notice-btn {
    font-family: inherit;
    font-size: inherit;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav .nav-notice-btn i {
    font-size: 13px;
}

.nav .notice-label {
    font-family: inherit;
    font-size: inherit;
    font-weight: 700;
}

.nav a::after,
.nav .nav-notice-btn::after {
    display: none;
}

.nav a:hover,
.nav .nav-notice-btn:hover {
    background: #eef5fd;
    border-color: rgba(47,117,187,0.42);
    color: #1f5ea4;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(47,117,187,0.16);
}

.nav-notice-btn.has-notice {
    position: relative;
}

.nav-notice-btn .notice-dot {
    position: absolute;
    top: 0px;
    right: 0px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff2d2d;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.95);
}

.nav-notice-btn .notice-dot.hidden {
    display: none;
}

/* ===== Dropdown cá»™ng Ä‘á»“ng ===== */
.community-menu {
    position: absolute;
    top: 120%;
    right: 0;
    background: #f5fbff;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 12px;
    display: none;
    flex-direction: column;
    min-width: 180px;
}

.community-menu a {
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 600;
    transition: .25s;
}

.community-menu a:hover {
    background: #e9f3fb;
}

/* ================== INTRO ================== */


.intro h1 {
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 10px;
}

.intro p {
    font-size: 18px;
    color: #555;
}

/* ================== SECTION ================== */
.section {
    padding: 60px 8%;
}

.section.gray {
    background: #d9ebf7;
}

.section h2 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 40px;
    position: relative;
}

.section h2::after {
    content: "";
    width: 80px;
    height: 4px;
    background: #2f75bb;
    display: block;
    margin: 10px auto 0;
    border-radius: 2px;
}

/* ================== SUBJECTS ================== */
.subjects {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 28px;
}

.second-row {
    grid-template-columns: repeat(4, 1fr);
    max-width: 100%;
    margin: auto;
}

.subject {
    padding: 22px;
    border-radius: 18px;
    border: 2px solid rgba(255,255,255,0.55);
    color: #fff;
    text-decoration: none;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .5px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.28);
    text-align: center;
    cursor: pointer;
    transition: .3s;
    box-shadow: 0 12px 28px rgba(0,0,0,0.15);
}

.subject:visited,
.subject:hover,
.subject:focus,
.subject:active {
    text-decoration: none;
}

.subject:hover {
    transform: translateY(-6px) scale(1.03);
    border-color: rgba(255,255,255,0.9);
    box-shadow: 0 18px 36px rgba(0,0,0,0.25);
}

/* ===== MÃ€U Stu* ===== */
.stumath { background: #2f75bb; }
.stuphys { background: #ed7d31; }
.stuchem { background: #5B3FA6; }
.stubio  { background: #00b050; }

.stuhis  { background: #a6a6a6; }
.stueng  { background: #e53935; }
.stugeo  { background: #fbc02d; color:#2b3340; text-shadow: 0 1px 0 rgba(255,255,255,0.45); }
.stutech  { background: #012A4A; }

.subject.locked-temp {
    cursor: not-allowed;
    filter: saturate(0.8) brightness(0.88);
}

.subject.locked-temp::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(6,10,20,0.15), rgba(6,10,20,0.4));
    z-index: 1;
}

.subject.locked-temp .lock-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(8, 16, 34, 0.75);
    border: 2px solid rgba(237, 241, 247, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    box-shadow: 0 6px 14px rgba(0,0,0,0.35);
    z-index: 4;
    animation: lockPulse 1.9s ease-in-out infinite;
}

.subject.locked-temp .lock-icon i {
    font-size: 16px;
    color: #ffffff;
}

.subject.locked-temp .lock-chain {
    position: absolute;
    left: -22%;
    top: 50%;
    width: 144%;
    height: 8px;
    border-radius: 999px;
    background: repeating-linear-gradient(
        90deg,
        #f1f4f8 0 12px,
        #b5bfca 12px 24px
    );
    box-shadow: 0 2px 6px rgba(0,0,0,0.36);
    z-index: 3;
}

.subject.locked-temp .lock-chain::before,
.subject.locked-temp .lock-chain::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #aeb8c4;
    border: 2px solid #e7ecf4;
    transform: translateY(-50%);
}

.subject.locked-temp .lock-chain::before {
    left: -6px;
}

.subject.locked-temp .lock-chain::after {
    right: -6px;
}

.subject.locked-temp .chain-a {
    transform: translateY(-50%) rotate(24deg);
    animation: chainSwayA 2.6s ease-in-out infinite;
}

.subject.locked-temp .chain-b {
    transform: translateY(-50%) rotate(-24deg);
    animation: chainSwayB 2.6s ease-in-out infinite;
}

.subject.locked-temp:hover {
    transform: none;
    border-color: rgba(255,255,255,0.7);
    box-shadow: 0 12px 28px rgba(0,0,0,0.22);
}

@keyframes lockPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.07); }
}

@keyframes chainSwayA {
    0%, 100% { transform: translateY(-50%) rotate(24deg); }
    50% { transform: translateY(-50%) rotate(21deg); }
}

@keyframes chainSwayB {
    0%, 100% { transform: translateY(-50%) rotate(-24deg); }
    50% { transform: translateY(-50%) rotate(-21deg); }
}
/* ================== GAMES ================== */
.games {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.game-card {
    background: #f6fbff;
    border-radius: 20px;
    padding: 36px 20px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    box-shadow: 0 10px 28px rgba(0,0,0,0.12);
    transition: .3s;
}

.game-card:hover {
    transform: translateY(-6px);
}

/* ================== FOOTER ================== */
.footer {
    background: #1e2530;
    color: #ddd;
    padding: 60px 8%;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.footer h3 {
    margin-bottom: 14px;
    color: #fff;
}

.footer p {
    font-size: 14px;
    color: #ccc;
}

/* ================== RESPONSIVE ================== */
@media (max-width: 950px) {
    .subjects {
        grid-template-columns: repeat(2, 1fr);
    }

    .second-row {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
    }
    .games {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
}
.intro {
    padding: 16px 20px 24px;
    text-align: center;
    background: linear-gradient(
        180deg,
        #eaf6ff 0%,
        #dceefb 100%
    );
}

.hero-actions {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.hero-actions button {
    padding: 14px 32px;
    border-radius: 30px;
    border: none;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: .25s;
}

.hero-primary {
    background: #2f75bb;
    color: #fff;
}

.hero-secondary {
    background: #f4faff;
    color: #2f75bb;
    box-shadow: 0 6px 20px rgba(0,0,0,.15);
}

.hero-actions button:hover {
    transform: translateY(-3px);
}
.subject {
    position: relative;
    overflow: hidden;
}

.subject::after {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: .3s;
}

.subject:hover::after {
    opacity: 1;
}

.subject:hover {
    filter: brightness(1.08);
}
#learn {
    background-color: #FFF8DC;
    border-radius: 40px 40px 0 0;
}
.game-card {
    position: relative;
    overflow: hidden;
}

.game-card::after {
    position: absolute;
    bottom: 20px;
    right: 24px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transition: .3s;
}

.game-card:hover::after {
    opacity: 1;
}
#learn.section {
    padding-top: 24px;
}
/* ================== RESPONSIVE ================== */

/* ===== Tablet (<= 1024px) ===== */
@media (max-width: 950px) {

    .header {
        padding: 16px 24px;
        gap: 10px;
    }

    .main {
        font-size: 30px;
        letter-spacing: 3px;
    }

    .nav {
        gap: 16px;
        padding: 8px 12px;
    }

    .nav a,
    .nav .nav-notice-btn {
        padding: 8px 10px;
        font-size: 14px;
    }

    .subjects {
        grid-template-columns: repeat(2, 1fr);
    }

    .second-row {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
    }

    .games {
        grid-template-columns: repeat(2, 1fr);
    }
        .nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 10px;
    }

    .nav a,
    .nav .nav-notice-btn {
        font-size: 13px;
        padding: 8px 12px;
    }
        .header {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        padding: 14px 16px;
    }

    #logo {
        width: 48px;
        height: 48px;
    }

    #logo img {
        transform: scale(1.4);
    }

    .main {
        font-size: 26px;
        margin: 6px 0;
        letter-spacing: 2.5px;
    }

    .nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 10px;
    }

    .nav a,
    .nav .nav-notice-btn {
        font-size: 24px;
        padding: 8px 12px;
    }

    .header {
        padding-right: 72px;
    }

    .nav .nav-notice-btn {
        position: absolute;
        top: 14px;
        right: 16px;
        width: 42px;
        height: 42px;
        padding: 0;
        font-size: 18px;
        border-radius: 50%;
        justify-content: center;
        z-index: 2;
    }

    .nav .notice-label {
        display: none;
    }

    .nav .nav-notice-btn .notice-dot {
        top: 0;
        right: 1px;
    }
}
@media (max-width: 768px) {
    .nav a {
        font-size: 18px;
        padding: 8px 12px;
    } 
    .intro h1 {
    font-size: 43px;
    font-weight: 900;
    margin-bottom: 10px;
}
}
@media (max-width: 550px) {
    .nav a {
        font-size: 13px;
        padding: 8px 12px;
    } 
    .section {
    padding: 60px 4%;
}
.intro h1 {
    font-size: 38px;
    font-weight: 900;
    margin-bottom: 10px;
}
}

.notice-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
}

.notice-modal.active {
    display: flex;
}

.notice-modal-card {
    position: relative;
    width: min(520px, 100%);
    max-height: 80vh;
    background: #f8fcff;
    border-radius: 16px;
    border: 1px solid rgba(47, 117, 187, 0.22);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.2);
    padding: 20px 18px 16px;
}

.notice-modal-card h3 {
    color: #1f5ea4;
    font-size: 24px;
    margin-bottom: 14px;
}

#noticeTitle .fa-bell {
    color: #f2b705;
}

.notice-content {
    color: #2d3138;
    line-height: 1.65;
    max-height: calc(80vh - 96px);
    overflow: auto;
    padding-right: 4px;
}

.notice-content ul {
    padding-left: 20px;
    margin: 10px 0;
}

.notice-content h4 {
    margin: 0 0 6px;
    color: #1f5ea4;
    font-size: 16px;
}

.notice-content p {
    margin: 0 0 12px;
}

.notice-content .notice-copyright {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border-left: 4px solid #16a34a;
    background: #ecfdf3;
    color: #15803d;
    font-weight: 700;
    line-height: 1.5;
}

.notice-content .notice-copyright i {
    margin-top: 1px;
    color: #16a34a;
    font-size: 15px;
}

.notice-content .notice-copyright span {
    display: block;
}

.notice-content .stuchem-highlight {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 8px;
    background: #5b3fa6;
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.notice-close {
    position: absolute;
    top: 8px;
    right: 10px;
    border: 0;
    background: transparent;
    font-size: 28px;
    color: #456;
    cursor: pointer;
}

/* ===== Notice responsive override ===== */
@media (max-width: 950px) {
    .header {
        position: relative;
        justify-content: flex-start !important;
        text-align: left !important;
        padding: 14px 16px;
    }

    #logo,
    .main {
        position: relative;
        z-index: 2;
    }

    .main {
        padding-right: 52px;
    }

    .nav {
        position: relative;
        width: 100%;
        order: 2;
        margin-top: 10px;
    }

    .nav .nav-notice-btn {
        position: absolute !important;
        top: -62px;
        right: 0;
        width: 42px;
        height: 42px;
        min-width: 42px;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 50%;
        justify-content: center;
        align-items: center;
        font-size: 18px;
        z-index: 4;
    }

    .nav .nav-notice-btn i {
        font-size: 17px;
        margin: 0;
    }

    .nav .notice-label {
        display: none;
    }

    .nav .nav-notice-btn .notice-dot {
        top: 1px;
        right: 1px;
    }
}

@media (max-width: 550px) {
    .main { padding-right: 48px; }

    .nav .nav-notice-btn {
        top: -60px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
}

/* ===== Nav visual polish override ===== */
.header .nav {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    width: auto;
    max-width: min(100%, 760px);
    margin-left: auto !important;
    padding: 10px 14px !important;
}

.header .nav a,
.header .nav .nav-notice-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    min-height: 46px;
    padding: 10px 16px !important;
    line-height: 1.2;
    white-space: nowrap;
    text-align: center;
}

@media (max-width: 1200px) {
    .header .nav {
        gap: 10px !important;
        padding: 10px 12px !important;
    }

    .header .nav a,
    .header .nav .nav-notice-btn {
        font-size: 15px;
        padding: 9px 14px !important;
    }
}

@media (max-width: 1100px) {
    .main {
        font-size: 34px;
        letter-spacing: 3px;
    }

    .header .nav {
        max-width: 700px;
        gap: 8px !important;
        padding: 8px 10px !important;
    }

    .header .nav a,
    .header .nav .nav-notice-btn {
        font-size: 14px !important;
        min-height: 42px;
        padding: 8px 12px !important;
    }
}

@media (max-width: 950px) {
    .header {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        row-gap: 10px;
    }

    .header .nav {
        flex: 0 1 auto;
        width: fit-content !important;
        max-width: calc(100% - 8px) !important;
        margin: 0 auto !important;
        margin-top: 8px !important;
        justify-content: center !important;
        padding: 8px 10px !important;
        gap: 8px !important;
    }

    .header .nav a {
        font-size: 16px !important;
        padding: 9px 14px !important;
        min-height: 44px;
    }

    .header .nav .nav-notice-btn {
        position: absolute !important;
        top: -60px !important;
        right: 0 !important;
        width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
        min-width: 42px !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 50% !important;
        font-size: 18px !important;
    }
}

@media (max-width: 768px) {
    .header .nav {
        gap: 8px !important;
    }

    .header .nav a {
        font-size: 15px !important;
        padding: 8px 12px !important;
        min-height: 42px;
    }
}

@media (max-width: 550px) {
    .header .nav {
        padding: 8px !important;
        gap: 8px !important;
    }

    .header .nav a {
        font-size: 13px !important;
        padding: 8px 12px !important;
        min-height: 40px;
    }

    .header .nav .nav-notice-btn {
        top: -58px !important;
        right: 8px !important;
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
    }
}

/* ===== Final nav behavior lock ===== */
/* Vung chuyen tiep: giu chuong trong nav, chua bay len goc phai */
@media (min-width: 951px) and (max-width: 1100px) {
    .header .nav {
        width: auto !important;
        max-width: min(100%, 760px) !important;
        margin-left: auto !important;
        margin-right: 0 !important;
        justify-content: center !important;
    }

    .header .nav .nav-notice-btn {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        width: auto !important;
        height: auto !important;
        min-width: 0 !important;
        min-height: 42px !important;
        border-radius: 12px !important;
        padding: 8px 12px !important;
        margin: 0 !important;
        font-size: 14px !important;
    }

    .header .nav .notice-label {
        display: inline !important;
    }
}

/* Duoi PC: layout giong gu tham my anh 3 */
@media (max-width: 950px) {
    .header {
        row-gap: 8px !important;
    }

    .header .nav {
        width: calc(100% - 24px) !important;
        max-width: calc(100% - 24px) !important;
        margin: 8px auto 0 !important;
        justify-content: flex-start !important;
        padding: 8px 12px !important;
        gap: 8px !important;
    }

    .header .nav .nav-notice-btn {
        position: absolute !important;
        top: -58px !important;
        right: 12px !important;
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
        border-radius: 50% !important;
        padding: 0 !important;
        margin: 0 !important;
        font-size: 18px !important;
    }

    .header .nav .notice-label {
        display: none !important;
    }

    .intro h1 {
        font-size: 43px;
    }
}

/* Duoi PC den mobile: nav luon 1 dong, gian padding theo width */
@media (max-width: 950px) {
    .header .nav {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: calc(100% - 24px) !important;
        max-width: calc(100% - 24px) !important;
        margin: 8px auto 0 !important;
        padding: clamp(6px, 1.6vw, 10px) clamp(8px, 2.2vw, 14px) !important;
        gap: clamp(6px, 1.4vw, 10px) !important;
        overflow: visible !important;
    }

    .header .nav a {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        min-height: 42px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-weight: 700 !important;
        font-size: clamp(11px, 2vw, 15px) !important;
        padding: clamp(6px, 1.4vw, 9px) clamp(8px, 1.8vw, 12px) !important;
        line-height: 1.2 !important;
        white-space: normal !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        text-align: center !important;
    }

    .header .nav .notice-label {
        font-weight: 700 !important;
    }
}
@media (max-width: 550px) {
.intro h1 {
    font-size: 36px;
    font-weight: 900;
    margin-bottom: 10px;
}
.intro p {
    font-size: 17px;
    color: #555;
}
}
