body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background-color: #f5f6f8;
    color: #333;
    font-weight: 300;
}

/* TOPBAR */

.topbar {
    height: 64px;
    background: #ffffff;
    border-bottom: 1px solid #dedede;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 34px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 42px;
}

.logo img {
    height: 42px;
    width: auto;
    display: block;
}

.topbar nav {
    display: flex;
    gap: 28px;
}

.topbar nav a {
    text-decoration: none;
    color: #444;
    font-size: 15px;
    font-weight: 300;
}

.topbar nav a:hover {
    color: #0f6cbf;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 22px;
    color: #555;
    font-weight: 300;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.top-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
    cursor: pointer;
}

.profile-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    cursor: pointer;
}

.profile-name {
    font-size: 14px;
    color: #444;
}

.notification-wrapper {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;

    background: #d63333;
    color: white;

    width: 18px;
    height: 18px;

    border-radius: 50%;

    font-size: 11px;
    font-weight: 600;

    display: flex;
    align-items: center;
    justify-content: center;
}

.mooble-footer {
    margin-top: 120px;
    padding: 60px 20px;

    text-align: center;

    background: #eceff1;
    border-top: 1px solid #d0d0d0;

    color: #666;

    font-size: 14px;
    line-height: 1.8;
}

.mooble-footer p {
    margin: 8px 0;
}
/* COURSE TOOLBAR */

.course-toolbar {
    display: grid;
    grid-template-columns: 110px 1fr 220px 95px;
    gap: 10px;
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid #d8d8d8;
}

.toolbar-select,
.toolbar-search {
    height: 38px;
    border: 1px solid #8f9baa;
    border-radius: 7px;
    background: #ffffff;
    color: #4a5568;
    font-size: 14px;
    font-family: inherit;
    font-weight: 300;
    display: flex;
    align-items: center;
    padding: 0 14px;
}

.toolbar-select {
    justify-content: space-between;
    cursor: default;
}

.toolbar-search {
    justify-content: flex-start;
}
/* MAIN */

main {
    max-width: 1580px;
    margin: 0 auto;
    padding: 32px 24px;
}

.welcome h1 {
    margin: 0 0 10px;
    font-size: 34px;
    font-weight: 300;
    letter-spacing: 0.2px;
}

.welcome p {
    margin: 0;
    color: #666;
    font-size: 18px;
    font-weight: 300;
}

/* COURSE GRID */

.courses {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 14px;
}

/* COURSE CARD */

.course-card {
    background: #ffffff;
    border: 1.8px solid #9f9f9f;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: 0.25s ease;
    min-height: 240px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
}

.course-card:hover {
    transform: translateY(-5px);
    border-color: #666;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.14);
}

.course-banner {
    height: 105px;
    background-size: cover;
    background-position: center;
}

.course-content {
    padding: 16px 18px;
    min-height: 95px;
}

.course-content h3 {
    margin: 0 0 12px;
    font-size: 17px;
    line-height: 1.4;
    font-weight: 300;
    color: #1f4f75;
}

.course-content p {
    margin: 0;
    color: #777;
    font-size: 14px;
    font-weight: 300;
}

/* BANNER PATTERNS */

