/* ═══════════════════════════════════════════════════════════
   IRON DOME DEFENDER — Game Styles
   All classes scoped under .irondome-game to prevent collisions
   ═══════════════════════════════════════════════════════════ */

/* ─── Container ─────────────────────────────────────────── */
.irondome-game {
    position: relative;
    width: 100%;
    margin: 0 auto;
    background: #0a0a15;
    border-radius: 16px;
    overflow: hidden !important;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
/* Override arena-gaming.css flex/scroll rules on game view children */
.arena-games-dark .arena-game-view > .irondome-game {
    display: block !important;
    flex: none !important;
    min-height: auto !important;
    overflow: hidden !important;
    overflow-y: hidden !important;
}
/* Prevent the game view itself from compressing the container */
.arena-games-dark #arena-game-irondome {
    overflow: visible !important;
    overflow-y: visible !important;
}

/* ─── Canvas ────────────────────────────────────────────── */
.irondome-game #idCanvas {
    display: block;
    width: 100%;
    height: 560px;
    cursor: crosshair;
    border-radius: 16px;
}

/* ─── HUD Overlay ───────────────────────────────────────── */
.irondome-game .id-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 5;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    border-radius: 16px 16px 0 0;
    pointer-events: none;
}
.irondome-game .id-hud-left { color: #88bbff; }
.irondome-game .id-hud-center { color: #ffffff; font-size: 16px; }
.irondome-game .id-hud-right { color: #ffd700; }

/* ─── Screen Overlays ───────────────────────────────────── */
.irondome-game .id-screen {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 5, 20, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10;
    border-radius: 16px;
}
.irondome-game .id-screen-inner {
    text-align: center;
    padding: 30px 24px;
    max-width: 420px;
    width: 100%;
}

/* ─── Title / Subtitle ──────────────────────────────────── */
.irondome-game .id-title {
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: 1px;
    text-shadow: 0 0 20px rgba(68, 136, 255, 0.5);
}
.irondome-game .id-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 20px;
}
.irondome-game .id-fun-badge {
    display: inline-block;
    background: rgba(255, 200, 0, 0.15);
    color: #ffd700;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 200, 0, 0.3);
}

/* ─── Rules ─────────────────────────────────────────────── */
.irondome-game .id-rules {
    text-align: left;
    margin: 16px 0 20px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.irondome-game .id-rule {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    padding: 4px 0;
    line-height: 1.5;
}

/* ─── Stats Mini ────────────────────────────────────────── */
.irondome-game .id-stats-mini {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 16px 0;
}
.irondome-game .id-stat-item {
    text-align: center;
}
.irondome-game .id-stat-num {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
}
.irondome-game .id-stat-label {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Buttons ───────────────────────────────────────────── */
.irondome-game .id-btn {
    display: inline-block;
    padding: 12px 32px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    outline: none;
}
.irondome-game .id-btn-primary {
    background: linear-gradient(135deg, #4488ff, #2266dd);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(68, 136, 255, 0.3);
}
.irondome-game .id-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(68, 136, 255, 0.5);
}
.irondome-game .id-btn-fun {
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 20px;
    font-size: 13px;
    margin-top: 12px;
}
.irondome-game .id-btn-fun:hover {
    color: #ffd700;
    border-color: rgba(255, 200, 0, 0.4);
}

/* ─── Attempts / Limit ──────────────────────────────────── */
.irondome-game .id-attempts {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 10px;
}
.irondome-game .id-limit-msg {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
}
.irondome-game .id-limit-sub {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 16px;
}

/* ─── Wave Transition ───────────────────────────────────── */
.irondome-game .id-wave-announce {
    font-size: 42px;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 0 30px rgba(68, 136, 255, 0.6);
    animation: idWaveIn 0.5s ease-out forwards;
    letter-spacing: 3px;
}
.irondome-game .id-wave-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 10px;
    animation: idFadeIn 0.5s ease-out 0.2s both;
}

@keyframes idWaveIn {
    0% { transform: scale(0.3); opacity: 0; }
    60% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes idFadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ─── End Screen ────────────────────────────────────────── */
.irondome-game .id-end-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: 1px;
}
.irondome-game .id-end-title.id-victory {
    color: #44ff88;
    text-shadow: 0 0 20px rgba(68, 255, 136, 0.4);
}
.irondome-game .id-end-title.id-defeat {
    color: #ff4444;
    text-shadow: 0 0 20px rgba(255, 68, 68, 0.4);
}

.irondome-game .id-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}
.irondome-game .id-end-stat {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 12px 10px;
    text-align: center;
}
.irondome-game .id-end-stat.id-bonus {
    background: rgba(255, 200, 0, 0.08);
    border: 1px solid rgba(255, 200, 0, 0.15);
}
.irondome-game .id-end-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}
.irondome-game .id-end-label {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    margin-top: 3px;
}
.irondome-game .id-coin-total {
    font-size: 18px;
    color: #ffd700;
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(255, 200, 0, 0.08);
    border-radius: 10px;
    border: 1px solid rgba(255, 200, 0, 0.15);
}

/* ─── Screen Shake ──────────────────────────────────────── */
.irondome-game.id-shake {
    animation: idShake 0.3s ease-out;
}
@keyframes idShake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-4px) translateY(2px); }
    30% { transform: translateX(3px) translateY(-2px); }
    50% { transform: translateX(-2px) translateY(1px); }
    70% { transform: translateX(2px); }
}

