/* ==========================================================================
   GAUTAM MEME SOUNDBOARD • DELUXE HARDWARE SAMPLER
   Modern Arcade Streetwear Aesthetic • High-Performance UI/UX
   ========================================================================== */

:root {
    /* Base Surfaces */
    --bg-canvas: #090a0f;
    --bg-deck: #12151e;
    --bg-card: #181c28;
    --bg-card-hover: #1f2536;
    --bg-inner: #0b0d13;

    --border-subtle: #242a3c;
    --border-highlight: #3b4460;
    --border-active: #60a5fa;

    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-dim: #64748b;

    /* Theme Accent Colors */
    --pad-1-color: #f43f5e; /* Eyebrow: Magenta */
    --pad-2-color: #06b6d4; /* Papad: Cyan */
    --pad-3-color: #a855f7; /* FAAAAH: Purple */
    --pad-4-color: #f59e0b; /* Takla: Amber */
    --pad-5-color: #84cc16; /* Baigan: Lime */
    --pad-6-color: #3b82f6; /* Splendor CJ: San Andreas Blue */
    --pad-7-color: #ef4444; /* Slap: Crimson */
    --pad-8-color: #ec4899; /* Gigachad: Hot Pink */

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;

    --ease-tactile: cubic-bezier(0.2, 0.9, 0.3, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

body {
    min-height: 100vh;
    background-color: var(--bg-canvas);
    background-image: 
        radial-gradient(circle at 50% 0%, #171c2b 0%, transparent 65%),
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 28px 28px, 28px 28px;
    padding-bottom: 36px;
}

.main-wrapper {
    max-width: 1260px;
    margin: 0 auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 26px;
}

/* ==========================================================================
   Header Hardware Sampler Deck
   ========================================================================== */
.sampler-header {
    background: var(--bg-deck);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 22px 26px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

.deck-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.brand-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brand-badge-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hardware-badge {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    background: #f59e0b;
    color: #000;
    padding: 2px 7px;
    border-radius: 4px;
}

.live-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    color: #10b981;
}

.status-dot {
    width: 7px;
    height: 7px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    animation: liveBlink 1.8s ease-in-out infinite alternate;
}

@keyframes liveBlink {
    0% { opacity: 0.4; }
    100% { opacity: 1; }
}

.deck-title {
    font-size: clamp(1.7rem, 3.8vw, 2.4rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #ffffff;
    line-height: 1.15;
}

.deck-tagline {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Digital Scoreboard Unit */
.scoreboard-unit {
    background: var(--bg-inner);
    border: 2px solid #23293a;
    border-radius: 12px;
    padding: 8px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.scoreboard-title {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #f59e0b;
}

.scoreboard-display {
    display: flex;
    align-items: center;
    gap: 6px;
}

.scoreboard-digits {
    font-family: var(--font-mono);
    font-size: 1.85rem;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.1;
}

.scoreboard-icon {
    font-size: 1.2rem;
}

/* ==========================================================================
   Hardware Control Strip
   ========================================================================== */
.control-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--bg-inner);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 10px 16px;
}

.strip-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.strip-divider {
    width: 1px;
    height: 28px;
    background: #252b3d;
}

.strip-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-dim);
    letter-spacing: 0.06em;
}

/* Volume Unit */
.volume-section {
    gap: 10px;
}

.strip-btn {
    background: #1b202e;
    border: 1px solid var(--border-subtle);
    color: #ffffff;
    font-size: 1.05rem;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

@media (hover: hover) and (pointer: fine) {
    .strip-btn:hover {
        background: #272f44;
    }
}

.slider-container {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.slider-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.slider-readout {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 800;
    color: #38bdf8;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 105px;
    height: 6px;
    background: #262e42;
    border-radius: 9999px;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    background: #38bdf8;
    border: 2px solid #ffffff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
    transition: transform 0.12s ease;
}

@media (hover: hover) and (pointer: fine) {
    input[type="range"]::-webkit-slider-thumb:hover {
        transform: scale(1.2);
    }
}

/* Speed Selector Segmented Control */
.speed-selector {
    display: flex;
    align-items: center;
    background: #131722;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.speed-pill {
    background: transparent;
    border: none;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-dim);
    padding: 4px 8px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.12s ease;
}

@media (hover: hover) and (pointer: fine) {
    .speed-pill:hover {
        color: var(--text-primary);
    }
}

.speed-pill.active {
    background: #0ea5e9;
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.4);
}

/* Action Buttons */
.actions-section {
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 800;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid #2e364a;
    border-bottom: 3px solid #141722;
    cursor: pointer;
    transition: all 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
}

@media (hover: hover) and (pointer: fine) {
    .action-btn:hover {
        filter: brightness(1.1);
    }
}

.action-btn:active {
    transform: translateY(2px);
    border-bottom-width: 1px;
}

.key-hint {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    padding: 1px 4px;
    margin-left: 2px;
}

.roast-action {
    background: #2b1f0c;
    border-color: #634313;
    color: #fbbf24;
}

.chaos-action {
    background: #2e1117;
    border-color: #5c1c28;
    color: #f87171;
}

.random-action {
    background: #182233;
    border-color: #2b3b57;
    color: #60a5fa;
}

.stop-action {
    background: #1b1e28;
    border-color: #31374a;
    color: #e2e8f0;
}

@media (hover: hover) and (pointer: fine) {
    .roast-action:hover {
        background: #3d2b10;
        border-color: #f59e0b;
    }

    .chaos-action:hover {
        background: #42161f;
        border-color: #ef4444;
    }

    .stop-action:hover {
        border-color: #ef4444;
        color: #ef4444;
    }
}

/* ==========================================================================
   8 Sound Pads Grid
   ========================================================================== */
.pads-container {
    width: 100%;
}

.pads-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    width: 100%;
}

/* Pad Shell */
.sound-pad {
    position: relative;
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    border-bottom: 5px solid #0f121a;
    border-radius: var(--radius-lg);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    transition: transform 0.12s var(--ease-tactile), border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
    touch-action: manipulation;
}

@media (hover: hover) and (pointer: fine) {
    .sound-pad:hover {
        background: var(--bg-card-hover);
        border-color: var(--border-highlight);
    }
}

.sound-pad:active,
.sound-pad.pressed {
    transform: translateY(3px) scale(0.985);
    border-bottom-width: 2px;
}

/* Per Pad Colors */
.pad-1 { --accent: var(--pad-1-color); }
.pad-2 { --accent: var(--pad-2-color); }
.pad-3 { --accent: var(--pad-3-color); }
.pad-4 { --accent: var(--pad-4-color); }
.pad-5 { --accent: var(--pad-5-color); }
.pad-6 { --accent: var(--pad-6-color); }
.pad-7 { --accent: var(--pad-7-color); }
.pad-8 { --accent: var(--pad-8-color); }

.sound-pad.playing {
    border-color: var(--accent);
    box-shadow: 0 0 22px var(--accent), inset 0 0 10px rgba(255, 255, 255, 0.05);
}

/* Pad Meta Header */
.pad-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pad-number {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-dim);
}

