.game-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.game-modal.active {
    display: flex;
}

.game-container {
    background: #1e293b;
    border-radius: 12px;
    padding: 2rem;
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
}

.close-game {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(148, 163, 184, 0.2);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    transition: all 0.3s ease;
}

.close-game:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
}

.game-info {
    text-align: center;
    margin-bottom: 1rem;
}

.game-timer {
    font-size: 2rem;
    color: #60a5fa;
    font-weight: bold;
}

.game-image {
    position: relative;
    max-width: min(800px, 80vw);
    max-height: min(500px, 50vh);
    cursor: crosshair;
    margin-bottom: 1rem;
}

.game-canvas {
    width: 800px;
    height: 500px;
    max-width: 80vw;
    max-height: 50vh;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.bg-shapes-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.bg-shape {
    position: absolute;
    pointer-events: none;
    transition: all 0.3s ease;
}

.bg-circle {
    border-radius: 50%;
}

.bg-square {
    border-radius: 4px;
}

.bg-triangle {
    width: 0 !important;
    height: 0 !important;
    background-color: transparent !important;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 70px solid currentColor;
}

.bg-hexagon {
    clip-path: polygon(30% 0%, 70% 0%, 100% 50%, 70% 100%, 30% 100%, 0% 50%);
}

.bg-diamond {
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    transform: rotate(45deg);
}

.cat-face {
    position: absolute;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    pointer-events: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    aspect-ratio: 1;
}

.cat-face:hover {
    border-color: rgba(96, 165, 250, 0.9);
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.5);
    transform: translate(-50%, -50%) scale(1.05) !important;
}

.game-result {
    margin-top: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    position: relative;
    z-index: 10;
}

.game-result.success {
    color: #34d399;
}

.game-result.fail {
    color: #ef4444;
}

.play-again {
    margin-top: 1rem;
    margin-bottom: 1rem;
    background: rgba(96, 165, 250, 0.2);
    border: 1px solid #60a5fa;
    color: #60a5fa;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
}

.play-again:hover {
    background: rgba(96, 165, 250, 0.3);
}

.game-stats {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(148, 163, 184, 0.3);
    width: 100%;
    max-width: 600px;
}

.game-stats h3 {
    color: #60a5fa;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-item {
    background: rgba(15, 23, 42, 0.5);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    color: #94a3b8;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    color: #60a5fa;
    font-size: 1.5rem;
    font-weight: bold;
}

.reset-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.reset-difficulty-btn,
.reset-stats-btn {
    flex: 1;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.reset-difficulty-btn {
    background: rgba(251, 146, 60, 0.1);
    border-color: rgba(251, 146, 60, 0.3);
    color: #fb923c;
}

.reset-difficulty-btn:hover {
    background: rgba(251, 146, 60, 0.2);
    border-color: #fb923c;
}

.reset-stats-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.play-again:disabled {
    opacity: 0.7;
    cursor: default;
}

.difficulty-controls {
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
}

.mode-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.mode-btn {
    flex: 1;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #94a3b8;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    border-color: rgba(96, 165, 250, 0.5);
    color: #60a5fa;
}

.mode-btn.active {
    background: rgba(96, 165, 250, 0.2);
    border-color: #60a5fa;
    color: #60a5fa;
}

.difficulty-adjuster {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.difficulty-adjuster label {
    color: #94a3b8;
    font-size: 0.875rem;
}

.difficulty-controls-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
}

.difficulty-btn {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: rgba(96, 165, 250, 0.2);
    border: 1px solid rgba(96, 165, 250, 0.3);
    color: #60a5fa;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.difficulty-btn:hover:not(:disabled) {
    background: rgba(96, 165, 250, 0.3);
    border-color: #60a5fa;
}

.difficulty-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.difficulty-display {
    color: #60a5fa;
    font-size: 1.5rem;
    font-weight: bold;
    min-width: 3rem;
    text-align: center;
}

.decoy-circle {
    position: absolute;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 15;
    pointer-events: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    aspect-ratio: 1;
}

.decoy-circle:hover {
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.decoy-animated {
    animation: floatDecoy infinite ease-in-out alternate;
}

@keyframes floatDecoy {
    0% {
        transform: translate(-50%, -50%) translateX(0) translateY(0);
    }
    25% {
        transform: translate(-50%, -50%) translateX(-60px) translateY(40px);
    }
    50% {
        transform: translate(-50%, -50%) translateX(50px) translateY(-60px);
    }
    75% {
        transform: translate(-50%, -50%) translateX(-40px) translateY(-50px);
    }
    100% {
        transform: translate(-50%, -50%) translateX(60px) translateY(60px);
    }
}
