/* Mobile-First Layout (< 768px) */

/* Container */
.app-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* Reduce gaps on mobile */
:root {
    --panel-gap: 1rem;
    --panel-padding: 1rem;
}

/* Header - Sticky on mobile */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: var(--panel-gap);
}

/* Touch-friendly inputs */
.comic-input {
    font-size: 16px;
    /* Prevents zoom on iOS */
    min-height: 48px;
}

.comic-button {
    min-height: 48px;
    min-width: 48px;
    font-size: 1.1rem;
}

/* Stack all panels vertically */
.panel-grid {
    display: flex;
    flex-direction: column;
    gap: var(--panel-gap);
}

/* Power modules - single column on small screens */
.modules-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

/* Dice tray - vertical layout */
.dice-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Results - horizontal on mobile */
.dice-results {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

/* Hero tracking - larger buttons */
.tracker-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tracker-controls button {
    min-width: 60px;
    min-height: 60px;
    font-size: 1.5rem;
}

.tracker-display {
    flex: 1;
    font-size: 3rem;
    padding: 1rem;
}

/* Collapsible panels for mobile */
.panel-collapsible .panel-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.panel-collapsible.expanded .panel-content {
    max-height: 1000px;
}

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

.panel-toggle {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.panel-collapsible.expanded .panel-toggle {
    transform: rotate(180deg);
}

/* Small phones (< 375px) */
@media (max-width: 375px) {
    :root {
        --panel-gap: 0.75rem;
        --panel-padding: 0.75rem;
    }

    body {
        padding: 0.5rem;
    }

    .comic-title {
        font-size: 1.5rem;
    }
}

/* Larger phones (480px - 768px) */
@media (min-width: 480px) {

    /* Two-column modules on larger phones */
    .modules-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    /* Horizontal dice controls */
    .dice-controls {
        flex-direction: row;
    }
}