/* Base Reset and Box Sizing */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Utility Classes */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Body and Root Styling */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Sidebar Navigation Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 50px;
    background: #0f1419;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    transition: width 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.sidebar.expanded {
    width: 200px;
}

.sidebar-toggle {
    width: 50px;
    height: 50px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s ease;
    /* Improve touch interactions */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-toggle:focus {
    outline: 2px solid #3498db;
    outline-offset: -2px;
}

.sidebar-toggle:active {
    background-color: rgba(255, 255, 255, 0.2);
}

.sidebar-content {
    margin-top: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar.expanded .sidebar-content {
    opacity: 1;
}

.game-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.game-item {
    display: flex;
    align-items: center;
    padding: 15px 10px;
    color: #ecf0f1;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    gap: 10px;
    /* Improve touch interactions */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    /* Ensure minimum touch target size */
    min-height: 44px;
}

.game-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.game-item:focus {
    outline: 2px solid #3498db;
    outline-offset: -2px;
    background-color: rgba(255, 255, 255, 0.1);
}

.game-item:active {
    background-color: rgba(255, 255, 255, 0.2);
}

.game-item.active {
    background-color: #3498db;
    border-left: 4px solid #2ecc71;
}

.game-item.active:hover {
    background-color: #2980b9;
}

.game-icon {
    font-size: 20px;
    min-width: 30px;
    text-align: center;
}

.game-name {
    font-size: 14px;
    font-weight: 500;
}

/* Mobile Responsive Sidebar - Overlay Behavior */
@media (max-width: 768px) {
    .sidebar {
        width: 50px;
        z-index: 1001;
    }
    
    .sidebar.expanded {
        width: 250px;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
    }
    
    /* Overlay backdrop for mobile */
    .sidebar.expanded::after {
        content: '';
        position: fixed;
        top: 0;
        left: 250px;
        width: calc(100vw - 250px);
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
}

/* Game Container */
.game-container {
    width: 100%;
    max-width: 600px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #1a1f3a;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    margin-left: 50px;
    transition: margin-left 0.3s ease;
    border: 1px solid #2a3556;
}

/* Hide game containers by default when display is set to none */
.game-container[style*="display: none"] {
    display: none !important;
}

/* Header and Score Display */
.game-header {
    padding: 20px;
    background: #0f1419;
    border-bottom: 2px solid #2a3556;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

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

.lives-label {
    font-size: 20px;
    font-weight: 600;
    color: #8892b0;
}

.lives-value {
    font-size: 24px;
    color: #ff4444;
}

.level-display {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: center;
}

.level-label {
    font-size: 20px;
    font-weight: 600;
    color: #8892b0;
}

.level-value {
    font-size: 24px;
    font-weight: bold;
    color: #64ffda;
}

.score-display {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex: 1;
}

.score-label {
    font-size: 20px;
    font-weight: 600;
    color: #8892b0;
}

.score-value {
    font-size: 24px;
    font-weight: bold;
    color: #64ffda;
    min-width: 60px;
    text-align: right;
}

.timer-display {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex: 1;
}

.timer-label {
    font-size: 20px;
    font-weight: 600;
    color: #8892b0;
}

.timer-value {
    font-size: 24px;
    font-weight: bold;
    color: #ffd700;
    min-width: 60px;
    text-align: right;
}

/* Game Area */
.game-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    background: #1a1f3a;
}

/* Object Container */
.object-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Responsive Design for Mobile */
@media (max-width: 768px) {
    .game-container {
        max-width: 100%;
        margin-left: 50px;
    }
    
    .game-header {
        padding: 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .lives-display,
    .level-display,
    .score-display,
    .timer-display {
        flex: 1 1 auto;
        min-width: 120px;
    }
    
    .lives-label,
    .level-label,
    .score-label,
    .timer-label {
        font-size: 16px;
    }
    
    .lives-value {
        font-size: 20px;
    }
    
    .level-value,
    .score-value,
    .timer-value {
        font-size: 20px;
    }
    
    .game-area {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .game-header {
        padding: 12px;
        flex-direction: column;
        gap: 8px;
    }
    
    .lives-display,
    .level-display,
    .score-display,
    .timer-display {
        justify-content: center;
    }
    
    .lives-label,
    .level-label,
    .score-label,
    .timer-label {
        font-size: 14px;
    }
    
    .lives-value {
        font-size: 18px;
    }
    
    .level-value,
    .score-value,
    .timer-value {
        font-size: 18px;
    }
}

/* Game Object Base Styles */
.game-object {
    width: 200px;
    height: 200px;
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease;
}

/* Object Image */
.object-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none;
    border-radius: 10px;
}

/* Glow Effects - Applied to Image */
.green-border .object-image {
    filter: drop-shadow(0 0 10px rgba(0, 255, 136, 0.9))
            drop-shadow(0 0 20px rgba(0, 255, 136, 0.7))
            drop-shadow(0 0 30px rgba(0, 255, 136, 0.5));
}

.red-border .object-image {
    filter: drop-shadow(0 0 10px rgba(255, 68, 68, 0.9))
            drop-shadow(0 0 20px rgba(255, 68, 68, 0.7))
            drop-shadow(0 0 30px rgba(255, 68, 68, 0.5));
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(100px);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-100px);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

@keyframes scoreUpdate {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
        color: #00ff88;
    }
    100% {
        transform: scale(1);
    }
}

@keyframes livesUpdate {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes levelUpdate {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
        color: #00ffff;
    }
    100% {
        transform: scale(1);
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 200ms ease-out forwards;
}

.slide-down {
    animation: slideDown 300ms ease-in forwards;
}

.slide-up {
    animation: slideUp 300ms ease-in forwards;
}

.shake {
    animation: shake 400ms ease-in-out forwards;
}

.score-update {
    animation: scoreUpdate 300ms ease-in-out;
}

.lives-update {
    animation: livesUpdate 300ms ease-in-out;
}

.level-update {
    animation: levelUpdate 300ms ease-in-out;
}

/* Responsive Object Sizing */
@media (max-width: 768px) {
    .game-object {
        width: 160px;
        height: 160px;
    }
}

@media (max-width: 480px) {
    .game-object {
        width: 140px;
        height: 140px;
        min-width: 44px;
        min-height: 44px;
    }
}

/* Feedback Message Styles */
.feedback-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-weight: bold;
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.feedback-message.show {
    animation: feedbackPulse 500ms ease-out forwards;
}

.feedback-message.correct {
    color: #00ff88;
}

.feedback-message.incorrect {
    color: #ff4444;
}

/* Color Flash Effect */
@keyframes colorFlashGreen {
    0% {
        background-color: #1a1f3a;
    }
    50% {
        background-color: rgba(0, 255, 136, 0.15);
    }
    100% {
        background-color: #1a1f3a;
    }
}

@keyframes colorFlashRed {
    0% {
        background-color: #1a1f3a;
    }
    50% {
        background-color: rgba(255, 68, 68, 0.15);
    }
    100% {
        background-color: #1a1f3a;
    }
}

@keyframes feedbackPulse {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

.game-area.flash-green {
    animation: colorFlashGreen 500ms ease-out;
}

.game-area.flash-red {
    animation: colorFlashRed 500ms ease-out;
}

/* Responsive Feedback Text */
@media (max-width: 768px) {
    .feedback-message {
        font-size: 40px;
    }
}

@media (max-width: 480px) {
    .feedback-message {
        font-size: 32px;
    }
}

/* Level-Up Notification Styles */
.level-up-notification {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #0f1419 0%, #1a2332 100%);
    padding: 40px 60px;
    border-radius: 20px;
    border: 2px solid #64ffda;
    box-shadow: 0 10px 40px rgba(100, 255, 218, 0.3), 0 0 60px rgba(100, 255, 218, 0.2);
    z-index: 200;
    text-align: center;
    animation: levelUpPulse 1500ms ease-out forwards;
}

.level-up-text {
    font-size: 48px;
    font-weight: bold;
    color: #64ffda;
    text-shadow: 0 0 20px rgba(100, 255, 218, 0.8);
    margin-bottom: 10px;
}

.level-up-subtext {
    font-size: 20px;
    color: #8892b0;
    text-shadow: none;
}

@keyframes levelUpPulse {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    10% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
    20% {
        transform: translate(-50%, -50%) scale(0.95);
    }
    30% {
        transform: translate(-50%, -50%) scale(1.05);
    }
    40% {
        transform: translate(-50%, -50%) scale(1);
    }
    90% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

/* Responsive Level-Up Notification */
@media (max-width: 768px) {
    .level-up-notification {
        padding: 30px 40px;
    }
    
    .level-up-text {
        font-size: 40px;
    }
    
    .level-up-subtext {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .level-up-notification {
        padding: 20px 30px;
    }
    
    .level-up-text {
        font-size: 32px;
    }
    
    .level-up-subtext {
        font-size: 16px;
    }
}

/* Game Over Overlay Styles */
.game-over-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 39, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 300;
    animation: fadeIn 300ms ease-out forwards;
}

.game-over-content {
    text-align: center;
    padding: 40px;
    background: #0f1419;
    border: 2px solid #2a3556;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.game-over-title {
    font-size: 48px;
    font-weight: bold;
    color: #ff4444;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 68, 68, 0.5);
}

.game-over-score {
    font-size: 32px;
    color: #8892b0;
    margin-bottom: 30px;
    text-shadow: none;
}

.restart-button {
    font-size: 20px;
    padding: 15px 40px;
    background: linear-gradient(135deg, #64ffda 0%, #00ff88 100%);
    color: #0a0e27;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(100, 255, 218, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    /* Improve touch interactions */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    /* Ensure minimum touch target size */
    min-height: 44px;
}

.restart-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(100, 255, 218, 0.6);
}

.restart-button:focus {
    outline: 2px solid #64ffda;
    outline-offset: 2px;
}

.restart-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(100, 255, 218, 0.4);
}

/* Responsive Game Over Overlay */
@media (max-width: 768px) {
    .game-over-content {
        padding: 30px;
    }
    
    .game-over-title {
        font-size: 40px;
    }
    
    .game-over-score {
        font-size: 28px;
    }
    
    .restart-button {
        font-size: 18px;
        padding: 12px 30px;
    }
}

@media (max-width: 480px) {
    .game-over-content {
        padding: 20px;
    }
    
    .game-over-title {
        font-size: 32px;
    }
    
    .game-over-score {
        font-size: 24px;
    }
    
    .restart-button {
        font-size: 16px;
        padding: 10px 25px;
    }
}

/* Color Game Specific Styles */
.color-game-object {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    transition: transform 0.2s ease, opacity 0.3s ease;
    cursor: pointer;
    /* Improve touch target size for mobile */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.color-game-object:hover {
    transform: scale(1.1);
}

.color-game-object:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.color-game-object:active {
    transform: scale(0.95);
}

/* Scale-out animation for object removal */
@keyframes scaleOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0);
        opacity: 0;
    }
}

.color-game-object.removing {
    animation: scaleOut 300ms ease-out forwards;
}

/* Responsive sizing for color game objects */
@media (max-width: 768px) {
    .color-game-object {
        width: 70px;
        height: 70px;
        /* Ensure minimum touch target size */
        min-width: 44px;
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .color-game-object {
        width: 60px;
        height: 60px;
        /* Maintain minimum touch target size for accessibility */
        min-width: 44px;
        min-height: 44px;
    }
}

/* Habit Tracker Styles */

/* Tracker Header */
.tracker-header {
    padding: 20px;
    background: #0f1419;
    color: #64ffda;
    text-align: center;
    border-bottom: 2px solid #2a3556;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tracker-header h1 {
    font-size: 28px;
    font-weight: bold;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Tracker Content */
.tracker-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #1a1f3a;
}

/* Profile Section */
.profile-section {
    background: #0f1419;
    border: 1px solid #2a3556;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.profile-section h2 {
    font-size: 20px;
    font-weight: 600;
    color: #64ffda;
    margin-bottom: 15px;
}

.habit-config {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.habit-config label {
    font-size: 14px;
    font-weight: 500;
    color: #8892b0;
}

#habit-name-input {
    padding: 12px;
    font-size: 16px;
    background: #1a1f3a;
    color: #e0e0e0;
    border: 2px solid #2a3556;
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

#habit-name-input:focus {
    outline: none;
    border-color: #64ffda;
    box-shadow: 0 0 0 3px rgba(100, 255, 218, 0.1);
}

#save-habit-btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, #64ffda 0%, #00ff88 100%);
    color: #0a0e27;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
}

#save-habit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 255, 218, 0.3);
}

#save-habit-btn:focus {
    outline: 2px solid #64ffda;
    outline-offset: 2px;
}

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

/* Counters Section */
.counters-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.counter-card {
    background: #0f1419;
    border: 1px solid #2a3556;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.counter-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.counter-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #8892b0;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.counter-value {
    font-size: 64px;
    font-weight: bold;
    color: #64ffda;
    margin: 20px 0;
    line-height: 1;
    transition: transform 0.3s ease, color 0.3s ease;
}

.habit-free-card .counter-value {
    color: #00ff88;
}

.streak-card .counter-value {
    color: #ffd700;
}

.streak-subtitle {
    font-size: 14px;
    color: #8892b0;
    margin-top: 10px;
}

/* Counter Actions */
.counter-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.counter-actions button {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
}

#increment-habit-btn {
    background: linear-gradient(135deg, #00ff88 0%, #00cc70 100%);
    color: #0a0e27;
    flex: 1;
}

#increment-habit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.3);
}

