/* ===================================
   BLOOMSCROLL MAIN CSS
   Consolidated Production Styles
   =================================== */

/* ===================================
   1. CSS VARIABLES & RESET
   =================================== */
:root {
    /* Colors */
    --color-bg: #000000;
    --color-text: #f4f1e8;
    --color-text-muted: #9e9b89;
    --color-accent: #ff5722;
    --color-border: rgba(244, 241, 232, 0.1);
    --color-border-hover: rgba(244, 241, 232, 0.2);

    /* Safe areas for mobile devices */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
}

/* PWA Standalone Mode Specific */
@media (display-mode: standalone) {
    :root {
        --safe-area-bottom: max(env(safe-area-inset-bottom, 0px), 20px);
    }
}

/* ===================================
   2. BASE STYLES
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Berkeley Mono', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, monospace;
    background: var(--color-bg);
    color: var(--color-text);
    overflow: hidden; /* No scrolling needed - single screen app */
    position: relative;
    width: 100vw;
    height: 100vh;
    touch-action: manipulation; /* Allow taps but prevent zoom/pan */
}

/* PWA Standalone Mode */
body.pwa-standalone {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===================================
   3. CANVAS CONTAINER
   =================================== */
#p5js-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center; /* Always center */
    z-index: 1;
    touch-action: manipulation; /* Allow taps on the container */
    pointer-events: auto; /* Ensure it receives events */
}

#p5js-container canvas {
    /* Let p5.js control canvas dimensions */
    display: block;
    /* Smooth vertical movement transition */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center center;
    touch-action: manipulation; /* Allow taps on canvas */
    pointer-events: auto; /* Ensure canvas receives events */
    cursor: pointer; /* Show it's clickable */
}

/* ===================================
   4. CONTROL PANEL - MOBILE FIRST
   =================================== */
.control-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 40vh; /* Optimal height - golden ratio inspired */
    max-height: none;
    transform: translateY(calc(100% - 70px)); /* Collapsed shows buttons lifted from bottom */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: #000000;
    backdrop-filter: none; /* Remove any backdrop blur effects */
    -webkit-backdrop-filter: none;
    overflow: hidden;
    will-change: transform;
}

.control-panel.expanded {
    transform: translateY(0);
}

/* PWA Standalone Mode Adjustments */
body.pwa-standalone .control-panel {
    bottom: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===================================
   5. BUTTON BAR & PANEL HANDLE
   =================================== */

/* Button bar container - holds all three buttons */
.button-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    height: 40px;
    padding: 0;
    position: relative;
    z-index: 10;
}

/* Side buttons (save and t-shirt) */
.bar-button {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: rgba(244, 241, 232, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 0;
    position: relative;
}

/* Button icons - minimalist glyphs */
.button-icon {
    font-size: 22px;
    line-height: 1;
    font-family: 'Berkeley Mono', monospace;
    font-weight: 400;
    transform-origin: center;
    transition: all 0.3s ease;
}

/* Save button specific */
.save-button .button-icon {
    font-size: 24px;
    transform: rotate(0deg);
}

/* T-shirt button specific */
.tshirt-button .button-icon {
    font-size: 20px;
}

/* Hover effects */
.bar-button:hover {
    color: rgba(244, 241, 232, 0.65);
}

.bar-button:hover .button-icon {
    transform: scale(1.1);
    text-shadow: 0 0 8px rgba(244, 241, 232, 0.3);
}

.save-button:hover .button-icon {
    transform: scale(1.1) rotate(0deg);
}

/* Active state */
.bar-button:active .button-icon {
    transform: scale(0.9);
}

/* Panel Handle - now part of button bar */
.panel-handle {
    position: relative;
    height: 40px;
    background: transparent;
    border-top: none;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    touch-action: manipulation;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    padding: 10px;
    overflow: hidden;
    min-width: 60px;
}

/* All panel gradients disabled for clean look */

/* Designer Diamond Glyph */
.handle-indicator {
    /* Reset previous styles */
    width: auto;
    height: auto;
    background: transparent;
    border-radius: 0;

    /* Diamond glyph styling */
    font-size: 22px; /* Perfect size for diamond */
    color: rgba(244, 241, 232, 0.4);
    line-height: 1;
    user-select: none;
    position: relative;

    /* Multi-layered glow for depth */
    text-shadow:
        0 0 3px rgba(244, 241, 232, 0.25),    /* Core glow */
        0 0 8px rgba(244, 241, 232, 0.12),    /* Inner halo */
        0 0 16px rgba(244, 241, 232, 0.06),   /* Outer halo */
        0 1px 2px rgba(0, 0, 0, 0.4);         /* Depth shadow */

    /* Smooth animations with spring physics feel */
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
    transform: rotate(0deg) scale(1);
}

/* Diamond sparkle animation */
@keyframes diamond-sparkle {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.05); /* No rotation */
        filter: brightness(1.2);
    }
}

