:root {
    --primary: #ff5e00;
    --secondary: #ff2a00;
    --accent: #ff9600;
    --background: #e0950a;
    --card-bg: #fff7e6;
    --text-light: #fff;
    --text-dark: #333;
    --success: #4CAF50;
    --error: #f44336;
    --dark-bg: #1a1a1a;
    --dark-card: #2d2d2d;
    --dark-text: #e0e0e0;
    
    /* MonkeyType-style colors */
    --text-untyped: #646669;
    --text-correct: #d1d0c5;
    --text-incorrect: #ca4754;
    --text-current: #ffc107;
    --text-extra: #ca4754;
}
#cancel-custom-text-btn {
    padding: 12px 25px;  /* Increase padding */
}

/* For the "Use This Text" button */
#use-custom-text-btn {
    padding: 12px 25px;  /* Match the Cancel button */
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Orbitron', sans-serif;
}

body {
    background: rgb(253, 253, 253);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background 0.3s, color 0.3s;
}

body.dark-mode {
    background: var(--dark-bg);
    color: var(--dark-text);
}

.announcement-bar {
    width: 100%;
    overflow: hidden;
    background: rgb(253, 199, 91);
    color: #fff;
    font-weight: bold;
    padding: 8px 0;
    position: relative;
    background-color: var(--primary);
    color: white;
    padding: 8px 0;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    width: 100%;
}

.announcement-bar:hover .announcement-text {
    animation-play-state: paused;
}

.announcement-text {
    display: inline-block;
    white-space: nowrap;
    animation: marquee 25s linear infinite;
    font-size: 1rem;
    min-width: 100%;
    will-change: transform;
    display: inline-block;
    padding-left: 100%; /* Start off-screen to the right */
    animation: scroll 20s linear infinite;
    animation-play-state: running;
    white-space: nowrap;
    padding-right: 50px; /* Add some space at the end */
}

@keyframes scroll {
    0% {
        transform: translateX(0); /* Start from the right edge */
    }
    100% {
        transform: translateX(-100%); /* Move to the left edge */
    }
}

/* Ensure the animation is smooth on all devices */
@media (prefers-reduced-motion: reduce) {
    .announcement-text {
        animation: none;
        padding-left: 20px;
    }
}

/* Options Container */
.options-container {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    justify-items: center;
    width: 100%;
}

.option-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 10px 20px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
    width: 100%;
    max-width: 280px;
}

.option-group:hover {
    background: rgba(255, 94, 0, 0.1);
    transform: translateY(-1px);
}

.option-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-dark);
    margin: 0;
    font-size: 0.95rem;
    flex: 1;
    white-space: nowrap;
}

/* Custom Checkbox */
.checkbox-option {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.checkbox-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    margin: 0;
    z-index: 2;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid var(--primary);
    border-radius: 4px;
    transition: all 0.2s ease;
    pointer-events: none;
}

.checkbox-option input:checked ~ .checkmark {
    background-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-option input:checked ~ .checkmark:after {
    display: block;
}

/* Dark Mode Styles */
body.dark-mode .options-container {
    background: var(--dark-card);
}

body.dark-mode .option-group {
    background: rgba(45, 45, 45, 0.8);
}

body.dark-mode .option-group:hover {
    background: rgba(255, 150, 0, 0.2);
}

body.dark-mode .option-group label {
    color: var(--dark-text);
}

body.dark-mode .checkmark {
    background-color: var(--dark-card);
    border-color: var(--accent);
}

body.dark-mode .checkbox-option input:checked ~ .checkmark {
    background-color: var(--accent);
}

.settings-option {
    margin: 10px 0;
}

.settings-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.settings-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgb(255, 235, 199);
    border-bottom: 1px solid var(--secondary);
    transition: background 0.3s;
}

body.dark-mode header {
    background: var(--dark-card);
    border-bottom: 1px solid var(--accent);
}

#custom-time-input {
    margin-top: 10px;
}

#custom-time-value {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#custom-time-value:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-light);
    box-shadow: 0 0 15px rgba(255, 42, 0, 0.5);
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
}

body.dark-mode .logo-text {
    color: var(--accent);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
}

nav a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 15px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.dark-mode nav a {
    color: var(--accent);
}

nav a:hover {
    background: rgba(255, 42, 0, 0.1);
    color: var(--accent);
}