/* ─── Coming Soon / Login ───────────────────────────────── */
.irondome-coming-soon,
.irondome-login-required {
    text-align: center;
    padding: 60px 20px;
    background: #0a0a15;
    border-radius: 16px;
    width: 100%;
    margin: 0 auto;
}
.irondome-coming-soon .coming-soon-content {
    color: #ffffff;
}
.irondome-coming-soon .coming-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
}
.irondome-coming-soon h2 {
    color: #ffffff !important;
    margin-bottom: 8px !important;
}
.irondome-coming-soon p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
}
.irondome-coming-soon .coming-sub {
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
    /* Reduce wrap padding on mobile when game is active */
    .arena-games-dark .arena-gaming-wrap.arena-game-active {
        padding: 12px 8px !important;
    }
    .irondome-game {
        border-radius: 8px;
    }
    .irondome-game #idCanvas {
        height: 65vh;
        min-height: 350px;
        border-radius: 8px;
    }
    .irondome-game .id-title {
        font-size: 22px;
    }
    .irondome-game .id-wave-announce {
        font-size: 32px;
    }
    .irondome-game .id-hud {
        padding: 8px 12px;
        font-size: 12px;
        border-radius: 8px 8px 0 0;
    }
    .irondome-game .id-btn {
        padding: 10px 24px;
        font-size: 14px;
    }
    .irondome-game .id-stats-mini {
        gap: 16px;
    }
    .irondome-game .id-stat-num {
        font-size: 18px;
    }
    .irondome-game .id-stat-grid {
        gap: 8px;
    }
    .irondome-game .id-screen {
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .arena-games-dark .arena-gaming-wrap.arena-game-active {
        padding: 8px 4px !important;
    }
    .irondome-game {
        border-radius: 4px;
    }
    .irondome-game #idCanvas {
        height: 70vh;
        min-height: 300px;
        border-radius: 4px;
    }
    .irondome-game .id-title {
        font-size: 18px;
    }
    .irondome-game .id-screen-inner {
        padding: 20px 16px;
    }
    .irondome-game .id-screen {
        border-radius: 4px;
    }
    .irondome-game .id-rules {
        padding: 10px 14px;
    }
    .irondome-game .id-rule {
        font-size: 12px;
    }
    .irondome-game .id-wave-announce {
        font-size: 26px;
    }
    .irondome-game .id-hud {
        border-radius: 4px 4px 0 0;
    }
    .irondome-game .id-end-title {
        font-size: 16px;
    }
    .irondome-game .id-stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    .irondome-game .id-end-num {
        font-size: 16px;
    }
}