/* Hover state: elegant rotation and enhanced glow */
.panel-handle:hover .handle-indicator {
    color: rgba(244, 241, 232, 0.65);
    text-shadow:
        0 0 6px rgba(244, 241, 232, 0.4),
        0 0 12px rgba(244, 241, 232, 0.2),
        0 0 20px rgba(244, 241, 232, 0.1),
        0 2px 3px rgba(0, 0, 0, 0.3);
    transform: rotate(15deg) scale(1.08);
}

/* Active/click state: diamond flash animation */
.panel-handle:active .handle-indicator {
    color: rgba(244, 241, 232, 0.8);
    text-shadow:
        0 0 8px rgba(244, 241, 232, 0.6),
        0 0 16px rgba(244, 241, 232, 0.3),
        0 0 24px rgba(244, 241, 232, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.4);
    transform: scale(1.15); /* No rotation */
    animation: diamond-sparkle 0.6s ease-out;
}

/* Expanded state: rotate symbol slightly for visual feedback */
.control-panel.expanded .handle-indicator {
    color: rgba(244, 241, 232, 0.7);
    text-shadow:
        0 0 10px rgba(244, 241, 232, 0.4),
        0 0 16px rgba(244, 241, 232, 0.2),
        0 0 24px rgba(244, 241, 232, 0.1);
    transform: rotate(180deg);
}

/* Subtle breathing animation for discoverability (optional - remove if too much) */
@keyframes gentle-pulse {
    0%, 100% {
        text-shadow:
            0 0 8px rgba(244, 241, 232, 0.3),
            0 0 12px rgba(244, 241, 232, 0.15),
            0 0 16px rgba(244, 241, 232, 0.08);
    }
    50% {
        text-shadow:
            0 0 12px rgba(244, 241, 232, 0.4),
            0 0 16px rgba(244, 241, 232, 0.2),
            0 0 24px rgba(244, 241, 232, 0.1);
    }
}

/* Apply gentle pulse only when panel is closed (for discoverability) */
.control-panel:not(.expanded) .handle-indicator {
    animation: gentle-pulse 3s ease-in-out infinite;
}

/* Pause animation on interaction */
.panel-handle:hover .handle-indicator,
.panel-handle:active .handle-indicator {
    animation: none;
}

/* ===================================
   6. PANEL CONTENT
   =================================== */
