/* Base styles */
:root {
     /* Default (Blade Runner) theme */
     --theme-primary: #FFB000;
     --theme-glow-1: #FFB000;
     --theme-glow-2: #FF9900;
     --theme-scrollbar-thumb: #FFB000;
     --theme-scrollbar-thumb-bg: rgba(255, 176, 0, 0.4);
     --theme-scrollbar-thumb-bg-hover: rgba(255, 176, 0, 0.6);

     /* Shared Colors */
     --theme-background-darker: #111;
     --theme-background-dark: #1a1a1a;
     --theme-screen-bg: #000;
     --theme-bezel-dark: #2a2a2a;
     --theme-bezel-light: #3a3a3a;
     --theme-error: #FF5555;
     --theme-success: #55FF55;
}

/* Default theme is blade-runner (no class needed) */

/* Matrix theme */
.matrix-theme {
     --theme-primary: #00FF41;
     --theme-glow-1: #00FF41;
     --theme-glow-2: #39FF14;
     --theme-scrollbar-thumb: #00FF41;
     --theme-scrollbar-thumb-bg: rgba(0, 255, 65, 0.4);
     --theme-scrollbar-thumb-bg-hover: rgba(0, 255, 65, 0.6);
}

body {
     background-color: var(--theme-background-dark);
     /* Dark background */
     display: flex;
     justify-content: center;
     align-items: center;
     min-height: 100vh;
     margin: 0;
     font-family: 'VT323', monospace;
     /* Retro pixel font */
     overflow: hidden;
     /* Hide scrollbars */
     background: radial-gradient(ellipse at center, #333 0%, var(--theme-background-darker) 100%);
}

/* Remove laptop keyboard base and adjust container padding */
.terminal-container {
     position: relative;
     padding-bottom: 20px;
     /* Reduced from 100px to remove space for keyboard base */
}

/* The CRT Screen - Updated for larger size */
.screen {
     background-color: var(--theme-screen-bg);
     /* Black screen background */
     color: var(--theme-primary);
     /* Main text color */
     border: 10px solid var(--theme-bezel-light);
     /* Darker bezel */
     border-radius: 20px;
     /* Curved screen corners - slightly larger */
     padding: 30px 35px 40px;
     /* Increased bottom padding to prevent button cutoff */
     width: 1200px;
     /* Doubled from 600px */
     height: 800px;
     /* Doubled from 400px */
     box-shadow:
          0 0 40px rgba(var(--theme-primary), 0.4),
          /* Outer glow - enhanced */
          inset 0 0 30px rgba(0, 0, 0, 0.7);
     /* Inner shadow - enhanced */
     position: relative;
     overflow: hidden;
     /* Important for scanlines and glow */
     display: flex;
     flex-direction: column;
     justify-content: space-between;
     border-top-color: var(--theme-bezel-light);
     border-left-color: var(--theme-bezel-light);
     border-bottom-color: var(--theme-bezel-dark);
     border-right-color: var(--theme-bezel-dark);
     max-width: 95vw;
     /* Responsive - won't exceed screen width */
     max-height: 80vh;
     /* Responsive - won't exceed screen height */
     overflow-y: auto;
     /* Change from 'hidden' to 'auto' to allow scrolling if needed */
}

/* Content scaling for larger screen */
.content {
     text-shadow:
          0 0 5px var(--theme-glow-1),
          0 0 10px var(--theme-glow-1),
          0 0 15px var(--theme-glow-2);
     /* Text glow effect */
     z-index: 2;
     /* Above scanlines */
     position: relative;
     line-height: 1.5;
     font-size: 32px;
     /* Increased from 24px */
     height: 100%;
     display: flex;
     flex-direction: column;
     justify-content: space-between;
     margin-bottom: 0;
     /* Remove bottom margin that could push content out of view */
}

/* Navigation menu for app functions */
.nav-menu {
     display: flex;
     justify-content: center;
     gap: 15px;
     margin: 15px 0;
     flex-wrap: wrap;
}

/* Navigation links for other pages */
.nav-links {
     display: flex;
     justify-content: center;
     gap: 15px;
     margin: 15px 0;
     flex-wrap: wrap;
}

.nav-link {
     font-family: 'VT323', monospace;
     background-color: rgba(0, 0, 0, 0.5);
     border: 2px solid var(--theme-primary);
     color: var(--theme-primary);
     text-shadow: 0 0 5px var(--theme-glow-1);
     font-size: 18px;
     cursor: pointer;
     padding: 6px 12px;
     min-width: 120px;
     transition: all 0.3s ease;
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 8px;
     box-shadow: 0 0 10px rgba(var(--theme-primary), 0.3);
     text-decoration: none;
}

.nav-link:hover {
     background-color: rgba(var(--theme-primary), 0.2);
     box-shadow: 0 0 20px rgba(var(--theme-primary), 0.6);
     transform: translateY(-2px);
}

/* Fix icons color in nav links and buttons */
.nav-link i,
.nav-button i {
     color: var(--theme-primary);
     text-shadow: 0 0 5px var(--theme-glow-1);
}

.nav-button {
     font-family: 'VT323', monospace;
     background-color: rgba(0, 0, 0, 0.5);
     border: 2px solid var(--theme-primary);
     color: var(--theme-primary);
     text-shadow: 0 0 5px var(--theme-glow-1);
     font-size: 20px;
     cursor: pointer;
     padding: 8px 16px;
     min-width: 140px;
     transition: all 0.3s ease;
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 10px;
     box-shadow: 0 0 10px rgba(var(--theme-primary), 0.3);
     text-decoration: none;
}

.nav-button.active {
     background-color: rgba(var(--theme-primary), 0.3);
     box-shadow: 0 0 15px rgba(var(--theme-primary), 0.7);
     font-weight: bold;
}

.nav-button:hover {
     background-color: rgba(var(--theme-primary), 0.2);
     box-shadow: 0 0 20px rgba(var(--theme-primary), 0.6);
     transform: translateY(-2px);
}

/* Mode selection dropdown - Improved with flexbox */
.mode-selection {
     display: flex;
     justify-content: center;
     align-items: center;
     position: relative;
     margin-bottom: 15px;
}

.mode-selection label {
     margin-right: 10px;
}

/* Custom styled select container */
.select-wrapper {
     position: relative;
     display: inline-block;
     width: 200px;
}

/* Custom arrow for select */
.select-wrapper::after {
     content: '▼';
     font-size: 14px;
     color: var(--theme-primary);
     position: absolute;
     right: 10px;
     top: 50%;
     transform: translateY(-50%);
     pointer-events: none;
     text-shadow: 0 0 5px var(--theme-glow-1);
}

.mode-selection select {
     width: 100%;
     padding-right: 30px;
     /* Space for the arrow */
     appearance: none;
}

/* Add custom styling for the retro-themed select dropdown */
select {
     font-family: 'VT323', monospace;
     background-color: rgba(0, 0, 0, 0.7);
     color: var(--theme-primary);
     border: 2px solid var(--theme-primary);
     padding: 5px 10px;
     font-size: 20px;
     text-shadow: 0 0 5px var(--theme-glow-1);
     outline: none;
     box-shadow: 0 0 10px rgba(var(--theme-primary), 0.3);
     appearance: none;
     cursor: pointer;
     transition: all 0.3s ease;
}

select:hover {
     background-color: rgba(var(--theme-primary), 0.1);
     box-shadow: 0 0 15px rgba(var(--theme-primary), 0.5);
}

select:focus {
     box-shadow: 0 0 20px rgba(var(--theme-primary), 0.7);
}

/* Scanline Effect */
.scanline-overlay {
     position: absolute;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background: linear-gradient(to bottom,
               rgba(18, 16, 16, 0) 50%,
               rgba(0, 0, 0, 0.25) 50%);
     background-size: 100% 4px;
     /* Adjust scanline thickness */
     z-index: 1;
     pointer-events: none;
     /* Allow clicks through */
     animation: flicker 0.15s infinite;
     /* Subtle flicker */
}

@keyframes flicker {
     0% {
          opacity: 0.95;
     }

     50% {
          opacity: 1;
     }

     100% {
          opacity: 0.95;
     }
}


/* Specific Text Elements */
/* Remove or comment out the old .header styles */
/*
.header,
.footer {
     text-align: center;
     margin-bottom: 20px;
     opacity: 0.8;
}
*/

.footer {
     /* Keep footer styles if needed */
     text-align: center;
     opacity: 0.8;
     margin-top: 10px;
     margin-bottom: 0;
     flex-shrink: 0;
}

/* Updated mode display for larger screen */
#mode-display {
     font-size: 40px;
     /* Increased from 28px */
     margin-bottom: 10px;
     text-align: center;
}

