@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700;900&family=Rajdhani:wght@500;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: auto;
    position: relative;
    padding: 10px;
    box-sizing: border-box;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(0, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 0, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 
            0 10px 40px rgba(255, 107, 157, 0.6),
            0 0 60px rgba(224, 86, 253, 0.4),
            inset 0 -4px 10px rgba(0, 0, 0, 0.3);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 
            0 15px 50px rgba(255, 107, 157, 0.8),
            0 0 80px rgba(224, 86, 253, 0.6),
            inset 0 -4px 10px rgba(0, 0, 0, 0.3);
    }
}

#game-container {
    width: 100%;
    max-width: 1600px;
    height: 100vh;
    max-height: 1200px;
    min-height: 600px;
    background: rgba(20, 20, 40, 0.95);
    border-radius: 40px;
    box-shadow: 
        0 0 60px rgba(0, 255, 255, 0.3),
        0 0 100px rgba(255, 0, 255, 0.2),
        inset 0 0 40px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(0, 255, 255, 0.3);
    box-sizing: border-box;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 1800px) {
    #game-container {
        max-width: 95vw;
        max-height: 95vh;
    }
}

@media (max-width: 1200px) {
    #game-container {
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 20px;
    }
}

#game-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 255, 255, 0.8) 50%, 
        transparent 100%);
    animation: scanline 4s linear infinite;
}

@keyframes scanline {
    0% { transform: translateY(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(1200px); opacity: 0; }
}

#toolbar {
    width: 100%;
    min-height: 100px;
    background: linear-gradient(135deg, 
        #ff6b9d 0%,    /* Pink */
        #c44569 15%,   /* Deep rose */
        #f39c12 30%,   /* Orange */
        #f1c40f 45%,   /* Yellow */
        #2ecc71 60%,   /* Green */
        #3498db 75%,   /* Blue */
        #9b59b6 90%,   /* Purple */
        #e056fd 100%); /* Magenta */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 40px;
    position: relative;
    border-bottom: 2px solid rgba(0, 255, 255, 0.3);
    box-shadow: 
        0 5px 30px rgba(0, 255, 255, 0.3),
        inset 0 -2px 10px rgba(0, 0, 0, 0.3);
    overflow: visible;
}

#toolbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.5) 50%,
        transparent 100%);
    animation: glow 2s ease-in-out infinite;
}

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

.score-section, .gimme-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.score-label, .gimme-label {
    font-family: 'Orbitron', monospace;
    font-size: 24px;
    font-weight: 900;
    color: #fff;
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.8),
        0 0 20px rgba(0, 255, 255, 0.6),
        0 0 30px rgba(0, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 2px;
}

#score-display {
    font-family: 'Orbitron', monospace;
    font-size: 32px;
    font-weight: 900;
    color: #00ffff;
    text-shadow: 
        0 0 15px rgba(0, 255, 255, 1),
        0 0 30px rgba(0, 255, 255, 0.8),
        0 0 45px rgba(0, 255, 255, 0.6);
    min-width: 80px;
    text-align: center;
}

.btn {
    font-family: 'Orbitron', monospace;
    padding: 12px 30px;
    background: linear-gradient(135deg, 
        #ff6b9d 0%, 
        #e056fd 50%, 
        #c471ed 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    color: white;
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 
        0 5px 20px rgba(224, 86, 253, 0.4),
        inset 0 -3px 10px rgba(0, 0, 0, 0.3);
}

.btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 10px 30px rgba(224, 86, 253, 0.6),
        0 0 40px rgba(255, 107, 157, 0.5),
        inset 0 -3px 10px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

.btn:active {
    transform: translateY(-1px) scale(1.02);
}

.timer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    padding: 10px 15px;
    border-radius: 10px;
}

.timer-label {
    font-family: 'Orbitron', monospace;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.8),
        0 0 20px rgba(0, 255, 255, 0.6);
}

#timer-display {
    font-family: 'Orbitron', monospace;
    font-size: 48px;
    font-weight: 900;
    color: #00ffff;
    text-shadow: 
        0 0 20px rgba(0, 255, 255, 1),
        0 0 40px rgba(0, 255, 255, 0.8),
        0 0 60px rgba(0, 255, 255, 0.6);
    letter-spacing: 4px;
}

#timer-display.warning {
    color: #ffaa00;
    text-shadow: 
        0 0 20px rgba(255, 170, 0, 1),
        0 0 40px rgba(255, 170, 0, 0.8);
    animation: pulse-warning 0.5s ease-in-out infinite;
}

#timer-display.danger {
    color: #ff0000;
    text-shadow: 
        0 0 20px rgba(255, 0, 0, 1),
        0 0 40px rgba(255, 0, 0, 0.8);
    animation: pulse-danger 0.3s ease-in-out infinite;
}

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

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