#increment-habit-btn:focus {
    outline: 2px solid #00ff88;
    outline-offset: 2px;
}

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

#reset-habit-btn {
    background: #ff4444;
    color: #0a0e27;
    padding: 10px 16px;
}

#reset-habit-btn:hover {
    background: #cc3333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.3);
}

#reset-habit-btn:focus {
    outline: 2px solid #ff4444;
    outline-offset: 2px;
}

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

/* Statistics Section */
.stats-section {
    background: #0f1419;
    border: 1px solid #2a3556;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.stats-section h2 {
    font-size: 20px;
    font-weight: 600;
    color: #64ffda;
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: #1a1f3a;
    border: 1px solid #2a3556;
    border-radius: 8px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.stat-item:hover {
    background: #242b45;
    transform: translateY(-2px);
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: #8892b0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #64ffda;
}

/* Counter Update Animation */
@keyframes counterPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
    }
}

.counter-value.updating {
    animation: counterPulse 400ms ease-out;
}

/* Feedback Message for Tracker */
.tracker-feedback {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: #00ff88;
    color: #0a0e27;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.4);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tracker-feedback.show {
    opacity: 1;
    transform: translateX(-50%) translateY(10px);
    animation: feedbackSlide 2s ease-out forwards;
}

.tracker-feedback.error {
    background: #ff4444;
    color: #0a0e27;
}

