/* ========================================
   TESTANDO O MOUSE - GAME CSS
   Jogo de Coordenação Motora
   Layout 2026 Compatible
   ======================================== */

:root {
    --target-red: #FF6B6B;
    --target-blue: #4ECDC4;
    --target-yellow: #FFE66D;
    --target-green: #95E1D3;
    --target-purple: #A8E6CF;
    --target-orange: #FFB347;
    
    --game-primary: #4ECDC4;
    --game-secondary: #FF6B6B;
    --game-accent: #FFE66D;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* ========================================
   GAME CONTAINER
   ======================================== */

.game-container {
    position: relative;
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
    border-radius: 20px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: var(--shadow-lg);
    min-height: 600px;
    overflow: hidden;
}

/* Permite scroll na tela de resultado (mobile) */
.game-container.showing-results {
    overflow-y: auto;
    overflow-x: hidden;
    min-height: unset;
}

/* Fullscreen Button */
.fullscreen-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    z-index: 1000;
}

.fullscreen-btn:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.fullscreen-btn svg {
    color: #44A08D;
    transition: transform 0.3s ease;
}

.fullscreen-btn:hover svg {
    transform: rotate(90deg);
}

/* ========================================
   LEVEL SELECTION
   ======================================== */

.level-selection {
    text-align: center;
    padding: 20px;
    animation: fadeIn 0.5s ease;
}

.level-title {
    font-family: var(--font-primary);
    font-size: 36px;
    font-weight: 800;
    color: white;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.level-subtitle {
    font-family: var(--font-secondary);
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
}

.level-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.level-card {
    background: white;
    border-radius: 20px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.level-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--game-primary), var(--game-secondary));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.level-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.level-card:hover::before {
    transform: scaleX(1);
}

.level-icon {
    font-size: 60px;
    margin-bottom: 15px;
    animation: bounce 1s ease-in-out infinite;
}

.level-card:nth-child(2) .level-icon {
    animation-delay: 0.2s;
}

.level-card:nth-child(3) .level-icon {
    animation-delay: 0.4s;
}

.level-name {
    font-family: var(--font-primary);
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 15px 0 10px;
}

.level-description {
    font-family: var(--font-secondary);
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
}

.level-age {
    font-size: 20px;
    margin: 10px 0;
}

.level-info {
    font-family: var(--font-secondary);
    font-size: 14px;
    color: #999;
    font-style: italic;
}

/* ========================================
   GAME PLAY
   ======================================== */

.game-play {
    position: relative;
    animation: fadeIn 0.5s ease;
}

.game-header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.game-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-family: var(--font-secondary);
    font-size: 14px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-family: var(--font-primary);
    font-size: 32px;
    font-weight: 800;
    color: #44A08D;
    line-height: 1;
}

.stat-value.warning {
    color: #FF6B6B;
    animation: pulse 0.5s ease;
}

/* Game Area - Where targets appear */
.game-area {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    min-height: 500px;
    overflow: hidden;
    cursor: none; /* Hide default cursor */
}

/* Custom Crosshair Cursor */
.crosshair {
    position: absolute;
    width: 30px;
    height: 30px;
    pointer-events: none;
    z-index: 100;
    /* Sem transition para acompanhar o cursor em tempo real */
    transform: translate(-50%, -50%); /* Centraliza o crosshair no ponto do cursor */
}

.crosshair::before,
.crosshair::after {
    content: '';
    position: absolute;
    background: rgba(255, 107, 107, 0.8);
}

.crosshair::before {
    width: 2px;
    height: 30px;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}

.crosshair::after {
    width: 30px;
    height: 2px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.crosshair.active {
    transform: translate(-50%, -50%) scale(0.8);
}

/* Target Styling */
.target {
    position: absolute;
    border-radius: 50%;
    cursor: none; /* Mantém crosshair customizado sobre os alvos */
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-primary);
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3),
                inset -5px -5px 15px rgba(0, 0, 0, 0.2),
                inset 5px 5px 15px rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
    animation: targetAppear 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.target:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

