/* Game World CSS for Student Dashboard
 * This provides a gamified interface for the learning platform
 */

:root {
    --primary-color: #3c096c;
    --primary-dark: #3c096c;
    --primary-light: #3c096c;
    --secondary-color: #1b9aaa;
    --secondary-dark: #1b9aaa;
    --accent-color: #ffcc00;
    --dark-color: #000000;
    --light-color: #ffffff;
    --success-color: #1b9aaa;
    --info-color: #1b9aaa;
    --warning-color: #ffcc00;
    --danger-color: #ef476f;
    --error-color: #ef476f;
    --xp-color: #1b9aaa;
    --star-color: #ffcc00;
    --badge-color: #ef476f;
    --text-primary: #ffffff;
    --text-dark: #000000;
    --text-light: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.8);
    --font-heading: 'Orbitron', monospace;
    --font-body: 'Kanit', sans-serif;
    --bg-light: #ffffff;
    --bg-dark: #000000;
    --bg-card: #ffffff;
}

/* Game World Background and Container */
body {
    margin: 0;
    padding: 0;
    font-family: 'Nunito', sans-serif;
    background-color: var(--dark-color);
    color: var(--light-color);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

.game-world-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Game UI Header */
.game-ui-header {
    background-color: var(--primary-color);
    border: 3px solid var(--accent-color);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    color: var(--light-color);
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 25px;
    box-shadow: 0 8px 30px rgba(255, 204, 0, 0.4);
}

/* Player Info Section */
.player-info {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.player-avatar {
    position: relative;
    width: 90px;
    height: 90px;
}

.avatar-frame {
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background-color: var(--accent-color);
    border: 3px solid var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-inner {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--dark-color);
    color: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: bold;
    text-transform: uppercase;
    overflow: hidden;
    border: 2px solid var(--accent-color);
}

.avatar-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.level-indicator {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background-color: var(--accent-color);
    color: var(--dark-color);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    border: 2px solid var(--light-color);
}

.player-details {
    flex-grow: 1;
    text-align: left;
}

.player-name {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 8px 0;
    color: var(--light-color);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    text-align: left;
}

.player-email {
    margin: 0;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
}

/* Player Stats */
.player-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.stat-capsule {
    background-color: transparent;
    border: 2px solid var(--accent-color);
    border-radius: 25px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 2px;
    box-sizing: border-box;
    color: var(--light-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-capsule:hover {
    background-color: var(--accent-color);
    color: var(--dark-color);
    transform: translateY(-3px);
}

.stat-value {
    font-weight: 800;
}

/* Resource Bars */
.resource-bars {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.resource-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.resource-bar {
    position: relative;
    height: 35px;
    background-color: var(--dark-color);
    border: 2px solid var(--accent-color);
    border-radius: 20px;
    overflow: hidden;
    width: 200px;
    min-width: 200px;
}

.resource-fill {
    height: 100%;
    border-radius: 18px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.resource-fill.xp {
    background-color: var(--primary-color);
}

.resource-fill.energy {
    background-color: var(--accent-color);
}

.resource-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--light-color);
    font-size: 14px;
    font-weight: bold;
    z-index: 10;
}

/* Game Worlds Grid */
.game-worlds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
}

/* Special grid layout for achievement hall */
.achievements-world {
    grid-column: auto / span 2; /* Make achievements take up more space */
}

/* Game Card */
.game-card {
    background-color: transparent;
    border-radius: 20px;
    padding: 25px;
    transition: all 0.4s ease;
    border: 3px solid var(--primary-color);
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    color: var(--light-color);
    box-shadow: 0 6px 20px rgba(60, 9, 108, 0.3);
}

.game-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-color);
    box-shadow: 0 12px 35px rgba(255, 204, 0, 0.4);
}

.game-card.course-world {
    border-color: var(--accent-color);
    box-shadow: 0 6px 20px rgba(255, 204, 0, 0.3);
}

.game-card.course-world:hover {
    border-color: var(--danger-color);
    box-shadow: 0 12px 35px rgba(239, 71, 111, 0.4);
}

.game-card.quiz-world {
    border-color: var(--secondary-color);
    box-shadow: 0 6px 20px rgba(27, 154, 170, 0.3);
}

.game-card.quiz-world:hover {
    border-color: var(--accent-color);
    box-shadow: 0 12px 35px rgba(255, 204, 0, 0.4);
}

.game-card.achievements-world {
    border-color: var(--danger-color);
    box-shadow: 0 6px 20px rgba(239, 71, 111, 0.3);
}

.game-card.achievements-world:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 12px 35px rgba(27, 154, 170, 0.4);
}