/* Updated timer display for larger screen */
#timer-display {
     font-size: 140px;
     /* Increased from 80px */
     text-align: center;
     margin: 20px 0;
     letter-spacing: 8px;
}

/* Stats display using flexbox */
.stats-display {
     display: flex;
     flex-direction: column;
     gap: 8px;
     margin: 15px 0;
     /* Control vertical spacing */
}

.status-line {
     margin-top: 10px;
     /* Reduced from 20px */
     text-align: left;
     height: 25px;
     /* Ensure space for cursor */
}

/* Blinking Cursor */
#cursor {
     animation: blink 1s step-end infinite;
     background-color: var(--theme-primary);
     /* Make cursor solid block */
     display: inline-block;
     width: 15px;
     /* Width of the cursor */
     height: 32px;
     /* Match font size */
     margin-left: 5px;
     box-shadow: 0 0 5px var(--theme-glow-1);
     vertical-align: middle;
     /* Better alignment with text */
     position: relative;
     top: 0px;
     /* Fine-tune vertical position */
}

@keyframes blink {

     0%,
     100% {
          opacity: 1;
     }

     50% {
          opacity: 0;
     }
}

/* Enhanced control buttons with flexbox */
.controls {
     margin-top: 10px;
     /* Reduced from 20px */
     margin-bottom: 10px;
     /* Reduced from 15px */
     display: flex;
     justify-content: center;
     flex-wrap: wrap;
     gap: 15px;
     /* Slightly reduced from 25px */
     position: relative;
     /* Ensure positioned in flow */
     z-index: 10;
     /* Ensure buttons appear above other elements */
}

