:root {
    --math-color: #ff4b4b;
    --english-color: #1cb0f6;
    --science-color: #58cc02;
    --ss-color: #ffc800;
    --it-color: #ce82ff;
    --minigames-color: #f66a1c;
    --bg-gray: #f7f7f7;
    --text-dark: #4b4b4b;
}

html, body {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: white;
    color: var(--text-dark);
    margin: 0;
    display: grid;
    cursor: url('assets/images/cursor.png'), auto;
    padding: 0 150px;
    column-gap: 100px;
    grid-template-columns: 300px 1fr 400px;
}

/* Hide scrollbar for Chrome, Safari and Opera */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
}

/* Sidebar Layout Container */
.right-sidebar {
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px; /* Spacing between cards */
    min-height: 100vh;
    border-left: 2px solid #e5e5e5;
    box-sizing: border-box;
}

/* Base Side Card Style */
.side-card {
    border: 2px solid #e5e5e5;
    border-radius: 16px;
    padding: 20px;
    background: white;
    box-sizing: border-box;
}

.side-card h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 900;
    color: #4b4b4b;
}

/* Sidebar Carousel Layout (Desktop Defaults) */
.sidebar-carousel {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.carousel-track {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.carousel-dots {
    display: none;
}

.carousel-slide {
    width: 100%;
    box-sizing: border-box;
}

/* Promo/Plus Card (Top) */
.promo-card {
    background: linear-gradient(135deg, #1cb0f6, #58cc02);
    border: none;
    color: white;
    position: relative;
    overflow: hidden;
    padding-top: 25px; /* Give the top icon some breathing room */
    max-height: 600px; /* Set a large max-height for the collapse animation */
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.promo-bg-icon {
    font-size: 110px; /* Slightly larger since it's at the top */
    opacity: 0.15;    /* Subtler so it doesn't distract from the text */
    position: absolute;
    right: -20px;     /* Peek off the edge */
    top: -20px;       /* Pinned to the top */
    transform: rotate(15deg); /* Tilted the opposite way for the top corner */
    pointer-events: none;
    z-index: 1;
}

.promo-card h3, 
.promo-card p, 
.promo-header, 
.promo-btn {
    position: relative;
    z-index: 2;
}

.promo-header {
    position: relative;
    z-index: 2;
    margin-bottom: 12px;
}

.promo-card h3, .promo-card p {
    color: white;
}

.knowva-plus {
    font-weight: 900;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.3);
    padding: 4px 12px;
    border-radius: 10px;
    display: inline-block;
}

.promo-img {
    float: right;
    width: 60px;
}

.promo-btn {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: white;
    color: #1cb0f6;
    font-weight: 900;
    box-shadow: 0 4px 0 rgba(0,0,0,0.1);
    transition: transform 0.1s;
}

/* Close button for the promo card */
.close-promo {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 18px;
    line-height: 0;
    cursor: pointer;
    opacity: 0.7;
    z-index: 10;
    transition: all 0.2s;
}

.close-promo:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

.promo-card.dismissed {
    max-height: 0;
    margin: -8px 0; /* Negate half the gap to make the collapse feel tighter */
    padding: 0 20px;
    opacity: 0;
    pointer-events: none;
    border: none;
}

/* Side Item Layouts */
.side-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lock-icon {
    font-size: 30px;
    background: #f1f1f1;
    padding: 10px;
    border-radius: 12px;
}

.side-text {
    font-size: 14px;
    font-weight: 700;
    color: #777;
    margin: 0;
}

/* Quest Specifics */
.side-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.side-header a {
    font-size: 12px;
    font-weight: 900;
    color: #1cb0f6;
    text-decoration: none;
}

.quest-icon {
    font-size: 24px;
    color: #ffc800;
}

.quest-main {
    flex-grow: 1;
}

.quest-label {
    font-weight: 800;
    font-size: 15px;
    color: #4b4b4b;
    display: block;
    margin-bottom: 5px;
}

.quest-progress {
    height: 12px;
    background: #e5e5e5;
    border-radius: 10px;
}

.quest-fill {
    height: 100%;
    background: #ffc800;
    border-radius: 10px;
}

/* Sidebar Navigation */
nav {
    width: 300px;
    height: 100vh;
    border-right: 2px solid #e5e5e5;
    padding: 20px;
    position: sticky;
    top: 0;
    box-sizing: border-box;
    background: white;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.logo {
    display: flex;
    align-items: center;
    font-weight: 900;
    font-size: 42px;
    color: var(--science-color);
    margin-bottom: 40px;
    letter-spacing: -1px;
}

.logo img {
    height: 42px;
}

.letter {
  display: inline-block;
}

.n { color: var(--math-color); }   
.o { color: var(--english-color); }   
.w { color: var(--ss-color); }   
.v { color: var(--it-color); }   
.a { color: var(--minigames-color); }

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    margin-bottom: 8px;
    transition: background 0.2s;
    position: relative;
}

.nav-controls-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.nav-controls-row .nav-icon {
    margin-right: 0;
}

#mute-toggle {
    width: 100%;
    justify-content: center;
}

#theme-toggle {
    width: 100%;
    justify-content: center;
}

.language-selector select {
    background: transparent;
    border: none;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    color: inherit;
    cursor: pointer;
    outline: none;
}

.nav-item:hover { 
    background-color: #f1f1f1; 
}

.nav-item.active {
    background-color: #ddf4ff;
    color: #1899d6;
    border: 2px solid #84d8ff;
}

.nav-icon {
    margin-right: 12px;
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.nav-bubble {
    position: absolute;
    top: 6px;
    right: 10px;
    background: var(--math-color);
    color: white;
    font-size: 14px;
    font-weight: 800;
    padding: 3px 7px;
    border-radius: 30px;
    line-height: 1;
}

/* Main Content Area */
main {
    margin: 0 auto;
    padding: 40px 20px;
    max-width: 1000px;
    width: 100%;
    box-sizing: border-box;
}

.header-status {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    font-weight: 900;
}

.stats-container {
    display: flex;
    gap: 25px;
    padding: 10px 20px;
    background-color: #f0f0f0; /* Darker than the white background */
    border-radius: 15px;
    /* This creates the "indent" / "sunken" effect */
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); 
    border: 1px solid #e5e5e5;
}

.streak { 
    color: #ff9600; 
    font-weight: 900;
    font-size: 14px;
}

.xp { 
    color: var(--ss-color); 
    font-weight: 900;
    font-size: 14px;
}

.diamond { 
    color: var(--english-color); 
    font-weight: 900;
    font-size: 14px;
}

.unit-card {
    width: 100%;
    background: #ebebeb;
    border-radius: 15px;
    padding: 20px;
    color: var(--text-dark);
    box-shadow: 0 4px 0 #cccccc;
    margin-bottom: 40px;
    box-sizing: border-box;
}

/* Subject Card Styling */
.subject-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Base Card Styling */
.card {
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    color: white;
    cursor: pointer;
    /* transition: transform 0.2s, box-shadow 0.2s; - Added smoother transition */
    transition: all 0.2s ease;
    position: relative;
    box-sizing: border-box;
}

/* Hover Effect: Lift and Glow */
.card:hover {
    transform: translateY(-4px); /* Lift up */
}

.card:hover .icon-box {
    transform: scale(1.2) rotate(5deg);
}

/* Specific Hover Glows for each color */
.card.math:hover {
    box-shadow: 0 10px 20px rgba(255, 75, 75, 0.3);
    border-bottom: 6px solid #ff6666; /* Slightly lighter border on hover */
}

.card.science:hover {
    box-shadow: 0 10px 20px rgba(88, 204, 2, 0.3);
    border-bottom: 6px solid #72e61a;
}

.card.english:hover {
    box-shadow: 0 10px 20px rgba(28, 176, 246, 0.3);
    border-bottom: 6px solid #45c2ff;
}

.card.ss:hover {
    box-shadow: 0 10px 20px rgba(255, 200, 0, 0.3);
    border-bottom: 6px solid #ffd433;
}

.card.it:hover {
    box-shadow: 0 10px 20px rgba(206, 130, 255, 0.3);
    border-bottom: 6px solid #db9eff;
}

/* Updated Minigames Card to match Daily Mix style */
.card.minigames {
    background: #f66a1c;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 8px 0 #c45112;
    border: none;
    overflow: hidden;
}

.card.minigames:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 0 #c45112, 0 10px 20px rgba(246, 106, 28, 0.3);
}