.game-card.leaderboard-world {
    border-color: var(--primary-color);
    box-shadow: 0 6px 20px rgba(60, 9, 108, 0.3);
}

.game-card.leaderboard-world:hover {
    border-color: var(--accent-color);
    box-shadow: 0 12px 35px rgba(255, 204, 0, 0.4);
}

.game-card.full-width {
    grid-column: 1 / -1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e5e5;
    flex-wrap: wrap;
    gap: 15px;
}

.card-header h3 {
    margin: 0;
    color: var(--light-color);
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.card-header h3 i {
    background-color: var(--accent-color);
    color: var(--dark-color);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 18px;
    font-style: normal;
    border: 3px solid var(--light-color);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 204, 0, 0.4);
}

.card-header h3 i:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 204, 0, 0.6);
}

/* Specific icon colors for different card types */
.course-world .card-header h3 i {
    background-color: var(--accent-color);
    color: var(--dark-color);
    box-shadow: 0 4px 15px rgba(255, 204, 0, 0.4);
}

.quiz-world .card-header h3 i {
    background-color: var(--secondary-color);
    color: var(--light-color);
    box-shadow: 0 4px 15px rgba(27, 154, 170, 0.4);
}

.achievements-world .card-header h3 i {
    background-color: var(--danger-color);
    color: var(--light-color);
    box-shadow: 0 4px 15px rgba(239, 71, 111, 0.4);
}

.leaderboard-world .card-header h3 i {
    background-color: var(--primary-color);
    color: var(--light-color);
    box-shadow: 0 4px 15px rgba(60, 9, 108, 0.4);
}

.card-content {
    color: var(--light-color);
    width: 100%;
    overflow: hidden;
    flex: 1;
}

/* Course Item */
.course-item {
    background-color: transparent;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 18px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 3px solid var(--primary-color);
    width: 100%;
    box-sizing: border-box;
    color: var(--light-color);
}

.course-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.course-item.enrolled {
    border-color: var(--secondary-color);
}

.course-item.available {
    border-color: var(--accent-color);
}

.course-item h4 {
    margin: 0 0 8px 0;
    color: var(--light-color);
    font-weight: 700;
    font-size: 18px;
}

.course-item p {
    margin: 0 0 12px 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.4;
}

.course-status {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: var(--light-color);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.course-item.available .course-status {
    background-color: var(--info-color);
}

.course-item.enrolled .course-status {
    background-color: var(--success-color);
}

.course-actions, .quiz-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.button-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.game-button {
    background-color: var(--primary-color);
    color: var(--light-color);
    border: 2px solid var(--primary-color);
    padding: 10px 18px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.game-button:hover {
    background-color: var(--accent-color);
    color: var(--dark-color);
    transform: translateY(-3px);
    border-color: var(--accent-color);
}

.game-button:active {
    transform: translateY(0);
}

.game-button.secondary {
    background-color: var(--secondary-color);
    color: var(--light-color);
    border-color: var(--secondary-color);
}

.game-button.secondary:hover {
    background-color: var(--danger-color);
    color: var(--light-color);
    border-color: var(--danger-color);
}

.game-button.accent {
    background-color: var(--accent-color);
    color: var(--dark-color);
    border-color: var(--accent-color);
}

.game-button.accent:hover {
    background-color: var(--danger-color);
    color: var(--light-color);
    border-color: var(--danger-color);
}

.game-button:disabled {
    background-color: var(--bg-color) !important;
    color: var(--text-color) !important;
    border-color: var(--text-color) !important;
    cursor: not-allowed !important;
    opacity: 0.7;
    transform: none !important;
}

/* Quiz Item */
.quiz-item {
    background: linear-gradient(var(--dark-color), var(--dark-color)) padding-box,
                linear-gradient(135deg, var(--secondary-color), var(--accent-color), var(--danger-color)) border-box;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 18px;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    color: var(--light-color);
    box-shadow: 0 5px 20px rgba(27, 154, 170, 0.3);
}

.quiz-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 35px rgba(27, 154, 170, 0.5);
    background: linear-gradient(var(--dark-color), var(--dark-color)) padding-box,
                linear-gradient(135deg, var(--accent-color), var(--danger-color), var(--primary-color)) border-box;
}

.quiz-item h4 {
    margin: 0 0 8px 0;
    color: var(--light-color);
    font-weight: 700;
    font-size: 18px;
}

.quiz-item p {
    margin: 0 0 12px 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.4;
}

.quiz-difficulty {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 6px 14px;
    border-radius: 15px;
    font-weight: 700;
    font-size: 11px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.quiz-difficulty:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.difficulty-easy {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    box-shadow: 0 3px 10px rgba(27, 154, 170, 0.4);
}

.difficulty-medium {
    background: linear-gradient(135deg, var(--accent-color), var(--danger-color));
    color: var(--dark-color);
    box-shadow: 0 3px 10px rgba(255, 204, 0, 0.4);
}

.difficulty-hard {
    background: linear-gradient(135deg, var(--danger-color), var(--primary-color));
    box-shadow: 0 3px 10px rgba(239, 71, 111, 0.4);
}

.quiz-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
    margin: 15px 0;
    font-size: 13px;
}

.quiz-stat {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 2px solid var(--accent-color);
    padding: 10px 12px;
    border-radius: 12px;
    text-align: center;
    color: #ffffff !important;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(255, 204, 0, 0.2);
}

.quiz-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 204, 0, 0.1), transparent);
    transition: left 0.5s;
}