.controls button,
.controls .retro-button {
     font-family: 'VT323', monospace;
     background-color: rgba(0, 0, 0, 0.5);
     border: 3px solid var(--theme-primary);
     color: var(--theme-primary);
     text-shadow: 0 0 5px var(--theme-glow-1);
     font-size: 22px;
     cursor: pointer;
     padding: 10px 16px;
     min-width: 120px;
     transition: all 0.3s ease;
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 6px;
     box-shadow: 0 0 15px rgba(var(--theme-primary), 0.3);
}

.controls button:hover,
.controls .retro-button:hover {
     background-color: rgba(var(--theme-primary), 0.2);
     box-shadow: 0 0 15px rgba(var(--theme-primary), 0.6);
}

.controls button:active,
.controls .retro-button:active {
     background-color: rgba(var(--theme-primary), 0.4);
     transform: scale(0.98);
}

.btn-icon {
     font-size: 18px;
     display: inline-block;
     margin-right: 5px;
}

/* Hide the keyboard base entirely */
.keyboard-base {
     display: none;
     /* Hide the keyboard base instead of removing it from HTML */
}

/* Add these styles to your existing style.css */

/* Authentication Specific Styles - Enhanced with flexbox */
.auth-mode .screen {
     height: auto;
     /* Adjust height for forms */
     min-height: 350px;
}

#auth-container form {
     margin: 20px auto;
     max-width: 350px;
     text-align: left;
}

#auth-container form div {
     margin-bottom: 15px;
     display: flex;
     flex-wrap: wrap;
     align-items: center;
}

#auth-container label {
     flex: 0 0 100px;
     margin-right: 10px;
}

/* Enhance input fields with neon glow for authentication */
#auth-container input[type="text"],
#auth-container input[type="password"] {
     font-family: 'VT323', monospace;
     background-color: rgba(0, 0, 0, 0.5);
     border: 2px solid var(--theme-primary);
     color: var(--theme-primary);
     padding: 5px 8px;
     font-size: 18px;
     flex: 1;
     min-width: 150px;
     outline: none;
     box-shadow: 0 0 10px rgba(var(--theme-primary), 0.3);
     text-shadow: 0 0 2px var(--theme-glow-1);
     transition: all 0.3s ease;
}

#auth-container input:focus {
     border-color: var(--theme-primary);
     box-shadow: 0 0 15px rgba(var(--theme-primary), 0.6);
}

#auth-container input::placeholder {
     color: rgba(var(--theme-primary), 0.5);
}

/* Enhance auth buttons with more prominent neon styling */
#auth-container button {
     font-family: 'VT323', monospace;
     background: none;
     border: 2px solid var(--theme-primary);
     color: var(--theme-primary);
     text-shadow: 0 0 5px var(--theme-glow-1);
     font-size: 20px;
     margin: 10px 5px 0 5px;
     cursor: pointer;
     padding: 5px 15px;
     transition: all 0.3s ease;
     box-shadow: 0 0 10px rgba(var(--theme-primary), 0.3);
}

