.game-nav { display: flex; justify-content: space-between; align-items: center; padding: 16px 32px; margin: 20px auto; max-width: 800px; width: 95%; }
.nav-back { color: var(--text-secondary); text-decoration: none; font-weight: 600; transition: color 0.3s; }
.nav-back:hover { color: var(--text-primary); }
.nav-title { font-size: 1.25rem; font-weight: 800; }

.game-container { display: flex; flex-direction: column; align-items: center; margin: 20px auto; padding: 0 20px; width: 100%; }

.game-header { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 480px; padding: 16px 24px; margin-bottom: 24px; gap: 8px;}
.stat-box { display: flex; align-items: center; gap: 8px; background: var(--surface-color); padding: 8px 16px; border-radius: 8px; border: 1px solid var(--glass-border); }
.stat-value { font-family: monospace; font-size: 1.5rem; color: var(--text-primary); font-weight: 800; }

.next-fruit-box { display: flex; align-items: center; justify-content: center; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--glass-border); background: var(--surface-color); }

.board-wrapper {
    position: relative;
    padding: 16px;
    background: var(--surface-color);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 16px;
    max-width: 100%;
    width: 100%;
}

#canvas-container {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 2 / 3;
    max-height: 65vh;
    margin: 0 auto;
    position: relative; 
    border-bottom: 8px solid var(--glass-border);
    border-left: 8px solid var(--glass-border);
    border-right: 8px solid var(--glass-border);
    border-radius: 4px 4px 12px 12px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    background: #0f172a; 
    touch-action: none;
    cursor: crosshair;
}

#canvas-container canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}

/* The overflow line visually */
.danger-line {
    position: absolute;
    top: 90px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--danger-color);
    opacity: 0.3;
    z-index: 10;
    pointer-events: none;
    border-top: 2px dashed var(--danger-color);
}
.danger-line.pulse {
    animation: flash 0.5s infinite alternate;
}

@keyframes flash {
    from { opacity: 0.3; }
    to { opacity: 1; box-shadow: 0 0 10px var(--danger-color); }
}

.overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.90);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    border-radius: 14px;
}
.overlay.hidden { display: none !important; }