.quiz-stat:hover::before {
    left: 100%;
}

.quiz-stat:hover {
    background: linear-gradient(135deg, rgba(255, 204, 0, 0.2), rgba(27, 154, 170, 0.2)) !important;
    color: #ffffff !important;
    transform: translateY(-2px) scale(1.05);
    border-color: var(--secondary-color);
    box-shadow: 0 5px 15px rgba(27, 154, 170, 0.4);
}

/* Individual quiz stat colors */
.quiz-stat:nth-child(1) {
    border-color: var(--secondary-color);
    box-shadow: 0 3px 10px rgba(27, 154, 170, 0.2);
}

.quiz-stat:nth-child(2) {
    border-color: var(--accent-color);
    box-shadow: 0 3px 10px rgba(255, 204, 0, 0.2);
}

.quiz-stat:nth-child(3) {
    border-color: var(--danger-color);
    box-shadow: 0 3px 10px rgba(239, 71, 111, 0.2);
}

.quiz-stat:nth-child(4) {
    border-color: var(--primary-color);
    box-shadow: 0 3px 10px rgba(60, 9, 108, 0.2);
}

/* Quiz stat icon colors */
.quiz-stat i {
    margin-right: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.quiz-stat:nth-child(1) i {
    color: var(--secondary-color);
    text-shadow: 0 0 8px rgba(27, 154, 170, 0.6);
}

.quiz-stat:nth-child(1):hover i {
    color: var(--light-color);
    text-shadow: 0 0 12px var(--secondary-color);
    transform: scale(1.2);
    filter: brightness(1.3);
}

.quiz-stat:nth-child(2) i {
    color: var(--accent-color);
    text-shadow: 0 0 8px rgba(255, 204, 0, 0.6);
}

.quiz-stat:nth-child(2):hover i {
    color: var(--light-color);
    text-shadow: 0 0 12px var(--accent-color);
    transform: scale(1.2);
    filter: brightness(1.3);
}

.quiz-stat:nth-child(3) i {
    color: var(--danger-color);
    text-shadow: 0 0 8px rgba(239, 71, 111, 0.6);
}

.quiz-stat:nth-child(3):hover i {
    color: var(--light-color);
    text-shadow: 0 0 12px var(--danger-color);
    transform: scale(1.2);
    filter: brightness(1.3);
}

.quiz-stat:nth-child(4) i {
    color: var(--primary-color);
    text-shadow: 0 0 8px rgba(60, 9, 108, 0.6);
}

.quiz-stat:nth-child(4):hover i {
    color: var(--light-color);
    text-shadow: 0 0 12px var(--primary-color);
    transform: scale(1.2);
    filter: brightness(1.3);
}

/* Achievement Badges */
.achievement-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.achievement-buttons .game-button {
    white-space: nowrap;
    min-width: fit-content;
    font-size: 12px;
    padding: 6px 12px;
}

.achievement-buttons .game-button.active {
    background: var(--accent-color);
    color: var(--dark-color);
    box-shadow: 0 3px 0 var(--primary-color);
}

.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
}

.badge-item {
    position: relative;
    text-align: center;
    padding: 20px 15px;
    border-radius: 15px;
    background: transparent;
    border: 2px solid var(--primary-color);
    transition: all 0.4s ease;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    overflow: hidden;
    backdrop-filter: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.badge-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-light);
    background: rgba(117, 89, 218, 0.05);
}

.badge-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.badge-item:hover::before {
    opacity: 1;
}