.pattern-pink {
    background:
        radial-gradient(circle at 18% 28%, rgba(255,255,255,0.45) 0 16%, transparent 17%),
        radial-gradient(circle at 72% 42%, rgba(255,255,255,0.35) 0 20%, transparent 21%),
        linear-gradient(135deg, #c94f7c, #f0a3c0);
}

.pattern-grey {
    background:
        linear-gradient(45deg, rgba(255,255,255,0.18) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,0.18) 25%, transparent 25%),
        linear-gradient(135deg, #555, #aaa);
    background-size: 38px 38px, 38px 38px, cover;
}

.pattern-purple {
    background:
        radial-gradient(circle at 25% 25%, rgba(255,255,255,0.35) 0 12%, transparent 13%),
        radial-gradient(circle at 70% 70%, rgba(255,255,255,0.25) 0 18%, transparent 19%),
        linear-gradient(135deg, #5f3dc4, #b197fc);
}

.pattern-yellow {
    background:
        repeating-linear-gradient(45deg, rgba(255,255,255,0.28) 0 12px, transparent 12px 24px),
        linear-gradient(135deg, #f59f00, #ffe066);
}

.pattern-turquoise {
    background:
        radial-gradient(circle at 20% 70%, rgba(255,255,255,0.35) 0 14%, transparent 15%),
        repeating-linear-gradient(135deg, rgba(255,255,255,0.2) 0 10px, transparent 10px 22px),
        linear-gradient(135deg, #0ca678, #66d9e8);
}

.pattern-digezz {
    background:
        linear-gradient(135deg, rgba(0,0,0,0.12), rgba(255,255,255,0.12)),
        url("../assets/images/digezz-banner.jpg");
    background-size: cover;
    background-position: center;
}

/* MODAL */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 24px;
}

.hidden {
    display: none;
}

.modal-content {
    width: 90%;
    max-width: 920px;
    max-height: 90vh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 14px;
    padding: 34px;
    position: relative;
    min-height: 450px;
    text-align: center;
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 22px;
    border: none;
    background: none;
    font-size: 28px;
    cursor: pointer;
}

#gameContainer {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* GENERAL GAME BUTTONS */

.game-btn {
    padding: 10px 18px;
    border: 1px solid #555;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 14px;
}

.game-btn:hover {
    background: #f0f0f0;
}

/* TIC TAC TOE */

.ttt-board {
    display: grid;
    grid-template-columns: repeat(3, 90px);
    gap: 10px;
    margin: 24px 0;
    justify-content: center;
}

.ttt-cell {
    width: 90px;
    height: 90px;
    border: 2px solid #555;
    background: #f8f8f8;
    font-size: 46px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 8px;
    display: grid;
    place-items: center;
}

.ttt-cell:hover {
    background: #ececec;
}

.ttt-cell.x-player {
    color: #1c7ed6;
}

.ttt-cell.o-player {
    color: #e03131;
}

/* WORDLE */

.wordle-grid {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 24px 0;
}

.wordle-row {
    display: flex;
    gap: 7px;
    justify-content: center;
}

.wordle-box {
    width: 54px;
    height: 54px;
    border: 2px solid #d3d6da;
    display: grid;
    place-items: center;
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
    background: #ffffff;
    color: #1a1a1b;
}

.wordle-box.filled {
    border-color: #878a8c;
}

.wordle-box.correct {
    background: #6aaa64;
    border-color: #6aaa64;
    color: white;
}

.wordle-box.almost {
    background: #c9b458;
    border-color: #c9b458;
    color: white;
}

.wordle-box.wrong {
    background: #787c7e;
    border-color: #787c7e;
    color: white;
}

.wordle-keyboard {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 18px;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.key {
    height: 46px;
    min-width: 36px;
    border: none;
    border-radius: 4px;
    background: #d3d6da;
    color: #1a1a1b;
    font-weight: 700;
    cursor: pointer;
}

.key.wide {
    min-width: 62px;
    font-size: 12px;
}

.key.correct {
    background: #6aaa64;
    color: white;
}

.key.almost {
    background: #c9b458;
    color: white;
}

.key.wrong {
    background: #787c7e;
    color: white;
}

#wordleMessage {
    min-height: 24px;
    font-weight: 500;
}

/* MEMORY */

.memory-controls {
    display: flex;
    gap: 10px;
    margin: 18px 0 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.memory-size-btn {
    padding: 10px 16px;
    border: 1px solid #777;
    background: #ffffff;
    border-radius: 6px;
    cursor: pointer;
}

.memory-size-btn:hover,
.memory-size-btn.active {
    background: #1f4f75;
    color: white;
}

.memory-board {
    display: grid;
    gap: 10px;
    margin-top: 18px;
    justify-content: center;
}

.memory-board.small {
    grid-template-columns: repeat(5, 120px);
}

.memory-board.medium {
    grid-template-columns: repeat(5, 110px);
}

.memory-board.large {
    grid-template-columns: repeat(6, 95px);
}

.memory-card {
    border: 2px solid #555;
    background: #f1f3f5;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    display: grid;
    place-items: center;
    padding: 0;
}

.memory-board.small .memory-card {
    width: 120px;
    height: 120px;
}

.memory-board.medium .memory-card {
    width: 110px;
    height: 110px;
}

.memory-board.large .memory-card {
    width: 95px;
    height: 95px;
}


.memory-card.revealed::before,
.memory-card.matched::before {
    content: "";
}

.memory-card.matched {
    border-color: #2f9e44;
    background: #d3f9d8;
    cursor: default;
}

.memory-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    display: none;
    pointer-events: none;
}

.memory-card.revealed .memory-image,
.memory-card.matched .memory-image {
    display: block;
}
.memory-board.small .memory-card {
    width: 130px;
    height: 130px;
}
/* REACTION */

.reaction-box {
    width: 100%;
    max-width: 520px;
    height: 220px;
    background: #d9534f;
    color: white;
    display: grid;
    place-items: center;
    font-size: 28px;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 24px;
}

.reaction-box.ready {
    background: #2f9e44;
}

/* MINESWEEPER */

.minesweeper-board {
    display: grid;
    gap: 3px;
    margin-top: 24px;
    justify-content: center;
}

.mine-cell {
    width: 40px;
    height: 40px;
    border: 1px solid #777;
    background: #e9ecef;
    cursor: pointer;
    font-size: 18px;
    border-radius: 4px;
}

.mine-cell:hover {
    background: #dee2e6;
}

.mine-cell.revealed {
    background: #ffffff;
    cursor: default;
}

.mine-cell.danger-1 {
    background: #fff3bf;
    color: #8a6d00;
    font-weight: 700;
}

.mine-cell.danger-2 {
    background: #ffd8a8;
    color: #d9480f;
    font-weight: 700;
}

.mine-cell.danger-3 {
    background: #ffc9c9;
    color: #c92a2a;
    font-weight: 700;
}

/* SNAKE */

#snakeCanvas {
    background: #d8f3dc;
    border: 3px solid #2f9e44;
    border-radius: 12px;
    display: block;
    margin-top: 18px;
}

/* RESPONSIVE */

@media (max-width: 1200px) {
    .courses {
        grid-template-columns: repeat(2, minmax(260px, 1fr));
    }

    .memory-board.large {
        grid-template-columns: repeat(5, 70px);
    }
}

@media (max-width: 768px) {
    main {
        padding: 28px 18px;
    }

    .courses {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .topbar {
        padding: 0 16px;
    }

    .topbar nav {
        display: none;
    }

    .modal-content {
        width: 88%;
        padding: 28px 18px;
    }

    .memory-board.small,
    .memory-board.medium,
    .memory-board.large {
        grid-template-columns: repeat(4, 68px);
    }

    .memory-board.small .memory-card,
    .memory-board.medium .memory-card,
    .memory-board.large .memory-card {
        width: 68px;
        height: 68px;
    }

    #snakeCanvas {
        width: 300px;
        height: 300px;
    }
}

.jumpscare {
    position: fixed;
    inset: 0;
    background: black;
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.jumpscare img {
    width: 100vw;
    height: 100vh;
    object-fit: cover;
}

.jumpscare.hidden {
    display: none;
}