/* ==========================================================================
   🦕 DYNOMITE! EGG SHOOTER - STYLESHEET
   Dedicated standalone stylesheet harmonized with TODesign & Article Content Width
   ========================================================================== */

.dynomite-wrapper {
    margin: 32px auto 28px auto;
    width: 100%;
    max-width: 100%; /* Match exact article width */
    font-family: 'Outfit', 'Roboto', 'Trebuchet MS', sans-serif;
    user-select: none;
    -webkit-user-select: none;
    box-sizing: border-box;
}

.detail-content > .dynomite-wrapper:last-child,
.detail-content > p:last-child > .dynomite-wrapper,
#retro-game-container:last-child .dynomite-wrapper {
    margin-bottom: 56px;
}

/* Outer Stone Ruin Frame */
.dynomite-frame {
    background: radial-gradient(circle at 50% 20%, #2b3038 0%, #171a1f 100%);
    border-radius: 20px;
    padding: 20px;
    border: 3px solid #4a3e2c;
    box-shadow: 
        0 16px 40px rgba(0, 0, 0, 0.6),
        inset 0 2px 4px rgba(255, 255, 255, 0.1),
        inset 0 -4px 10px rgba(0, 0, 0, 0.8);
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
}

/* Header & Banner */
.dynomite-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, #3d3121 0%, #241c12 100%);
    border: 2px solid #6b573c;
    border-radius: 12px;
    padding: 10px 16px;
    margin-bottom: 16px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.dynomite-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dynomite-title {
    font-size: 1.4rem;
    font-weight: 900;
    color: #f8d84d;
    letter-spacing: 2px;
    margin: 0;
    text-transform: uppercase;
    text-shadow: 2px 2px 0 #8b4513, -1px -1px 0 #000;
}

.dynomite-subtitle {
    font-size: 0.75rem;
    color: #bfa888;
    font-weight: 700;
    letter-spacing: 1px;
}

.dynomite-sys-btns {
    display: flex;
    gap: 8px;
}

.dynomite-btn-sys {
    background: linear-gradient(180deg, #574632 0%, #362a1c 100%);
    color: #ffebad;
    border: 1px solid #8c7150;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 0 #1f170e;
    transition: all 0.15s ease;
}

.dynomite-btn-sys:hover {
    background: linear-gradient(180deg, #6e5940 0%, #473827 100%);
    color: #fff;
}

.dynomite-btn-sys:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #1f170e;
}

/* Main Layout: Sidebar HUD + Game Canvas */
.dynomite-body {
    display: flex;
    gap: 16px;
    align-items: stretch;
}

/* Stone Sidebar HUD */
.dynomite-sidebar {
    width: 170px;
    min-width: 170px;
    background: linear-gradient(180deg, #23272e 0%, #15181e 100%);
    border: 2px solid #4a3e2c;
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.6);
}

.dynomite-hud-box {
    background: #101216;
    border: 1px solid #3d3426;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 10px;
    text-align: center;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.7);
}

.dynomite-hud-label {
    font-size: 9px;
    font-weight: 800;
    color: #a89476;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.dynomite-hud-val {
    font-family: 'Courier New', monospace;
    font-size: 1.25rem;
    font-weight: 900;
    color: #5cf84d;
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(92, 248, 77, 0.4);
}

.dynomite-danger-meter {
    background: #1a0000;
    border: 1px solid #731e1e;
    border-radius: 6px;
    height: 12px;
    overflow: hidden;
    margin-top: 4px;
    position: relative;
}

.dynomite-danger-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff9900, #ff2200);
    transition: width 0.3s ease;
}

/* Cute Turtle Character Frame */
.dynomite-character-frame {
    background: radial-gradient(circle, #3d4632 0%, #1a2115 100%);
    border: 3px solid #e74c3c;
    border-radius: 50%;
    width: 72px;
    height: 72px;
    margin: 8px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    box-shadow: 0 0 14px rgba(231, 76, 60, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

/* Playfield Canvas Container */
.dynomite-canvas-container {
    flex: 1;
    position: relative;
    background: #0f140d;
    border: 3px solid #4a3e2c;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
}

#dynomite-canvas {
    display: block;
    width: 100%;
    max-width: 520px;
    height: auto;
    background: transparent;
    cursor: crosshair;
}

/* Overlay Screen (Start / Game Over / Paused) */
.dynomite-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 20, 13, 0.88);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    text-align: center;
    padding: 20px;
}