.badge-item.earned {
    background: rgba(255, 204, 0, 0.1);
    border: 2px solid rgba(255, 204, 0, 0.6);
    box-shadow: 0 6px 20px rgba(255, 204, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.badge-item.earned::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(255, 204, 0, 0.1) 0%, 
        rgba(255, 204, 0, 0.05) 50%, 
        rgba(255, 204, 0, 0.1) 100%);
    animation: earned-glow 3s ease-in-out infinite alternate;
}

@keyframes earned-glow {
    0% { opacity: 0.3; }
    100% { opacity: 0.8; }
}

.badge-item.earned::after {
    content: '✨';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 16px;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

.badge-icon {
    font-size: 48px;
    margin-bottom: 12px;
    filter: drop-shadow(0px 2px 4px rgba(0,0,0,0.4));
    transition: all 0.4s ease;
    z-index: 2;
    position: relative;
}

.badge-item:hover .badge-icon {
    transform: scale(1.15) rotateY(10deg);
    filter: drop-shadow(0px 4px 8px rgba(0,0,0,0.6));
}

.badge-name {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--light-color);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    z-index: 2;
    position: relative;
    line-height: 1.2;
}

.badge-item.earned .badge-name {
    color: var(--light-color);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.badge-progress {
    font-size: 11px;
    color: var(--light-color);
    width: 100%;
    z-index: 2;
    position: relative;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin-top: 5px;
}

.badge-item.earned .badge-progress {
    background: rgba(255, 204, 0, 0.2);
    color: var(--light-color);
    font-weight: bold;
}

.badge-item.locked {
    opacity: 0.6;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.badge-item.locked .badge-icon {
    filter: grayscale(100%) opacity(0.4) drop-shadow(0px 2px 4px rgba(0,0,0,0.4));
}

.badge-item.locked::after {
    content: '🔒';
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 18px;
    opacity: 0.7;
}

.badge-item.locked:hover {
    transform: translateY(-3px);
    opacity: 0.8;
}

/* Badge rarity colors */
.badge-item[data-rarity="common"] {
    border-color: rgba(255, 255, 255, 0.4);
}

.badge-item[data-rarity="uncommon"] {
    border-color: rgba(27, 154, 170, 0.4);
}

.badge-item[data-rarity="rare"] {
    border-color: rgba(60, 9, 108, 0.4);
}

.badge-item[data-rarity="epic"] {
    border-color: rgba(255, 204, 0, 0.4);
}

.badge-item[data-rarity="legendary"] {
    border-color: rgba(239, 71, 111, 0.4);
}

.badge-item[data-rarity="mythic"] {
    border-color: rgba(60, 9, 108, 0.6);
}

.badge-item[data-rarity="divine"] {
    border-color: rgba(255, 204, 0, 0.6);
}

/* Activity Feed */
.activity-item {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
}

.activity-item:hover {
    transform: translateY(-2px);
    border-color: var(--accent-color);
    background-color: rgba(60, 9, 108, 0.1);
}

.activity-item.quiz-completed {
    border-color: var(--success-color);
}

.activity-item.badge-earned {
    border-color: var(--star-color);
}

.activity-item.course-enrolled {
    border-color: var(--primary-color);
}

.activity-icon {
    width: 45px;
    height: 45px;
    min-width: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s ease;
    color: var(--dark-color);
    border: 2px solid var(--light-color);
}

.activity-item:hover .activity-icon {
    transform: scale(1.1);
}

.activity-content {
    flex: 1;
    color: var(--light-color);
    line-height: 1.5;
}

.activity-item div:not(.activity-icon) {
    color: var(--light-color);
}

.activity-item strong {
    color: var(--accent-color);
    font-weight: 700;
    font-size: 14px;
}

/* Activity item text styling - making text white/yellow as requested */
.activity-item div[style*="color: var(--primary-color)"] {
    color: var(--light-color) !important;
}

.activity-item div {
    color: var(--light-color);
}

/* Score and metadata text in yellow for better visibility */
.activity-item div[style*="font-size: 13px"] {
    color: var(--accent-color) !important;
    font-weight: 500;
}

/* Timestamp text in lighter yellow */
.activity-item div[style*="font-size: 12px"] {
    color: var(--star-color) !important;
    opacity: 0.9;
}

/* Specific overrides for activity log text colors */
#recent-activity .activity-item div {
    color: var(--light-color) !important;
}

#recent-activity .activity-item strong {
    color: var(--accent-color) !important;
    font-weight: 700;
}