body.dark-mode nav a:hover {
    background: rgba(255, 150, 0, 0.2);
}

/* ENHANCED MAIN CONTAINER - Match leaderboard width */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    max-width: none;
    width: 100%;
    margin: 0;
}

.page-title {
    text-align: center;
    margin-bottom: 20px;
    align-items: center;
    width: 100%;
}

.page-title h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 10px;
}

body.dark-mode .page-title h1 {
    color: var(--accent);
}

.page-title p {
    color: #555;
    font-size: 1.1rem;
    max-width: 600px;
    text-align: center;
    margin: 0 auto;
}

body.dark-mode .page-title p {
    color: #aaa;
}

/* ENHANCED TYPING TEST CONTAINER - Match leaderboard container width */
.typing-container {
    width: 100%;
    background: var(--card-bg);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin: 0 auto 30px;
    transition: background 0.3s;
}

body.dark-mode .typing-container {
    background: var(--dark-card);
}

/* Test Controls */
.test-controls {
    justify-content: center;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 20px;
    flex: 1;
    min-width: 200px;
}

.time-selector, .difficulty-selector {
    min-width: 180px;
}

.time-selector label, .difficulty-selector label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary);
    font-weight: 600;
    text-align: center;
}

body.dark-mode .time-selector label,
body.dark-mode .difficulty-selector label {
    color: var(--accent);
}

.time-selector select, .difficulty-selector select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--primary);
    border-radius: 8px;
    background-color: var(--card-bg);
    color: var(--text-dark);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

body.dark-mode .time-selector select,
body.dark-mode .difficulty-selector select {
    background-color: var(--dark-bg);
    color: var(--dark-text);
    border-color: var(--accent);
}

.time-selector select:focus, .difficulty-selector select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 94, 0, 0.3);
}

/* Custom Text Area */
.custom-text-area {
    width: 100%;
    margin: 20px 0;
    display: none;
}
.custom-text-area label {
    display: block;
    margin-bottom: 12px; /* Adjust this value to control the space */
    font-weight: 500;
    color: var(--text-dark);
}

.custom-text-area textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--primary);
    border-radius: 8px;
    background-color: var(--card-bg);
    color: var(--text-dark);
    font-size: 1rem;
    min-height: 100px;
    resize: vertical;
    transition: all 0.3s;
}

body.dark-mode .custom-text-area textarea {
    background-color: var(--dark-bg);
    color: var(--dark-text);
    border-color: var(--accent);
}

/* MONKEYTYPE-STYLE TEXT DISPLAY - Enhanced with proper spacing */
.text-display {
    position: relative;
    height: 150px; /* Fixed height for scrolling */
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 20px; /* Reduced padding for better text visibility */
    margin: 20px auto; /* Reduced margin */
    font-size: 1.8rem;
    line-height: 1.9;
    font-family: 'Courier New', monospace;
    text-align: left;
    transition: all 0.3s;
    letter-spacing: 0.05em;
    word-spacing: 0.1em;
    overflow-y: auto; /* Enable vertical scrolling */
    scroll-behavior: smooth; /* Smooth scrolling */
    white-space: pre-wrap; /* Preserve whitespace and wrap */
    word-wrap: break-word;
    scroll-behavior: smooth;
    word-break: break-word;
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    contain: content;
    contain: strict;
    overflow-anchor: none;
}

/* Improve scrollbar appearance */
.text-display::-webkit-scrollbar {
    width: 8px;
}

.text-display::-webkit-scrollbar-track {
    background: rgba(241, 241, 241, 0.5);
    border-radius: 4px;
}

.text-display::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.text-display::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* Dark mode scrollbar */
body.dark-mode .text-display::-webkit-scrollbar-track {
    background: rgba(45, 45, 45, 0.5);
}

body.dark-mode .text-display::-webkit-scrollbar-thumb {
    background: var(--accent);
}

body.dark-mode .text-display {
    color: var(--text-untyped);
}

/* MonkeyType-style character states with improved spacing */
.text-display span {
    position: relative;
    transition: all 0.1s ease;
    margin-right: 0.02em;
    display: inline-block;  /* Change from default inline */
    vertical-align: top;    /* Align to top to prevent vertical shifting */
    will-change: transform;

}

/* Punctuation and numbers - reduced spacing */
.text-display span.punctuation,
.text-display span.number {
    margin-right: 0.01em;
}