.dynomite-overlay-title {
    font-size: 1.8rem;
    font-weight: 900;
    color: #f8d84d;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
    text-shadow: 0 4px 10px rgba(248, 216, 77, 0.4);
}

.dynomite-overlay-desc {
    font-size: 0.9rem;
    color: #d1c4b0;
    margin-bottom: 16px;
}

.dynomite-overlay-btn {
    background: linear-gradient(180deg, #f8d84d 0%, #d4aa1c 100%);
    color: #1a1c21;
    border: none;
    padding: 10px 24px;
    font-size: 1rem;
    font-weight: 900;
    border-radius: 24px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(248, 216, 77, 0.4);
    transition: transform 0.15s ease;
}

.dynomite-overlay-btn:hover {
    transform: scale(1.06);
}

/* Mobile & Touch Controls Bar */
.dynomite-touch-controls {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.25);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #3d3426;
}

.dynomite-touch-group {
    display: flex;
    gap: 8px;
}

.dynomite-touch-btn {
    background: linear-gradient(180deg, #444c59 0%, #2b3038 100%);
    color: #fff;
    border: 1px solid #616b7c;
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 0 #181b20;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.dynomite-touch-btn:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #181b20;
}

.dynomite-touch-fire {
    background: linear-gradient(180deg, #e74c3c 0%, #c0392b 100%);
    border-color: #f1948a;
    box-shadow: 0 4px 0 #7b241c;
    flex: 1;
    font-size: 1rem;
    letter-spacing: 1px;
}

.dynomite-touch-fire:active {
    box-shadow: 0 1px 0 #7b241c;
}

.dynomite-hint {
    text-align: center;
    font-size: 0.8rem;
    color: #9a8a75;
    margin-top: 10px;
}

.dynomite-hud-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ==========================================================================
   📱 RESPONSIVE MOBILE OPTIMIZATIONS (< 640px)
   ========================================================================== */
@media (max-width: 640px) {
    .dynomite-frame {
        padding: 10px;
        border-radius: 14px;
    }

    /* Header 2-line layout on mobile */
    .dynomite-header {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 10px 8px;
        margin-bottom: 10px;
    }

    .dynomite-title-group {
        justify-content: center;
    }

    .dynomite-title {
        font-size: 1.15rem;
        letter-spacing: 1px;
    }

    .dynomite-subtitle {
        display: none;
    }

    .dynomite-sys-btns {
        width: 100%;
        display: flex;
        justify-content: center;
        gap: 6px;
    }

    .dynomite-btn-sys {
        flex: 1;
        padding: 6px 4px;
        font-size: 10px;
        text-align: center;
        white-space: nowrap;
    }

    .dynomite-body {
        flex-direction: column;
        gap: 10px;
    }

    .dynomite-sidebar {
        width: 100%;
        min-width: 100%;
        padding: 8px;
        box-sizing: border-box;
    }

    /* 2x2 Grid Layout for Stats Boxes on Mobile */
    .dynomite-hud-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }

    .dynomite-hud-box {
        margin-bottom: 0;
        padding: 6px 8px;
    }

    .dynomite-hud-label {
        font-size: 8.5px;
    }

    .dynomite-hud-val {
        font-size: 1.1rem;
    }

    .dynomite-character-frame {
        display: none;
    }

    .dynomite-hint {
        display: none;
    }

    /* Compact Touch Buttons for Mobile Screens */
    .dynomite-touch-controls {
        margin-top: 10px;
        padding: 8px 10px;
        gap: 8px;
    }

    .dynomite-touch-group {
        gap: 6px;
    }

    .dynomite-touch-btn {
        padding: 8px 10px;
        font-size: 0.85rem;
        border-radius: 8px;
        box-shadow: 0 2px 0 #181b20;
    }

    .dynomite-touch-fire {
        padding: 8px 12px;
        font-size: 0.9rem;
        box-shadow: 0 2px 0 #7b241c;
    }
}
