:root {
    --bg: #f8f9fc;
    --card: #ffffff;
    --border: #d1d9e6;
    --text: #1f2a44;
    --text-light: #6b7280;
    --blue: #3b82f6;
    --red: #ef4444;
    --green: #10b981;
    --gray: #9ca3af;
}

* {
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 24px 16px;
    min-height: 100vh;
    line-height: 1.5;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

h1 {
    margin: 0 0 1.2rem;
    color: #111827;
    font-size: 2.1rem;
    font-weight: 700;
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.status {
    font-size: 1.1rem;
    font-weight: 500;
}

#player {
    color: var(--text);
}

#debug-section {
    margin-top: 1.5rem;
}

#debug-display {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.92rem;
    white-space: pre-wrap;
    max-height: 320px;
    overflow-y: auto;
    display: none;
}

#debug-switch:checked ~ #debug-display {
    display: block;
}

#playground {
    width: 100%;
    height: 580px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

#playground.disabled {
    filter: grayscale(40%) brightness(85%);
}

#overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35); /* darken background slightly */
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    animation: fadeIn 0.2s ease-out;
}

.overlay-box {
    background: linear-gradient(
        145deg,
        rgba(255,255,255,0.08),
        rgba(255,255,255,0.03)
    );
    backdrop-filter: blur(10px);
    padding: 40px 50px;
    border-radius: 20px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255,255,255,0.15);
    text-align: center;
    color: #f5f5f5;
    border: 1px solid rgba(255,255,255,0.08);
    min-width: 320px;
    animation: popIn 0.25s ease-out;
}

.overlay-box h2 {
    margin-bottom: 25px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.coin-input {
    width: 120px;
    padding: 12px 16px;
    font-size: 18px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.3);
    color: white;
    text-align: center;
    outline: none;
    margin-bottom: 30px;
    transition: all 0.2s ease;
}

.coin-input:focus {
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3);
}

.overlay-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.overlay-btn {
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
}

/* Confirm Button */
.btn-confirm {
    background: linear-gradient(145deg, #4caf50, #388e3c);
    color: white;
    box-shadow: 0 6px 18px rgba(76, 175, 80, 0.4);
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(76, 175, 80, 0.6);
}

/* Cancel Button */
.btn-cancel {
    background: linear-gradient(145deg, #d32f2f, #b71c1c);
    color: white;
    box-shadow: 0 6px 18px rgba(211, 47, 47, 0.4);
}

.btn-cancel:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(211, 47, 47, 0.6);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}