/* Target Colors */
.target.red {
    background: radial-gradient(circle at 30% 30%, #FFB8B8, var(--target-red));
}

.target.blue {
    background: radial-gradient(circle at 30% 30%, #A8E6E2, var(--target-blue));
}

.target.yellow {
    background: radial-gradient(circle at 30% 30%, #FFF4B8, var(--target-yellow));
}

.target.green {
    background: radial-gradient(circle at 30% 30%, #D4F1E8, var(--target-green));
}

.target.purple {
    background: radial-gradient(circle at 30% 30%, #E0F5E5, var(--target-purple));
}

.target.orange {
    background: radial-gradient(circle at 30% 30%, #FFD8A8, var(--target-orange));
}

/* Target Number */
.target-number {
    font-size: 24px;
    pointer-events: none;
}

/* Hit Animation */
@keyframes targetHit {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5) rotate(180deg);
        opacity: 0.5;
    }
    100% {
        transform: scale(0) rotate(360deg);
        opacity: 0;
    }
}

.target.hitting {
    animation: targetHit 0.4s ease-out forwards;
    pointer-events: none;
}

/* Miss Feedback */
.miss-feedback {
    position: absolute;
    font-family: var(--font-primary);
    font-size: 20px;
    font-weight: 700;
    color: #FF6B6B;
    pointer-events: none;
    animation: fadeUp 1s ease-out forwards;
    z-index: 50;
}

@keyframes fadeUp {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-50px);
        opacity: 0;
    }
}

/* Hit Particles */
.hit-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 60;
}

@keyframes particleExplosion {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

.hit-particle {
    animation: particleExplosion 0.6s ease-out forwards;
}

/* Target Appear Animation */
@keyframes targetAppear {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.btn-action {
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 700;
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-pause {
    background: #FFE66D;
    color: #333;
}

.btn-pause:hover {
    background: #FFD93D;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-quit {
    background: #FF6B6B;
    color: white;
}

.btn-quit:hover {
    background: #FF5252;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========================================
   RESULT SCREEN
   ======================================== */

.result-screen {
    text-align: center;
    padding: 40px 20px;
    animation: zoomIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.result-icon {
    font-size: 100px;
    margin-bottom: 20px;
    animation: bounce 1s ease-in-out infinite;
}

.result-title {
    font-family: var(--font-primary);
    font-size: 42px;
    font-weight: 800;
    color: white;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.result-message {
    font-family: var(--font-secondary);
    font-size: 20px;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 40px;
    line-height: 1.6;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.result-stat {
    background: white;
    border-radius: 15px;
    padding: 25px 15px;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
}

.result-stat:hover {
    transform: translateY(-5px);
}

.result-stat-label {
    font-family: var(--font-secondary);
    font-size: 14px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.result-stat-value {
    font-family: var(--font-primary);
    font-size: 36px;
    font-weight: 800;
    color: #44A08D;
    line-height: 1;
}

.result-medal {
    font-size: 80px;
    margin: 30px 0;
    animation: rotate 2s linear infinite;
}

.result-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 40px;
}

.btn-restart {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    color: white;
}

.btn-restart:hover {
    background: linear-gradient(135deg, #44A08D, #4ECDC4);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-levels {
    background: white;
    color: #44A08D;
}

.btn-levels:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========================================
   ANIMATIONS
   ======================================== */

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

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

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .game-container {
        padding: 20px;
        min-height: 500px;
    }

    .level-title {
        font-size: 28px;
    }

    .level-subtitle {
        font-size: 16px;
    }

    .level-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .level-icon {
        font-size: 50px;
    }

    .game-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-value {
        font-size: 24px;
    }

    .game-area {
        min-height: 400px;
    }

    .result-title {
        font-size: 32px;
    }

    .result-message {
        font-size: 16px;
    }

    .result-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .result-stat {
        padding: 20px 10px;
    }

    .result-stat-value {
        font-size: 28px;
    }

    .fullscreen-btn {
        width: 45px;
        height: 45px;
        top: 15px;
        right: 15px;
    }

    .crosshair {
        width: 25px;
        height: 25px;
    }

    .crosshair::before {
        height: 25px;
    }

    .crosshair::after {
        width: 25px;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 15px;
        border-radius: 15px;
    }

    .level-title {
        font-size: 24px;
    }

    .level-card {
        padding: 25px 15px;
    }

    .level-icon {
        font-size: 40px;
    }

    .level-name {
        font-size: 20px;
    }

    .game-header {
        padding: 15px;
    }

    .stat-label {
        font-size: 11px;
    }

    .stat-value {
        font-size: 20px;
    }

    .game-area {
        min-height: 350px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-action {
        width: 100%;
        justify-content: center;
    }

    .result-screen {
        padding: 20px 12px;
    }

    .result-icon {
        font-size: 52px;
        margin-bottom: 10px;
    }

    .result-title {
        font-size: 26px;
        margin-bottom: 8px;
    }

    .result-message {
        font-size: 14px;
        margin-bottom: 16px;
    }

    .result-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin: 16px 0;
    }

    .result-stat {
        padding: 14px 8px;
        border-radius: 12px;
    }

    .result-stat-label {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .result-stat-value {
        font-size: 26px;
    }

    .result-medal {
        font-size: 44px;
        margin: 14px 0;
    }

    .result-buttons {
        flex-direction: column;
        margin-top: 16px;
        gap: 10px;
    }

    .btn-action {
        padding: 15px 25px;
    }

    .crosshair {
        width: 20px;
        height: 20px;
    }

    .crosshair::before {
        height: 20px;
    }

    .crosshair::after {
        width: 20px;
    }
}

/* ========================================
   PAUSED STATE
   ======================================== */

.game-area.paused {
    filter: blur(5px);
    pointer-events: none;
}

.pause-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

.pause-overlay h3 {
    font-family: var(--font-primary);
    font-size: 32px;
    font-weight: 800;
    color: #44A08D;
    margin-bottom: 20px;
}

.pause-overlay button {
    margin: 10px;
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.target:focus {
    outline: 3px solid #FFE66D;
    outline-offset: 5px;
}

.btn-action:focus {
    outline: 3px solid white;
    outline-offset: 3px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .target {
        border: 3px solid black;
    }
    
    .stat-value {
        font-weight: 900;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01s !important;
    }
    
    .game-area {
        cursor: crosshair !important;
    }
    
    .crosshair {
        display: none;
    }
}