#start-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s, visibility 0.5s;
}

#start-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

#start-button {
    font-family: 'Orbitron', monospace;
    font-size: 32px;
    font-weight: 900;
    padding: 20px 60px;
    background: linear-gradient(135deg, #00ff00 0%, #00cc00 100%);
    border: 3px solid #fff;
    border-radius: 20px;
    color: #000;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 4px;
    box-shadow: 
        0 0 30px rgba(0, 255, 0, 0.6),
        0 10px 40px rgba(0, 255, 0, 0.4),
        inset 0 -4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

#start-button:hover {
    transform: scale(1.1);
    box-shadow: 
        0 0 50px rgba(0, 255, 0, 0.8),
        0 15px 50px rgba(0, 255, 0, 0.6),
        inset 0 -4px 10px rgba(0, 0, 0, 0.3);
}

#start-button:active {
    transform: scale(1.05);
}

#start-overlay h1 {
    font-family: 'Orbitron', monospace;
    font-size: 64px;
    font-weight: 900;
    color: #00ffff;
    text-shadow: 
        0 0 20px rgba(0, 255, 255, 1),
        0 0 40px rgba(0, 255, 255, 0.8),
        0 0 60px rgba(0, 255, 255, 0.6);
    margin-bottom: 40px;
    letter-spacing: 8px;
}

#game-area {
    position: relative;
    width: 100%;
    height: calc(100% - 100px);
}

.game-image {
    position: absolute;
    filter: blur(20px);
    transition: filter 0.5s ease;
}

.game-image.revealed {
    filter: blur(0);
}

.clickable-area {
    position: absolute;
    cursor: crosshair;
}

.clickable-area svg {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.clickable-area polygon {
    fill: rgba(0, 255, 0, 0);
    stroke: rgba(0, 255, 0, 0);
    stroke-width: 2;
    transition: all 0.3s;
}

/* Removed hover effect - polygons stay invisible until found */

.found polygon {
    fill: rgba(0, 255, 0, 0.3) !important;
    stroke: rgba(0, 255, 0, 0.8) !important;
    stroke-width: 3 !important;
}

.flash-correct {
    animation: flash-green 0.5s ease;
}

@keyframes flash-green {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(2) drop-shadow(0 0 20px #00ff00); }
}

.flash-wrong {
    animation: flash-red 0.5s ease;
}

@keyframes flash-red {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(2) drop-shadow(0 0 20px #ff0000); }
}

.level-complete, .game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid #00ffff;
    border-radius: 30px;
    padding: 60px;
    text-align: center;
    box-shadow: 
        0 0 60px rgba(0, 255, 255, 0.6),
        0 20px 80px rgba(0, 0, 0, 0.8),
        inset 0 0 40px rgba(0, 255, 255, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    z-index: 2000;
    min-width: 600px;
}

.level-complete.show, .game-over.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.level-complete h2, .game-over h2 {
    font-family: 'Orbitron', monospace;
    font-size: 48px;
    font-weight: 900;
    color: #00ffff;
    text-shadow: 
        0 0 20px rgba(0, 255, 255, 1),
        0 0 40px rgba(0, 255, 255, 0.8);
    margin-bottom: 30px;
    letter-spacing: 6px;
}

.level-complete p, .game-over p {
    font-family: 'Rajdhani', sans-serif;
    font-size: 28px;
    font-weight: 600;
    color: #fff;
    margin: 15px 0;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

#btn-gimme {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

#btn-gimme:hover {
    box-shadow: 
        0 10px 30px rgba(240, 147, 251, 0.6),
        0 0 40px rgba(245, 87, 108, 0.5);
}

.gimme-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 10px;
    position: relative;
    align-self: center;
    justify-content: center;
    min-height: 100%;
    padding: 5px 0;
}

.gimme-section .btn {
    margin-bottom: 5px;
    flex-shrink: 0;
}

.level-info {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    margin-top: 8px;
    padding: 5px 15px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 255, 0.8);
    min-width: 120px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 10;
    cursor: pointer;
    transition: all 0.3s ease;
}

.level-info:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: rgba(0, 255, 255, 1);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
}

.level-info:active {
    transform: scale(0.98);
}

.level-name {
    color: #00ffff !important;
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.8);
    letter-spacing: 1px;
    text-align: center;
    white-space: nowrap;
    overflow: visible;
    text-overflow: ellipsis;
    max-width: 200px;
    margin-bottom: 3px;
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
}

.level-counter {
    color: #00ffff;
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    font-weight: 500;
    text-shadow: 0 0 6px rgba(0, 255, 255, 0.5);
    opacity: 0.9;
}