#auth-container button:hover {
     background-color: var(--theme-primary);
     color: #000;
     text-shadow: none;
     box-shadow: 0 0 15px rgba(var(--theme-primary), 0.7);
}

/* Message Styling */
.message {
     min-height: 25px;
     margin: 5px 0;
     /* Reduced from 10px */
     text-align: center;
     font-size: 18px;
     color: var(--theme-primary);
     /* Default color */
}

.message.error {
     color: var(--theme-error);
     /* Reddish for errors */
     text-shadow: 0 0 5px var(--theme-error);
}

.message.success {
     color: var(--theme-primary);
     /* Use theme color for success */
     text-shadow: 0 0 5px var(--theme-primary);
}

/* Logout Button - improved positioning */
.logout-btn {
     font-family: 'VT323', monospace;
     background: none;
     border: 1px solid var(--theme-primary);
     color: var(--theme-primary);
     font-size: 16px;
     /* Smaller */
     padding: 2px 8px;
     cursor: pointer;
     position: absolute;
     right: 10px;
     top: 0;
     margin-left: 0;
     /* Remove margin that was affecting centering */
     transition: background-color 0.2s, color 0.2s;
}

.logout-btn:hover {
     background-color: var(--theme-primary);
     color: var(--theme-screen-bg);
}

/* Ensure header clears the floated button */
/*
.header::after {
     content: "";
     clear: both;
     display: table;
}

.header {
     display: flex;
     justify-content: center;
     align-items: center;
     position: relative;
     margin-bottom: 20px;
     text-align: center;
     width: 100%;
}
*/

/* Theme indicator styling */
/*
.theme-indicator {
     position: absolute;
     left: 10px;
     top: 0;
     font-size: 16px;
     background-color: rgba(0, 0, 0, 0.4);
     border: 1px solid var(--theme-primary);
     padding: 2px 8px;
     border-radius: 4px;
}
*/

/* Adjust status line ID */
/* #status-text { ... } */

/* Achievements Styles with grid */
.achievements-panel {
     width: 90%;
     max-width: 550px;
     height: 280px;
     overflow-y: auto;
     margin: 0 auto;
     padding: 5px;
     background-color: rgba(0, 0, 0, 0.2);
     border: 1px solid var(--theme-primary);
     box-shadow: 0 0 10px rgba(var(--theme-primary), 0.3);
     scrollbar-width: thin;
     /* For Firefox */
}

.achievements-grid {
     display: grid;
     grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
     gap: 15px;
     margin: 10px 0;
}

.achievement-card {
     border: 2px solid #555;
     padding: 10px;
     text-align: center;
     transition: all 0.3s ease;
     background-color: rgba(0, 0, 0, 0.4);
     position: relative;
}

.achievement-card.earned {
     border-color: var(--theme-primary);
     background-color: rgba(var(--theme-primary), 0.1);
}

.achievement-card.locked {
     opacity: 0.7;
     filter: grayscale(0.8);
}

.achievement-card.bronze {
     border-color: #cd7f32;
}

.achievement-card.silver {
     border-color: #c0c0c0;
}

.achievement-card.gold {
     border-color: #ffd700;
}

.achievement-card.earned.bronze {
     background-color: rgba(205, 127, 50, 0.15);
}

.achievement-card.earned.silver {
     background-color: rgba(192, 192, 192, 0.15);
}

.achievement-card.earned.gold {
     background-color: rgba(255, 215, 0, 0.15);
}

.achievement-icon {
     font-size: 2rem;
     margin-bottom: 5px;
}

.achievement-title {
     font-size: 1rem;
     margin: 5px 0;
     color: var(--theme-primary);
}

.achievement-description {
     font-size: 0.9rem;
     color: var(--theme-primary);
     opacity: 0.8;
     margin-bottom: 8px;
}

.achievement-date {
     font-size: 0.8rem;
     color: var(--theme-primary);
     opacity: 0.6;
}

.loading-container {
     display: flex;
     flex-direction: column;
     align-items: center;
     justify-content: center;
     padding: 20px 0;
}

.retro-loader {
     width: 40px;
     height: 40px;
     border: 4px solid var(--theme-primary);
     border-bottom-color: transparent;
     border-radius: 50%;
     display: inline-block;
     box-sizing: border-box;
     animation: rotation 1s linear infinite;
}

