/* ===================================
   CSS Variables - Stardew Valley Inspired Color Palette
   =================================== */
:root {
    /* Primary Colors - Warm and Playful */
    --color-grass: #8bc34a;
    --color-sky: #5dade2;
    --color-sunset: #ff6b6b;
    --color-gold: #ffd700;
    --color-wood: #8b6f47;

    /* Background Colors */
    --color-bg-light: #f0e68c;
    --color-bg-primary: #98d8c8;
    --color-bg-dark: #6a9f8a;
    --color-bg-darker: #4a7c5e;

    /* UI Colors */
    --color-white: #ffffff;
    --color-black: #2c3e50;
    --color-shadow: #34495e;
    --color-highlight: #ffe135;

    /* Game Colors */
    --color-success: #27ae60;
    --color-warning: #f39c12;
    --color-danger: #e74c3c;
    --color-info: #3498db;

    /* Pixel Art Styling */
    --pixel-border: 4px;
    --pixel-shadow: 6px 6px 0px;
    --font-pixel: 'Press Start 2P', cursive;

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;
}

/* ===================================
   Global Styles & Reset
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-pixel);
    background-color: var(--color-bg-light);
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.1) 2px,
            rgba(255, 255, 255, 0.1) 4px
        );
    color: var(--color-black);
    line-height: 1.6;
    min-height: 100vh;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    /* Prevent overscroll bounce on mobile */
    overscroll-behavior-y: contain;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-md);
}

/* ===================================
   Utility Classes
   =================================== */
.hidden {
    display: none !important;
}

/* ===================================
   Header Styles - Retro Game Start Screen
   =================================== */
.game-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-xl);
    background: linear-gradient(135deg, var(--color-sunset) 0%, #c0392b 100%);
    border: var(--pixel-border) solid var(--color-black);
    box-shadow:
        var(--pixel-shadow) var(--color-shadow),
        inset 0 -8px 0 rgba(0, 0, 0, 0.2),
        inset 0 4px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.game-header::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    border: 3px solid rgba(255, 255, 255, 0.4);
    pointer-events: none;
    z-index: 1;
}

.game-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: headerShine 3s infinite;
}

@keyframes headerShine {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

.game-title {
    font-size: 2.5rem;
    color: var(--color-white);
    text-shadow:
        4px 4px 0px var(--color-black),
        6px 6px 0px rgba(0, 0, 0, 0.5),
        -2px -2px 0px rgba(255, 255, 255, 0.3);
    margin-bottom: var(--spacing-sm);
    letter-spacing: 3px;
    position: relative;
    z-index: 2;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from {
        text-shadow:
            4px 4px 0px var(--color-black),
            6px 6px 0px rgba(0, 0, 0, 0.5),
            -2px -2px 0px rgba(255, 255, 255, 0.3);
    }
    to {
        text-shadow:
            4px 4px 0px var(--color-black),
            6px 6px 0px rgba(0, 0, 0, 0.5),
            -2px -2px 0px rgba(255, 255, 255, 0.3),
            0 0 20px rgba(255, 255, 255, 0.5);
    }
}

.game-subtitle {
    font-size: 0.75rem;
    color: var(--color-highlight);
    text-shadow:
        2px 2px 0px var(--color-black),
        -1px -1px 0px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 2;
    letter-spacing: 2px;
}

/* ===================================
   Section Styles
   =================================== */
.countdown-section,
.assessment-section,
.game-section,
.results-section {
    background-color: var(--color-bg-primary);
    border: var(--pixel-border) solid var(--color-black);
    box-shadow: var(--pixel-shadow) var(--color-shadow);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.section-title {
    font-size: 1.5rem;
    color: var(--color-wood);
    text-align: center;
    margin-bottom: var(--spacing-lg);
    text-shadow: 2px 2px 0px var(--color-white);
    padding-bottom: var(--spacing-sm);
    border-bottom: var(--pixel-border) solid var(--color-wood);
}

/* ===================================
   Countdown Display
   =================================== */
.countdown-section {
    background: linear-gradient(135deg, var(--color-bg-primary) 0%, var(--color-bg-dark) 100%);
    position: relative;
    overflow: hidden;
}

.countdown-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.05) 10px,
        rgba(255, 255, 255, 0.05) 20px
    );
    animation: slide 20s linear infinite;
    pointer-events: none;
}

