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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow: hidden;
    background: #000;
}

.container {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

h1 {
    font-size: 3rem;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    color: #2c3e50;
}

.counter-display {
    font-size: 4rem;
    text-align: center;
    margin: 2rem 0;
    font-weight: bold;
    color: #2c3e50;
}

.blink-counter {
    transition: all 0.3s ease;
}

.blink-counter.blink-animation {
    transform: scale(1.2);
    color: #ffeb3b;
    text-shadow: 0 0 30px rgba(255, 235, 59, 0.8);
}

.status {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 100;
}

.controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 8px;
}

button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background-color: #3498db;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #2980b9;
}

button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.camera-container {
    max-width: 640px;
    margin: 2rem auto;
    position: relative;
}

video {
    width: 100%;
    border-radius: 8px;
    background-color: #000;
}

.error {
    color: #e74c3c;
    text-align: center;
    margin: 1rem 0;
}

.info {
    text-align: center;
    margin: 2rem 0;
    color: #666;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    color: #666;
    margin-bottom: 0.5rem;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

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

/* Back Link */
.back-link {
    margin-bottom: 2rem;
}

.back-link a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.back-link a:hover {
    text-decoration: underline;
}

.back-link--overlay {
    position: fixed;
    top: 12px;
    left: 16px;
    z-index: 200;
    margin-bottom: 0;
}

.back-link--overlay a {
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 12px;
    border-radius: 4px;
    font-family: sans-serif;
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .controls {
        flex-direction: column;
    }
    
    button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .counter-display {
        font-size: 4rem;
    }
    
    button {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
}

/* Eye Tracking Styles */
.tracking-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto;
}

.image-container, .heatmap-container {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#heatmap {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
}

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

/* Fullscreen container */
.fullscreen-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Cityscape image */
#cityscape {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Overlay canvas */
#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}