/* Override any inline purple text colors to white/yellow */
#recent-activity div[style*="color: var(--primary-color)"],
#recent-activity div[style*="color: #3c096c"] {
    color: var(--light-color) !important;
}

/* Make score/metadata text yellow */
#recent-activity div[style*="font-size: 13px; color"],
#recent-activity div[style*="margin-top: 3px; font-size: 13px"] {
    color: var(--accent-color) !important;
}

/* Make timestamp text light yellow */
#recent-activity div[style*="font-size: 12px; margin-top: 3px"],
#recent-activity div[style*="font-size: 12px;"] {
    color: var(--star-color) !important;
}

.activity-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.activity-type {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.activity-type.quiz { background: rgba(27, 154, 170, 0.1); }
.activity-type.badge { background: rgba(255, 204, 0, 0.1); }
.activity-type.course { background: rgba(255, 255, 255, 0.1); }

.activity-time {
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 500;
}

/* Leaderboard */
.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 2px solid var(--primary-color);
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    border-radius: 10px;
    margin-bottom: 8px;
    background: transparent;
}

.leaderboard-item:hover {
    background: rgba(255, 204, 0, 0.08);
    transform: translateX(3px);
}

.stars {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: var(--star-color);
    font-size: 16px;
}

.leaderboard-rank {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--light-color);
    font-weight: 600;
}

.rank-number {
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: var(--light-color);
    transition: all 0.2s ease;
}

.leaderboard-item:hover .rank-number {
    transform: scale(1.1);
}

.leaderboard-item:nth-child(1) .rank-number {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-color));
    border-color: var(--accent-color);
    color: var(--dark-color);
    box-shadow: 0 3px 10px rgba(255, 204, 0, 0.3);
}

.leaderboard-item:nth-child(2) .rank-number {
    background: linear-gradient(135deg, var(--light-color), var(--light-color));
    border-color: var(--light-color);
    color: var(--dark-color);
    box-shadow: 0 3px 10px rgba(255, 255, 255, 0.3);
}

.leaderboard-item:nth-child(3) .rank-number {
    background: linear-gradient(135deg, var(--danger-color), var(--danger-color));
    border-color: var(--danger-color);
    color: var(--light-color);
    box-shadow: 0 3px 10px rgba(239, 71, 111, 0.3);
}

.leaderboard-item.current-user {
    background: rgba(27, 154, 170, 0.15);
    border: 3px solid var(--secondary-color);
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(27, 154, 170, 0.4);
    color: var(--light-color);
}

.leaderboard-item.current-user .rank-number {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--light-color);
    box-shadow: 0 0 15px rgba(27, 154, 170, 0.6);
}

/* Game Select Dropdown */
.game-select {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--light-color);
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    padding: 8px 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(60, 9, 108, 0.3);
}

.game-select:hover {
    background: linear-gradient(135deg, var(--accent-color), var(--danger-color));
    color: var(--dark-color);
    box-shadow: 0 5px 15px rgba(255, 204, 0, 0.5);
    transform: translateY(-2px);
}

.game-select option {
    background: var(--dark-color);
    color: var(--light-color);
    border: none;
}

/* Progress Overview */
.progress-item {
    margin-bottom: 15px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    margin-bottom: 5px;
}

.progress-bar {
    height: 20px;
    background: transparent;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: progress-shine 1.5s infinite linear;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Quiz Modal */
.game-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    animation: modal-backdrop-appear 0.4s ease;
}

@keyframes modal-backdrop-appear {
    from { opacity: 0; backdrop-filter: blur(0px); }
    to { opacity: 1; backdrop-filter: blur(5px); }
}

.modal-content {
    background: linear-gradient(135deg, 
        rgba(0, 0, 0, 0.98) 0%, 
        rgba(60, 9, 108, 0.3) 20%,
        rgba(0, 0, 0, 0.98) 40%,
        rgba(27, 154, 170, 0.3) 60%,
        rgba(0, 0, 0, 0.98) 80%,
        rgba(255, 204, 0, 0.3) 100%
    );
    border: 4px solid transparent;
    background-clip: padding-box;
    position: relative;
    margin: 2% auto;
    border-radius: 25px;
    width: 95%;
    max-width: 700px;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.7),
        0 0 50px rgba(255, 204, 0, 0.4),
        0 0 100px rgba(27, 154, 170, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: modal-appear 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: var(--light-color);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.modal-content::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        var(--primary-color), 
        var(--secondary-color), 
        var(--accent-color), 
        var(--danger-color),
        var(--primary-color),
        var(--secondary-color),
        var(--accent-color)
    );
    background-size: 600% 600%;
    animation: modal-border-glow 6s ease-in-out infinite;
    z-index: -1;
    border-radius: 25px;
    filter: blur(2px);
}