@keyframes rotation {
     0% {
          transform: rotate(0deg);
     }

     100% {
          transform: rotate(360deg);
     }
}

.error-message {
     text-align: center;
     color: #FF5555;
     padding: 15px;
     border: 1px dashed #FF5555;
     margin: 15px 0;
}

.modal-actions {
     display: flex;
     justify-content: center;
     margin: 15px 0;
}

.retro-button {
     font-family: 'VT323', monospace;
     background: none;
     border: 1px solid var(--theme-primary);
     color: var(--theme-primary);
     text-shadow: 0 0 5px var(--theme-glow-1);
     font-size: 18px;
     padding: 5px 15px;
     cursor: pointer;
     transition: all 0.2s;
}

.retro-button:hover {
     background-color: var(--theme-primary);
     color: #000;
     text-shadow: none;
}

.retro-button.primary {
     border-width: 2px;
}

/* Settings Modal Styles with flexbox */
#settings-modal,
#analytics-modal {
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background-color: rgba(0, 0, 0, 0.8);
     z-index: 1000;
     display: flex;
     justify-content: center;
     align-items: center;
     transition: all 0.3s ease;
     padding: 20px 0;
}

.settings-panel {
     width: 90%;
     max-width: 700px;
     margin: 0 auto;
     overflow-y: auto;
     max-height: 70vh;
     padding: 10px;
     scrollbar-width: thin;
     /* For Firefox */
}

.settings-group {
     margin-bottom: 25px;
     display: flex;
     justify-content: space-between;
     align-items: center;
     flex-wrap: wrap;
     gap: 15px;
     position: relative;
     width: 100%;
}

.settings-group label {
     font-size: 28px;
     flex: 1;
     min-width: 250px;
     /* Prevent label from getting too compressed */
}

/* Style for number input spinner buttons */
input[type="number"] {
     -moz-appearance: textfield;
     /* Firefox */
}

/* Chrome, Safari, Edge, Opera */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
     -webkit-appearance: none;
     margin: 0;
}

/* Input wrapper for custom spinners */
.input-wrapper {
     position: relative;
     display: inline-flex;
     width: 120px;
     flex-shrink: 0;
     padding-right: 30px;
     /* Add space for the spinner buttons */
}

/* Restoring retro-input styling */
.retro-input {
     font-family: 'VT323', monospace;
     background-color: rgba(0, 0, 0, 0.5);
     border: 2px solid var(--theme-primary);
     color: var(--theme-primary);
     padding: 5px 8px;
     font-size: 18px;
     outline: none;
     box-shadow: 0 0 10px rgba(var(--theme-primary), 0.3);
     text-shadow: 0 0 2px var(--theme-glow-1);
     transition: all 0.3s ease;
}

.retro-input:focus {
     box-shadow: 0 0 15px rgba(var(--theme-primary), 0.6);
}

.input-wrapper input[type="number"] {
     width: 100%;
     -moz-appearance: textfield;
}

.input-wrapper input[type="number"]::-webkit-inner-spin-button,
.input-wrapper input[type="number"]::-webkit-outer-spin-button {
     -webkit-appearance: none;
     margin: 0;
}

/* Custom spinner styling */
.custom-spinner {
     position: absolute;
     right: 0;
     top: 0;
     height: 100%;
     display: flex;
     flex-direction: column;
     justify-content: space-between;
     width: 30px;
     z-index: 10;
     pointer-events: auto;
}

.custom-spinner-up,
.custom-spinner-down {
     display: flex;
     align-items: center;
     justify-content: center;
     height: calc(50% - 1px);
     /* Added 1px gap between buttons */
     width: 100%;
     color: var(--theme-primary);
     font-size: 12px;
     font-weight: bold;
     text-align: center;
     user-select: none;
     padding: 0;
     margin: 0;
     cursor: pointer;
     border: 1px solid var(--theme-primary);
     background: none;
}

.custom-spinner-up {
     border-bottom: none;
}

.custom-spinner-up:hover,
.custom-spinner-down:hover {
     background-color: rgba(255, 255, 255, 0.1);
     color: var(--accent-color);
}

.custom-spinner-up:active,
.custom-spinner-down:active {
     background-color: rgba(255, 255, 255, 0.2);
}

/* Toggle Switch */
.toggle-switch {
     position: relative;
     display: inline-block;
     width: 80px;
     height: 40px;
}

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