@keyframes slide {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.countdown-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-lg);
    position: relative;
    z-index: 1;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(180deg, var(--color-gold) 0%, #e6c200 100%);
    border: var(--pixel-border) solid var(--color-black);
    padding: var(--spacing-md);
    min-width: 120px;
    box-shadow:
        4px 4px 0px var(--color-shadow),
        inset 2px 2px 0px rgba(255, 255, 255, 0.5),
        inset -2px -2px 0px rgba(0, 0, 0, 0.2);
    position: relative;
    transition: transform 0.3s ease;
}

.countdown-item::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 4px;
    right: 4px;
    height: 2px;
    background: rgba(0, 0, 0, 0.3);
}

.countdown-value {
    font-size: 2.5rem;
    color: var(--color-black);
    line-height: 1;
    margin-bottom: var(--spacing-xs);
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.3);
    font-weight: bold;
}

.countdown-label {
    font-size: 0.6rem;
    color: var(--color-wood);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.countdown-separator {
    font-size: 2rem;
    color: var(--color-wood);
    font-weight: bold;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.countdown-cta {
    text-align: center;
    margin-top: var(--spacing-lg);
    position: relative;
    z-index: 1;
}

.cta-button {
    font-size: 1rem;
    padding: var(--spacing-md) var(--spacing-xl);
    background: linear-gradient(180deg, var(--color-sunset) 0%, #e74c3c 100%);
    color: var(--color-white);
    border: var(--pixel-border) solid var(--color-black);
    box-shadow:
        6px 6px 0px var(--color-shadow),
        inset 2px 2px 0px rgba(255, 255, 255, 0.4);
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
    animation: ctaPulse 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
    /* Ensure minimum touch target size on mobile */
    min-height: 44px;
    min-width: 44px;
    /* Prevent text selection on double-tap */
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes ctaPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.cta-button:hover {
    background: linear-gradient(180deg, #ff7b7b 0%, #ff6b6b 100%);
    transform: translate(3px, 3px) scale(1.05);
    box-shadow: 3px 3px 0px var(--color-shadow);
}

.cta-button:active {
    transform: translate(6px, 6px);
    box-shadow: none;
}

/* ===================================
   Assessment Section
   =================================== */
.assessment-content {
    max-width: 800px;
    margin: 0 auto;
}

.assessment-intro {
    text-align: center;
    font-size: 0.8rem;
    margin-bottom: var(--spacing-xl);
    color: var(--color-wood);
    line-height: 1.8;
}

.planning-question,
.checklist-question {
    background-color: var(--color-white);
    border: var(--pixel-border) solid var(--color-black);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: 4px 4px 0px var(--color-shadow);
}

.question-title {
    font-size: 1rem;
    color: var(--color-wood);
    margin-bottom: var(--spacing-md);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Date Slider Styles */
.date-slider-container {
    padding: var(--spacing-md) 0;
}

.date-display {
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.selected-date {
    display: block;
    font-size: 1.2rem;
    color: var(--color-sunset);
    margin-bottom: var(--spacing-xs);
    font-weight: bold;
}

.weeks-ago {
    display: block;
    font-size: 0.7rem;
    color: var(--color-wood);
}

.date-slider {
    width: 100%;
    height: 12px;
    background: linear-gradient(90deg, var(--color-success) 0%, var(--color-warning) 50%, var(--color-danger) 100%);
    border: var(--pixel-border) solid var(--color-black);
    outline: none;
    -webkit-appearance: none;
    margin: var(--spacing-md) 0;
    cursor: pointer;
}

.date-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 32px;
    height: 32px;
    background: var(--color-gold);
    border: var(--pixel-border) solid var(--color-black);
    cursor: pointer;
    box-shadow: 2px 2px 0px var(--color-shadow);
}

.date-slider::-moz-range-thumb {
    width: 32px;
    height: 32px;
    background: var(--color-gold);
    border: var(--pixel-border) solid var(--color-black);
    cursor: pointer;
    box-shadow: 2px 2px 0px var(--color-shadow);
}

.date-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--color-wood);
}

/* Checkbox Styles */
.checklist-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-sm);
}

@media (max-width: 768px) {
    .checklist-container {
        grid-template-columns: 1fr;
    }
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm);
    background-color: var(--color-bg-light);
    border: 2px solid var(--color-black);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.checkbox-item:hover {
    background-color: var(--color-bg-primary);
    transform: translate(1px, 1px);
}

.checkbox-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-custom {
    width: 24px;
    height: 24px;
    border: var(--pixel-border) solid var(--color-black);
    background-color: var(--color-white);
    margin-right: var(--spacing-sm);
    flex-shrink: 0;
    position: relative;
}

.checkbox-item input[type="checkbox"]:checked + .checkbox-custom {
    background-color: var(--color-success);
}

.checkbox-item input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 6px;
    width: 6px;
    height: 12px;
    border: solid var(--color-white);
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.checkbox-label {
    font-size: 0.7rem;
    color: var(--color-black);
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Difficulty Badge Styles */
.difficulty-badge-container {
    text-align: center;
    margin: var(--spacing-xl) 0;
}

.difficulty-title {
    font-size: 0.9rem;
    color: var(--color-wood);
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.difficulty-badge {
    display: inline-block;
    padding: var(--spacing-md) var(--spacing-xl);
    background: linear-gradient(135deg, var(--color-gold) 0%, #e6c200 100%);
    border: var(--pixel-border) solid var(--color-black);
    box-shadow:
        6px 6px 0px var(--color-shadow),
        inset 2px 2px 0px rgba(255, 255, 255, 0.5),
        inset -2px -2px 0px rgba(0, 0, 0, 0.2);
    animation: badgePulse 2s ease-in-out infinite;
}

.difficulty-badge.easy {
    background: linear-gradient(135deg, var(--color-success) 0%, #27ae60 100%);
}

.difficulty-badge.medium {
    background: linear-gradient(135deg, var(--color-warning) 0%, #e67e22 100%);
}

.difficulty-badge.hard {
    background: linear-gradient(135deg, var(--color-danger) 0%, #c0392b 100%);
}

.difficulty-badge.extreme {
    background: linear-gradient(135deg, #8e44ad 0%, #6c3483 100%);
}

.difficulty-text {
    font-size: 1.5rem;
    color: var(--color-white);
    text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.5);
    font-weight: bold;
    letter-spacing: 2px;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.assessment-controls {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-top: var(--spacing-xl);
}

/* ===================================
   Game Section
   =================================== */
.game-container {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.game-area {
    width: 100%;
    max-width: 900px;
    position: relative;
}

/* Notification Popup Styles */
.notification-container {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 300px;
    max-height: 400px;
    pointer-events: none;
    z-index: 1000;
}

@media (max-width: 768px) {
    .notification-container {
        top: 10px;
        right: 10px;
        width: 200px;
        max-height: 300px;
    }
}

.notification {
    background: rgba(26, 29, 33, 0.95);
    border: 3px solid #2c3e50;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    display: flex;
    gap: 12px;
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 4.7s;
    animation-fill-mode: forwards;
}

.notification.urgent {
    background: rgba(255, 107, 107, 0.95);
    border-color: #ff6b6b;
    animation: slideInRight 0.3s ease, shake 0.5s ease 0.3s, fadeOut 0.3s ease 4.7s;
    animation-fill-mode: forwards;
}

.notification-avatar {
    width: 32px;
    height: 32px;
    font-size: 1.3rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-content {
    flex: 1;
}

.notification-author {
    font-size: 0.75rem;
    color: #fff;
    font-weight: bold;
    margin-bottom: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.notification-text {
    font-size: 0.7rem;
    color: #ddd;
    line-height: 1.3;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.notification.urgent .notification-text {
    color: #fff;
    font-weight: 600;
}

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

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(50px);
    }
}

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

/* Sticky Countdown Header */
.sticky-countdown-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--color-sunset) 0%, #c0392b 100%);
    border-bottom: var(--pixel-border) solid var(--color-black);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 9998;
    padding: var(--spacing-sm) var(--spacing-md);
}

.sticky-countdown-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.sticky-countdown-label {
    font-size: 0.7rem;
    color: var(--color-white);
    text-shadow: 2px 2px 0px var(--color-black);
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sticky-countdown-display {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.sticky-countdown-item {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.sticky-countdown-value {
    font-size: 1.2rem;
    color: var(--color-highlight);
    text-shadow: 2px 2px 0px var(--color-black);
    font-weight: bold;
    line-height: 1;
}

.sticky-countdown-unit {
    font-size: 0.6rem;
    color: var(--color-gold);
    text-shadow: 1px 1px 0px var(--color-black);
    font-weight: bold;
}

.sticky-countdown-sep {
    font-size: 1rem;
    color: var(--color-white);
    font-weight: bold;
    margin: 0 2px;
}

/* Add padding to body to account for sticky header */
body {
    padding-top: 70px;
}

@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }

    .sticky-countdown-header {
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .sticky-countdown-label {
        font-size: 0.55rem;
    }

    .sticky-countdown-value {
        font-size: 1rem;
    }

    .sticky-countdown-unit {
        font-size: 0.5rem;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 50px;
    }

    .sticky-countdown-content {
        gap: var(--spacing-xs);
    }

    .sticky-countdown-label {
        font-size: 0.5rem;
        display: none; /* Hide label on very small screens */
    }

    .sticky-countdown-value {
        font-size: 0.9rem;
    }

    .sticky-countdown-unit {
        font-size: 0.45rem;
    }

    .sticky-countdown-sep {
        font-size: 0.8rem;
        margin: 0 1px;
    }
}

.game-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: var(--spacing-md);
    background-color: var(--color-bg-dark);
    border: var(--pixel-border) solid var(--color-black);
    padding: var(--spacing-md);
}

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

.stat-label {
    font-size: 0.7rem;
    color: var(--color-white);
    margin-bottom: var(--spacing-xs);
}

.stat-value {
    font-size: 1.5rem;
    color: var(--color-gold);
    text-shadow: 2px 2px 0px var(--color-black);
}

.game-canvas-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-md);
    background-color: var(--color-black);
    border: var(--pixel-border) solid var(--color-shadow);
    padding: var(--spacing-sm);
}

#gameCanvas {
    border: var(--pixel-border) solid var(--color-wood);
    background-color: var(--color-sky);
    max-width: 100%;
    height: auto;
    cursor: url('/assets/hand-cursor-small.png') 10 2, pointer !important;
    touch-action: none; /* Prevent default touch behaviors */
}

/* Remove custom cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
    #gameCanvas {
        cursor: default !important;
    }
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* ===================================
   Modal Overlay - Results Section
   =================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: all;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    position: relative;
    z-index: 10000;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    background-color: var(--color-bg-primary);
    border: 6px solid var(--color-black);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 -4px 0 rgba(0, 0, 0, 0.2),
        inset 0 4px 0 rgba(255, 255, 255, 0.2);
    padding: var(--spacing-lg);
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: var(--color-danger);
    border: 4px solid var(--color-black);
    color: var(--color-white);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 4px 4px 0px var(--color-shadow);
    transition: all 0.1s ease;
    line-height: 1;
    padding: 0;
    font-family: Arial, sans-serif;
    z-index: 10001;
}

.modal-close:hover {
    background: #ff6b6b;
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--color-shadow);
}

.modal-close:active {
    transform: translate(4px, 4px);
    box-shadow: none;
}

.results-modal .section-title {
    margin-top: 20px;
    font-size: 2rem;
    color: var(--color-sunset);
    text-shadow:
        3px 3px 0px var(--color-black),
        -1px -1px 0px rgba(255, 255, 255, 0.3);
}

.results-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.final-score,
.rank-display {
    background-color: #2c3e50;
    border: var(--pixel-border) solid var(--color-black);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.results-label,
.rank-label {
    display: block;
    font-size: 0.8rem;
    color: #ffffff;
    margin-bottom: var(--spacing-sm);
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.results-value,
.rank-value {
    display: block;
    font-size: 2.5rem;
    color: #ffd700;
    text-shadow: 3px 3px 0px var(--color-black);
    font-weight: bold;
}

.rank-value {
    color: var(--color-gold);
}

.results-message {
    background-color: var(--color-bg-dark);
    border: var(--pixel-border) solid var(--color-black);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    color: var(--color-white);
    font-size: 0.75rem;
    line-height: 1.8;
}

.results-controls {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* ===================================
   Button Styles
   =================================== */
.pixel-button {
    font-family: var(--font-pixel);
    font-size: 0.8rem;
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--color-grass);
    color: var(--color-white);
    border: var(--pixel-border) solid var(--color-black);
    box-shadow: 4px 4px 0px var(--color-shadow);
    cursor: pointer;
    transition: all 0.1s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    /* Ensure minimum touch target size on mobile */
    min-height: 44px;
    min-width: 44px;
    /* Prevent text selection on double-tap */
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.pixel-button:hover {
    background-color: var(--color-success);
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--color-shadow);
}

.pixel-button:active {
    transform: translate(4px, 4px);
    box-shadow: none;
}

.pixel-button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    opacity: 0.6;
}

.pixel-button:disabled:hover {
    transform: none;
    box-shadow: 4px 4px 0px var(--color-shadow);
}

/* ===================================
   Footer Styles
   =================================== */
.game-footer {
    text-align: center;
    padding: var(--spacing-lg);
    font-size: 0.7rem;
    color: var(--color-wood);
    margin-top: var(--spacing-xl);
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 768px) {
    .game-header {
        padding: var(--spacing-md);
    }

    .game-title {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }

    .game-subtitle {
        font-size: 0.65rem;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .countdown-value {
        font-size: 2rem;
    }

    .countdown-item {
        min-width: 80px;
        padding: var(--spacing-sm);
    }

    .countdown-label {
        font-size: 0.5rem;
    }

    .cta-button {
        font-size: 0.85rem;
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .pixel-button {
        font-size: 0.7rem;
        padding: var(--spacing-sm);
    }

    #gameCanvas {
        width: 100%;
        height: auto;
    }

    /* Modal responsive adjustments */
    .modal-overlay {
        padding: var(--spacing-sm);
    }

    .modal-content {
        max-height: 85vh;
        padding: var(--spacing-md);
    }

    .results-modal .section-title {
        font-size: 1.5rem;
        margin-top: 30px;
    }

    .modal-close {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: var(--spacing-sm);
    }

    .game-header {
        padding: var(--spacing-sm);
        margin-bottom: var(--spacing-md);
    }

    .game-title {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }

    /* Reduce title glow effect on mobile to match desktop */
    @keyframes titleGlow {
        from {
            text-shadow:
                4px 4px 0px var(--color-black),
                6px 6px 0px rgba(0, 0, 0, 0.5),
                -2px -2px 0px rgba(255, 255, 255, 0.3);
        }
        to {
            text-shadow:
                4px 4px 0px var(--color-black),
                6px 6px 0px rgba(0, 0, 0, 0.5),
                -2px -2px 0px rgba(255, 255, 255, 0.3),
                0 0 8px rgba(255, 255, 255, 0.3);
        }
    }

    .game-subtitle {
        font-size: 0.5rem;
        letter-spacing: 1px;
    }

    .countdown-section,
    .assessment-section,
    .game-section,
    .results-section {
        padding: var(--spacing-sm);
    }

    .section-title {
        font-size: 1rem;
        margin-bottom: var(--spacing-sm);
    }

    /* Change countdown to 2x2 grid on mobile */
    .countdown-display {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: var(--spacing-sm);
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    .countdown-separator {
        display: none;
    }

    .countdown-item {
        min-width: unset;
        width: 100%;
        padding: var(--spacing-sm);
    }

    .countdown-value {
        font-size: 1.8rem;
    }

    .countdown-label {
        font-size: 0.5rem;
    }

    .cta-button {
        font-size: 0.75rem;
        padding: var(--spacing-sm) var(--spacing-md);
        width: 100%;
    }

    .game-stat {
        flex: 1;
    }

    .pixel-button {
        font-size: 0.6rem;
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .assessment-intro {
        font-size: 0.7rem;
    }

    .checkbox-item {
        padding: var(--spacing-xs);
    }

    .checkbox-label {
        font-size: 0.65rem;
    }

    /* Game canvas mobile adjustments - take up more screen space */
    .game-canvas-wrapper {
        padding: 4px;
        margin-bottom: var(--spacing-xs);
    }

    #gameCanvas {
        width: 100%;
        height: auto;
    }

    .game-info {
        padding: var(--spacing-sm);
        margin-bottom: var(--spacing-xs);
    }

    .stat-label {
        font-size: 0.6rem;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .game-section {
        padding: var(--spacing-xs);
    }

    .game-controls {
        gap: var(--spacing-xs);
    }

    /* Modal mobile adjustments */
    .modal-overlay {
        padding: var(--spacing-xs);
    }

    .modal-content {
        max-height: 80vh;
        padding: var(--spacing-sm);
        border-width: 4px;
    }

    .results-modal .section-title {
        font-size: 1.2rem;
        margin-top: 24px;
    }

    .modal-close {
        width: 32px;
        height: 32px;
        top: 8px;
        right: 8px;
        font-size: 1rem;
    }

    .results-value,
    .rank-value {
        font-size: 2rem;
    }
}

/* ===================================
   Animations
   =================================== */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.countdown-item {
    animation: pulse 2s ease-in-out infinite;
}

/* Retro pixel sparkle effect */
@keyframes pixelFloat {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) scale(0.5);
        opacity: 0;
    }
}
