/* ============================================================================
   Difficulty Button Styles
   ============================================================================ */
.dd-difficulty-btn {
    display: inline-block;
    min-width: 110px;
    margin: 0 0.5rem 0.5rem 0;
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 0.75rem;
    border: 2px solid #bbf7d0;
    background: linear-gradient(135deg, #f0fdf4 0%, #d1fae5 100%);
    color: #166534;
    box-shadow: 0 2px 8px 0 rgba(34,197,94,0.08);
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.4,0,0.2,1);
    outline: none;
    position: relative;
}
.dd-difficulty-btn:hover, .dd-difficulty-btn:focus {
    background: linear-gradient(135deg, #bbf7d0 0%, #6ee7b7 100%);
    color: #065f46;
    border-color: #22c55e;
    box-shadow: 0 4px 16px 0 rgba(34,197,94,0.13);
    transform: translateY(-2px) scale(1.04);
}
.dd-difficulty-btn.selected {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    border-color: #15803d;
    box-shadow: 0 6px 24px 0 rgba(34,197,94,0.18);
    transform: scale(1.07);
    z-index: 1;
}
.dd-difficulty-btn:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px 0 rgba(34,197,94,0.10);
}
.dd-sector {
    fill: rgba(255,255,255,0.18); /* default: white highlight */
    stroke: rgba(255,255,255,0.7);
    stroke-width: 1.5;
    cursor: pointer;
    transition: fill 120ms ease, transform 120ms ease;
}
.dd-sector:hover {
    fill: rgba(255,255,255,0.35);
}
.dd-sector.selected {
    fill: rgba(255,255,255,0.55);
}

/* Savanna theme: orange sectors */
.dd-theme-savanna .dd-sector {
    fill: rgba(255, 140, 0, 0.18); /* orange highlight */
    stroke: rgba(255, 140, 0, 0.7);
}
.dd-theme-savanna .dd-sector:hover {
    fill: rgba(255, 140, 0, 0.35);
}
.dd-theme-savanna .dd-sector.selected {
    fill: rgba(255, 140, 0, 0.55);
}

/* Ocean theme: blue sectors */
.dd-theme-ocean .dd-sector {
    fill: rgba(52, 211, 255, 0.18); /* blue highlight */
    stroke: rgba(52, 211, 255, 0.7);
}
.dd-theme-ocean .dd-sector:hover {
    fill: rgba(52, 211, 255, 0.35);
}
.dd-theme-ocean .dd-sector.selected {
    fill: rgba(52, 211, 255, 0.55);
}
/* ============================================================================
   NeuroAge Cognitive Training - Optimized CSS
   ============================================================================ */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    min-height: 100vh;
    padding: 1rem;
}

/* ============================================================================
   Layout Utilities
   ============================================================================ */