.modal-content::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    background: linear-gradient(135deg, 
        rgba(0, 0, 0, 0.95) 0%, 
        rgba(60, 9, 108, 0.1) 50%,
        rgba(0, 0, 0, 0.95) 100%
    );
    border-radius: 21px;
    z-index: -1;
}

@keyframes modal-border-glow {
    0% { 
        background-position: 0% 50%; 
        filter: blur(2px) brightness(1);
    }
    25% { 
        background-position: 100% 50%; 
        filter: blur(3px) brightness(1.2);
    }
    50% { 
        background-position: 100% 100%; 
        filter: blur(2px) brightness(1);
    }
    75% { 
        background-position: 0% 100%; 
        filter: blur(3px) brightness(1.2);
    }
    100% { 
        background-position: 0% 50%; 
        filter: blur(2px) brightness(1);
    }
}

@keyframes modal-appear {
    0% { 
        opacity: 0; 
        transform: translateY(-80px) scale(0.6) rotateX(15deg);
        filter: blur(10px);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-20px) scale(1.05) rotateX(5deg);
        filter: blur(2px);
    }
    100% { 
        opacity: 1; 
        transform: translateY(0) scale(1) rotateX(0deg);
        filter: blur(0px);
    }
}

.modal-header {
    padding: 30px;
    background: linear-gradient(135deg, 
        rgba(60, 9, 108, 0.6) 0%,
        rgba(239, 71, 111, 0.4) 50%,
        rgba(255, 204, 0, 0.3) 100%
    );
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    border-radius: 25px 25px 0 0;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: header-shine 3s ease-in-out infinite;
}

@keyframes header-shine {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

.modal-header h3 {
    margin: 0;
    font-size: 28px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(135deg, 
        var(--accent-color) 0%,
        var(--light-color) 25%,
        var(--secondary-color) 50%,
        var(--light-color) 75%,
        var(--accent-color) 100%
    );
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: title-glow 4s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(255, 204, 0, 0.5);
    position: relative;
}

@keyframes title-glow {
    0%, 100% { 
        background-position: 0% 50%; 
        filter: brightness(1);
    }
    50% { 
        background-position: 100% 50%; 
        filter: brightness(1.3);
    }
}

.close {
    background: linear-gradient(135deg, 
        var(--danger-color), 
        var(--primary-color)
    );
    color: var(--light-color);
    border: 3px solid var(--light-color);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 
        0 5px 15px rgba(239, 71, 111, 0.4),
        0 0 20px rgba(239, 71, 111, 0.2);
    position: relative;
    overflow: hidden;
}

.close::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent);
    transition: all 0.4s ease;
    transform: translate(-50%, -50%);
}

.close:hover {
    background: linear-gradient(135deg, 
        var(--accent-color), 
        var(--secondary-color)
    );
    transform: scale(1.15) rotate(180deg);
    box-shadow: 
        0 8px 25px rgba(255, 204, 0, 0.6),
        0 0 40px rgba(27, 154, 170, 0.4);
    border-color: var(--accent-color);
}

.close:hover::before {
    width: 100%;
    height: 100%;
}

.modal-body {
    padding: 35px;
    color: var(--light-color);
    background: 
        radial-gradient(circle at 25% 25%, rgba(60, 9, 108, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(27, 154, 170, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 100%, rgba(255, 204, 0, 0.1) 0%, transparent 50%),
        linear-gradient(145deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.95));
    position: relative;
    overflow: hidden;
    border-radius: 0 0 25px 25px;
    min-height: 300px;
}

.modal-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.02) 50%, transparent 60%),
        linear-gradient(-45deg, transparent 40%, rgba(255, 255, 255, 0.02) 50%, transparent 60%);
    background-size: 20px 20px;
    opacity: 0.5;
    animation: mesh-move 8s linear infinite;
}

@keyframes mesh-move {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 20px 20px, -20px 20px; }
}

.modal-body::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        transparent,
        rgba(60, 9, 108, 0.1),
        transparent,
        rgba(27, 154, 170, 0.1),
        transparent,
        rgba(255, 204, 0, 0.1),
        transparent,
        rgba(239, 71, 111, 0.1),
        transparent
    );
    animation: cosmic-rotation 20s linear infinite;
    pointer-events: none;
}

