/* ── Bubble Shooter — Violet Theme ── */
:root {
    --bs-accent: #8B5CF6;
    --bs-accent-light: #C4B5FD;
    --bs-accent-dark: #5B21B6;
    --bs-glow: rgba(139, 92, 246, 0.55);
    --bs-bg: #0E0820;
    --bs-surface: #1A1130;
    --bs-surface-light: #271A45;
    --bs-text: #EDE9FE;
    --bs-text-dim: #9582C0;
    --bs-gold: #FACC15;
}

.bs-layout { display: flex; justify-content: center; gap: 20px; max-width: 1200px; margin: 0 auto; padding: 20px; min-height: calc(100vh - 80px); }
.ad-slot { width: 160px; flex-shrink: 0; }
.ad-slot--left, .ad-slot--right { display: flex; align-items: flex-start; }
.ad-placeholder--vertical { width: 160px; height: 600px; background: var(--bs-surface); border: 1px dashed var(--bs-text-dim); display: flex; align-items: center; justify-content: center; color: var(--bs-text-dim); font-size: 12px; border-radius: 8px; }

#bubbleshooter-app { flex: 1; max-width: 760px; min-width: 320px; color: var(--bs-text); }

.screen { display: none; }
.screen.active { display: block; animation: bsFade 0.3s ease; }
@keyframes bsFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.bs-header { text-align: center; padding: 36px 0 24px; }
.bs-logo {
    display: inline-flex; gap: 6px; margin-bottom: 14px;
    padding: 12px; background: var(--bs-surface); border-radius: 30px;
    border: 1px solid var(--bs-surface-light);
}
.bs-orb {
    width: 22px; height: 22px; border-radius: 50%;
    box-shadow: inset 0 0 6px rgba(255,255,255,0.6), 0 0 10px currentColor;
    animation: bsFloat 2s ease-in-out infinite;
}
.bs-orb.c1 { background: radial-gradient(circle at 30% 30%, #fff, #EF4444); color: rgba(239,68,68,0.5); }
.bs-orb.c2 { background: radial-gradient(circle at 30% 30%, #fff, #3B82F6); color: rgba(59,130,246,0.5); animation-delay: 0.25s; }
.bs-orb.c3 { background: radial-gradient(circle at 30% 30%, #fff, #FACC15); color: rgba(250,204,21,0.5); animation-delay: 0.5s; }
.bs-orb.c4 { background: radial-gradient(circle at 30% 30%, #fff, #10B981); color: rgba(16,185,129,0.5); animation-delay: 0.75s; }
@keyframes bsFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

.bs-header h1 { font-family: 'Syne', sans-serif; font-size: 2.6rem; font-weight: 800; color: var(--bs-accent-light); letter-spacing: 4px; margin: 0; text-shadow: 0 0 26px var(--bs-glow); }
.subtitle { color: var(--bs-text-dim); font-size: 1rem; margin-top: 8px; }

.card { background: var(--bs-surface); border-radius: 14px; padding: 20px; margin-bottom: 16px; border: 1px solid var(--bs-surface-light); }
.card__title { font-family: 'Syne', sans-serif; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 2px; color: var(--bs-accent-light); margin-bottom: 14px; }

.difficulty-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.diff-btn { background: var(--bs-surface-light); border: 1.5px solid transparent; color: var(--bs-text); padding: 14px 8px; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; transition: transform 0.15s ease, border-color 0.15s ease; font-family: 'DM Sans', sans-serif; font-size: 0.85rem; }
.diff-btn:hover { transform: translateY(-2px); border-color: var(--bs-accent); }
.diff-btn.selected { background: linear-gradient(135deg, var(--bs-accent-dark), var(--bs-accent)); border-color: var(--bs-accent-light); box-shadow: 0 0 16px var(--bs-glow); }
.diff-icon { font-family: 'JetBrains Mono', monospace; font-size: 0.9rem; font-weight: 700; color: var(--bs-accent-light); }
.diff-btn.selected .diff-icon { color: #fff; }
.diff-desc { font-size: 0.72rem; color: var(--bs-text-dim); }
.diff-btn.selected .diff-desc { color: rgba(255,255,255,0.85); }

.bs-rules { margin: 0; padding-left: 1.1rem; color: var(--bs-text-dim); font-size: 0.92rem; line-height: 1.6; }
.bs-rules li + li { margin-top: 6px; }

.btn { font-family: 'DM Sans', sans-serif; font-weight: 600; border-radius: 10px; border: none; cursor: pointer; padding: 12px 22px; transition: transform 0.12s ease, box-shadow 0.12s ease; font-size: 0.95rem; }
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: linear-gradient(135deg, var(--bs-accent), var(--bs-accent-light)); color: #0E0820; box-shadow: 0 6px 18px var(--bs-glow); }
.btn--primary:hover { box-shadow: 0 10px 24px var(--bs-glow); }
.btn--outline { background: transparent; border: 1.5px solid var(--bs-accent); color: var(--bs-accent-light); }
.btn--outline:hover { background: rgba(139, 92, 246, 0.12); }
.btn--ghost { background: transparent; color: var(--bs-text-dim); }
.btn--ghost:hover { color: var(--bs-accent-light); }
.btn--lg { padding: 16px 36px; font-size: 1.05rem; }
.btn--sm { padding: 8px 14px; font-size: 0.85rem; }
.menu-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 18px; }

#game-hud { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; background: var(--bs-surface); padding: 14px; border-radius: 12px; border: 1px solid var(--bs-surface-light); margin-bottom: 14px; }
.hud__cell { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hud__label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--bs-text-dim); }
.hud__value { font-family: 'JetBrains Mono', monospace; font-size: 1.4rem; font-weight: 700; color: var(--bs-accent-light); }

.bs-canvas-wrap { display: flex; justify-content: center; background: var(--bs-surface); border: 1px solid var(--bs-surface-light); border-radius: 14px; padding: 12px; box-shadow: 0 12px 36px rgba(0,0,0,0.45); }
#bs-canvas { background: linear-gradient(180deg, #1A1130 0%, #2C1948 100%); border-radius: 8px; max-width: 100%; height: auto; display: block; cursor: crosshair; touch-action: none; }

.bs-actions { display: flex; justify-content: center; margin-top: 16px; }

.result-card, .lb-card { background: var(--bs-surface); border-radius: 16px; padding: 36px 28px; border: 1px solid var(--bs-surface-light); text-align: center; max-width: 480px; margin: 40px auto; box-shadow: 0 18px 36px rgba(0,0,0,0.4); }
.result-card h2 { font-family: 'Syne', sans-serif; font-size: 2rem; color: var(--bs-accent-light); letter-spacing: 4px; margin: 0 0 12px; text-shadow: 0 0 24px var(--bs-glow); }
.result-score { font-family: 'JetBrains Mono', monospace; font-size: 3rem; font-weight: 700; color: var(--bs-gold); margin: 8px 0; }
.result-detail { color: var(--bs-text-dim); font-size: 0.95rem; margin-bottom: 18px; line-height: 1.6; }
#nickname { width: 100%; padding: 12px 14px; border-radius: 10px; background: var(--bs-bg); color: var(--bs-text); border: 1.5px solid var(--bs-surface-light); font-family: 'DM Sans', sans-serif; font-size: 0.95rem; margin-bottom: 12px; box-sizing: border-box; }
#nickname:focus { outline: none; border-color: var(--bs-accent); }
.result-actions { display: flex; gap: 10px; justify-content: center; margin-bottom: 10px; }

.lb-card h2 { font-family: 'Syne', sans-serif; color: var(--bs-accent-light); letter-spacing: 4px; margin-bottom: 18px; text-shadow: 0 0 24px var(--bs-glow); }
#leaderboard-list { list-style: none; padding: 0; margin: 0 0 16px; text-align: left; counter-reset: lb; }
#leaderboard-list li { counter-increment: lb; display: flex; justify-content: space-between; padding: 10px 14px; background: var(--bs-bg); margin-bottom: 6px; border-radius: 8px; border: 1px solid var(--bs-surface-light); font-family: 'DM Sans', sans-serif; }
#leaderboard-list li::before { content: counter(lb); color: var(--bs-accent-light); font-weight: 700; margin-right: 10px; min-width: 24px; }
#leaderboard-list li:nth-child(1) { border-color: var(--bs-gold); }
#leaderboard-list li:nth-child(1)::before { color: var(--bs-gold); }
#leaderboard-list .lb-score { font-family: 'JetBrains Mono', monospace; color: var(--bs-accent-light); font-weight: 600; }

@media (max-width: 900px) {
    .bs-layout { flex-direction: column; padding: 12px; }
    .ad-slot { width: 100%; }
    .ad-placeholder--vertical { width: 100%; height: 90px; }
    .bs-header h1 { font-size: 2rem; letter-spacing: 2px; }
    #game-hud { grid-template-columns: repeat(2, 1fr); }
}