.toggle-slider {
     position: absolute;
     cursor: pointer;
     top: 0;
     left: 0;
     right: 0;
     bottom: 0;
     background-color: rgba(0, 0, 0, 0.6);
     transition: .4s;
     border-radius: 40px;
     border: 3px solid var(--theme-primary);
     box-shadow: 0 0 15px rgba(var(--theme-primary), 0.3);
}

.toggle-slider:before {
     position: absolute;
     content: "";
     height: 28px;
     width: 28px;
     left: 4px;
     bottom: 3px;
     background-color: var(--theme-primary);
     transition: .4s;
     border-radius: 50%;
     box-shadow: 0 0 10px rgba(var(--theme-primary), 0.5);
}

input:checked+.toggle-slider {
     background-color: rgba(var(--theme-primary), 0.2);
}

input:checked+.toggle-slider:before {
     transform: translateX(40px);
}

/* Theme Labels */
.theme-labels {
     display: flex;
     justify-content: space-between;
     width: auto;
     min-width: 120px;
     margin-top: 5px;
     font-size: 18px;
     color: var(--theme-primary);
     position: relative;
     left: -10px;
}

/* Updated theme label styling to indicate active theme */
.theme-labels span {
     opacity: 0.5;
     transition: opacity 0.3s ease, transform 0.3s ease;
     padding: 2px 4px;
     flex: 1;
     text-align: center;
}

.theme-labels span.active {
     opacity: 1;
     text-shadow: 0 0 5px var(--theme-primary);
     transform: scale(1.1);
     position: relative;
}

.theme-labels span.active::after {
     content: "";
     position: absolute;
     bottom: -2px;
     left: 0;
     width: 100%;
     height: 2px;
     background-color: var(--theme-primary);
     box-shadow: 0 0 5px var(--theme-primary);
}

/* Analytics Styles */
.analytics-panel {
     width: 90%;
     max-width: 900px;
     margin: 0 auto;
     overflow-y: auto;
     max-height: 70%;
     padding: 10px;
     scrollbar-width: thin;
     /* For Firefox */
}

.analytics-section {
     margin-bottom: 30px;
     border: 2px solid var(--theme-primary);
     padding: 15px;
     background-color: rgba(0, 0, 0, 0.3);
     box-shadow: 0 0 15px rgba(var(--theme-primary), 0.2);
}

.analytics-section h2 {
     text-align: center;
     margin-top: 0;
     margin-bottom: 20px;
     font-size: 32px;
     text-shadow: 0 0 10px var(--theme-primary);
}

.analytics-stat {
     display: flex;
     justify-content: space-between;
     margin-bottom: 15px;
     font-size: 26px;
}

.analytics-value {
     font-weight: bold;
     color: var(--theme-primary);
     text-shadow: 0 0 8px var(--theme-primary);
}

.session-chart {
     height: 200px;
     background-color: rgba(0, 0, 0, 0.4);
     border: 1px solid var(--theme-primary);
     display: flex;
     justify-content: center;
     align-items: center;
}

.chart-placeholder {
     text-align: center;
     color: rgba(var(--theme-primary), 0.7);
     font-size: 24px;
}

.chart-placeholder i {
     font-size: 48px;
     display: block;
     margin-bottom: 10px;
}

@media (max-width: 1300px) {
     .screen {
          width: 90vw;
          height: 80vh;
          padding: 25px;
     }

     .content {
          font-size: 28px;
     }

     #timer-display {
          font-size: 120px;
     }

     #mode-display {
          font-size: 36px;
     }

     .keyboard-base {
          width: 95vw;
          height: 180px;
     }
}

@media (max-width: 768px) {
     .screen {
          width: 95vw;
          height: 80vh;
          padding: 20px;
          border-width: 8px;
     }

     .content {
          font-size: 24px;
     }

     #timer-display {
          font-size: 90px;
          letter-spacing: 5px;
     }

     #mode-display {
          font-size: 30px;
     }

     .nav-button {
          min-width: 140px;
          font-size: 20px;
          padding: 8px 15px;
     }

     .controls button,
     .controls .retro-button {
          min-width: 110px;
          font-size: 22px;
          padding: 10px 25px;
     }

     .keyboard-base {
          height: 150px;
     }

     .mode-selection select {
          width: 100%;
          font-size: 18px;
     }

     .select-wrapper {
          width: 160px;
     }

     .settings-group {
          flex-direction: column;
          align-items: flex-start;
     }

     .settings-group label {
          margin-bottom: 5px;
     }

     .input-wrapper {
          width: 100%;
          max-width: 200px;
     }
}

