/* ============================================================
   Brick Breaker — Neon Arcade Theme
   Accent: #3b82f6 (electric blue)   Glow: #60a5fa
   Font: Syne (display) · DM Sans (body)
   ============================================================ */
.bb-layout {
    display: grid;
    grid-template-areas:
        "top top top"
        "left game right"
        "bottom bottom bottom";
    grid-template-columns: 160px 1fr 160px;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    background: #0d0d1a;
    color: #ccd6f6;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}
.bb-layout .ad-slot--top    { grid-area: top; }
.bb-layout .ad-slot--left   { grid-area: left; }
.bb-layout .ad-slot--right  { grid-area: right; }
.bb-layout .ad-slot--bottom { grid-area: bottom; }

#bb-app {
    grid-area: game;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0 20px;
    gap: 10px;
}

/* ── Canvas ── */
.bb-canvas-wrap {
    position: relative;
    line-height: 0;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    box-shadow: 0 0 40px rgba(59,130,246,0.18);
}

#gameCanvas {
    display: block;
    background: #0d0d1a;
    cursor: default;
    touch-action: none;
    max-width: 100%;
    height: auto;
    max-height: calc(100vh - 120px);
}

/* Cursor: hide only during active gameplay (toggled by JS) */
#gameCanvas.playing {
    cursor: none;
}

/* ── Volume control ── */
.bb-volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
}
.bb-volume-control input[type="range"] {
    width: 80px;
    accent-color: #3b82f6;
}

/* ── Overlay ── */
.bb-overlay {
    position: fixed; inset: 0;
    background: rgba(5,5,20,0.88);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}
.bb-overlay.hidden { display: none; }
.bb-overlay-card {
    background: linear-gradient(135deg, #0d1a2e, #0a1020);
    border: 1px solid rgba(59,130,246,0.3);
    border-radius: 14px;
    padding: 2rem 2.5rem;
    max-width: 380px; width: 90%;
    text-align: center;
    box-shadow: 0 0 50px rgba(59,130,246,0.15);
}
.bb-overlay-card h2 { font-family: 'Syne', sans-serif; color: #90caf9; font-size: 1.6rem; margin: 0 0 0.5rem; letter-spacing: 2px; }
.bb-overlay-score { font-size: 2.2rem; font-weight: 900; color: #fff; margin: 0.3rem 0; text-shadow: 0 0 20px rgba(59,130,246,0.5); }
.bb-overlay-stats { font-size: 0.82rem; color: rgba(255,255,255,0.4); margin: 0 0 1.2rem; }
.bb-nickname-row { margin-bottom: 1rem; }
.bb-nickname-row input {
    width: 100%; padding: 0.6rem 1rem; box-sizing: border-box;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.2); border-radius: 8px;
    color: #eee; font-size: 0.95rem; font-family: inherit; outline: none;
}
.bb-nickname-row input:focus { border-color: #3b82f6; }
.bb-overlay-btns { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
.bb-obtn {
    padding: 0.6rem 1.2rem; border-radius: 8px; font-family: inherit;
    font-size: 0.85rem; font-weight: 700; cursor: pointer; border: none; transition: all 0.15s;
}
.bb-obtn--primary { background: #1565c0; color: #fff; border: 1px solid #3b82f6; }
.bb-obtn--primary:hover { background: #1e88e5; }
.bb-obtn--secondary { background: #2e7d32; color: #fff; }
.bb-obtn--secondary:hover { background: #388e3c; }
.bb-obtn--ghost { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.6); border: 1px solid rgba(255,255,255,0.15); }
.bb-obtn--ghost:hover { background: rgba(255,255,255,0.12); }
.bb-obtn:disabled { opacity: 0.45; cursor: not-allowed; }
.bb-overlay-achlist { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: 0.8rem; max-height: 60px; overflow-y: auto; }
.bb-ach-badge { background: rgba(255,215,0,0.1); border: 1px solid rgba(255,215,0,0.3); border-radius: 4px; padding: 2px 7px; font-size: 0.72rem; color: #ffd700; }

/* ── Tutorial ── */
.bb-tutorial {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0,0,0,0.75);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
}
.bb-tutorial.hidden { display: none; }
.bb-tut-card {
    background: linear-gradient(135deg, #0d1a2e, #0a1020);
    border: 1px solid rgba(59,130,246,0.35);
    border-radius: 16px; padding: 2rem 2.5rem;
    max-width: 400px; width: 100%; text-align: center;
    box-shadow: 0 0 50px rgba(59,130,246,0.15);
}
.bb-tut-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.bb-tut-badge { background: rgba(59,130,246,0.15); border: 1px solid #3b82f6; border-radius: 20px; padding: 0.2rem 0.7rem; font-size: 0.7rem; color: #3b82f6; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.bb-tut-step { font-size: 0.75rem; color: rgba(255,255,255,0.4); }
.bb-tut-icon { font-size: 2.8rem; margin-bottom: 0.5rem; }
.bb-tut-title { font-family: 'Syne', sans-serif; color: #90caf9; font-size: 1.1rem; margin: 0 0 0.6rem; }
.bb-tut-body { color: rgba(255,255,255,0.65); font-size: 0.88rem; line-height: 1.6; margin: 0 0 1.5rem; }
.bb-tut-footer { display: flex; justify-content: space-between; align-items: center; }
.bb-tut-nav { display: flex; gap: 0.5rem; }
.bb-tut-btn { padding: 0.4rem 0.9rem; border-radius: 7px; font-family: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; border: none; transition: all 0.15s; }
.bb-tut-btn--primary { background: #1565c0; color: #fff; border: 1px solid #3b82f6; }
.bb-tut-btn--primary:hover { background: #1e88e5; }
.bb-tut-btn--secondary { background: transparent; color: rgba(255,255,255,0.5); border: 1px solid rgba(255,255,255,0.2); }
.bb-tut-btn--secondary:hover { color: rgba(255,255,255,0.8); }
.bb-tut-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Ad Slots ── */
.ad-slot { display: flex; align-items: center; justify-content: center; }
.ad-slot--top    { padding: 6px 0; }
.ad-slot--bottom { padding: 6px 0; }
.ad-slot--left, .ad-slot--right { padding: 8px; }
.ad-placeholder { background: #0a1020; border: 1px dashed #1a2a3a; color: #1e3050; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.ad-placeholder { width: 100%; height: 90px; }
.ad-placeholder--vertical { height: 600px; width: 140px; }

/* ── Responsive ── */
@media (max-width: 860px) {
    .bb-layout {
        grid-template-areas: "top" "game" "bottom";
        grid-template-columns: 1fr;
    }
    .ad-slot--left, .ad-slot--right { display: none; }
}
@media (max-width: 480px) {
    #gameCanvas { width: 100vw; height: auto; }
}