.modal-body #quiz-description {
    font-size: 18px;
    line-height: 1.8;
    margin-bottom: 30px;
    color: var(--light-color);
    text-align: center;
    background: linear-gradient(135deg, 
        rgba(60, 9, 108, 0.2) 0%,
        rgba(27, 154, 170, 0.15) 50%,
        rgba(255, 204, 0, 0.1) 100%
    );
    padding: 20px 30px;
    border-radius: 15px;
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
    overflow: hidden;
    box-shadow: 
        inset 0 2px 10px rgba(255, 204, 0, 0.1),
        0 5px 20px rgba(0, 0, 0, 0.3);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.modal-body #quiz-description::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: description-shimmer 4s ease-in-out infinite;
}

@keyframes description-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.modal-footer {
    padding: 30px;
    background: linear-gradient(135deg, 
        rgba(27, 154, 170, 0.3) 0%,
        rgba(60, 9, 108, 0.4) 50%,
        rgba(239, 71, 111, 0.2) 100%
    );
    border-top: none;
    display: flex;
    gap: 20px;
    justify-content: center;
    border-radius: 0 0 25px 25px;
    position: relative;
    overflow: hidden;
}

.modal-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--secondary-color), 
        var(--danger-color), 
        var(--accent-color),
        var(--primary-color),
        var(--secondary-color)
    );
    background-size: 300% 100%;
    animation: footer-shimmer 4s linear infinite;
}

.modal-footer::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        transparent,
        rgba(60, 9, 108, 0.1),
        transparent,
        rgba(27, 154, 170, 0.1),
        transparent,
        rgba(255, 204, 0, 0.1),
        transparent
    );
    animation: footer-cosmic-rotation 15s linear infinite reverse;
    pointer-events: none;
}

@keyframes footer-shimmer {
    0% { background-position: 300% 0; }
    100% { background-position: -300% 0; }
}

@keyframes footer-cosmic-rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal Quiz Stats */
.modal-body .quiz-stats {
    background: linear-gradient(135deg, 
        rgba(60, 9, 108, 0.3) 0%,
        rgba(27, 154, 170, 0.2) 50%,
        rgba(255, 204, 0, 0.1) 100%
    );
    border-radius: 20px;
    padding: 25px;
    margin: 25px 0;
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        inset 0 2px 10px rgba(255, 204, 0, 0.1);
}

.modal-body .quiz-stats::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, 
        var(--primary-color), 
        var(--accent-color), 
        var(--secondary-color), 
        var(--danger-color),
        var(--primary-color)
    );
    background-size: 400% 400%;
    border-radius: 23px;
    z-index: -1;
    animation: stats-border-flow 6s ease-in-out infinite;
}

@keyframes stats-border-flow {
    0%, 100% { 
        background-position: 0% 50%; 
    }
    50% { 
        background-position: 100% 50%; 
    }
}

.modal-body .quiz-stat {
    background: linear-gradient(135deg, 
        rgba(0, 0, 0, 0.7) 0%,
        rgba(60, 9, 108, 0.2) 50%,
        rgba(0, 0, 0, 0.7) 100%
    ) !important;
    border: 2px solid var(--secondary-color);
    margin: 12px 0;
    border-radius: 15px;
    padding: 15px 20px;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: hidden;
    color: var(--light-color);
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.modal-body .quiz-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: all 0.4s ease;
}

.modal-body .quiz-stat:hover {
    background: linear-gradient(135deg, 
        rgba(27, 154, 170, 0.4) 0%, 
        rgba(255, 204, 0, 0.3) 50%,
        rgba(239, 71, 111, 0.2) 100%
    ) !important;
    transform: translateX(10px) scale(1.05);
    box-shadow: 
        0 8px 25px rgba(27, 154, 170, 0.4),
        inset 0 2px 10px rgba(255, 204, 0, 0.2);
    border-color: var(--accent-color);
    color: var(--light-color);
}

.modal-body .quiz-stat:hover::before {
    left: 100%;
}

/* Animations and Effects */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Override any gradient backgrounds in student dashboard to solid black */
.game-world-container,
.feature-section,
.highlights-section,
body.dashboard-page {
    background-color: var(--dark-color) !important;
    background-image: none !important;
}

/* Ensure activity log text is properly colored */
.activity-item,
.activity-item * {
    color: var(--light-color) !important;
}

.activity-item strong {
    color: var(--accent-color) !important;
}

/* Force override for any inline styles that set purple text */
[style*="color: var(--primary-color)"],
[style*="color: #3c096c"] {
    color: var(--light-color) !important;
}