.sound-length {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.04);
    padding: 1px 6px;
    border-radius: 4px;
}

.hotkey-pill kbd {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 800;
    background: #0d0f17;
    color: #ffffff;
    border: 1px solid #333a4f;
    border-radius: 4px;
    padding: 2px 6px;
}

/* Image Frame: 100% UNCONSTRAINED FULL FIT */
.pad-image-box {
    position: relative;
    width: 100%;
    height: 220px;
    background: #090b10;
    border: 1px solid #202636;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pad-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: transform 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .sound-pad:hover .pad-img {
        transform: scale(1.03);
    }
}

/* Active Playing Badge */
.playing-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    background: var(--accent);
    color: #000;
    padding: 2px 7px;
    border-radius: 4px;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
}

.sound-pad.playing .playing-badge {
    opacity: 1;
    transform: scale(1);
}

/* Equalizer Dancing Animation */
.equalizer-anim {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 20px;
    background: rgba(0, 0, 0, 0.75);
    padding: 3px 6px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.sound-pad.playing .equalizer-anim {
    opacity: 1;
}

.equalizer-anim span {
    width: 3px;
    height: 4px;
    background-color: var(--accent);
    border-radius: 2px;
}

.sound-pad.playing .equalizer-anim span:nth-child(1) { animation: eqBounce 0.4s ease infinite alternate; }
.sound-pad.playing .equalizer-anim span:nth-child(2) { animation: eqBounce 0.3s ease infinite alternate 0.1s; }
.sound-pad.playing .equalizer-anim span:nth-child(3) { animation: eqBounce 0.5s ease infinite alternate 0.2s; }
.sound-pad.playing .equalizer-anim span:nth-child(4) { animation: eqBounce 0.35s ease infinite alternate 0.05s; }

@keyframes eqBounce {
    0% { height: 4px; }
    100% { height: 16px; }
}

/* Pad Text Info */
.pad-text-block {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.pad-title {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.25;
}

.pad-sub {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Trigger Button */
.pad-trigger-btn {
    width: 100%;
    margin-top: auto;
    padding: 11px 12px;
    background: #11141e;
    border: 2px solid var(--accent);
    border-bottom: 4px solid var(--accent);
    border-radius: var(--radius-md);
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    user-select: none;
    -webkit-user-select: none;
    transition: all 0.08s ease;
}

@media (hover: hover) and (pointer: fine) {
    .pad-trigger-btn:hover {
        background: var(--accent);
        color: #000;
    }
}

.sound-pad.pressed .pad-trigger-btn,
.pad-trigger-btn:active {
    transform: translateY(2px);
    border-bottom-width: 2px;
    background: var(--accent);
    color: #000;
}

.btn-state-icon {
    font-size: 0.78rem;
    opacity: 0.9;
}

/* Pad Progress Fill Line */
.pad-progress-bar {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: var(--accent);
    border-radius: 9999px;
    transition: width 0.08s linear;
}

/* ==========================================================================
   Hotkey Legend Bar
   ========================================================================== */
.hotkey-bar {
    background: #10141f;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.hotkey-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 800;
    color: #f59e0b;
}

.hotkey-tags {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.hotkey-tags span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.hotkey-tags kbd {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 800;
    background: #181d2c;
    border: 1px solid #333d54;
    padding: 2px 5px;
    border-radius: 4px;
    color: #fff;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
    padding-top: 10px;
    border-top: 1px solid #1e2434;
}

.footer-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-note {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 500;
}

.footer-reset-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-dim);
    font-size: 0.75rem;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    .footer-reset-btn:hover {
        color: #ffffff;
        border-color: #ffffff;
    }
}

/* ==========================================================================
   Roast Toast Banner
   ========================================================================== */
.roast-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    max-width: 440px;
    background: #facc15;
    color: #000000;
    border: 3px solid #000000;
    box-shadow: 6px 6px 0 #000000;
    border-radius: 10px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.25s var(--ease-tactile);
}

.roast-toast.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.toast-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toast-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.toast-close {
    background: transparent;
    border: none;
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
    color: #000;
    padding: 0 4px;
}

.toast-body {
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.35;
}

/* Screen Shake Effect */
.screen-shake {
    animation: arcadeShake 0.3s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes arcadeShake {
    10%, 90% { transform: translate3d(-3px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-5px, 0, 0); }
    40%, 60% { transform: translate3d(5px, 0, 0); }
}

/* ==========================================================================
   Mobile Quick-Action Thumb Dock
   ========================================================================== */
.mobile-dock {
    display: none;
}

/* ==========================================================================
   Responsive Breakpoints & Mobile Optimization
   ========================================================================== */
@media (max-width: 1080px) {
    .pads-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .pad-image-box {
        height: 200px;
    }
}

@media (max-width: 768px) {
    body {
        padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    }

    .main-wrapper {
        padding: 12px 10px;
        gap: 14px;
    }

    /* Ultra-Compact Sampler Header on Mobile */
    .sampler-header {
        padding: 12px 12px 10px 12px;
        border-radius: 12px;
        gap: 10px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    }

    .deck-top-row {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        flex-wrap: nowrap;
    }

    .brand-block {
        gap: 2px;
        min-width: 0;
    }

    .brand-badge-row {
        gap: 6px;
    }

    .hardware-badge {
        font-size: 0.62rem;
        padding: 1px 5px;
    }

    .live-status {
        font-size: 0.62rem;
    }

    .deck-title {
        font-size: clamp(1.1rem, 4.8vw, 1.45rem);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Hide long tagline on mobile so pads are immediately visible */
    .deck-tagline {
        display: none;
    }

    /* Digital Scoreboard Unit - Compact */
    .scoreboard-unit {
        padding: 4px 10px;
        border-radius: 8px;
        flex-shrink: 0;
    }

    .scoreboard-title {
        font-size: 0.55rem;
    }

    .scoreboard-digits {
        font-size: 1.25rem;
    }

    .scoreboard-icon {
        font-size: 0.95rem;
    }

    /* Hardware Control Strip - Mobile Single-Bar */
    .control-strip {
        padding: 6px 10px;
        gap: 8px;
        flex-wrap: nowrap;
        justify-content: space-between;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .control-strip::-webkit-scrollbar {
        display: none;
    }

    /* Hide bulky desktop action buttons from header - moved to mobile dock! */
    .actions-section,
    .strip-divider {
        display: none;
    }

    .volume-section {
        flex-shrink: 0;
        gap: 6px;
    }

    .volume-section .strip-btn {
        padding: 5px 8px;
        font-size: 0.95rem;
    }

    .slider-header .strip-label {
        display: none;
    }

    .slider-readout {
        font-size: 0.7rem;
    }

    input[type="range"] {
        width: 65px;
        height: 5px;
    }

    input[type="range"]::-webkit-slider-thumb {
        width: 14px;
        height: 14px;
    }

    .speed-section {
        flex-shrink: 0;
        gap: 3px;
    }

    .speed-section .strip-label {
        display: none;
    }

    .speed-selector {
        padding: 2px;
        gap: 1px;
    }

    .speed-pill {
        font-size: 0.66rem;
        padding: 3px 6px;
    }

    /* 2 Columns on Mobile - Thumb-Playable */
    .pads-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .sound-pad {
        padding: 9px 8px 8px 8px;
        border-radius: 12px;
        gap: 7px;
    }

    .pad-meta-row {
        gap: 4px;
    }

    .pad-number {
        font-size: 0.65rem;
    }

    .sound-length {
        font-size: 0.62rem;
        padding: 1px 4px;
    }

    /* Keyboard hotkeys irrelevant on touch mobile */
    .hotkey-pill {
        display: none;
    }

    .pad-image-box {
        height: clamp(130px, 34vw, 160px);
        border-radius: 8px;
    }

    .playing-badge {
        top: 6px;
        left: 6px;
        font-size: 0.58rem;
        padding: 1px 5px;
    }

    .equalizer-anim {
        bottom: 6px;
        right: 6px;
        height: 15px;
        padding: 2px 4px;
        gap: 2px;
    }

    .equalizer-anim span {
        width: 2.5px;
    }

    .pad-title {
        font-size: 0.88rem;
        line-height: 1.2;
    }

    .pad-sub {
        font-size: 0.68rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Big thumb-friendly pad trigger button (min 44px) */
    .pad-trigger-btn {
        min-height: 44px;
        padding: 8px 6px;
        font-size: 0.76rem;
        border-radius: 8px;
        gap: 5px;
    }

    .btn-sound-name {
        font-size: 0.74rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Hide keyboard shortcuts legend on mobile */
    .hotkey-bar {
        display: none;
    }

    /* Mobile Quick-Action Thumb Dock */
    .mobile-dock {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: rgba(14, 17, 24, 0.94);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid #283147;
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.6);
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)) 12px;
    }

    .dock-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-height: 46px;
        padding: 5px 4px;
        border-radius: 10px;
        border: 1px solid var(--border-subtle);
        background: #181d2a;
        color: #ffffff;
        cursor: pointer;
        user-select: none;
        -webkit-user-select: none;
        touch-action: manipulation;
        transition: transform 0.08s ease, background 0.1s ease;
    }

    .dock-btn:active {
        transform: scale(0.92);
    }

    .dock-icon {
        font-size: 1.15rem;
        line-height: 1;
    }

    .dock-label {
        font-family: var(--font-mono);
        font-size: 0.64rem;
        font-weight: 800;
        letter-spacing: 0.04em;
    }

    .dock-stop {
        border-color: #551e24;
        background: #241317;
        color: #fca5a5;
    }
    .dock-stop:active {
        background: #ef4444;
        color: #fff;
    }

    .dock-random {
        border-color: #1e3a5f;
        background: #111d30;
        color: #93c5fd;
    }
    .dock-random:active {
        background: #3b82f6;
        color: #fff;
    }

    .dock-chaos {
        border-color: #552b14;
        background: #241710;
        color: #fdba74;
    }
    .dock-chaos:active,
    .dock-chaos.active-chaos {
        background: #f97316;
        color: #fff;
        box-shadow: 0 0 12px rgba(249, 115, 22, 0.6);
    }

    .dock-roast {
        border-color: #59420b;
        background: #2b200b;
        color: #fde047;
    }
    .dock-roast:active {
        background: #f59e0b;
        color: #000;
    }

    /* Mobile Roast Toast: Slides down from TOP like Dynamic Island / Push banner */
    .roast-toast {
        top: max(12px, env(safe-area-inset-top, 0px));
        bottom: auto;
        left: 12px;
        right: 12px;
        max-width: none;
        transform: translateY(-30px);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8), 4px 4px 0 #000;
        padding: 12px 14px;
        gap: 6px;
    }

    .roast-toast.visible {
        transform: translateY(0);
    }

    .toast-body {
        font-size: 0.88rem;
    }

    .footer-wrap {
        justify-content: center;
        text-align: center;
        gap: 10px;
    }

    .footer-note {
        font-size: 0.75rem;
    }
}

/* Extra Compact Phones (iPhone SE, Galaxy Z Fold Cover, width <= 380px) */
@media (max-width: 380px) {
    .pads-grid {
        gap: 8px;
    }

    .sound-pad {
        padding: 8px 6px 7px 6px;
        gap: 5px;
    }

    .pad-image-box {
        height: 125px;
    }

    .pad-title {
        font-size: 0.82rem;
    }

    .pad-sub {
        font-size: 0.64rem;
    }

    .pad-trigger-btn {
        min-height: 40px;
        padding: 7px 4px;
        font-size: 0.72rem;
    }

    .btn-sound-name {
        font-size: 0.7rem;
    }

    .dock-btn {
        min-height: 42px;
        padding: 4px 2px;
    }

    .dock-icon {
        font-size: 1rem;
    }

    .dock-label {
        font-size: 0.58rem;
    }
}