/* ===== Mobile Optimizations ===== */

/* Prevent double-tap zoom on all interactive elements */
button,
.tab,
.study-button,
.building-button,
.list-item-button,
.graduate-button {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Smooth scrolling for iOS */
.content-panel {
    -webkit-overflow-scrolling: touch;
}

/* Mobile-specific styles (phones and small tablets) */
@media (max-width: 768px) {

    /* Header adjustments */
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1rem;
    }

    .logo-container {
        justify-content: center;
    }

    .logo {
        height: 40px;
    }

    .stats-container {
        flex-direction: row;
        gap: 2rem;
        justify-content: center;
    }

    .stat-item {
        text-align: center;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-value.secondary {
        font-size: 1rem;
    }

    .copyright {
        padding-left: 0;
        text-align: center;
    }

    /* Game container padding */
    .game-container {
        padding: 0 1rem;
    }

    /* Study button - larger for easier tapping */
    .study-button {
        width: 160px;
        height: 160px;
    }

    .study-text {
        font-size: 1.75rem;
    }

    .click-power {
        font-size: 1.125rem;
    }

    /* Tabs - stack vertically for better touch targets */
    .tabs {
        flex-direction: column;
        gap: 0.75rem;
        margin: 1.5rem 0 1rem;
    }

    .tab {
        min-width: 100%;
        padding: 1.25rem;
        font-size: 1.125rem;
    }

    .tab-icon {
        font-size: 1.75rem;
    }

    /* Content panel adjustments */
    .content-panel {
        padding: 1.5rem;
        min-height: 400px;
        max-height: 500px;
    }

    /* Building cards - single column */
    .buildings-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .building-card {
        padding: 1.5rem;
    }

    .building-name {
        font-size: 1.25rem;
    }

    .building-button {
        padding: 1rem;
        font-size: 1rem;
        min-height: 48px;
        /* Accessibility minimum touch target */
    }

    /* List items - stack vertically */
    .list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.5rem;
    }

    .list-item-name {
        font-size: 1.375rem;
    }

    .list-item-desc {
        font-size: 1rem;
    }

    .list-item-button,
    .list-item-status {
        width: 100%;
        text-align: center;
        padding: 1rem;
        font-size: 1.125rem;
        min-height: 48px;
    }

    /* Graduate button - full width at bottom */
    .graduate-button {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        width: calc(100% - 2rem);
        padding: 1.5rem;
        font-size: 1.375rem;
    }

    /* Achievement popup - full width */
    .achievement-popup {
        right: 1rem;
        left: 1rem;
        top: 100px;
        max-width: calc(100% - 2rem);
    }

    /* Modal adjustments */
    .modal-content {
        padding: 2rem;
        margin: 1rem;
    }

    .modal-content h2 {
        font-size: 1.75rem;
    }

    .offline-iq {
        font-size: 2.5rem;
    }
}

/* Tablet landscape and larger phones */
@media (min-width: 769px) and (max-width: 1024px) {
    .header-content {
        padding: 0.75rem 1.5rem;
    }

    .game-container {
        padding: 0 1.5rem;
    }

    .buildings-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .content-panel {
        padding: 1.75rem;
    }
}