@media (max-width: 480px) {
     .screen {
          padding: 15px;
          border-width: 6px;
     }

     .content {
          font-size: 20px;
     }

     #timer-display {
          font-size: 70px;
          letter-spacing: 3px;
          margin: 15px 0;
     }

     #mode-display {
          font-size: 24px;
     }

     .nav-button {
          min-width: 120px;
          font-size: 18px;
          padding: 6px 12px;
     }

     .controls {
          gap: 10px;
     }

     .controls button,
     .controls .retro-button {
          min-width: 100px;
          font-size: 18px;
          padding: 8px 12px;
     }
}

@media (max-width: 600px) {
     .achievements-grid {
          grid-template-columns: 1fr;
     }
}

/* Custom Scrollbar Styling for retro-neon theme */
/* For Webkit browsers (Chrome, Safari, Opera) */
::-webkit-scrollbar {
     width: 14px;
     height: 14px;
}

::-webkit-scrollbar-track {
     background: rgba(0, 0, 0, 0.6);
     border: 1px solid #444;
}

::-webkit-scrollbar-thumb {
     background: var(--theme-scrollbar-thumb-bg);
     border: 2px solid var(--theme-scrollbar-thumb);
     box-shadow: 0 0 10px rgba(var(--theme-primary), 0.7);
}

::-webkit-scrollbar-thumb:hover {
     background: var(--theme-scrollbar-thumb-bg-hover);
     box-shadow: 0 0 15px rgba(var(--theme-primary), 0.8);
}

/* Firefox scrollbar styling */
* {
     scrollbar-width: thin;
     scrollbar-color: var(--theme-scrollbar-thumb) rgba(0, 0, 0, 0.6);
}

/* Task Management Styles */
.task-management {
     margin-top: 20px;
     border-top: 1px solid rgba(255, 255, 255, 0.2);
     padding-top: 15px;
}

.section-title {
     margin: 0 0 10px;
     font-size: 1.2rem;
     text-align: left;
     color: var(--theme-primary);
     text-shadow: 0 0 5px var(--theme-glow-1);
}

.task-form {
     display: flex;
     margin-bottom: 15px;
}

.task-input {
     flex: 1;
     background-color: rgba(0, 0, 0, 0.5);
     border: 1px solid var(--theme-primary);
     color: #fff;
     padding: 8px;
     font-family: 'VT323', monospace;
     font-size: 1rem;
     border-radius: 3px 0 0 3px;
}

.task-add-btn {
     background-color: var(--theme-primary);
     color: #000;
     border: none;
     padding: 0 12px;
     cursor: pointer;
     font-family: 'VT323', monospace;
     font-size: 1rem;
     border-radius: 0 3px 3px 0;
}

.task-list {
     max-height: 200px;
     overflow-y: auto;
     text-align: left;
}

.task-item {
     display: flex;
     align-items: center;
     padding: 8px 5px;
     border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
     color: #fff;
     transition: background-color 0.2s;
}

.task-item:hover {
     background-color: rgba(var(--theme-primary), 0.1);
}

.matrix-theme .task-item:hover {
     background-color: rgba(0, 255, 0, 0.1);
}

.task-item.active {
     background-color: rgba(var(--theme-primary), 0.2);
     border-left: 3px solid var(--theme-primary);
}

.matrix-theme .task-item.active {
     background-color: rgba(0, 255, 0, 0.2);
     border-left: 3px solid #0f0;
}

.task-item.completed .task-description {
     text-decoration: line-through;
     opacity: 0.6;
}

.task-checkbox {
     margin-right: 10px;
     appearance: none;
     width: 16px;
     height: 16px;
     background-color: rgba(0, 0, 0, 0.5);
     border: 1px solid var(--theme-primary);
     border-radius: 3px;
     position: relative;
     cursor: pointer;
}

.matrix-theme .task-checkbox {
     border-color: #0f0;
}

.task-checkbox:checked::after {
     content: '✓';
     position: absolute;
     top: 50%;
     left: 50%;
     transform: translate(-50%, -50%);
     font-size: 12px;
     color: var(--theme-primary);
}

.matrix-theme .task-checkbox:checked::after {
     color: #0f0;
}

.task-description {
     flex: 1;
     font-size: 0.9rem;
     word-break: break-word;
}

.task-stats {
     font-size: 0.7rem;
     margin: 0 10px;
     opacity: 0.7;
     min-width: 80px;
     text-align: right;
}