.panel-content {
    padding: 16px 20px 24px;
    height: calc(100% - 40px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    max-width: 100%;
    box-sizing: border-box;
}

/* ===================================
   7. SLIDERS - TOUCH OPTIMIZED
   =================================== */
.sliders {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.slider {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.slider label {
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    width: 50px;
}

/* Slider value display */
.slider .value-display {
    position: absolute;
    right: 0;
    font-size: 10px;
    color: rgba(244, 241, 232, 0.6);
    min-width: 28px;
    text-align: right;
    font-family: 'Berkeley Mono', monospace;
}

.slider input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 2px;
    background: rgba(244, 241, 232, 0.1);
    border-radius: 1px;
    outline: none;
}

/* Touch-optimized thumb - 44px touch target */
.slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 44px;
    height: 44px;
    background: rgba(244, 241, 232, 0.85);
    cursor: pointer;
    border-radius: 22px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.15s ease;
}

.slider input[type="range"]::-webkit-slider-thumb:hover {
    background: rgba(244, 241, 232, 1);
    transform: scale(1.05);
}

.slider input[type="range"]::-webkit-slider-thumb:active {
    background: rgba(244, 241, 232, 1);
    transform: scale(1.2);
}

/* Firefox */
.slider input[type="range"]::-moz-range-thumb {
    width: 44px;
    height: 44px;
    background: rgba(244, 241, 232, 0.85);
    cursor: pointer;
    border: none;
    border-radius: 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.15s ease;
}

.slider input[type="range"]::-moz-range-thumb:hover {
    background: rgba(244, 241, 232, 1);
    transform: scale(1.05);
}

.slider input[type="range"]::-moz-range-thumb:active {
    background: rgba(244, 241, 232, 1);
    transform: scale(1.2);
}

/* ===================================
   8. COLOR CONTROLS
   =================================== */
.color-controls {
    margin-bottom: 16px;
}

.color-controls label {
    display: block;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

/* ===================================
   8b. HUE SLIDER (SPECIAL)
   =================================== */
.hue-slider {
    -webkit-appearance: none !important;
    appearance: none !important;
    height: 44px !important;
    width: 100% !important;
    background: linear-gradient(to right,
        hsl(0, 70%, 50%),
        hsl(60, 70%, 50%),
        hsl(120, 70%, 50%),
        hsl(180, 70%, 50%),
        hsl(240, 70%, 50%),
        hsl(300, 70%, 50%),
        hsl(360, 70%, 50%)
    ) !important; /* Fixed rainbow gradient */
    border-radius: 16px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    margin: 8px 0 !important;
}

.hue-slider::-webkit-slider-thumb {
    width: 36px !important;
    height: 36px !important;
    border: 2px solid var(--color-text) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 0 0 2px var(--color-bg) !important;
}

.hue-slider::-webkit-slider-thumb:hover {
    transform: scaleY(1.05);
    box-shadow: 0 0 0 1px var(--color-text), 0 4px 12px rgba(0, 0, 0, 0.4);
}

.hue-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scaleY(1.08);
}

/* Firefox */
.hue-slider::-moz-range-thumb {
    width: 36px !important;
    height: 36px !important;
    border: 2px solid var(--color-text) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 0 0 2px var(--color-bg) !important;
}

/* ===================================
   9. DIVIDERS
   =================================== */
.divider {
    height: 1px;
    background: var(--color-border);
    margin: 16px 0;
}

/* ===================================
   10. BUTTONS & CONTROLS
   =================================== */
/* Harmony Modes */
.harmony-modes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 12px;
}

.harmony-btn {
    padding: 8px 12px;
    font-size: 10px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    font-family: inherit;
}

.harmony-btn:hover {
    background: rgba(244, 241, 232, 0.05);
    border-color: var(--color-border-hover);
    color: var(--color-text);
}

.harmony-btn.active {
    background: rgba(244, 241, 232, 0.08);
    border-color: rgba(244, 241, 232, 0.3);
    color: var(--color-text);
}

/* Styles Section */
.styles-section {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin-top: 16px;
}

.style-group {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.style-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.style-btn:hover {
    background: rgba(244, 241, 232, 0.05);
    border-color: var(--color-border-hover);
    color: var(--color-text);
}

.style-btn.active {
    background: rgba(244, 241, 232, 0.08);
    border-color: rgba(244, 241, 232, 0.3);
    color: var(--color-text);
}

/* Mode Buttons */
.mode-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    width: 100%;
}