/* Current character - highlighted cursor (MonkeyType style) */
.text-display span.current {
    color: var(--text-current);
    position: relative;
}
.text-display.scrolling * {
    transition: none !important;
}

.text-display span.current::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: var(--text-current);
    animation: blink 1s infinite;
}

body.dark-mode .text-display span.current::after {
    background: var(--text-current);
}

/* Correct characters - muted color (MonkeyType style) */
.text-display span.correct {
    color: var(--text-correct);
    background: transparent;
    text-decoration: none;
}

body.dark-mode .text-display span.correct {
    color: var(--text-correct);
}

/* Incorrect characters - red highlight (MonkeyType style) */
.text-display span.incorrect {
    color: var(--text-incorrect);
    background: transparent;
    text-decoration: underline wavy;
    text-decoration-color: var(--text-incorrect);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

/* Untyped characters - gray (MonkeyType style) */
.text-display span.untyped {
    color: var(--text-untyped);
    background: transparent;
}

body.dark-mode .text-display span.untyped {
    color: var(--text-untyped);
}

/* Extra characters (when user types more than expected) */
.text-display span.extra {
    color: var(--text-incorrect);
    background: transparent;
    position: relative;
}

.text-display span.extra::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--text-incorrect);
    opacity: 0.7;
}

/* ENHANCED TYPING INPUT - MonkeyType style */
.typing-input {
    width: 100%;
    padding: 20px;
    border: 3px solid transparent;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.8);
    color: var(--text-dark);
    font-size: 1.5rem;
    margin: 0 auto 30px;
    transition: all 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}

body.dark-mode .typing-input {
    background-color: rgba(45, 45, 45, 0.8);
    color: var(--dark-text);
}

.typing-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 94, 0, 0.2);
    transform: translateY(-2px);
}

body.dark-mode .typing-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 150, 0, 0.2);
}

/* ENHANCED STATS CONTAINER - Better spacing */
.stats-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    flex-wrap: wrap;
    gap: 40px;
    width: 100%;
    max-width: 1000px;
    margin: 30px auto;
}

.timer-display {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Courier New', monospace;
    min-width: 150px;
    text-align: center;
}

body.dark-mode .timer-display {
    color: var(--accent);
}