.task-actions {
     display: flex;
     gap: 5px;
}

.task-btn {
     background-color: transparent;
     border: 1px solid var(--theme-primary);
     color: var(--theme-primary);
     width: 24px;
     height: 24px;
     border-radius: 3px;
     cursor: pointer;
     display: flex;
     align-items: center;
     justify-content: center;
     font-size: 0.7rem;
     padding: 0;
}

.matrix-theme .task-btn {
     border-color: #0f0;
     color: #0f0;
}

.task-btn:hover {
     background-color: rgba(var(--theme-primary), 0.2);
}

.matrix-theme .task-btn:hover {
     background-color: rgba(0, 255, 0, 0.2);
}

.empty-task-message {
     text-align: center;
     padding: 20px;
     color: rgba(255, 255, 255, 0.5);
     font-style: italic;
}

/* Modal styles for task editing */
.modal-overlay {
     position: fixed;
     top: 0;
     left: 0;
     right: 0;
     bottom: 0;
     background-color: rgba(0, 0, 0, 0.7);
     display: flex;
     align-items: center;
     justify-content: center;
     z-index: 1000;
}

.modal {
     background-color: #000810;
     border: 2px solid #30cfd0;
     border-radius: 5px;
     padding: 20px;
     min-width: 300px;
     max-width: 90%;
}

.matrix-theme .modal {
     border-color: #0f0;
}

.modal-header {
     margin-bottom: 15px;
     padding-bottom: 10px;
     border-bottom: 1px solid rgba(48, 207, 208, 0.5);
     text-align: center;
     font-size: 1.2rem;
}

.matrix-theme .modal-header {
     border-color: rgba(0, 255, 0, 0.5);
}

.task-edit-input {
     width: 100%;
     background-color: rgba(0, 0, 0, 0.5);
     border: 1px solid #30cfd0;
     color: #fff;
     padding: 8px;
     font-family: 'VT323', monospace;
     font-size: 1rem;
     margin-bottom: 15px;
}

.matrix-theme .task-edit-input {
     border-color: #0f0;
}

.modal-actions {
     display: flex;
     justify-content: flex-end;
     gap: 10px;
}

.modal-content {
     margin-bottom: 15px;
     font-size: 1rem;
     line-height: 1.4;
     color: #fff;
     text-align: center;
}

.matrix-theme .modal-content {
     color: #fff;
     text-shadow: 0 0 5px rgba(0, 255, 0, 0.7);
}

.modal-content input {
     width: 100%;
     margin-top: 10px;
}

/* Avatar styles - More specific and enforced sizing */
.user-avatar,
.header-avatar .user-avatar,
[data-avatar-container] .user-avatar,
.avatar-preview .user-avatar {
     display: inline-block;
     overflow: hidden;
     border-radius: 50%;
     vertical-align: middle;
     background-color: rgba(0, 0, 0, 0.2);
     border: 2px solid var(--theme-primary);
     width: 64px !important;
     height: 64px !important;
     min-width: 64px !important;
     min-height: 64px !important;
     max-width: 64px !important;
     max-height: 64px !important;
     transition: all 0.3s ease;
     box-sizing: border-box !important;
}

/* Ensure the image fills the container and scales correctly */
.user-avatar img,
.header-avatar .user-avatar img,
[data-avatar-container] .user-avatar img {
     display: block;
     width: 100% !important;
     height: 100% !important;
     object-fit: cover;
     margin: 0 !important;
     padding: 0 !important;
}

/* Clean up contextual avatar styles to avoid conflicts */
.avatar-preview .user-avatar {
     margin: 0 auto;
}

.header-avatar {
     position: relative;
     display: inline-block;
}

.header-avatar .user-avatar {
     margin-left: 10px;
}

.matrix-theme .user-avatar {
     border-color: #0f0;
     box-shadow: 0 0 8px rgba(0, 255, 0, 0.6);
}

.matrix-theme .user-avatar img {
     filter: hue-rotate(100deg) saturate(150%) brightness(1.2) drop-shadow(0 0 2px rgba(0, 255, 0, 0.8));
}

/* Mobile responsiveness for avatars */
@media (max-width: 600px) {
     .avatar-grid {
          grid-template-columns: repeat(3, 1fr);
     }
}

@media (max-width: 400px) {
     .avatar-grid {
          grid-template-columns: repeat(2, 1fr);
     }
}