/* The Press Effect (Keep this as is) */
.card:active { 
    transform: translateY(2px); 
    box-shadow: none !important;
    border-bottom-width: 2px; 
}

.icon-box {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-right: 20px;
    transition: transform 0.2s ease;
}

/* Container for progress bar and percentage text */
.progress-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-top: 4px;
}

.progress-percent {
    font-weight: 900;
    font-size: 14px;
    color: white;
}

.info { 
    flex-grow: 1; 
}

.subject-name {
    font-weight: 900;
    font-size: 20px;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
}

.difficulty-label {
    font-size: 12px;
    background: rgba(0,0,0,0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Progress Bar Styling */
.progress-bg {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.3);
    flex-grow: 1;
    border-radius: 10px;
}

.progress-fill {
    height: 100%;
    background: white;
    border-radius: 10px;
}

/* Subject Specific Colors */
.math { background: var(--math-color); border-bottom: 6px solid #d33131; }
.english { background: var(--english-color); border-bottom: 6px solid #1482b5; }
.science { background: var(--science-color); border-bottom: 6px solid #46a302; }
.ss { background: var(--ss-color); border-bottom: 6px solid #e5b300; }
.it { background: var(--it-color); border-bottom: 6px solid #a558d4; }

/* Special Daily Task Card */
.daily-task-card {
    width: 100%;
    background: linear-gradient(135deg, #58cc02 0%, #23ac38 100%);
    border-radius: 24px;
    padding: 24px;
    color: white;
    box-shadow: 0 8px 0 #1a8a2a;
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.daily-content {
    flex: 1;
}

.daily-badge {
    background: rgba(255, 255, 255, 0.3);
    font-size: 10px;
    font-weight: 900;
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.partitioned-progress {
    display: flex;
    gap: 6px;
    align-items: center;
    margin: 12px 0 16px 0;
    width: 100%;
    max-width: 320px;
}

.progress-diamond {
    font-size: 18px;
    margin-left: 4px;
    line-height: 1;
}

.progress-chunk {
    height: 8px;
    flex: 1;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.progress-chunk.filled {
    background: white;
}

.daily-task-card h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 900;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card.minigames .subject-name {
    font-size: 24px;
    margin-bottom: 12px;
}

.card.minigames .progress-row {
    max-width: 320px;
}

.daily-task-card p {
    margin: 8px 0 20px 0;
    opacity: 0.9;
    font-size: 16px;
    max-width: 80%;
}

.daily-footer {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.timer {
    font-size: 13px;
    font-weight: 700;
    opacity: 0.8;
}

.play-btn {
    background: white;
    color: #23ac38;
    border: none;
    padding: 10px 24px;
    border-radius: 16px;
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 0 #e0e0e0;
    transition: transform 0.1s;
}

.knowva-btn {
    background: white;
    color: #58cc02;
    border: none;
    padding: 10px 24px;
    border-radius: 16px;
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 0 #e0e0e0;
    transition: transform 0.1s;
}

.knowva-btn:hover {
    transform: scale(1.05);
}

.knowva-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 white;
}

.play-btn:hover {
    transform: scale(1.05);
}

.play-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 white;
}

.daily-icon {
    font-size: 120px;
    opacity: 0.2;
    position: absolute;
    right: -10px;
    bottom: -10px;
    transform: rotate(-15deg);
}

.card.minigames .icon-box1 {
    font-size: 120px;
    opacity: 0.2;
    position: absolute;
    right: -25px;
    bottom: -30px;
    background: none;
    transform: rotate(-15deg);
}

/* 2. Hovering over Cards/Buttons (The Open Hand) */
.card, .play-btn, .nav-item, a, button, .flip-container {
    /* '16 0' centers the hotspot horizontally for the hand icon */
    cursor: url('assets/images/hand.png'), pointer;
}

/* 3. The Click Action (The Closed Hand/Grab) */
.card:active, .play-btn:active, .nav-item:active {
    cursor: url('assets/images/hand-closed.png'), grabbing;
}

/* Fix for Sidebar - Ensure it uses the custom cursor too */
nav {
    cursor: url('assets/images/cursor.png'), auto;
}

/* 2. The Hover State (The Open Hand) */
/* This applies to cards, buttons, nav items, and links */
.card, 
.play-btn, 
.nav-item, 
button, 
a,
.flip-container {
    /* 12 0 moves the "click point" to the top-middle (where the finger usually is) */
    cursor: url('assets/images/hand.png') 12 0, pointer;
}

/* 3. The Click State (The Closed Hand) */
/* This triggers the moment the user presses the mouse button down */
.card:active, 
.play-btn:active, 
.nav-item:active, 
button:active,
.flip-container:active {
    cursor: url('assets/images/hand-closed.png') 12 0, grabbing;
}

/* Fade Logic */
#dashboard-view, #lesson-view, #stats-view, #profile-view {
    transition: opacity 0.4s ease, transform 0.4s ease;
    opacity: 1;
    transform: translateY(0);
    max-width: 700px;
    margin: 0 auto;
}

#quad-view {
    transition: opacity 0.4s ease, transform 0.4s ease;
    opacity: 1;
    transform: translateY(0);
    max-width: 900px;
    margin: 0 auto;
}

.hidden {
    display: none;
    opacity: 0;
    transform: translateY(10px);
}

/* Lesson Page Styling */
.lesson-header {
    display: flex;
    align-items: center;
    gap: 30px; /* Increased gap for more spacing */
    margin-bottom: 30px;
    padding: 20px 24px;
    border-radius: 20px;
    background: white;
    border: 2px solid #e5e5e5;
    border-bottom: 6px solid #e5e5e5;
    transition: all 0.3s ease;
}

/* Subject Specific Colors for the Header Card */
.lesson-header.math { background: var(--math-color); border-color: var(--math-color); border-bottom-color: #d33131; color: white; }
.lesson-header.science { background: var(--science-color); border-color: var(--science-color); border-bottom-color: #46a302; color: white; }
.lesson-header.english { background: var(--english-color); border-color: var(--english-color); border-bottom-color: #1482b5; color: white; }
.lesson-header.ss { background: var(--ss-color); border-color: var(--ss-color); border-bottom-color: #e5b300; color: white; }
.lesson-header.it { background: var(--it-color); border-color: var(--it-color); border-bottom-color: #a558d4; color: white; }
.lesson-header.minigames { background: var(--minigames-color); border-color: var(--minigames-color); border-bottom-color: #c45112; color: white; }

.lesson-header h2 {
    margin: 0;
    font-weight: 900;
    font-size: 24px;
    color: inherit;
}

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 800;
    color: white;
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
}

/* Roadmap Styling */
.roadmap-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 80px 20px;
    position: relative;
    background: transparent; /* Removed the clinical box background */
    overflow: visible;
}

/* The Path Line */
.roadmap-container::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 12px;
    background: repeating-linear-gradient(#e5e5e5, #e5e5e5 10px, transparent 10px, transparent 20px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 0;
    opacity: 0.5;
}

.node {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: white;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    box-shadow: 0 10px 0 #e5e5e5, 0 15px 25px rgba(0,0,0,0.1);
    box-sizing: border-box;
    margin-bottom: 40px;
}

/* Node Size & Shape Hierarchy */
.node.activity {
    width: 140px;
    height: 140px;
    border-radius: 30%; /* Squircle shape */
}

.node.minigame {
    width: 140px;
    height: 140px;
    border-width: 8px;
    border-radius: 24px;
    transform: rotate(45deg);
    margin: 60px 0;
    background: linear-gradient(135deg, #fff 0%, #f9f9f9 100%);
    box-shadow: 10px 10px 0 var(--node-shadow), 0 20px 40px rgba(0,0,0,0.2);
}

.node.minigame span {
    font-size: 70px;
    animation: float-minigame 3s ease-in-out infinite;
    display: block;
}

.node.minigame .node-label {
    transform: translateX(-50%) rotate(-45deg);
    top: 130%;
}

.node.minigame:hover {
    transform: translateY(-8px) scale(1.1) rotate(45deg) !important;
}

.node.minigame:active {
    transform: translateY(4px) scale(0.95) rotate(45deg) !important;
    box-shadow: 4px 4px 0 var(--node-shadow) !important;
}

@keyframes float-minigame {
    0%, 100% { transform: rotate(-45deg) translateY(0); }
    50% { transform: rotate(-45deg) translateY(-10px); }
}

/* Remove individual connectors */
.node::after {
    display: none;
}

/* Bigger icon for the "Stepping Stone" */
.node span {
    font-size: 56px;
    filter: drop-shadow(0 4px 4px rgba(0,0,0,0.1));
}

.node-label {
    position: static;
    font-weight: 900;
    text-align: left;
    font-size: 13px;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
    position: absolute;
    top: 110%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.node:hover {
    transform: translateY(-8px) scale(1.1) !important; /* Force override translation */
    filter: brightness(1.08);
}

.node:active {
    transform: translateY(4px) scale(0.95) !important;
    box-shadow: 0 4px 0 #e5e5e5;
}

/* Node States & Colors */
.node.math { border: 6px solid var(--math-color); }
.node.science { border: 6px solid var(--science-color); }
.node.english { border: 6px solid var(--english-color); }
.node.ss { border: 6px solid var(--ss-color); }
.node.it { border: 6px solid var(--it-color); }
.node.minigames { border: 6px solid var(--minigames-color); }

/* Subject Shadows - Special handling for diamond minigames */
.node.math { box-shadow: 0 10px 0 #d33131; }
.node.math.minigame { box-shadow: 10px 10px 0 #d33131, 0 20px 40px rgba(0,0,0,0.2); }
.node.science { box-shadow: 0 10px 0 #46a302; }
.node.science.minigame { box-shadow: 10px 10px 0 #46a302, 0 20px 40px rgba(0,0,0,0.2); }
.node.english { box-shadow: 0 10px 0 #1482b5; }
.node.english.minigame { box-shadow: 10px 10px 0 #1482b5, 0 20px 40px rgba(0,0,0,0.2); }
.node.ss { box-shadow: 0 10px 0 #e5b300; }
.node.ss.minigame { box-shadow: 10px 10px 0 #e5b300, 0 20px 40px rgba(0,0,0,0.2); }
.node.it { box-shadow: 0 10px 0 #a558d4; }
.node.it.minigame { box-shadow: 10px 10px 0 #a558d4, 0 20px 40px rgba(0,0,0,0.2); }
.node.minigames { box-shadow: 0 10px 0 #c45112; }
.node.minigames.minigame { box-shadow: 10px 10px 0 #c45112, 0 20px 40px rgba(0,0,0,0.2); }

/* The Pulse animation for the "Next" lesson */
@keyframes nodePulse {
    0% { box-shadow: 0 10px 0 var(--node-shadow), 0 0 0 0px rgba(0,0,0,0.1); }
    70% { box-shadow: 0 10px 0 var(--node-shadow), 0 0 0 20px rgba(0,0,0,0); }
    100% { box-shadow: 0 10px 0 var(--node-shadow), 0 0 0 0px rgba(0,0,0,0); }
}

.node.active-pulse {
    --node-shadow: #e5e5e5;
    animation: nodePulse 2s infinite;
}

.node.math.active-pulse { --node-shadow: #d33131; }
.node.science.active-pulse { --node-shadow: #46a302; }
.node.english.active-pulse { --node-shadow: #1482b5; }

/* Arena View Styling */
.arena-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 80px;
}

.exit-arena {
    font-size: 24px;
    color: #afafaf;
    background: #f1f1f1;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    cursor: pointer;
}

.arena-progress-bg {
    flex-grow: 1;
    height: 20px;
    background: #e5e5e5;
    border-radius: 20px;
    overflow: hidden;
}

.arena-progress-fill {
    height: 100%;
    background: var(--science-color);
    transition: width 0.3s ease;
}

.question-card {
    padding: 0 20px;
    max-width: 600px;
    margin: 0 auto;
}

.question-card h3 {
    font-size: 28px;
    font-weight: 900;
    margin: 20px 0 40px 0;
    color: var(--text-dark);
}

.option-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    background: white;
    border: 2px solid #e5e5e5;
    border-bottom: 4px solid #e5e5e5;
    border-radius: 16px;
    padding: 16px 24px;
    font-size: 18px;
    font-weight: 800;
    color: #4b4b4b;
    text-align: left;
    cursor: pointer;
    transition: all 0.1s;
}

.option-btn:hover {
    background-color: #f7f7f7;
}

.option-btn:active {
    transform: translateY(2px);
    border-bottom-width: 0;
}

#stats-view .back-btn {
    color: black;
    background: rgba(0, 0, 0, 0.05);
}

.back-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

.lesson-placeholder {
    text-align: center;
    padding: 100px 0;
    color: #ccc;
}

/* Sidebar Footer Styling */
.sidebar-footer {
    margin-top: 0;
    padding: 24px 0 0 0;
    border-top: 2px solid #e5e5e5;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-nav, .footer-social {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.sidebar-footer a {
    font-size: 12px;
    font-weight: 800;
    color: #afafaf;
    text-decoration: none;
    transition: color 0.2s;
}

.sidebar-footer a:hover {
    color: #777;
}

.mobile-footer {
    display: none;
}

/* Dropdown Menu Styling */
.nav-item.dropdown {
    position: relative;
}

.footer-nav.about:hover {
	color: var(--math-color);
}

.footer-nav.education:hover {
	color: var(--science-color);
}

.footer-nav.privacy:hover {
	color: var(--english-color);
}

.footer-nav.terms:hover {
	color: var(--ss-color);
}

.footer-nav.financials:hover {
	color: var(--it-color);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%; /* Makes the menu appear below the 'MORE' item */
    left: 0;
    width: 100%;
    background: white;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    margin-top: 8px;
    overflow: hidden;
}

.nav-item.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    display: block;
    padding: 12px;
    color: #777;
    text-decoration: none;
    font-weight: 800;
    font-size: 13px;
    transition: all 0.2s;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
    color: var(--science-color);
}

/* Difficulty Selection Boxes */
.difficulty-selection {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.difficulty-option {
    background: white;
    border: 2px solid #e5e5e5;
    border-bottom: 5px solid #e5e5e5;
    border-radius: 20px;
    padding: 42px 32px;
    display: flex;
    align-items: center;
    gap: 24px;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    /* New entrance animation */
    animation: difficultyEntrance 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

@keyframes difficultyEntrance {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered delay for each card */
.difficulty-option:nth-child(1) { animation-delay: 0.1s; }
.difficulty-option:nth-child(2) { animation-delay: 0.2s; }
.difficulty-option:nth-child(3) { animation-delay: 0.3s; }

.difficulty-option:hover {
    transform: translateY(-2px);
}

.difficulty-option:active {
    transform: translateY(2px);
    border-bottom-width: 0;
    margin-bottom: 5px;
}

.difficulty-option.beginner:hover { 
    border-color: var(--science-color); 
    background-color: #f7fff0;
    border-bottom-color: #46a302;
}
.difficulty-option.intermediate:hover { 
    border-color: var(--english-color); 
    background-color: #f0f9ff;
    border-bottom-color: #1482b5;
}
.difficulty-option.hard:hover { 
    border-color: var(--math-color); 
    background-color: #fff0f0;
    border-bottom-color: #d33131;
}

.difficulty-option:hover .diff-icon-container {
    transform: scale(1.2) rotate(5deg);
}

.difficulty-option.beginner:hover h3 { color: var(--science-color); }
.difficulty-option.intermediate:hover h3 { color: var(--english-color); }
.difficulty-option.hard:hover h3 { color: var(--math-color); }

.difficulty-option .diff-icon-container {
    width: 60px;
    height: 60px;
    background: #f1f1f1;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    transition: all 0.2s ease;
}

.difficulty-option.beginner:hover .diff-icon-container { background: #e8f7d9; }
.difficulty-option.intermediate:hover .diff-icon-container { background: #e1f5fe; }
.difficulty-option.hard:hover .diff-icon-container { background: #ffebee; }

.diff-text {
    flex-grow: 1;
}

.diff-text p {
    margin: 4px 0 0 0;
    font-size: 14px;
    color: #afafaf;
    font-weight: 700;
}

.difficulty-option h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 900;
    color: #4b4b4b;
    transition: color 0.2s;
}

.diff-arrow {
    font-size: 24px;
    color: #e5e5e5;
    transition: all 0.3s ease;
    transform: translateX(20px);
    opacity: 0;
}

.difficulty-option:hover .diff-arrow {
    opacity: 1;
    transform: translateX(0);
    color: #ccc;
}

/* Sidebar Ad Styling */
.sidebar-ad-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

.ad-link {
    display: block;
    text-align: center;
    margin-top: 15px;
    font-size: 13px;
    font-weight: 900;
    color: #afafaf;
    text-decoration: none;
    transition: color 0.2s;
}

.ad-link:hover {
    color: #1cb0f6;
}

/* Leaderboard Styling */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 165px; /* Shows 3 items plus the 4th peeking through */
    max-height: 152px; /* Exactly 3 items: (3 * 48px) + (2 * 4px gap) */
    overflow-y: auto;
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

.leaderboard-list::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}


.leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rank {
    font-weight: 900;
    width: 28px;
    color: #afafaf;
    display: flex;
    align-items: center;
}

.leaderboard-item:nth-child(1) .rank { font-size: 0; }
.leaderboard-item:nth-child(1) .rank::after { content: "🥇"; font-size: 20px; }

.leaderboard-item:nth-child(2) .rank { font-size: 0; }
.leaderboard-item:nth-child(2) .rank::after { content: "🥈"; font-size: 20px; }

.leaderboard-item:nth-child(3) .rank { font-size: 0; }
.leaderboard-item:nth-child(3) .rank::after { content: "🥉"; font-size: 20px; }

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e5e5;
    object-fit: cover;
}

.username {
    font-weight: 700;
    color: var(--text-dark);
}

.score {
    font-weight: 900;
    color: #777;
    font-size: 14px;
}

/* Heatmap Styles */
.heatmap-wrapper {
    display: flex;
    flex-direction: column;
    margin-top: 10px;
    max-width: 100%;
}

.heatmap-quarters {
    display: grid;
    grid-template-columns: repeat(4, 62px); /* (3 * 18px) + (2 * 4px gap) */
    gap: 4px;
    margin-left: 60px;
    font-size: 10px;
    font-weight: 900;
    color: #afafaf;
    margin-bottom: 8px;
}

.heatmap-main {
    display: flex;
    gap: 20px;
}

.heatmap-days {
    display: grid;
    grid-template-rows: repeat(7, 18px);
    gap: 4px;
    font-size: 10px;
    font-weight: 800;
    color: #afafaf;
    justify-content: end;
    width: 40px;
}

.heatmap-grid {
    display: grid;
    grid-template-rows: repeat(7, 18px);
    grid-auto-flow: column;
    grid-auto-columns: 18px;
    gap: 4px;
}

.heatmap-square {
    width: 18px;
    height: 18px;
    border-radius: 2px;
    background-color: #ebedf0;
    transition: transform 0.1s;
}

.heatmap-square:hover {
    transform: scale(1.2);
    z-index: 1;
}

.heatmap-square.lv-1 { background-color: #9be9a8; }
.heatmap-square.lv-2 { background-color: #40c463; }
.heatmap-square.lv-3 { background-color: #30a14e; }
.heatmap-square.lv-4 { background-color: #216e39; }

/* Stats Layout Components */
.stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    align-items: stretch;
}

.side-card-stats {
    background: white;
    border: 2px solid #e5e5e5;
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 24px;
    margin-top: 20px;
    width: 100%;
    box-sizing: border-box;
}

.side-card-stats .sidebar-ad-img {
    height: 140px; /* Forced height to create the slim banner effect */
    object-fit: cover; /* Prevents distortion by cropping the image to fit */
}

.heatmap-container {
    flex: 4; /* Increased from 3 to 4 to make it wider */
    min-width: 0;
}

.streak-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    min-width: 160px;
    text-align: center;
}

.streak-card h3 {
    font-size: 11px;
    margin-bottom: 4px;
    text-align: center;
    width: 100%;
    color: #afafaf;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.streak-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
}

.streak-divider {
    height: 2px;
    background-color: #f1f1f1;
    width: 60%;
    margin: 0 auto;
}

.streak-display {
    display: flex;
    align-items: center;
    gap: 4px;
}

.streak-number {
    font-size: 32px;
    font-weight: 900;
    color: #ff9600;
}

/* Proficiency Chart Styles */
.proficiency-card {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px; /* Increased padding to give the chart more breathing room */
}

.chart-container {
    width: 100%;
    max-width: 380px; /* Constrained width so it doesn't feel oversized */
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1 / 1; /* Maintains square shape without fixed height */
    position: relative;
    overflow: hidden;
    border-radius: 16px;
}

.chart-lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(1.5px);
    -webkit-backdrop-filter: blur(1.5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.lock-box {
    background: white;
    padding: 24px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 2px solid #e5e5e5;
    max-width: 80%;
}

.lock-box p {
    margin: 0 0 16px 0;
    font-weight: 900;
    color: var(--text-dark);
    line-height: 1.4;
    font-size: 16px;
}

.lock-box p span {
    color: var(--science-color);
}

#proficiency-chart {
    width: 100%;
    height: 100%;
}

.chart-axis {
    stroke: #e5e5e5;
    stroke-width: 1;
}

.chart-grid {
    fill: none;
    stroke: #f1f1f1;
    stroke-width: 1;
}

.chart-label {
    font-size: 12px;
    font-weight: 900;
    fill: #afafaf;
    text-transform: uppercase;
}

/* Quick Metrics Styling */
.metric-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.metric-card h3 {
    font-size: 14px; /* Reduced slightly to accommodate 3 columns */
    margin-bottom: 12px;
    color: #afafaf;
}

.metric-content {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: -5px;
}

.metric-icon {
    font-size: 28px;
}

.metric-value {
    font-size: 28px;
    font-weight: 900;
    color: var(--text-dark);
}

.metric-value small {
    font-size: 16px;
    color: #afafaf;
    margin-left: 2px;
    font-weight: 700;
}

/* Tasks Page Styling */
.task-category h3 {
    color: #afafaf;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

#active-task-count {
    font-weight: 900;
    margin-left: 8px;
    transition: color 0.3s;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.task-card {
    background: white;
    border: 2px solid #e5e5e5;
    border-bottom: 5px solid #e5e5e5;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Minigame Gallery Split Styles */
.minigame-view-split {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 20px 0 80px 0 !important;
}

.minigame-view-split::before {
    display: none; /* Hide the roadmap path line */
}

.gallery-section-title {
    width: 100%;
    max-width: 800px;
    font-size: 13px;
    font-weight: 900;
    color: #afafaf;
    letter-spacing: 1.5px;
    margin: 60px 0 20px 0;
    text-align: left;
}

.minigame-gallery-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 800px;
    justify-items: center;
}

.minigame-view-split .node {
    transform: none !important;
    margin: 0 !important;
    width: 110px !important;
    height: 110px !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 0 var(--node-shadow), 0 10px 20px rgba(0,0,0,0.1) !important;
}

.minigame-view-split .node span {
    animation: none;
    transform: none;
    font-size: 48px;
}

.minigame-view-split .node:hover {
    transform: translateY(-5px) !important;
}

.minigame-view-split .node .node-label {
    transform: translateX(-50%);
    top: 105%;
    font-size: 10px;
    padding: 2px 8px;
}

.node.locked {
    filter: grayscale(1);
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #ccc !important;
    box-shadow: 0 10px 0 #bbb !important;
}

.node.minigame.locked {
    box-shadow: 10px 10px 0 #bbb, 0 20px 40px rgba(0,0,0,0.1) !important;
}

.lock-icon-inner {
    font-size: 40px;
    transform: rotate(-45deg); /* Counters the 45deg rotation of the minigame node */
}

.task-timer-box {
    background: #f7f7f7;
    border: 2px dashed #e5e5e5;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    margin-bottom: 32px;
}

.task-timer-box p {
    margin: 0;
    font-weight: 900;
    color: #afafaf;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.task-main {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-grow: 1;
}

.task-icon-circle {
    width: 48px;
    height: 48px;
    background: #f1f1f1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.task-details h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 900;
}

.task-details p {
    margin: 4px 0 10px 0;
    color: #777;
    font-size: 14px;
    font-weight: 700;
}

.task-progress-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 200px;
}

.task-progress-bg {
    flex-grow: 1;
    height: 10px;
    background: #e5e5e5;
    border-radius: 10px;
}

.task-progress-fill {
    height: 100%;
    background: var(--science-color);
    border-radius: 10px;
}

.task-count {
    font-size: 12px;
    font-weight: 900;
    color: #afafaf;
}

.task-rewards {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

/* Profile Specific Styling */
.profile-hero {
    padding: 40px;
    margin-bottom: 20px;
    min-height: 400px;
    display: flex;
    align-items: center;
}

.profile-main {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    position: relative;
    width: 100%;
}

.level-badge {
    position: absolute;
    bottom: -10px;
    right: -10px;
    background: #ffc800;
    color: white;
    border: 3px solid white;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 14px;
    box-shadow: 0 4px 0 rgba(0,0,0,0.1);
}

.profile-avatar-large {
    width: 180px;
    height: 320px;
    border-radius: 20px;
    background: #e5e5e5;
    box-sizing: border-box;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #afafaf;
    cursor: pointer;
    position: relative;
}

.profile-avatar-large:hover {
     background: #f0f9ff;

}

.create-avatar-content {
    text-align: center;
}

.plus-icon {
    font-size: 42px;
    font-weight: 900;
}

.create-text {
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
}

.xp-progress-bar {
    background: #e5e5e5;
    height: 24px;
    border-radius: 12px;
    width: 100%;
    max-width: 450px;
    position: relative;
    margin: 10px 0 20px 0;
    overflow: hidden;
}

.xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #72e61a, #60c910);
    transition: width 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.xp-text {
    position: absolute;
    width: 100%;
    text-align: center;
    font-size: 11px;
    font-weight: 900;
    color: #4b4b4b;
    line-height: 24px;
    text-transform: uppercase;
}

.profile-info h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 900;
}

.profile-info p {
    color: #afafaf;
    font-weight: 700;
    margin: 4px 0 15px 0;
}

.edit-btn {
    background: white;
    border: 2px solid #e5e5e5;
    border-bottom: 4px solid #e5e5e5;
    border-radius: 12px;
    padding: 8px 16px;
    font-weight: 900;
    color: #1cb0f6;
}

.profile-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.mini-header {
    font-size: 12px;
    font-weight: 900;
    color: #afafaf;
    margin: 24px 0 12px 0;
    letter-spacing: 1px;
}

.showcase-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0 12px 0;
}

.showcase-header-row .mini-header {
    margin: 0;
}

.change-badges-btn {
    background: #f1f1f1;
    border: none;
    border-bottom: 3px solid #e5e5e5;
    border-radius: 10px;
    padding: 4px 12px;
    font-weight: 900;
    font-size: 11px;
    color: #afafaf;
    cursor: pointer;
    transition: all 0.1s;
}

.change-badges-btn:active {
    transform: translateY(2px);
    border-bottom-width: 0;
}

/* Profile Gamification Layout */
.profile-grid-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    margin-top: 0;
}

.profile-section-card {
    background: white;
    border: 2px solid #e5e5e5;
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
}

.profile-section-card h2 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 900;
    color: #4b4b4b;
}

/* Badge Grid & Showcase */
.badge-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    max-width: 450px;
    gap: 16px;
}

.badge-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: #f7f7f7;
    border-radius: 16px;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);

}

.badge-item.locked {
    cursor: default;
}

.badge-item.locked .badge-icon,
.badge-item.locked .badge-details {
    opacity: 0.3;
    filter: grayscale(1);
}

.badge-item:not(.locked):hover {
    transform: translateY(-5px);
    background: white;
    box-shadow: 0 8px 16px rgba(0,0,0,0.05);
}

.badge-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

/* Badge Tooltip Styling */
.badge-tooltip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #4b4b4b;
    color: white;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 800;
    width: 160px;
    text-align: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    line-height: 1.4;
}

.badge-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #4b4b4b;
}

.badge-item:hover {
    z-index: 10; /* This is correct for bringing it to the front */
}

.badge-item:hover .badge-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(8px);
}


.badge-title {
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

/* Activity Feed Entries */
.feed-entry {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid #f1f1f1;
    align-items: center;
}

.feed-info p {
    margin: 0;
    font-size: 14px;
}

.feed-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.react-btn {
    background: none;
    border: none;
    font-size: 12px;
    font-weight: 800;
    color: #1cb0f6;
    padding: 0;
    cursor: pointer;
}

.react-btn:hover {
    text-decoration: underline;
}

/* Gamified Buttons */
.mystery-box-btn {
    background: #ce82ff;
    color: white;
    border: none;
    border-bottom: 4px solid #a558d4;
    border-radius: 12px;
    padding: 8px 16px;
    font-weight: 900;
    margin-left: 10px;
    cursor: pointer;
    transition: all 0.1s;
}

.mystery-box-btn:active {
    transform: translateY(2px);
    border-bottom-width: 0;
}

/* Badge Modal Styles */
#badge-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 10001; /* Ensure above nav and welcome overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease, visibility 0.3s;
}

#badge-modal-overlay.hidden-overlay {
    opacity: 0;
    visibility: hidden;
}

.badge-modal {
    background: white;
    border-radius: 24px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

#badge-modal-overlay.hidden-overlay .badge-modal {
    transform: translateY(30px);
}

.badge-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.badge-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 900;
    color: var(--text-dark);
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #afafaf;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #ff4b4b;
}

.modal-badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
}

.badge-item.selected {
    border-color: var(--science-color);
    background: #f0f9ff;
}

.badge-check {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--science-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
}

.shaking {
    animation: shake 0.5s infinite;
}

@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.reward-claimed {
    background: #58cc02;
    border-bottom-color: #46a302;
    pointer-events: none;
}

/* Feed Animation */
.slide-in {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.achievement-item {
    padding: 10px 0;
    font-weight: 700;
    color: #777;
}

/* Daily Challenges Sidebar Styling */
.challenge-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.challenge-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f1f1;
}

.challenge-item:last-child {
    border-bottom: none;
}

.challenge-emoji {
    font-size: 20px;
}

.challenge-info {
    display: flex;
    flex-direction: column;
}

.challenge-info strong {
    font-size: 14px;
    font-weight: 800;
    color: #4b4b4b;
}

.challenge-info small {
    font-size: 11px;
    font-weight: 900;
    color: #afafaf;
    margin-top: 2px;
}

/* Metric Flip Card Logic */
.flip-container {
    perspective: 1000px;
    min-height: 120px;
    cursor: url('assets/images/hand.png') 12 0, pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.flip-container.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.flip-card-back {
    transform: rotateY(180deg);
    background: #f8f9fa;
}

.flip-card-back p {
    font-size: 11px;
    line-height: 1.4;
    color: #777;
    margin: 0;
    text-align: center;
}

.reward-tag {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 900;
    background: #f1f1f1;
}

.reward-tag.xp { color: var(--ss-color); background: #fff9e6; }
.reward-tag.gems { color: var(--english-color); background: #e6f7ff; }

.claim-btn {
    background: #e5e5e5;
    color: #afafaf;
    border: none;
    padding: 6px 16px;
    border-radius: 12px;
    font-weight: 900;
    font-size: 12px;
}

.reward-row {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.accept-btn {
    background: var(--english-color);
    color: white;
    border: none;
    border-bottom: 4px solid #1482b5;
    padding: 8px 20px;
    border-radius: 12px;
    font-weight: 900;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.1s;
}

.accept-btn:active {
    transform: translateY(2px);
    border-bottom-width: 0;
}

/* Quad View Specifics */
.quad-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.chat-placeholder {
    width: 100%;
    max-width: 900px;
    height: 200px;
    display: flex;
    flex-direction: column;
    background: #f9f9f9;
    padding: 0;
    overflow: hidden;
	margin-bottom: -20px;
}

.chat-header {
    display: none;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.chat-messages::-webkit-scrollbar {
    display: none;
}

.message-bubble {
    padding: 8px 14px;
    border-radius: 18px;
    max-width: 80%;
    width: fit-content;
    animation: slideIn 0.3s ease-out;
}

.message-meta {
    display: flex;
    gap: 8px;
    font-size: 10px;
    font-weight: 900;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.message-text {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}

.message-bubble.received {
    background: #e5e5e5;
    color: #4b4b4b;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message-bubble.received .message-meta {
    color: #afafaf;
}

.message-bubble.sent {
    background: var(--english-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message-bubble.sent .message-meta {
    color: rgba(255, 255, 255, 0.8);
}

.chat-input-area {
    display: flex;
    padding: 12px;
    gap: 10px;
    background: white;
    border-top: 2px solid #e5e5e5;
}

.chat-input-area input {
    flex: 1;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    padding: 10px 16px;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    outline: none;
    font-size: 14px;
}

.chat-input-area button {
    background: var(--english-color);
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 12px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 4px 0 #1482b5;
    transition: all 0.1s;
}

.chat-input-area button:active {
    transform: translateY(4px);
    box-shadow: none;
}

.quad-big-box {
    width: 100%;
    max-width: 900px;
    min-height: 500px; /* 3x the chat-placeholder height */
    background: white;
}

/* Welcome Overlay Styles */
#welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    z-index: 10000;
    display: none; /* Set this back to 'block' to re-enable the welcome overlay */
    overflow-y: auto;
    transition: opacity 0.5s ease, visibility 0.5s;
    scrollbar-width: none;
}

#welcome-overlay::-webkit-scrollbar { display: none; }

#welcome-overlay.hidden-overlay {
    opacity: 0;
    visibility: hidden;
}

.overlay-scroll-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 0;
    width: 100%;
}

.overlay-card {
    text-align: left;
    max-width: 950px;
    width: 90%;
    padding: 40px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 60px;
    margin-bottom: 100px;
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.overlay-reveal-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.overlay-left {
    flex: 1;
}

.overlay-right {
    flex: 1;
    display: flex;
    justify-content: center;
}

.overlay-card h1 {
    font-size: 48px;
    font-weight: 900;
    color: var(--science-color);
    margin: 0 0 16px 0;
}

.overlay-card p {
    font-size: 18px;
    font-weight: 700;
    color: #777;
    line-height: 1.5;
    margin-bottom: 32px;
}

.overlay-image-large {
    width: 100%;
    max-width: 400px;
    height: auto;
}

.overlay-buttons {
    display: flex;
    flex-direction: row;
    gap: 16px;
    width: 100%;
}

.google-play-btn {
    background: #000;
    color: white;
    border: 2px solid #333;
    border-bottom: 6px solid #333;
    padding: 16px;
    border-radius: 16px;
    font-weight: 900;
    font-size: 14px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.1s;
    cursor: pointer;
}

.play-icon {
    width: 20px;
    height: 20px;
}

.google-play-btn:active {
    transform: translateY(4px);
    border-bottom-width: 2px;
}

.continue-btn {
    background: white;
    color: #1cb0f6;
    border: 2px solid #e5e5e5;
    border-bottom: 4px solid #e5e5e5;
    padding: 16px;
    border-radius: 16px;
    font-weight: 900;
    font-size: 14px;
    flex: 1;
    transition: all 0.1s;
    cursor: pointer;
}

.continue-btn:active {
    transform: translateY(4px);
    border-bottom-width: 2px;
}

.overlay-info-section {
    max-width: 1000px;
    width: 90%;
    margin-bottom: 120px;
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.section-heading {
    text-align: center;
    margin-bottom: 50px;
}

.section-heading h2 {
    font-size: 36px;
    font-weight: 900;
    color: #4b4b4b;
    margin-bottom: 10px;
}



.overlay-footer-cta h2 {
    font-size: 36px;
    font-weight: 900;
    color: #4b4b4b;
    margin-bottom: 10px;
}

.section-heading p {
    font-size: 18px;
    color: #afafaf;
    font-weight: 700;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.info-item {
    background: #f7f7f7;
    padding: 30px;
    border-radius: 24px;
    text-align: center;
}

.info-icon { font-size: 40px; display: block; margin-bottom: 15px; }
.info-item h3 { font-weight: 900; margin-bottom: 10px; color: #4b4b4b; }
.info-item p { font-size: 14px; color: #777; line-height: 1.6; }

.career-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.career-item {
    padding: 24px;
    border-radius: 20px;
    border: 2px solid #e5e5e5;
}

.career-head {
    font-weight: 900;
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.career-item p { font-size: 15px; font-weight: 700; line-height: 1.4; color: #777; }

.career-item.math { border-color: var(--math-color); }
.career-item.english { border-color: var(--english-color); }
.career-item.science { border-color: var(--science-color); }
.career-item.ss { border-color: var(--ss-color); }
.career-item.it { border-color: var(--it-color); }

.overlay-footer-cta { 
    margin-bottom: 60px; 
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.continue-btn-large {
    background: var(--science-color);
    color: white;
    border: none;
    border-bottom: 6px solid #46a302;
    padding: 20px 60px;
    border-radius: 20px;
    font-weight: 900;
    font-size: 18px;
    cursor: pointer;
}

/* Dark Mode Support */
body.dark-mode {
    background-color: #121212;
    color: #f7f7f7;
    --bg-gray: #121212;
    --text-dark: #f7f7f7;
}

body.dark-mode nav,
body.dark-mode aside.right-sidebar,
body.dark-mode .side-card,
body.dark-mode .side-card-stats,
body.dark-mode .stats-container,
body.dark-mode .node,
body.dark-mode .option-btn,
body.dark-mode .difficulty-option,
body.dark-mode .task-card,
body.dark-mode .profile-section-card,
body.dark-mode .chat-input-area,
body.dark-mode .chat-input-area input,
body.dark-mode .quad-big-box,
body.dark-mode #welcome-overlay,
body.dark-mode .dropdown-content,
body.dark-mode .lock-box,
body.dark-mode .profile-avatar-large,
body.dark-mode .message-bubble.received,
body.dark-mode .unit-card,
body.dark-mode .daily-task-card .play-btn,
body.dark-mode .daily-task-card .knowva-btn,
body.dark-mode .continue-btn,
body.dark-mode .info-item,
body.dark-mode .career-item,
body.dark-mode .flip-card-back,
body.dark-mode .badge-item,
body.dark-mode .badge-modal,
body.dark-mode .chat-placeholder {
    background-color: #1e1e1e;
    color: #f7f7f7;
    border-color: #333;
}

/* Preserve colorful subject headers, only darken neutral ones */
body.dark-mode .lesson-header:not(.math):not(.science):not(.english):not(.ss):not(.it):not(.minigames) {
    background-color: #1e1e1e;
    color: #f7f7f7;
    border-color: #333;
}

body.dark-mode .lesson-header:not(.math):not(.science):not(.english):not(.ss):not(.it):not(.minigames) .back-btn,
body.dark-mode #stats-view .back-btn {
    color: #f7f7f7;
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .node-label {
    background-color: rgba(30, 30, 30, 0.9);
    color: #e5e5e5;
}

body.dark-mode .node.minigame {
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
}

body.dark-mode .nav-item:hover,
body.dark-mode .dropdown-content a:hover,
body.dark-mode .option-btn:hover,
body.dark-mode .badge-item:not(.locked):hover {
    background-color: #2a2a2a;
}

body.dark-mode .nav-item.active {
    background-color: rgba(28, 176, 246, 0.15);
    border-color: #1899d6;
    color: #84d8ff;
}

body.dark-mode .badge-modal-header h3 {
    color: #fff;
}

body.dark-mode .badge-item.selected {
    background-color: rgba(88, 204, 2, 0.15);
    border-color: var(--science-color);
}

body.dark-mode .difficulty-option.beginner:hover { background-color: rgba(88, 204, 2, 0.15); }
body.dark-mode .difficulty-option.intermediate:hover { background-color: rgba(28, 176, 246, 0.15); }
body.dark-mode .difficulty-option.hard:hover { background-color: rgba(255, 75, 75, 0.15); }

body.dark-mode .sidebar-footer,
body.dark-mode .side-header,
body.dark-mode .streak-divider,
body.dark-mode .chat-input-area,
body.dark-mode .message-bubble.received,
body.dark-mode .feed-entry,
body.dark-mode .challenge-item {
    border-color: #333;
}

body.dark-mode .chart-grid { stroke: #333; }
body.dark-mode .chart-axis { stroke: #444; }
body.dark-mode .heatmap-square { background-color: #2a2a2a; }
body.dark-mode .chart-lock-overlay { background: rgba(30, 30, 30, 0.7); }

body.dark-mode .subject-name,
body.dark-mode .task-details h4,
body.dark-mode .profile-info h1,
body.dark-mode .section-heading h2,
body.dark-mode .metric-value,
body.dark-mode .streak-number,
body.dark-mode .question-card h3,
body.dark-mode .side-card h3,
body.dark-mode .challenge-info strong {
    color: #fff;
}

body.dark-mode .text-dark,
body.dark-mode .side-text,
body.dark-mode .task-details p,
body.dark-mode .badge-title,
body.dark-mode .message-text,
body.dark-mode .info-item p,
body.dark-mode .career-item p,
body.dark-mode .overlay-card p,
body.dark-mode .flip-card-back p {
    color: #afafaf;
}

body.dark-mode .arena-progress-bg,
body.dark-mode .xp-progress-bar,
body.dark-mode .task-progress-bg,
body.dark-mode .quest-progress {
    background-color: #333;
}

body.dark-mode .progress-bg {
    background: rgba(0, 0, 0, 0.3);
}

body.dark-mode .daily-task-card .play-btn {
    box-shadow: 0 4px 0 #000;
}

body.dark-mode .daily-task-card .play-btn:active {
    box-shadow: 0 0 0 #000;
}

body.dark-mode .badge-tooltip {
    background: #f7f7f7;
    color: #121212;
}

body.dark-mode .badge-tooltip::before {
    border-bottom-color: #f7f7f7;
}

body.dark-mode .diff-icon-container,
body.dark-mode .task-icon-circle,
body.dark-mode .reward-tag,
body.dark-mode .exit-arena {
    background-color: #2a2a2a;
    color: #f7f7f7;
}

body.dark-mode .lock-icon {
    background-color: #2a2a2a;
}

body.dark-mode .change-badges-btn,
body.dark-mode .claim-btn {
    background-color: #333;
    border-bottom-color: #222;
    color: #ccc;
}

body.dark-mode .edit-btn {
    background-color: #1e1e1e;
    border-color: #333;
    color: #1cb0f6;
}

body.dark-mode .level-badge {
    border-color: #1e1e1e;
}

/* Dark Mode Subject Cards */
body.dark-mode .card {
    background: #1e1e1e;
    border-bottom-color: #121212;
}

body.dark-mode .card.minigames {
    box-shadow: 0 8px 0 #121212;
}

body.dark-mode .card .icon-box {
    background: #2a2a2a;
    color: #f7f7f7;
}

body.dark-mode .card .difficulty-label {
    background: rgba(255, 255, 255, 0.1);
    color: #f7f7f7;
}

body.dark-mode .card .progress-bg {
    background: #121212;
}

body.dark-mode .card.math .subject-name,
body.dark-mode .card.math .progress-percent { color: var(--math-color); }
body.dark-mode .card.math .progress-fill { background: var(--math-color); }

body.dark-mode .card.science .subject-name,
body.dark-mode .card.science .progress-percent { color: var(--science-color); }
body.dark-mode .card.science .progress-fill { background: var(--science-color); }

body.dark-mode .card.english .subject-name,
body.dark-mode .card.english .progress-percent { color: var(--english-color); }
body.dark-mode .card.english .progress-fill { background: var(--english-color); }

body.dark-mode .card.ss .subject-name,
body.dark-mode .card.ss .progress-percent { color: var(--ss-color); }
body.dark-mode .card.ss .progress-fill { background: var(--ss-color); }

body.dark-mode .card.it .subject-name,
body.dark-mode .card.it .progress-percent { color: var(--it-color); }
body.dark-mode .card.it .progress-fill { background: var(--it-color); }

body.dark-mode .card.minigames .subject-name,
body.dark-mode .card.minigames .progress-percent { color: var(--minigames-color); }
body.dark-mode .card.minigames .progress-fill { background: var(--minigames-color); }

body.dark-mode .dot {
    background-color: #333;
}

body.dark-mode .dot.active {
    background-color: var(--science-color);
}

/* ==========================================================================
   Mobile Responsive & Hamburger Menu Styles
   ========================================================================== */

/* Mobile Header */
.mobile-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: white;
    border-bottom: 2px solid #e5e5e5;
    position: sticky;
    top: 0;
    z-index: 99;
}

.mobile-header .logo {
    margin-bottom: 0;
    font-size: 28px;
}

.mobile-header .logo img {
    height: 28px;
}

.hamburger-btn {
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dark);
}

#mobile-nav-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

#mobile-nav-overlay.active {
    display: block;
    opacity: 1;
}

body.dark-mode .mobile-header {
    background-color: #1e1e1e;
    border-bottom-color: #333;
}

body.dark-mode .hamburger-btn {
    color: #f7f7f7;
}

/* Responsive Layout Adjustments */
@media (max-width: 1400px) {
    body {
        padding: 0 50px;
        column-gap: 50px;
        grid-template-columns: 250px 1fr 300px;
    }
}

@media (max-width: 1024px) {
    body {
        display: flex;
        flex-direction: column;
        padding: 0;
    }

    .mobile-header {
        display: flex;
    }

    nav {
        position: fixed;
        top: 0;
        left: -300px;
        height: 100vh;
        z-index: 101;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }

    nav.open {
        left: 0;
    }

    main {
        padding: 20px;
    }

    .right-sidebar {
        border-left: none;
        border-top: 2px solid #e5e5e5;
        padding: 20px;
        min-height: auto;
    }

    body.dark-mode .right-sidebar {
        border-top-color: #333;
    }

    .profile-grid-layout {
        grid-template-columns: 1fr;
    }

    .overlay-card {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }

    .overlay-buttons {
        flex-direction: column;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .stats-row {
        flex-direction: column;
    }

    .minigame-gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .daily-task-card {
        flex-direction: column;
        text-align: center;
    }
    
    .partitioned-progress {
        margin: 12px auto 16px auto;
    }
    
    .daily-footer {
        justify-content: center;
    }
    
    .daily-icon, .card.minigames .icon-box1 {
        display: none;
    }

    /* Mobile Sidebar Carousel */
    .sidebar-carousel {
        width: 100%;
        overflow: hidden;
        position: relative;
    }
    
    .carousel-track {
        flex-direction: row;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -ms-overflow-style: none;
        gap: 20px;
        padding-bottom: 5px;
    }
    
    .carousel-track::-webkit-scrollbar {
        display: none;
    }
    
    .carousel-slide {
        flex: 0 0 100%;
        scroll-snap-align: start;
    }
    
    .carousel-dots {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-top: 10px;
    }
    
    .dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: #e5e5e5;
        cursor: pointer;
        transition: background 0.3s;
    }
    
    .dot.active {
        background: var(--science-color);
    }

    .desktop-footer {
        display: none;
    }
    
    .mobile-footer {
        display: flex;
        margin-top: 20px;
        padding-bottom: 20px;
        align-items: center;
    }
    
    .mobile-footer .footer-nav,
    .mobile-footer .footer-social {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .header-status { flex-direction: column; }
    .stats-container { flex-wrap: nowrap; justify-content: center; gap: 12px; padding: 12px 10px; }
    .streak, .xp, .diamond { font-size: 12px; }
    .lesson-header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .minigame-gallery-grid { grid-template-columns: repeat(3, 1fr); }
    
    .difficulty-option {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .diff-arrow { transform: rotate(90deg); margin-top: 10px; }
    
    .task-card { flex-direction: column; align-items: flex-start; gap: 15px; }
    .task-rewards { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; }
    
    .profile-main { flex-direction: column; align-items: center; text-align: center; }
    .profile-actions { justify-content: center; }
    
    .badge-grid { grid-template-columns: repeat(2, 1fr); margin: 0 auto; }
    
    .chat-input-area { flex-direction: column; }
    .quad-big-box { min-height: 300px; }
    
    .heatmap-quarters { margin-left: 20px; font-size: 8px; }
    .heatmap-days { font-size: 8px; width: 30px; }
    .heatmap-main { gap: 10px; }
}

@media (max-width: 480px) {
    .minigame-gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .modal-badge-grid { grid-template-columns: repeat(2, 1fr); }
    .career-grid { grid-template-columns: 1fr; }
}
