/* =============================================
   MOBILE RESPONSIVE PATCH
   Add this to the END of theme.css
   ============================================= */

/* ======================================
   TABLET BREAKPOINT (768px)
   ====================================== */
@media (max-width: 768px) {
    /* Header adjustments */
    .header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .header-buttons {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
    }

    header h1 {
        font-size: 1.5rem;
        text-align: center;
    }

    /* Stats row - stack vertically */
    .stats-row {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .stat-divider {
        display: none; /* Hide dividers on mobile */
    }

    /* Section spacing */
    section,
    .section {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    /* Character grid - 2 columns on tablet */
    .character-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    /* Dashboard buttons - smaller */
    .player-dashboard-btn,
    .st-dashboard-btn,
    .merits-flaws-btn,
    .in-the-blood-btn,
    .downtime-btn,
    .challenge-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    /* Form adjustments */
    .form-row {
        flex-direction: column;
    }

    /* Attributes grid - 1 column on tablet */
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ======================================
   MOBILE BREAKPOINT (480px)
   ====================================== */
@media (max-width: 480px) {
    /* Typography scaling */
    header h1 {
        font-size: 1.3rem;
        letter-spacing: 0.03em;
    }

    section h2,
    .section h2 {
        font-size: 1.3rem;
    }

    section h3,
    .section h3 {
        font-size: 1.1rem;
    }

    /* Character grid - single column */
    .character-grid {
        grid-template-columns: 1fr;
    }

    /* Button sizing */
    .player-dashboard-btn,
    .st-dashboard-btn,
    .merits-flaws-btn,
    .in-the-blood-btn,
    .downtime-btn,
    .challenge-btn {
        width: 100%;
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    /* Save footer adjustments */
    .save-footer {
        padding: 1rem;
    }

    .save-btn {
        width: 100%;
        max-width: 100%;
        padding: 1rem;
    }

    /* Auth box mobile */
    .auth-box {
        padding: 1.5rem 1rem;
        margin: 0.5rem;
    }

    .auth-logo {
        width: 80px;
        height: 80px;
    }

    /* Modal full screen on mobile */
    .modal-content {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    /* Downtime allocation bar */
    .allocation-bar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .period-selector {
        width: 100%;
    }

    /* Challenge page - stack resources */
    .resource-bar {
        flex-direction: column;
        gap: 0.5rem;
    }

    .combat-row {
        flex-direction: column;
        gap: 1rem;
    }

    /* XP containers - wrap */
    #xp-container {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ======================================
   TOUCH TARGET MINIMUM (44x44px)
   ====================================== */
button,
.btn,
.btn-primary,
.btn-secondary,
a.back-btn,
.resource-btn,
.action-btn-compact,
input[type="submit"],
input[type="button"] {
    min-height: 44px;
    min-width: 44px;
    /* Ensure touch-friendly targets */
}

/* Small buttons exception - but still accessible */
.gen-dot,
.cap-btn {
    min-height: 32px;
    min-width: 32px;
    padding: 0.25rem;
}

/* ======================================
   LANDSCAPE ORIENTATION
   ====================================== */
@media (max-width: 768px) and (orientation: landscape) {
    /* Reduce header size in landscape */
    header {
        padding: 0.5rem 1rem;
    }

    header h1 {
        font-size: 1.2rem;
    }

    /* Compact resource displays */
    .resource-bar {
        flex-direction: row;
        gap: 0.5rem;
    }
}

/* ======================================
   PRINT STYLES (Bonus)
   ====================================== */
@media print {
    /* Hide navigation */
    header .header-buttons,
    .back-btn,
    .save-footer {
        display: none;
    }

    /* Expand all collapsed sections */
    details {
        display: block;
    }

    details summary {
        display: none;
    }

    /* Remove background effects for printing */
    body,
    #app {
        background: white;
        color: black;
    }

    section,
    .section {
        border: 1px solid #333;
        box-shadow: none;
        page-break-inside: avoid;
    }
}