.flex { display: flex; }
.grid { display: grid; }
.hidden { display: none; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }
.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-md { max-width: 28rem; }
.max-w-xl { max-width: 36rem; }
.w-2 { width: 0.5rem; }
.w-3 { width: 0.75rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.w-24 { width: 6rem; }
.w-32 { width: 8rem; }
.h-1 { height: 0.25rem; }
.h-2 { height: 0.5rem; }
.h-3 { height: 0.75rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }
.h-24 { height: 6rem; }
.h-32 { height: 8rem; }
.object-contain { object-fit: contain; }
.z-5 { z-index: 5; }
.z-10 { z-index: 10; }
.opacity-0 { opacity: 0; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-lightgray-700 { color: #374151; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }

/* Flexbox Utilities */
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

/* Grid Utilities */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

/* Spacing Utilities */
.p-4 { padding: 1rem; }
.p-8 { padding: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.ml-2 { margin-left: 0.5rem; }

/* Typography */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1; }
.text-6xl { font-size: 3.75rem; line-height: 1; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.leading-relaxed { line-height: 1.625; }

/* Colors */
.text-white { color: #ffffff; }
.text-black { color: #000000; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-gray-900 { color: #111827; }
.text-blue-700 { color: #166534; }
.text-green-600 { color: #15803d; }
.text-red-600 { color: #dc2626; }
.text-yellow-400 { color: #facc15; }
.text-blue-400 { color: #34d399; }

.bg-white { background-color: #ffffff; }
.bg-blue-50 { background-color: #ecfdf5; }
.bg-blue-100 { background-color: #d1fae5; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-200 { background-color: #e5e7eb; }
.bg-gray-300 { background-color: #d1d5db; }
.bg-gray-400 { background-color: #9ca3af; }
.bg-gray-500 { background-color: #6b7280; }
.bg-gray-600 { background-color: #4b5563; }
.bg-black { background-color: #000000; }

.border-2 { border-width: 2px; }
.border-blue-200 { border-color: #bbf7d0; }
.border-blue-500 { border-color: #22c55e; }
.border-l-4 { border-left-width: 4px; }

/* Border Radius */
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

/* Shadows */
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }

/* Transforms */
.transform { transform: translate(var(--tw-translate-x, 0), var(--tw-translate-y, 0)) rotate(var(--tw-rotate, 0)) skewX(var(--tw-skew-x, 0)) skewY(var(--tw-skew-y, 0)) scaleX(var(--tw-scale-x, 1)) scaleY(var(--tw-scale-y, 1)); }
.scale-110 { transform: scale(1.1); }
.-translate-x-1\/2 { --tw-translate-x: -50%; }
.-translate-y-1\/2 { --tw-translate-y: -50%; }
.-translate-y-1 { --tw-translate-y: -0.25rem; }

/* Transitions */
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }

/* Opacity */
.opacity-50 { opacity: 0.5; }
.bg-opacity-50 { background-color: rgba(0, 0, 0, 0.5); }

/* Z-index */
.z-0 { z-index: 0; }
.z-50 { z-index: 50; }

/* Pointer Events */
.pointer-events-none { pointer-events: none; }

/* Overflow */
.overflow-hidden { overflow: hidden; }

/* ============================================================================
   NeuroAge Custom Styles
   ============================================================================ */

.neuroage-primary {
    background: linear-gradient(135deg, #0d4d24 0%, #14532d 100%);
}

.neuroage-primary-dark {
    background: linear-gradient(135deg, #0a3d1c 0%, #0f4f27 100%);
}

.neuroage-card {
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

.neuroage-text-primary {
    color: #296627;
}

.neuroage-text-secondary {
    color: #64748b;
}

.neuroage-accent {
    color: #1f7a3d;
}

/* ============================================================================
   Hover States
   ============================================================================ */

.hover\:shadow-xl:hover { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }
.hover\:shadow-lg:hover { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.hover\:bg-blue-100:hover { background-color: #bbf7d0; }
.hover\:bg-gray-200:hover { background-color: #e5e7eb; }
.hover\:bg-gray-300:hover { background-color: #d1d5db; }
.hover\:bg-gray-500:hover { background-color: #6b7280; }
.hover\:bg-gray-600:hover { background-color: #4b5563; }
.hover\:text-gray-800:hover { color: #1f2937; }
.hover\:-translate-y-1:hover { transform: translateY(-0.25rem); }
.hover\:neuroage-primary-dark:hover { background: linear-gradient(135deg, #0a3d1c 0%, #0f4f27 100%); }

/* ============================================================================
   Game Canvas Container
   ============================================================================ */

.dd-game-canvas-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin-bottom: 1rem;
    aspect-ratio: 1;
    min-height: 350px;
    max-height: 600px;
}

.tt-game-canvas-container {
    position: relative;
    width: 100%;
    min-height: 400px;
    max-height: 600px;
}

/* ============================================================================
   Image Sizes
   ============================================================================ */

.dd-moon-size {
    width: 1.5rem;
    height: 1.5rem;
}

.dd-center-object-size {
    width: 6rem;
    height: 6rem;
}

.dd-choice-btn-img {
    width: 6rem;
    height: 6rem;
}

@media (min-width: 768px) {
    .dd-moon-size {
        width: 2.25rem;
        height: 2.25rem;
    }
    
    .dd-center-object-size {
        width: 8rem;
        height: 8rem;
    }
    
    .dd-choice-btn-img {
        width: 8rem;
        height: 8rem;
    }
}

/* ============================================================================
   Double Decision Game Styles
   ============================================================================ */

.dd-peripheral-position {
    width: 80px;
    height: 80px;
    min-width: 70px;
    min-height: 70px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    z-index: 10;
    position: relative;
}

.dd-peripheral-position:hover {
    background-color: rgba(34, 197, 94, 0.15);
    transform: scale(1.1);
    transition-duration: 0.5s;
}

.dd-peripheral-position.selected {
    background-color: rgba(34, 197, 94, 0.35) !important;
    transform: scale(1.2) !important;
    transition-duration: 0.5s;
}

.dd-object-visible {
    animation: ddFadeInOut 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
}

.dd-object-hidden {
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

@keyframes ddFadeInOut {
    0% { opacity: 0; transform: scale(0.5); }
    60% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

.dd-choice-btn {
    background-color: #ecfdf5;
    color: #166534;
    font-weight: 700;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 2px solid #bbf7d0;
    cursor: pointer;
}

.dd-choice-btn:hover {
    background-color: #d1fae5;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.dd-choice-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.dd-choice-btn.selected {
    background-color: #166534;
    color: #ffffff;
    transform: scale(1.1);
}

.dd-choice-btn.disabled {
    opacity: 0.5;
}

#dd-restartButton,
#dd-mainMenuButton {
    position: absolute;
    bottom: 20px;
    z-index: 5; /* Above game area but below overlays */
}

#dd-restartButton.hidden,
#dd-mainMenuButton.hidden {
    display: none;
}

.dd-theme-space {
    position: relative;
    z-index: 1;
    background-image: url('img/space-bg.png');
    background-size: cover;
  background-repeat: no-repeat;
    background-attachment: fixed;
    color: #fff;
}
.dd-theme-ocean {
    background-image: url('img/ocean-bg.jpeg');
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: #fff;
}
.dd-theme-savanna {
    background-image: url('img/savanna.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: #fff;
}
/* Game canvas container */
#dd-gameArea > div:first-child {
    position: relative;
    z-index: 1;
}

#dd-sectorSvg {
    position: absolute;
    z-index: 1;
    pointer-events: auto;
}

#dd-moon {
    z-index: 2;
    pointer-events: none;
    position: absolute;
    transition: opacity 0.2s ease;
    object-fit: contain;
}

#dd-moon.moon-visible {
    opacity: 1;
}

#dd-moon.moon-hidden {
    opacity: 0;
}

#dd-centerObject {
    z-index: 3;
    position: relative;
}

/* Center object container - ensure proper centering */
.dd-center-object-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
}

/* Buttons and HUD elements should be below game canvas */
.dd-choice-btn,
#dd-clickPrompt,
#dd-gameRestartBtn {
    position: relative;
    z-index: 0;
}

/* Confirmation Modal - ensure it's centered */
#dd-confirmModal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

#dd-confirmModal.hidden {
    display: none;
}

#tt-confirmModal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

#tt-confirmModal.hidden {
    display: none;
}

/* Back to Menu Button */
.back-to-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 0.5rem;
    color: #4b5563;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.back-to-menu-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #1f2937;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.back-to-menu-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.back-arrow {
    font-size: 1rem;
    font-weight: 600;
    transition: transform 0.2s ease;
}

.back-to-menu-btn:hover .back-arrow {
    transform: translateX(-2px);
}

.dd-sector {
        fill: rgba(255,255,255,0.18); /* light white highlight */
        stroke: rgba(255,255,255,0.7);
        stroke-width: 1.5;
        cursor: pointer;
        transition: fill 120ms ease, transform 120ms ease;
}
.dd-sector:hover {
        fill: rgba(255,255,255,0.35);
}
.dd-sector.selected {
        fill: rgba(255,255,255,0.55);
}


/* ============================================================================
   Target Tracker Game Styles
   ============================================================================ */

.tt-target-circle {
    position: absolute;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.tt-target-circle.highlight {
    animation: ttPulse 0.5s ease-in-out;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.85);
}

.tt-target-circle.selected {
    box-shadow: 0 0 25px rgba(22, 128, 61, 0.85);
    transform: scale(1.1);
}

.tt-target-circle.correct {
    background-color: #15803d !important;
    box-shadow: 0 0 30px rgba(21, 128, 61, 0.95);
    animation: ttCorrectPulse 0.5s ease-in-out;
}

.tt-target-circle.incorrect {
    background-color: #ef4444 !important;
    box-shadow: 0 0 30px rgba(239, 68, 68, 1);
    animation: ttIncorrectShake 0.5s ease-in-out;
}

.tt-target-circle.moving {
    transition: left 0.1s linear, top 0.1s linear;
}

@keyframes ttPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(34, 197, 94, 0.8); }
    50% { transform: scale(1.15); box-shadow: 0 0 30px rgba(34, 197, 94, 1); }
}

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

@keyframes ttIncorrectShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.tt-gameCanvas {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e1;
}

/* ============================================================================
   Progress Bar Styles
   ============================================================================ */

.progress-bar-container {
    width: 100%;
}

.progress-bar-wrapper {
    width: 100%;
    height: 1.5rem;
    background-color: #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 50%, #15803d 100%);
    border-radius: 0.75rem;
    transition: width 0.5s ease-in-out;
    width: 0%;
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-bar-fill.complete {
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 50%, #15803d 100%);
    animation: progress-pulse 1s ease-in-out infinite;
}

@keyframes progress-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    }
}

/* ============================================================================
   Game Container
   ============================================================================ */

.game-container {
    display: none;
}

.game-container.active {
    display: block;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

/* Button States */
.btn-pointer-auto {
    pointer-events: auto;
    cursor: pointer;
}

.btn-pointer-none {
    pointer-events: none;
}

.sector-pointer-auto {
    pointer-events: auto;
    opacity: 1;
}

.sector-pointer-none {
    pointer-events: none;
    opacity: 0.5;
}

.sector-opacity-full {
    opacity: 1;
}

.sector-opacity-half {
    opacity: 0.5;
}

.text-green-600 {
    color: #15803d;
}

.text-red-600 {
    color: #dc2626;
}

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:text-5xl { font-size: 3rem; line-height: 1; }
    .md\:text-6xl { font-size: 3.75rem; line-height: 1; }
    .md\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
    .md\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
    .md\:p-6 { padding: 1.5rem; }
}

@media (max-width: 768px) {
    .dd-peripheral-position {
        width: 60px;
        height: 60px;
        min-width: 60px;
        min-height: 60px;
    }
    .tt-target-circle {
        width: 50px !important;
        height: 50px !important;
    }
}

@media (max-width: 640px) {
    .dd-peripheral-position {
        width: 50px;
        height: 50px;
        min-width: 50px;
        min-height: 50px;
    }
    .tt-target-circle {
        width: 40px !important;
        height: 40px !important;
    }
}