.mode-btn {
    padding: 10px 4px;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 3px;
    font-family: inherit;
    white-space: nowrap;
}

.mode-btn:hover {
    background: rgba(244, 241, 232, 0.04);
    border-color: rgba(244, 241, 232, 0.15);
}

.mode-btn.active {
    background: rgba(244, 241, 232, 0.06);
    border-color: rgba(244, 241, 232, 0.25);
    color: var(--color-text);
}

/* Randomize Button */
.randomize {
    flex: 1;
    min-height: 44px;
    padding: 0 16px;
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 12px;
    line-height: 1;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.randomize:hover {
    background: rgba(244, 241, 232, 0.03);
    border-color: rgba(244, 241, 232, 0.15);
    color: rgba(244, 241, 232, 0.9);
    transform: translateY(-1px);
}

.randomize:active {
    transform: translateY(0);
    background: rgba(244, 241, 232, 0.06);
}

/* Export PFP Button */
.export-pfp {
    width: 48px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.export-pfp:hover {
    background: rgba(244, 241, 232, 0.03);
    border-color: rgba(244, 241, 232, 0.15);
    color: rgba(244, 241, 232, 0.9);
}

.export-pfp svg {
    width: 18px;
    height: 18px;
}

/* ===================================
   11. ACTION BUTTONS
   =================================== */
.action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* Purchase CTA Section */
.panel-cta {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(244, 241, 232, 0.1);
}

.buy-cta-btn {
    width: 100%;
    padding: 16px 20px;
    background: #fff; /* Will be updated dynamically to match bloom */
    color: #000;
    border: none;
    border-radius: 8px;
    font-family: 'Berkeley Mono', monospace;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}

.buy-cta-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.buy-cta-btn:active {
    transform: translateY(0);
}

.cta-text {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.cta-price {
    font-size: 11px;
    opacity: 0.8;
    font-weight: 400;
}

/* ===================================
   12. ADVANCED CONTROLS
   =================================== */
.advanced-controls {
    margin: 12px 0;
}

.control-group {
    margin-bottom: 12px;
}

.group-header {
    font-size: 9px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 8px;
    opacity: 0.6;
}

.control-row {
    display: flex;
    gap: 8px;
}

.control-row.full {
    width: 100%;
}

/* ===================================
   13. MOBILE OPTIMIZATIONS
   =================================== */
/* Prevent scroll bouncing */
@supports (-webkit-touch-callout: none) {
    .control-panel {
        position: fixed;
    }
}

/* Improve touch response */
@media (hover: none) and (pointer: coarse) {
    .slider input[type="range"] {
        height: 44px;
        background: transparent;
    }

    .slider input[type="range"]::-webkit-slider-runnable-track {
        height: 2px;
        background: rgba(244, 241, 232, 0.1);
    }

    .harmony-btn,
    .style-btn,
    .mode-btn,
    .randomize {
        -webkit-tap-highlight-color: transparent;
    }
}

/* ===================================
   14. SPLASH SCREEN
   =================================== */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.splash-content {
    text-align: center;
    padding: 40px;
}

.splash-title {
    font-family: 'Berkeley Mono', monospace;
    font-size: 24px;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 24px 0;
}

.splash-description {
    font-family: 'Berkeley Mono', monospace;
    font-size: 13px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.4);
    margin: 0 0 40px 0;
    font-weight: 300;
}

.splash-description br {
    display: block;
    margin: 4px 0;
}

.splash-continue {
    position: static;
    font-family: 'Berkeley Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.25);
    animation: none;
    margin-top: 60px;
}

/* ===================================
   15. DESKTOP ADJUSTMENTS
   =================================== */
/* Mobile-first: no desktop overrides for panel positioning */

/* Removed desktop media queries - mobile-first approach */

/* ===================================
   16. INSTALL GUIDE MODAL
   =================================== */
.install-guide {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid rgba(244, 241, 232, 0.1);
    border-radius: 12px;
    padding: 16px 20px;
    max-width: 300px;
    width: calc(100% - 40px);
    z-index: 2000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.install-guide-text {
    font-size: 12px;
    line-height: 1.6;
    color: rgba(244, 241, 232, 0.7);
    margin-bottom: 12px;
}

.install-guide-button {
    width: 100%;
    padding: 10px;
    background: rgba(244, 241, 232, 0.08);
    border: 1px solid rgba(244, 241, 232, 0.2);
    color: var(--color-text);
    font-size: 12px;
    font-family: inherit;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.install-guide-button:hover {
    background: rgba(244, 241, 232, 0.12);
    border-color: rgba(244, 241, 232, 0.3);
}

/* ===================================
   17. HIDE SCROLLBARS
   =================================== */
.panel-content::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.panel-content {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* ===================================
   18. Z-INDEX HIERARCHY
   =================================== */
/*
   1: Canvas
   1000: Control Panel
   2000: Install Guide
   10000: Splash Screen
   99999: Favorites Modal (in separate file)
*/

/* ===================================
   19. MOBILE - CLEAN MINIMAL DESIGN
   =================================== */

/* Mobile - complete override for simplicity */
@media screen and (max-width: 768px), screen and (max-height: 900px) {
    /* Control panel - clean and simple */
    .control-panel {
        background: #000000 !important;
        padding-bottom: env(safe-area-inset-bottom, 0px) !important;
        border: none !important;
    }

    /* Button bar - compact and centered */
    .button-bar {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 40px !important;
        height: 44px !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Clean button styling */
    .bar-button,
    .panel-handle {
        width: 44px !important;
        height: 44px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
        cursor: pointer !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    /* Simple touch feedback */
    .bar-button:active,
    .panel-handle:active {
        opacity: 0.7 !important;
    }

    /* Icon styling - simple and centered */
    .button-icon,
    .handle-indicator {
        display: inline-block !important;
        font-size: 20px !important;
        line-height: 1 !important;
        color: rgba(255, 255, 255, 0.5) !important;
        font-family: system-ui, -apple-system, sans-serif !important;
        font-weight: normal !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Active state - bright white */
    .bar-button:active .button-icon,
    .panel-handle:active .handle-indicator {
        color: rgba(255, 255, 255, 1) !important;
        transform: none !important; /* No transform on mobile */
    }

    /* Consistent icon sizes */
    .button-icon {
        font-size: 22px !important;
    }

    .handle-indicator {
        font-size: 20px !important;
        color: rgba(255, 255, 255, 0.7) !important;
    }

    /* Micro-interactions */
    @keyframes pulse {
        0% { transform: scale(1); }
        50% { transform: scale(1.05); }
        100% { transform: scale(1); }
    }

    .panel-handle:active .handle-indicator {
        animation: pulse 0.3s ease !important;
    }

    /* Expanded state refinement */
    .control-panel.expanded {
        background: rgba(0, 0, 0, 0.98) !important;
        transform: translateY(0) !important;
    }

    .control-panel.expanded .handle-indicator {
        color: rgba(255, 255, 255, 1) !important;
        transform: rotate(180deg) !important;
    }
}

/* iOS PWA adjustments */
@media (display-mode: standalone) {
    .control-panel {
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 10px) !important;
    }
}

/* iPhone Pro models with Dynamic Island */
@media screen and (max-width: 430px) and (-webkit-min-device-pixel-ratio: 3) {
    .control-panel {
        background: rgba(0, 0, 0, 0.97) !important;
    }

    .button-icon,
    .handle-indicator {
        color: rgba(255, 255, 255, 0.7) !important;
    }
}

/* Landscape orientation adjustments */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .button-bar {
        height: 44px !important;
        top: -8px !important;
        padding: 4px 0 0 0 !important;
    }

    .bar-button,
    .panel-handle {
        width: 44px !important;
        height: 44px !important;
    }
}