.float {
    animation: float 3s ease-in-out infinite;
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .achievements-world {
        grid-column: auto / span 1; /* Reset to single column on smaller screens */
    }
    
    .game-worlds-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
}

@media (max-width: 768px) {
    .game-world-container {
        padding: 15px;
    }
    
    .game-ui-header {
        flex-direction: column;
        padding: 15px;
        gap: 15px;
    }
    
    .player-info {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .player-avatar {
        width: 70px;
        height: 70px;
    }
    
    .avatar-frame {
        width: 70px;
        height: 70px;
    }
    
    .avatar-inner {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    .level-indicator {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .player-name {
        font-size: 20px;
    }
    
    .player-stats {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .stat-capsule {
        font-size: 13px;
        padding: 4px 12px;
    }
    
    .resource-bars {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 15px;
    }
    
    .resource-bar {
        width: 100%;
        min-width: auto;
    }
    
    .resource-buttons {
        justify-content: center;
        width: 100%;
    }
    
    .game-worlds-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .game-card {
        padding: 15px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .card-header h3 {
        font-size: 18px;
    }
    
    .achievement-buttons {
        width: 100%;
        justify-content: space-between;
    }
    
    .activity-item {
        padding: 12px;
        gap: 10px;
        flex-direction: row;
    }
    
    .activity-icon {
        width: 35px;
        height: 35px;
        min-width: 35px;
        font-size: 16px;
    }
    
    .activity-content {
        font-size: 14px;
    }
    
    .activity-type {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .activity-time {
        font-size: 11px;
    }
    
    .leaderboard-item {
        padding: 12px;
    }
    
    .rank-number {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .stars {
        font-size: 14px;
        gap: 4px;
    }

    .badge-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 12px;
        padding: 5px;
    }
    
    .badge-item {
        min-height: 140px;
        padding: 15px 10px;
    }
    
    .badge-icon {
        font-size: 40px;
        margin-bottom: 10px;
    }
    
    .badge-name {
        font-size: 12px;
    }
    
    .badge-progress {
        font-size: 10px;
    }
    
    .course-item, .quiz-item {
        padding: 12px;
    }
    
    .course-actions, .quiz-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .button-container {
        flex-direction: column;
    }
    
    .game-button {
        width: 100%;
        justify-content: center;
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .quiz-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .quiz-stat {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .activity-item {
        padding: 10px;
        gap: 12px;
    }
    
    .activity-icon {
        width: 35px;
        height: 35px;
        min-width: 35px;
        font-size: 16px;
    }
    
    .leaderboard-item {
        padding: 10px;
    }
    
    .rank-number {
        width: 25px;
        height: 25px;
        font-size: 12px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-header, .modal-body, .modal-footer {
        padding: 15px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .game-world-container {
        padding: 10px;
    }
    
    .game-ui-header {
        padding: 12px;
    }
    
    .player-avatar {
        width: 60px;
        height: 60px;
    }
    
    .avatar-frame {
        width: 60px;
        height: 60px;
    }
    
    .avatar-inner {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .level-indicator {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
    
    .player-name {
        font-size: 18px;
    }
    
    .player-stats {
        gap: 8px;
    }
    
    .stat-capsule {
        font-size: 12px;
        padding: 3px 10px;
    }
    
    .badge-grid {
        grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
        gap: 10px;
    }
    
    .badge-item {
        min-height: 120px;
        padding: 12px 8px;
    }
    
    .badge-icon {
        font-size: 36px;
        margin-bottom: 8px;
    }
    
    .badge-name {
        font-size: 11px;
        line-height: 1.1;
    }
    
    .badge-progress {
        font-size: 9px;
        padding: 3px 6px;
    }
    
    .game-button {
        font-size: 11px;
        padding: 6px 10px;
    }
}

/* Loading and Empty States for Mobile */
@media (max-width: 768px) {
    .loading {
        padding: 20px 10px;
        font-size: 14px;
    }
    
    .empty-state, .error-state {
        padding: 20px 10px;
        font-size: 14px;
    }
    
    .empty-state div, .error-state div {
        font-size: 40px !important;
        margin-bottom: 10px !important;
    }
}

/* Dark theme enhancements */
@media (prefers-color-scheme: dark) {
    .game-ui-header {
        background: transparent;
        border-color: var(--primary-light);
    }
    
    .game-card {
        background: transparent;
    }
    
    .course-item, .quiz-item {
        background: transparent;
    }
    
    .badge-item {
        background: transparent;
    }
}