@keyframes feedbackSlide {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(0);
    }
    10% {
        opacity: 1;
        transform: translateX(-50%) translateY(10px);
    }
    90% {
        opacity: 1;
        transform: translateX(-50%) translateY(10px);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(0);
    }
}

/* Responsive Design for Tracker */
@media (max-width: 768px) {
    .tracker-header h1 {
        font-size: 24px;
    }
    
    .tracker-content {
        padding: 15px;
    }
    
    .profile-section,
    .stats-section {
        padding: 16px;
    }
    
    .counters-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .counter-value {
        font-size: 56px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .tracker-header {
        padding: 15px;
    }
    
    .tracker-header h1 {
        font-size: 20px;
    }
    
    .tracker-content {
        padding: 12px;
    }
    
    .profile-section,
    .counter-card,
    .stats-section {
        padding: 16px;
    }
    
    .counter-value {
        font-size: 48px;
    }
    
    .counter-actions {
        flex-direction: column;
    }
    
    .counter-actions button {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 24px;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    .counter-card,
    .stat-item,
    .counter-value,
    .tracker-feedback,
    #save-habit-btn,
    #increment-habit-btn,
    #reset-habit-btn {
        transition: none;
        animation: none;
    }
    
    .counter-value.updating {
        animation: none;
    }
}
