body {
    margin: 0;
    padding: 0;
    background-color: #1e293b;
    background-image: radial-gradient(#334155 1px, transparent 1px);
    background-size: 20px 20px;
    font-family: 'Nunito', sans-serif;
    color: #f8fafc;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

#game-container {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(10px);
    border: 2px solid #334155;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#header {
    width: 800px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

h1 {
    font-family: 'Fredoka One', cursive;
    margin: 0;
    color: #38bdf8;
    font-size: 2.5rem;
    text-shadow: 3px 3px 0px #0284c7;
    letter-spacing: 1px;
}

.subtitle {
    margin: 5px 0 0 0;
    color: #94a3b8;
    font-size: 0.95rem;
    font-weight: 700;
}

#stats {
    display: flex;
    gap: 15px;
}

.stat-box {
    background: #0f172a;
    border: 2px solid #334155;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 800;
    color: #e2e8f0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

#scoreVal {
    color: #f59e0b;
}

#opsProcessedVal {
    color: #ef4444;
}

#canvas-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 4px solid #475569;
}

canvas {
    background-color: #f1f5f9;
    cursor: crosshair;
    display: block;
}

#toolbar {
    width: 800px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #0f172a;
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid #334155;
    box-sizing: border-box;
}

.toolbar-label {
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    font-size: 0.9rem;
    margin-right: 10px;
}

.tool {
    background-color: #334155;
    color: white;
    border: none;
    padding: 10px 18px;
    font-size: 1.05rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: 'Nunito', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 0 #1e293b;
}

.tool:hover {
    background-color: #475569;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #1e293b;
}

.tool.active {
    background-color: #38bdf8;
    color: #0f172a;
    transform: translateY(2px);
    box-shadow: 0 2px 0 #0284c7;
}

.tool:active:not(.active) {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #1e293b;
}

.icon {
    font-size: 1.2rem;
}

.hint {
    margin-left: auto;
    font-size: 0.9rem;
    color: #f59e0b;
    font-weight: 700;
    font-style: italic;
}

#game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.hidden {
    display: none !important;
}

#end-title {
    font-family: 'Fredoka One', cursive;
    color: #f59e0b;
    font-size: 4rem;
    margin: 0 0 10px 0;
    text-shadow: 4px 4px 0px #b45309;
}

.end-desc {
    font-size: 1.2rem;
    color: #cbd5e1;
    margin-bottom: 20px;
}

.final-score-box {
    background: #1e293b;
    border: 3px solid #38bdf8;
    padding: 15px 30px;
    font-size: 1.8rem;
    font-weight: 900;
    border-radius: 12px;
    color: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    margin-bottom: 30px;
}

#final-score {
    color: #10b981;
}

#restart-btn {
    background-color: #10b981;
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 1.5rem;
    font-weight: 900;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Nunito', sans-serif;
    box-shadow: 0 6px 0 #047857;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#restart-btn:hover {
    background-color: #34d399;
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #047857;
}

#restart-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #047857;
}
