* {
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

body {
    background: linear-gradient(135deg, #f5e6d3 0%, #e8d5c4 100%);
    color: #6b5b47;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    min-height: 100vh;
    padding: 0;
    position: relative;
}

/* Base Switch Component */
.base-switch {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    cursor: pointer;
    user-select: none;
    touch-action: pan-x;
    display: flex;
    align-items: center;
    width: 52px;
    height: 28px;
    border-radius: 14px;
    background: linear-gradient(135deg, #d4a574, #b8860b);
    border: 2px solid #d4a574;
    box-shadow: 0 4px 15px rgba(212, 165, 116, 0.3);
    transition: all 0.3s ease;
}

.base-switch:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(212, 165, 116, 0.4);
}

.base-switch-track {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 14px;
    overflow: hidden;
}

.base-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #faf7f2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode state */
.base-switch.dark .base-switch-thumb {
    transform: translateX(24px);
    background: #0f3460;
}

/* Fixed Header */
.fixed-header {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 15px;
}

.centered-title {
    margin: 0;
    color: #8b7355;
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, #d4a574, #b8860b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.container {
    background-color: #faf7f2;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(107, 91, 71, 0.1);
    max-width: 600px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin: 80px auto 20px auto;
}

h1 {
    margin: 0;
    color: #8b7355;
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, #d4a574, #b8860b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.2rem;
    color: #a89b8a;
    text-align: center;
    margin: 0;
    font-weight: 500;
}

/* Login Screen */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
    width: 100%;
    max-width: 300px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    color: #8b7355;
    font-weight: 600;
    font-size: 1rem;
    text-align: left;
}

.login-input {
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 2px solid #e6d7c3;
    border-radius: 12px;
    background-color: #faf7f2;
    color: #6b5b47;
    font-family: inherit;
    transition: all 0.3s ease;
    outline: none;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.login-input:focus {
    border-color: #d4a574;
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.login-btn {
    background: linear-gradient(135deg, #d4a574, #b8860b);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 165, 116, 0.3);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 165, 116, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.login-note {
    font-size: 0.9rem;
    color: #a89b8a;
    text-align: center;
    margin: 0;
    font-style: italic;
}

/* Main Menu and Game Container */
.main-menu,
.game-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}



.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.username-container {
    position: relative;
}

.current-user {
    background: linear-gradient(135deg, #d4a574, #b8860b);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.current-user:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.4);
    background: linear-gradient(135deg, #b8860b, #8b7355);
}

.current-user.hoverable {
    cursor: pointer;
}

/* Profile Popup Menu */
.profile-popup {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: linear-gradient(135deg, #faf7f2, #f8f4f0);
    border: 2px solid #d4a574;
    border-radius: 16px;
    padding: 20px;
    width: 280px;
    box-shadow: 0 10px 30px rgba(107, 91, 71, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.username-container:hover .profile-popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-popup-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.profile-popup-header h3 {
    color: #8b7355;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
}

.profile-popup .profile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 0;
}

.profile-popup .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.profile-popup .stat-label {
    color: #8b7355;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 3px;
}

.profile-popup .stat-value {
    color: #6b5b47;
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #d4a574, #b8860b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile-popup .xp-bar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.profile-popup .xp-bar {
    width: 100%;
    height: 8px;
    background-color: #e6d7c3;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #d4a574;
}

.profile-popup .xp-progress {
    height: 100%;
    background: linear-gradient(135deg, #d4a574, #b8860b);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

.profile-popup .xp-text {
    color: #8b7355;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Arrow pointer for popup */
.profile-popup::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #d4a574;
}

.profile-popup::after {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #faf7f2;
}

.logout-btn {
    background: linear-gradient(135deg, #a89b8a, #8b7355);
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(168, 155, 138, 0.3);
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 155, 138, 0.4);
    background: linear-gradient(135deg, #8b7355, #6b5b47);
}

.logout-btn:active {
    transform: translateY(0);
}

/* Leaderboard Button */
.leaderboard-btn {
    background: linear-gradient(135deg, #d4a574, #b8860b);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 165, 116, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    position: relative;
    overflow: hidden;
}

.leaderboard-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.leaderboard-btn:hover::before {
    opacity: 1;
}

.leaderboard-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(212, 165, 116, 0.4);
    background: linear-gradient(135deg, #b8860b, #8b7355);
}

.leaderboard-btn:active {
    transform: translateY(0) scale(0.95);
}

.leaderboard-icon {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
}

.leaderboard-btn:hover .leaderboard-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Leaderboard Popup */
.leaderboard-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.leaderboard-content {
    background: linear-gradient(135deg, #faf7f2, #f8f4f0);
    border: 2px solid #d4a574;
    border-radius: 20px;
    padding: 0;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    box-shadow: 0 20px 40px rgba(107, 91, 71, 0.3);
    overflow: hidden;
    animation: leaderboardSlideIn 0.3s ease-out;
}

@keyframes leaderboardSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.leaderboard-header {
    background: linear-gradient(135deg, #d4a574, #b8860b);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #d4a574;
}

.leaderboard-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.close-leaderboard-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-leaderboard-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.leaderboard-tabs {
    display: flex;
    background: #f8f4f0;
    border-bottom: 2px solid #e6d7c3;
}

.leaderboard-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 15px;
    font-size: 1rem;
    font-weight: 600;
    color: #8b7355;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.leaderboard-tab:hover {
    background: rgba(212, 165, 116, 0.1);
    color: #b8860b;
}

.leaderboard-tab.active {
    background: linear-gradient(135deg, #d4a574, #b8860b);
    color: white;
    border-bottom-color: #d4a574;
}

.leaderboard-body {
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-section {
    display: none;
    padding: 20px;
}

.leaderboard-section.active {
    display: block;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 12px;
    border: 2px solid #e6d7c3;
    transition: all 0.3s ease;
    position: relative;
}

.leaderboard-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 165, 116, 0.2);
    border-color: #d4a574;
}

.leaderboard-item.current-user {
    background: linear-gradient(135deg, #f8f4f0, #e6d7c3);
    border-color: #d4a574;
    box-shadow: 0 4px 15px rgba(212, 165, 116, 0.3);
}

.leaderboard-rank {
    font-size: 1.2rem;
    font-weight: 700;
    color: #8b7355;
    min-width: 40px;
    text-align: center;
}

.leaderboard-rank.gold {
    color: #ffd700;
}

.leaderboard-rank.silver {
    color: #c0c0c0;
}

.leaderboard-rank.bronze {
    color: #cd7f32;
}

.leaderboard-user-info {
    flex: 1;
    margin-left: 15px;
}

.leaderboard-username {
    font-size: 1.1rem;
    font-weight: 600;
    color: #6b5b47;
    margin-bottom: 5px;
}

.leaderboard-stats {
    font-size: 0.9rem;
    color: #a89b8a;
}

.leaderboard-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #b8860b;
    margin-left: auto;
    padding-left: 15px;
}

.empty-leaderboard {
    text-align: center;
    padding: 40px 20px;
    color: #a89b8a;
    font-style: italic;
}

.empty-leaderboard h4 {
    margin: 0 0 10px 0;
    color: #8b7355;
}

.empty-leaderboard p {
    margin: 0;
    font-size: 0.9rem;
}



.profile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-label {
    color: #8b7355;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.stat-value {
    color: #6b5b47;
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #d4a574, #b8860b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.xp-bar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.xp-bar {
    width: 100%;
    height: 12px;
    background-color: #e6d7c3;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #d4a574;
}

.xp-progress {
    height: 100%;
    background: linear-gradient(135deg, #d4a574, #b8860b);
    border-radius: 6px;
    transition: width 0.5s ease;
    width: 0%;
}

.xp-text {
    color: #8b7355;
    font-size: 0.9rem;
    font-weight: 600;
}

.mode-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

/* Pixel Card Effect */
.pixel-canvas {
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

.pixel-card {
    height: 120px;
    width: 100%;
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
    border: 2px solid #e6d7c3;
    border-radius: 16px;
    isolation: isolate;
    transition: all 0.3s ease;
    user-select: none;
    cursor: pointer;
    background: linear-gradient(135deg, #f8f4f0, #e6d7c3);
    box-shadow: 0 4px 15px rgba(107, 91, 71, 0.1);
}

.pixel-card::before {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    aspect-ratio: 1;
    background: radial-gradient(circle, #d4c4b0, transparent 85%);
    opacity: 0;
    transition: opacity 800ms cubic-bezier(0.5, 1, 0.89, 1);
    z-index: 2;
}

.pixel-card:hover::before,
.pixel-card:focus-within::before {
    opacity: 1;
}

.pixel-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(107, 91, 71, 0.2);
    border-color: #d4a574;
}

.mode-content {
    position: relative;
    z-index: 3;
    text-align: left;
    width: 100%;
    padding: 25px;
    pointer-events: none;
}

.mode-btn h3 {
    margin: 0 0 10px 0;
    color: #8b7355;
    font-size: 1.4rem;
    font-weight: 600;
}

.mode-btn p {
    margin: 0;
    color: #a89b8a;
    font-size: 1rem;
    line-height: 1.4;
}

.back-btn {
    background: linear-gradient(135deg, #a89b8a, #8b7355);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(168, 155, 138, 0.3);
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 155, 138, 0.4);
}

.mode-indicator {
    background: linear-gradient(135deg, #d4a574, #b8860b);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}



.exit-btn {
    background: linear-gradient(135deg, #e6d7c3, #d4a574);
    color: #8b7355;
    border: 2px solid #d4a574;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(212, 165, 116, 0.2);
    margin-left: 15px;
}

.exit-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.3);
    background: linear-gradient(135deg, #d4a574, #b8860b);
    color: white;
}

.exit-btn:active {
    transform: scale(0.95);
}

.text-block {
    font-size: 1rem;
    line-height: 1.4;
    color: #6b5b47;
    text-align: center;
    padding: 15px;
    background-color: #f8f4f0;
    border-radius: 12px;
    border: 2px solid #e6d7c3;
    min-height: 120px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    word-wrap: normal;
    word-break: keep-all;
    white-space: pre-wrap;
    overflow: visible;
    box-sizing: border-box;
    flex-wrap: wrap;
}

.text-block.completed {
    border-color: #d4a574;
    background-color: #f5f0e6;
    color: #8b7355;
}

.typing-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 2px solid #e6d7c3;
    border-radius: 12px;
    background-color: #faf7f2;
    color: #6b5b47;
    resize: none;
    min-height: 60px;
    max-height: 120px;
    font-family: inherit;
    transition: all 0.3s ease;
    outline: none;
    word-wrap: break-word;
    white-space: pre-wrap;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.typing-input:focus {
    border-color: #d4a574;
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.typing-input.completed {
    border-color: #d4a574;
    background-color: #f5f0e6;
    color: #8b7355;
}

.typing-input:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.timer {
    font-size: 2rem;
    font-weight: 700;
    color: #8b7355;
    background: linear-gradient(135deg, #d4a574, #b8860b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.progress {
    font-size: 1.1rem;
    color: #a89b8a;
    text-align: center;
    font-weight: 500;
}

#restart-btn {
    background: linear-gradient(135deg, #d4a574, #b8860b);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 165, 116, 0.3);
}

#restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 165, 116, 0.4);
}

#restart-btn:active {
    transform: translateY(0);
}

/* Notification Overlay */
.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.notification-content {
    background: linear-gradient(135deg, #faf7f2, #f8f4f0);
    border: 2px solid #d4a574;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(107, 91, 71, 0.3);
    animation: notificationSlideIn 0.3s ease-out;
}

@keyframes notificationSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.notification-content h2 {
    color: #8b7355;
    margin: 0 0 20px 0;
    font-size: 1.8rem;
    font-weight: 700;
}

#notification-message {
    color: #6b5b47;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
    white-space: pre-line;
}

.notification-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.notification-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.notification-btn.primary {
    background: linear-gradient(135deg, #d4a574, #b8860b);
    color: white;
    box-shadow: 0 4px 15px rgba(212, 165, 116, 0.3);
}

.notification-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 165, 116, 0.4);
}

.notification-btn.secondary {
    background: linear-gradient(135deg, #e6d7c3, #d4a574);
    color: #8b7355;
    border: 2px solid #d4a574;
    box-shadow: 0 4px 15px rgba(212, 165, 116, 0.2);
}

.notification-btn.secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 165, 116, 0.3);
    background: linear-gradient(135deg, #d4a574, #b8860b);
    color: white;
}

.notification-btn:active {
    transform: translateY(0);
}

/* Responsive design for notifications */
@media (max-width: 768px) {
    .notification-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .notification-content h2 {
        font-size: 1.5rem;
    }
    
    #notification-message {
        font-size: 1rem;
    }
    
    .notification-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .notification-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* Letter highlighting styles */
.letter {
    display: inline-block;
    padding: 1px 1px;
    border-radius: 2px;
    transition: all 0.2s ease;
    word-wrap: normal;
    word-break: keep-all;
    white-space: pre-wrap;
}

.letter.correct {
    background-color: #e6d7c3;
    color: #8b7355;
}

.letter.incorrect {
    background-color: #f8d7da;
    color: #721c24;
}

.letter.current {
    background-color: #fff3cd;
    color: #856404;
    border-bottom: 2px solid #d4a574;
}

/* Responsive design */
@media (max-width: 768px) {
    .fixed-header {
        top: 10px;
        right: 10px;
        gap: 10px;
    }
    
    .centered-title {
        font-size: 2rem;
    }
    
    .container {
        padding: 30px 20px;
        margin: 10px;
        margin-top: 60px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .mode-btn {
        padding: 20px;
    }
    
    .mode-btn h3 {
        font-size: 1.2rem;
    }
    
    .text-block {
        font-size: 1rem;
        padding: 15px;
        max-height: 150px;
    }
    
    .typing-input {
        font-size: 1rem;
        padding: 12px 15px;
        max-height: 100px;
    }
    
    .timer {
        font-size: 1.5rem;
    }
    
    .current-user {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .logout-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .exit-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .base-switch {
        width: 45px;
        height: 24px;
        top: 10px;
        left: 10px;
    }
    
    .base-switch-thumb {
        width: 18px;
        height: 18px;
    }
    
    .base-switch.dark .base-switch-thumb {
        transform: translateX(21px);
    }
    
    /* Mobile leaderboard styles */
    .leaderboard-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .leaderboard-header h3 {
        font-size: 1.2rem;
    }
    
    .leaderboard-tabs {
        flex-direction: column;
    }
    
    .leaderboard-tab {
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .leaderboard-item {
        padding: 12px;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .leaderboard-rank {
        font-size: 1rem;
        min-width: auto;
    }
    
    .leaderboard-user-info {
        margin-left: 0;
        text-align: center;
    }
    
    .leaderboard-username {
        font-size: 1rem;
    }
    
    .leaderboard-stats {
        font-size: 0.8rem;
    }
    
    .leaderboard-value {
        font-size: 1.1rem;
        margin-left: 0;
        padding-left: 0;
    }
}

/* Dark Mode Styles */
body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e8e8e8;
}

body.dark-mode .container {
    background-color: #0f3460;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

body.dark-mode .centered-title,
body.dark-mode h1 {
    color: #e8e8e8;
    background: linear-gradient(135deg, #4a90e2, #357abd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.dark-mode .subtitle {
    color: #b8c5d6;
}

body.dark-mode .login-input {
    background-color: #1a1a2e;
    border-color: #4a90e2;
    color: #e8e8e8;
}

body.dark-mode .login-input:focus {
    border-color: #357abd;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

body.dark-mode .login-btn {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

body.dark-mode .login-btn:hover {
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

body.dark-mode .login-note {
    color: #b8c5d6;
}

body.dark-mode .current-user {
    background: linear-gradient(135deg, #4a90e2, #357abd);
}

body.dark-mode .current-user:hover {
    background: linear-gradient(135deg, #357abd, #2c5aa0);
}

body.dark-mode .logout-btn {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

body.dark-mode .logout-btn:hover {
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
    background: linear-gradient(135deg, #357abd, #2c5aa0);
}

body.dark-mode .exit-btn {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    border-color: #4a90e2;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.2);
}

body.dark-mode .exit-btn:hover {
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
    background: linear-gradient(135deg, #357abd, #2c5aa0);
}

body.dark-mode .base-switch {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    border-color: #4a90e2;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

body.dark-mode .base-switch:hover {
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

body.dark-mode .profile-popup {
    background: linear-gradient(135deg, #0f3460, #1a1a2e);
    border-color: #4a90e2;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

body.dark-mode .profile-popup-header h3 {
    color: #e8e8e8;
}

body.dark-mode .profile-popup .stat-label {
    color: #b8c5d6;
}

body.dark-mode .profile-popup .stat-value {
    color: #e8e8e8;
    background: linear-gradient(135deg, #4a90e2, #357abd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.dark-mode .profile-popup .xp-bar {
    background-color: #1a1a2e;
    border-color: #4a90e2;
}

body.dark-mode .profile-popup .xp-progress {
    background: linear-gradient(135deg, #4a90e2, #357abd);
}

body.dark-mode .profile-popup .xp-text {
    color: #b8c5d6;
}

body.dark-mode .pixel-card {
    background: linear-gradient(135deg, #0f3460, #1a1a2e);
    border-color: #4a90e2;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

body.dark-mode .pixel-card::before {
    background: radial-gradient(circle, #1a1a2e, transparent 85%);
}

body.dark-mode .pixel-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: #357abd;
}

body.dark-mode .mode-btn h3 {
    color: #e8e8e8;
}

body.dark-mode .mode-btn p {
    color: #b8c5d6;
}



body.dark-mode .back-btn {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

body.dark-mode .back-btn:hover {
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

body.dark-mode .mode-indicator {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
}

body.dark-mode .text-block {
    background-color: #1a1a2e;
    border-color: #4a90e2;
    color: #e8e8e8;
}

body.dark-mode .typing-input {
    background-color: #1a1a2e;
    border-color: #4a90e2;
    color: #e8e8e8;
}

body.dark-mode .typing-input:focus {
    border-color: #357abd;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

body.dark-mode .timer {
    color: #e8e8e8;
}

body.dark-mode .progress {
    color: #b8c5d6;
}

body.dark-mode #restart-btn {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

body.dark-mode #restart-btn:hover {
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

body.dark-mode .notification-content {
    background: linear-gradient(135deg, #0f3460, #1a1a2e);
    border-color: #4a90e2;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

body.dark-mode .notification-content h2 {
    color: #e8e8e8;
}

body.dark-mode #notification-message {
    color: #e8e8e8;
}

body.dark-mode .notification-btn.primary {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

body.dark-mode .notification-btn.primary:hover {
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

body.dark-mode .notification-btn.secondary {
    background: linear-gradient(135deg, #1a1a2e, #0f3460);
    color: #e8e8e8;
    border-color: #4a90e2;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

body.dark-mode .notification-btn.secondary:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
}

body.dark-mode .letter.correct {
    background-color: #718096;
    color: #e2e8f0;
}

body.dark-mode .letter.incorrect {
    background-color: #a0aec0;
    color: #2d3748;
}

body.dark-mode .letter.current {
    background-color: #4a4a2d;
    color: #ffff99;
    border-bottom-color: #4a90e2;
}

/* Dark mode leaderboard styles */
body.dark-mode .leaderboard-btn {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

body.dark-mode .leaderboard-btn::before {
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
}

body.dark-mode .leaderboard-btn:hover {
    background: linear-gradient(135deg, #357abd, #2c5aa0);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

body.dark-mode .leaderboard-icon {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

body.dark-mode .leaderboard-btn:hover .leaderboard-icon {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}
body.dark-mode .leaderboard-content {
    background: linear-gradient(135deg, #0f3460, #1a1a2e);
    border-color: #4a90e2;
}

body.dark-mode .leaderboard-header {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    border-bottom-color: #4a90e2;
}

body.dark-mode .leaderboard-tabs {
    background: #1a1a2e;
    border-bottom-color: #4a90e2;
}

body.dark-mode .leaderboard-tab {
    color: #b8c5d6;
}

body.dark-mode .leaderboard-tab:hover {
    background: rgba(74, 144, 226, 0.2);
    color: #4a90e2;
}

body.dark-mode .leaderboard-tab.active {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    border-bottom-color: #4a90e2;
}

body.dark-mode .leaderboard-item {
    background: #0f3460;
    border-color: #4a90e2;
    color: #e8e8e8;
}

body.dark-mode .leaderboard-item:hover {
    border-color: #357abd;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.2);
}

body.dark-mode .leaderboard-item.current-user {
    background: linear-gradient(135deg, #1a1a2e, #0f3460);
    border-color: #357abd;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

body.dark-mode .leaderboard-rank {
    color: #b8c5d6;
}

body.dark-mode .leaderboard-username {
    color: #e8e8e8;
}

body.dark-mode .leaderboard-stats {
    color: #b8c5d6;
}

body.dark-mode .leaderboard-value {
    color: #4a90e2;
}

body.dark-mode .empty-leaderboard {
    color: #b8c5d6;
}

body.dark-mode .empty-leaderboard h4 {
    color: #e8e8e8;
}

.word {
    margin-right: 16px;
    display: inline-block;
}