.live-stats {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.stat-box {
    background: rgba(255, 94, 0, 0.1);
    border-radius: 12px;
    padding: 15px 20px;
    min-width: 120px;
    text-align: center;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

body.dark-mode .stat-box {
    background: rgba(255, 150, 0, 0.1);
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

body.dark-mode .stat-label {
    color: #aaa;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Courier New', monospace;
}

body.dark-mode .stat-value {
    color: var(--accent);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
    width: 100%;
}
.action-buttons .btn,
.action-buttons .btn-secondary {
    flex: 1;
    max-width: 200px; /* Adjust as needed */
}
.test-controls .btn {
    width: 100%;
    
}
.btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(1px);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 50px;

}

body.dark-mode .btn-secondary {
    background: var(--dark-bg);
    color: var(--accent);
    border-color: var(--accent);
}

.btn-secondary:hover {
    background: rgba(255, 94, 0, 0.1);
}

body.dark-mode .btn-secondary:hover {
    background: rgba(255, 150, 0, 0.2);
}


/* ENHANCED RESULTS SECTION */
.results-container {
    width: 100%;
    background: var(--card-bg);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    display: none;
    transition: background 0.3s;
}

body.dark-mode .results-container {
    background: var(--dark-card);
}

.results-container.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

.results-header {
    text-align: center;
    margin-bottom: 30px;
}

.results-header h2 {
    color: var(--primary);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

body.dark-mode .results-header h2 {
    color: var(--accent);
}

.rank {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin: 15px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin: 40px 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.result-stat {
    text-align: center;
}

.result-stat h3 {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 500;
}

body.dark-mode .result-stat h3 {
    color: #aaa;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Courier New', monospace;
}

body.dark-mode .result-value {
    color: var(--accent);
}

/* Share Buttons */
.share-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
    flex-wrap: wrap;
}

.share-btn {
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: transform 0.2s;
}

.share-btn:hover {
    transform: translateY(-2px);
}

.twitter-share {
    background: #1DA1F2;
}

.reddit-share {
    background: #FF5700;
}

.whatsapp-share {
    background: #25D366;
}
.share-btn.share-score {
    background: #5865F2; /* Discord's brand color */
    border: none;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(88, 101, 242, 0.3);
}

.share-btn.share-score:hover {
    background: #4752C4; /* Darker shade for hover */
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(88, 101, 242, 0.4);
}

.share-btn.share-score:active {
    transform: translateY(1px);
    background: #3C45A5; /* Even darker for active state */
    box-shadow: 0 1px 2px rgba(88, 101, 242, 0.4);
}

.share-btn.share-score i {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Add smooth transition for dark mode */
body.dark-mode .share-btn.share-score {
    background: #5865F2;
    box-shadow: 0 2px 4px rgba(88, 101, 242, 0.4);
}

body.dark-mode .share-btn.share-score:hover {
    background: #4752C4;
}

body.dark-mode .share-btn.share-score:active {
    background: #3C45A5;
}

/* Settings Panel */
.settings-panel {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: var(--card-bg);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

body.dark-mode .settings-panel {
    background: var(--dark-card);
}

.settings-panel.open {
    right: 0;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

body.dark-mode .settings-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-header h3 {
    color: var(--primary);
    font-size: 1.5rem;
}

body.dark-mode .settings-header h3 {
    color: var(--accent);
}

.close-settings {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary);
}

body.dark-mode .close-settings {
    color: var(--accent);
}

.setting-option {
    margin-bottom: 20px;
}

.setting-option h4 {
    margin-bottom: 10px;
    color: var(--primary);
}

body.dark-mode .setting-option h4 {
    color: var(--accent);
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Countdown */
.countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.countdown-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.countdown-display {
    font-size: 10rem;
    color: white;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(255, 150, 0, 0.8);
}

/* ENHANCED LEADERBOARD */
.leaderboard-container {
    width: 100%;
    background: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    transition: background 0.3s;
}

body.dark-mode .leaderboard-container {
    background: var(--dark-card);
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.leaderboard-header h2 {
    color: var(--primary);
    font-size: 1.8rem;
}

body.dark-mode .leaderboard-header h2 {
    color: var(--accent);
}

.leaderboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 8px 15px;
    background: rgba(255, 94, 0, 0.1);
    border: none;
    border-radius: 5px;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s;
}

body.dark-mode .tab-btn {
    background: rgba(255, 150, 0, 0.1);
    color: var(--accent);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th, .leaderboard-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

body.dark-mode .leaderboard-table th,
body.dark-mode .leaderboard-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-table th {
    color: var(--primary);
    font-weight: 600;
}

body.dark-mode .leaderboard-table th {
    color: var(--accent);
}

.leaderboard-table tr:hover {
    background: rgba(255, 94, 0, 0.05);
}

body.dark-mode .leaderboard-table tr:hover {
    background: rgba(255, 150, 0, 0.05);
}

.leaderboard-table .highlight {
    background: rgba(255, 94, 0, 0.1);
    font-weight: 700;
}

body.dark-mode .leaderboard-table .highlight {
    background: rgba(255, 150, 0, 0.2);
}

/* Motivation Messages */
.motivation {
    font-size: 1.1rem;
    margin-top: 15px;
    padding: 12px 20px;
    color: #ff5e00;
    font-weight: 600;
    text-align: center;
    border: 2px solid #ff9600;
    border-radius: 12px;
    background-color: #fff3e0;
    animation: popFade 0.6s ease;
    box-shadow: 0 0 12px rgba(255, 150, 0, 0.4);
    transition: all 0.3s ease;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

body.dark-mode .motivation {
    background-color: rgba(255, 150, 0, 0.1);
    color: var(--accent);
    border-color: var(--accent);
}

/* Footer */
footer {
    background-color: #fff7e6;
    color: #333;
    text-align: center;
    padding: 10px 10px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 13px;
    border-top: 1px solid #ff5e00;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.05);
    line-height: 1.4;
  }
  
  footer p {
    margin: 6px 0;
  }
  
  footer a {
    color: #ff5e00;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
  }
  
  footer a:hover {
    color: #ff2a00;
    text-decoration: underline;
  }
  
  footer strong {
    color: #ff2a00;
  }
  
  footer small,
  footer p:last-of-type {
    font-size: 11px;
    color: #666;
  }
.copyright {
    margin-top: 20px;
    font-size: 0.9rem;
    opacity: 0.8;
}
/* Affiliate Section Styles */
.affiliate-section {
    width: 100%;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 3px solid var(--primary);
    border-radius: 15px;
    margin: 2rem 0;
    background: rgba(255, 94, 0, 0.03); /* Very light orange background */
}

.affiliate-title {
    text-align: center;
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    padding: 0 1rem;
    position: relative;
    display: inline-block;
}

.affiliate-title:before,
.affiliate-title:after {
    content: '';
    position: absolute;
    top: 50%;
    width: 50px;
    height: 2px;
    background: var(--primary);
}

.affiliate-title:before {
    left: -60px;
}

.affiliate-title:after {
    right: -60px;
}

.affiliate-products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 280px));
    justify-content: center;
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
    padding: 1rem 0;
}

.affiliate-product {
    background: #ffffff; /* Changed from var(--card-bg) to white */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.affiliate-product:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.affiliate-product img {
    width: 100%;
    height: 200px; /* Fixed height for consistency */
    object-fit: contain; /* Ensures the image maintains aspect ratio */
    background: #fff; /* White background for better visibility */
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.affiliate-product h4 {
    padding: 1rem 1rem 0.5rem;
    color: var(--text-dark);
    font-size: 1.1rem;
    margin: 0;
}

.affiliate-product p {
    padding: 0 1rem;
    color: var(--text-dark);
    opacity: 0.8;
    font-size: 0.9rem;
    flex-grow: 1;
    margin: 0.5rem 0;
}

.product-price {
    padding: 0 1rem;
    font-weight: bold;
    color: var(--primary);
    font-size: 1.2rem;
    margin: 0.5rem 0;
}

.affiliate-button {
    display: block;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    text-align: center;
    padding: 0.8rem;
    margin: 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.affiliate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.affiliate-disclaimer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-dark);
    opacity: 0.7;
    font-size: 0.85rem;
}

/* Dark mode adjustments */
body.dark-mode .affiliate-product {
    background: #ffffff;
    
    
}

body.dark-mode .affiliate-product h4,
body.dark-mode .affiliate-product p,
body.dark-mode .affiliate-disclaimer {
    color: var(--dark-text);
}

body.dark-mode .affiliate-product img {
    background: #333; /* Darker background for dark mode */
    border-bottom: 1px solid #444;
}

/* Product Badges */
.product-badges {
    display: flex;
    gap: 8px;
    margin: 8px 0;
}

.badge {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Product Rating */
.product-rating {
    color: #FFD700; /* Gold color for stars */
    font-weight: bold;
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-rating::before {
    content: '★';
    color: #FFD700;
    font-size: 1.1em;
}

/* Affiliate Product Card Adjustments */
.affiliate-product {
    background: #ffffff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.affiliate-product:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* Shortcut Message Styles */
.shortcut-message {
    background-color: #f3f2ef;
    border-left: 4px solid #f9a01b;
    padding: 12px 16px;
    margin: 20px 0;
    border-radius: 0 4px 4px 0;
    font-size: 14px;
    color: #2d2d2d;
    animation: fadeIn 0.3s ease-in-out;
    text-align: left;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.dark-mode .shortcut-message {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

.shortcut-message kbd {
    background-color: #f0f0f0;
    border: 1px solid #d1d1d1;
    border-radius: 3px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.2);
    color: #333;
    display: inline-block;
    font-family: monospace;
    font-size: 0.85em;
    line-height: 1;
    padding: 2px 6px;
    white-space: nowrap;
    margin: 0 2px;
}

.dark-mode .shortcut-message kbd {
    background-color: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
    box-shadow: 0 1px 1px rgba(0,0,0,0.4);
}

/* Keyboard Shortcuts Tip */
.shortcuts-tip {
    background-color: rgba(255, 235, 59, 0.1);
    border-left: 4px solid var(--primary);
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dark-mode .shortcuts-tip {
    background-color: rgba(255, 235, 59, 0.1);
    color: var(--dark-text);
}

.shortcuts-tip kbd {
    background-color: #f1f1f1;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.2);
    color: #333;
    display: inline-block;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    line-height: 1;
    padding: 2px 6px;
    white-space: nowrap;
    margin: 0 2px;
}

.dark-mode .shortcuts-tip kbd {
    background-color: #2d2d2d;
    border-color: #444;
    color: #eee;
}

@media (max-width: 768px) {
    .shortcuts-tip {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}