:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --error: #ef4444;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 100%;
    max-width: 800px;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    font-weight: 300;
}

.canvas-container {
    position: relative;
    width: 90vw;
    height: 60vh;
    max-width: 600px;
    max-height: 600px;
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

canvas {
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
}

#instruction-overlay, #result-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#instruction-overlay p {
    color: rgba(255, 255, 255, 0.3);
    font-size: 1.5rem;
    font-weight: 500;
    user-select: none;
}

#result-overlay {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    pointer-events: auto;
    gap: 1rem;
}

.hidden {
    opacity: 0;
    pointer-events: none !important;
}

#score-text {
    font-size: 5rem;
    font-weight: 700;
    color: var(--success);
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

#feedback-text {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 80%;
    line-height: 1.5;
}

#flag-container {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 1rem 0;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.flag-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

#flag-text {
    font-size: 1.5rem;
    color: #fbbf24;
    font-weight: 700;
    font-family: monospace;
}

button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 99px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    margin-top: 1rem;
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
}

button:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(59, 130, 246, 0.4);
}

button:active {
    transform: translateY(0);
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
