/* ═══════════════════════════════════════════════════════════════
   LORCANA BOMBER — Stylesheet
   ═══════════════════════════════════════════════════════════════ */

/* ─── Modal Overlay ─────────────────────────────────────────── */
.bomber-modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(8px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.bomber-modal-overlay.active { display: flex; align-items: flex-start; justify-content: center; }

.bomber-modal {
    width: 100%; max-width: 820px; margin: auto;
    background: #0f172a; border-radius: 12px;
    border: 1px solid #334155; overflow: hidden;
    box-shadow: 0 0 60px rgba(251,191,36,0.08);
    display: flex; flex-direction: column;
    max-height: 95vh;
}
.bomber-header { flex-shrink: 0; }
.bomber-screen { overflow-y: auto; flex: 1; min-height: 0; }

/* ─── Header ────────────────────────────────────────────────── */
.bomber-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; background: #1e293b;
    border-bottom: 1px solid #334155;
}
.bomber-title {
    font-size: 1.1rem; font-weight: 700; color: #fbbf24;
    display: flex; align-items: center; gap: 8px;
    margin: 0;
}
.bomber-title-icon { font-size: 1.4rem; }
.bomber-close {
    background: none; border: none; color: #94a3b8; cursor: pointer;
    font-size: 1.5rem; line-height: 1; padding: 4px 8px; border-radius: 6px;
    touch-action: manipulation;
}
.bomber-close:hover { background: #334155; color: #fff; }

/* ─── Screens ───────────────────────────────────────────────── */
.bomber-screen {
    padding: 24px; text-align: center; color: #e2e8f0;
}
.bomber-screen h2 {
    color: #fbbf24; margin: 0 0 20px; font-size: 1.5rem;
}

/* ─── Menu Screen ───────────────────────────────────────────── */
.bomber-menu-actions {
    display: flex; flex-direction: column; gap: 12px;
    max-width: 320px; margin: 0 auto;
}
.bomber-btn {
    padding: 14px 24px; border: none; border-radius: 8px;
    font-size: 1rem; font-weight: 600; cursor: pointer;
    transition: all 0.15s;
    touch-action: manipulation; -webkit-tap-highlight-color: rgba(251,191,36,0.2);
}
.bomber-btn-primary {
    background: #fbbf24; color: #0f172a;
}
.bomber-btn-primary:hover { background: #f59e0b; transform: translateY(-1px); }
.bomber-btn-secondary {
    background: #334155; color: #e2e8f0;
}
.bomber-btn-secondary:hover { background: #475569; }
.bomber-join-row {
    display: flex; gap: 8px;
}
.bomber-join-input {
    flex: 1; padding: 12px 14px; border: 1px solid #475569; border-radius: 8px;
    background: #1e293b; color: #fff; font-size: 1rem; font-family: monospace;
    text-transform: uppercase; letter-spacing: 2px; text-align: center;
}
.bomber-join-input::placeholder { color: #64748b; letter-spacing: 1px; text-transform: none; }
.bomber-join-input:focus { border-color: #fbbf24; outline: none; }
.bomber-join-error {
    color: #ef4444; font-size: 0.85rem; margin-top: 4px; display: none;
}

/* ─── Lobby Screen ──────────────────────────────────────────── */
.bomber-lobby-code {
    font-family: monospace; font-size: 2rem; font-weight: 700;
    color: #fbbf24; letter-spacing: 4px; margin: 8px 0 20px;
    background: #1e293b; padding: 8px 20px; border-radius: 8px;
    display: inline-block; border: 1px solid #334155;
    user-select: all;
}
.bomber-lobby-label { color: #94a3b8; font-size: 0.85rem; }

.bomber-slots {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
    margin: 16px 0;
}
.bomber-slot {
    padding: 12px 8px; border-radius: 8px; border: 2px solid;
    background: #1e293b; text-align: center;
    transition: all 0.2s;
}
.bomber-slot-filled { background: #1e293b; }
.bomber-slot-empty { opacity: 0.5; }
.bomber-slot-icon {
    display: inline-flex; width: 28px; height: 28px;
    border-radius: 50%; color: #fff; font-weight: 700;
    align-items: center; justify-content: center; font-size: 0.85rem;
    margin-bottom: 4px;
}
.bomber-slot-name { display: block; font-size: 0.8rem; color: #e2e8f0; margin-top: 2px; }
.bomber-slot-ready { color: #22c55e; font-weight: 700; margin-left: 4px; }
.bomber-slot-you { color: #fbbf24; font-size: 0.7rem; display: block; }

/* Selection sections */
.bomber-pick-section {
    margin: 16px 0; text-align: left;
}
.bomber-pick-label {
    color: #94a3b8; font-size: 0.8rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px;
}
.bomber-pick-grid {
    display: flex; gap: 8px; flex-wrap: wrap;
}
.bomber-map-btn, .bomber-item-btn, .bomber-skill-btn {
    padding: 10px 14px; border: 1px solid #334155; border-radius: 8px;
    background: #1e293b; color: #e2e8f0; cursor: pointer;
    font-size: 0.85rem; transition: all 0.15s; flex: 1; min-width: 0;
    text-align: center;
}
.bomber-map-btn:hover, .bomber-item-btn:hover, .bomber-skill-btn:hover {
    border-color: #fbbf24; background: #1a2744;
}
.bomber-map-btn.active, .bomber-item-btn.active, .bomber-skill-btn.active {
    border-color: #fbbf24; background: #422006; color: #fbbf24;
}
.bomber-map-btn:disabled { opacity: 0.5; cursor: default; }
.bomber-pick-icon { display: block; font-size: 1.3rem; margin-bottom: 2px; }
.bomber-pick-name { display: block; font-weight: 600; font-size: 0.8rem; }
.bomber-pick-desc { display: block; font-size: 0.65rem; color: #94a3b8; margin-top: 2px; }

/* Character skin picker */
.bomber-skin-grid {
    display: flex; gap: 6px; flex-wrap: wrap;
}
.bomber-skin-card {
    display: flex; flex-direction: column; align-items: center;
    padding: 6px; border: 2px solid #334155; border-radius: 8px;
    background: #1e293b; cursor: pointer; transition: all 0.15s;
    width: 64px; min-width: 64px; outline: none;
    -webkit-tap-highlight-color: transparent;
}
.bomber-skin-card:hover { border-color: #64748b; background: #1a2744; }
.bomber-skin-card.active { border-color: #fbbf24; background: #422006; box-shadow: 0 0 8px rgba(251,191,36,0.35); }
.bomber-skin-card.active:hover { border-color: #fbbf24; }
.bomber-skin-card canvas, .bomber-skin-card img { display: block; image-rendering: pixelated; }
.bomber-skin-card .bomber-skin-name {
    font-size: 0.6rem; color: #94a3b8; margin-top: 4px; text-align: center;
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.bomber-skin-card.active .bomber-skin-name { color: #fbbf24; }

/* Item2 consumable slot */
.bomber-item2-row { margin-top: 6px; }
.bomber-item2-selected {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; background: #1e293b; border: 1px solid #334155;
    border-radius: 8px; min-height: 38px;
}
.bomber-item2-selected.has-item { border-color: #7dd3fc; background: rgba(125,211,252,0.06); }
.bomber-item2-none { color: #475569; font-size: 0.8rem; font-style: italic; }
.bomber-item2-icon { font-size: 1.2rem; }
.bomber-item2-name { font-weight: 600; font-size: 0.82rem; color: #e2e8f0; }
.bomber-item2-qty { font-size: 0.7rem; color: #64748b; }
.bomber-item2-remove {
    margin-left: auto; background: none; border: none;
    color: #ef4444; cursor: pointer; font-size: 0.9rem; padding: 2px 6px;
}
.bomber-item2-add {
    margin-top: 6px; padding: 8px 14px; width: 100%;
    border: 1px dashed #475569; border-radius: 8px;
    background: transparent; color: #94a3b8; cursor: pointer;
    font-size: 0.82rem; font-weight: 600; transition: all 0.2s;
}
.bomber-item2-add:hover { border-color: #7dd3fc; color: #7dd3fc; background: rgba(125,211,252,0.04); }

/* Inventory slide-up panel */
.bomber-inventory-panel {
    position: absolute; left: 0; right: 0; bottom: 0;
    background: #0f172a; border-top: 2px solid #7dd3fc;
    border-radius: 12px 12px 0 0; padding: 0;
    max-height: 0; overflow: hidden; opacity: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease;
    z-index: 10;
}
.bomber-inventory-panel.open {
    max-height: 300px; opacity: 1; padding: 14px 16px 16px;
}
.bomber-inventory-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px; color: #e2e8f0; font-weight: 700; font-size: 0.9rem;
}
.bomber-inventory-close {
    background: none; border: none; color: #94a3b8;
    cursor: pointer; font-size: 1rem; padding: 2px 6px;
}
.bomber-inventory-close:hover { color: #ef4444; }
.bomber-inventory-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px; max-height: 220px; overflow-y: auto;
}
.bomber-inv-item {
    padding: 10px; border: 1px solid #334155; border-radius: 8px;
    background: #1e293b; cursor: pointer; transition: all 0.15s;
    text-align: center;
}
.bomber-inv-item:hover { border-color: #7dd3fc; background: #1a2744; }
.bomber-inv-item-icon { font-size: 1.3rem; display: block; }
.bomber-inv-item-name { font-weight: 600; font-size: 0.78rem; color: #e2e8f0; display: block; margin-top: 2px; }
.bomber-inv-item-qty { font-size: 0.7rem; color: #7dd3fc; display: block; }
.bomber-inv-empty { color: #475569; font-size: 0.82rem; padding: 20px; grid-column: 1 / -1; text-align: center; }

/* Ready button */
.bomber-ready-row { margin-top: 20px; }
.bomber-btn-ready {
    padding: 14px 40px; font-size: 1.1rem; border-radius: 10px;
    border: 2px solid #fbbf24; background: transparent; color: #fbbf24;
    font-weight: 700; cursor: pointer; transition: all 0.2s;
    touch-action: manipulation;
}
.bomber-btn-ready:hover { background: #fbbf24; color: #0f172a; }
.bomber-btn-ready.active { background: #22c55e; border-color: #22c55e; color: #fff; }
.bomber-lobby-status { color: #94a3b8; font-size: 0.85rem; margin-top: 8px; }

/* ─── Canvas ────────────────────────────────────────────────── */
.bomber-canvas-wrap {
    position: relative; display: flex; justify-content: center;
    background: #0a0a1a; overflow: hidden;
    touch-action: none; -webkit-user-select: none; user-select: none;
}
.bomber-canvas-wrap canvas {
    display: block; max-width: 100%;
    image-rendering: pixelated; image-rendering: crisp-edges;
}

/* ─── Countdown (rendered on canvas now) ────────────────────── */
.bomber-countdown {
    display: none;
}
.bomber-countdown-num {
    display: none;
}

/* ─── HUD ───────────────────────────────────────────────────── */
.bomber-hud {
    display: none; padding: 8px 16px;
    background: #1e293b; border-top: 1px solid #334155;
    flex-wrap: wrap; gap: 12px; align-items: center;
    justify-content: space-between;
}
.bomber-hud-group {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.85rem; color: #e2e8f0;
}
.bomber-hud-label {
    color: #64748b; font-size: 0.7rem; text-transform: uppercase;
    font-weight: 600; letter-spacing: 0.5px;
}
.bomber-timer { font-family: monospace; font-size: 1.1rem; font-weight: 700; color: #fbbf24; }
.bomber-timer-warn { color: #ef4444; animation: bomberBlink 0.5s infinite; }
@keyframes bomberBlink { 50% { opacity: 0.4; } }

.bomber-mode-indicator {
    padding: 3px 10px; border-radius: 4px;
    font-weight: 700; font-size: 0.85rem;
    background: #334155; color: #e2e8f0;
}
.bomber-mode-item { background: #422006; color: #fbbf24; }

/* HUD items row */
.bomber-hud-items {
    display: flex; gap: 6px; align-items: center;
}
.bomber-hud-item-slot {
    display: inline-block; padding: 2px 8px; border-radius: 4px;
    font-size: 0.82rem; font-weight: 600; color: #e2e8f0;
    background: rgba(0,0,0,0.3); border: 1px solid #334155;
    min-width: 54px; text-align: center;
}

/* ─── Shop Screen ───────────────────────────────────────────── */
.bomber-shop-balance {
    font-size: 1.2rem; font-weight: 700; color: #7dd3fc;
    background: rgba(125,211,252,0.08); border: 1px solid rgba(125,211,252,0.15);
    padding: 8px 20px; border-radius: 10px; display: inline-block;
    margin-bottom: 16px;
}
.bomber-shop-tabs {
    display: flex; gap: 6px; justify-content: center; margin-bottom: 16px;
}
.bomber-shop-tab {
    padding: 8px 16px; border: 1px solid #334155; border-radius: 8px;
    background: #1e293b; color: #94a3b8; cursor: pointer;
    font-size: 0.85rem; font-weight: 600; transition: all 0.15s;
}
.bomber-shop-tab:hover { border-color: #fbbf24; color: #e2e8f0; }
.bomber-shop-tab.active { background: #422006; border-color: #fbbf24; color: #fbbf24; }
.bomber-shop-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px; text-align: left;
}
.bomber-shop-item {
    padding: 14px; border: 1px solid #334155; border-radius: 10px;
    background: #1e293b; transition: all 0.2s;
}
.bomber-shop-item:hover { border-color: rgba(125,211,252,0.3); transform: translateY(-1px); }
.bomber-shop-item-head {
    display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.bomber-shop-item-icon { font-size: 1.4rem; }
.bomber-shop-item-name { font-weight: 700; color: #e2e8f0; font-size: 0.9rem; }
.bomber-shop-item-desc { font-size: 0.75rem; color: #64748b; margin-bottom: 10px; }
.bomber-shop-item-foot {
    display: flex; align-items: center; justify-content: space-between;
}
.bomber-shop-price { font-weight: 700; color: #7dd3fc; font-size: 0.85rem; }
.bomber-shop-buy-btn {
    padding: 5px 14px; border: 1px solid #fbbf24; border-radius: 6px;
    background: transparent; color: #fbbf24; font-weight: 700;
    font-size: 0.78rem; cursor: pointer; transition: all 0.15s;
}
.bomber-shop-buy-btn:hover { background: #fbbf24; color: #0f172a; }
.bomber-shop-buy-btn:disabled { opacity: 0.4; cursor: default; }
.bomber-shop-buy-btn:disabled:hover { background: transparent; color: #fbbf24; }
.bomber-shop-owned {
    padding: 5px 14px; border-radius: 6px;
    background: rgba(34,197,94,0.15); color: #22c55e;
    font-size: 0.78rem; font-weight: 700; border: 1px solid rgba(34,197,94,0.2);
}
.bomber-shop-qty {
    color: #38bdf8; font-size: 0.8rem; font-weight: 700;
}

/* ─── Leaderboard Screen ───────────────────────────────────── */
.bomber-leader-list {
    max-width: 460px; margin: 0 auto; text-align: left;
}
.bomber-leader-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; margin: 4px 0; border-radius: 8px;
    background: #1e293b; transition: background 0.15s;
}
.bomber-leader-row:hover { background: #1a2744; }
.bomber-leader-row.bomber-leader-me {
    background: #1a2744; border: 1px solid rgba(251,191,36,0.2);
    box-shadow: 0 0 12px rgba(251,191,36,0.08);
}
.bomber-leader-pos {
    width: 32px; text-align: center; font-weight: 800;
    font-size: 1rem; color: #64748b; flex-shrink: 0;
}
.bomber-leader-row:nth-child(1) .bomber-leader-pos { color: #fbbf24; font-size: 1.2rem; }
.bomber-leader-row:nth-child(2) .bomber-leader-pos { color: #94a3b8; font-size: 1.1rem; }
.bomber-leader-row:nth-child(3) .bomber-leader-pos { color: #cd7f32; font-size: 1.1rem; }
.bomber-leader-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: #334155; display: flex; align-items: center;
    justify-content: center; overflow: hidden; flex-shrink: 0;
    font-weight: 700; font-size: 0.8rem; color: #e2e8f0;
}
.bomber-leader-avatar img { width: 100%; height: 100%; object-fit: cover; }
.bomber-leader-name { flex: 1; font-weight: 600; color: #e2e8f0; font-size: 0.88rem; }
.bomber-leader-stats {
    display: flex; gap: 12px; font-size: 0.75rem; color: #64748b; flex-shrink: 0;
}
.bomber-leader-elo { font-weight: 700; color: #fbbf24; font-size: 0.85rem; }
.bomber-leader-wr { color: #7dd3fc; }

/* ─── Results Screen ────────────────────────────────────────── */
.bomber-rankings { max-width: 360px; margin: 0 auto; }
.bomber-rank-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; margin: 6px 0; border-radius: 8px;
    background: #1e293b;
}
.bomber-rank-me { background: #1a2744; box-shadow: 0 0 10px rgba(251,191,36,0.15); }
.bomber-rank-medal { font-size: 1.5rem; }
.bomber-rank-name { flex: 1; font-weight: 600; color: #e2e8f0; text-align: left; }
.bomber-rank-gold { color: #fbbf24; font-weight: 700; }
.bomber-results-actions {
    display: flex; gap: 10px; justify-content: center; margin-top: 20px;
}

/* ─── Mobile Controls ───────────────────────────────────────── */
.bomber-controls {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    padding: 12px 16px 20px; z-index: 10001;
    background: linear-gradient(transparent, rgba(15,23,42,0.95));
    justify-content: space-between; align-items: flex-end;
}
.bomber-thumbstick-zone {
    width: 140px; height: 140px; flex-shrink: 0;
}
.bomber-thumbstick-canvas {
    width: 100%; height: 100%; border-radius: 50%;
    touch-action: none;
}
.bomber-mobile-btns {
    display: flex; flex-direction: column; gap: 6px;
}
.bomber-mobile-btn {
    padding: 10px 14px; border: 1px solid #475569; border-radius: 10px;
    background: rgba(30,41,59,0.9); color: #e2e8f0;
    font-size: 0.8rem; font-weight: 600; cursor: pointer;
    touch-action: manipulation; user-select: none;
    min-width: 72px; text-align: center;
}
.bomber-mobile-btn:active { background: #334155; border-color: #fbbf24; }
.bomber-mobile-btn:disabled { opacity: 0.35; }
.bomber-btn-bomb { border-color: #ef4444; color: #fcd34d; }
.bomber-btn-bomb:active { background: rgba(239,68,68,0.2); }
.bomber-btn-item1 { border-color: #fbbf24; color: #fbbf24; }
.bomber-btn-item1.bomber-btn-active { background: rgba(251,191,36,0.15); }
.bomber-btn-item2 { border-color: #38bdf8; color: #38bdf8; }
.bomber-btn-item2.bomber-btn-active { background: rgba(56,189,248,0.15); }

/* ─── Key hints ─────────────────────────────────────────────── */
.bomber-keys-hint {
    display: flex; gap: 12px; justify-content: center;
    margin-top: 8px; flex-wrap: wrap;
}
.bomber-keys-hint span {
    font-size: 0.72rem; color: #64748b;
}
.bomber-keys-hint kbd {
    display: inline-block; padding: 1px 5px;
    background: #334155; border-radius: 3px;
    font-family: monospace; font-size: 0.7rem; color: #94a3b8;
    border: 1px solid #475569;
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .bomber-modal { max-width: 100%; margin: 0; border-radius: 0; height: 100vh; height: 100dvh; max-height: none; }
    .bomber-slots { grid-template-columns: repeat(2, 1fr); }
    .bomber-controls { display: flex; }
    .bomber-hud { font-size: 0.75rem; padding: 6px 10px; }
    .bomber-pick-grid { flex-wrap: wrap; }
    .bomber-map-btn, .bomber-item-btn, .bomber-skill-btn { min-width: 45%; }
    .bomber-keys-hint { display: none; }
}

@media (hover: none) and (pointer: coarse) {
    .bomber-controls { display: flex; }
    .bomber-keys-hint { display: none; }
}
