@media screen {
    main {
        max-width: 90vw;
        margin: 0 auto;
    }

    .subtitle {
        text-align: center;
        margin-bottom: 2rem;
        font-size: 1.1rem;
    }

    .search-container {
        display: flex;
        justify-content: center;
        margin-bottom: 2rem;
    }

    .search-box {
        display: flex;
        max-width: 500px;
        width: 100%;
    }

    #username {
        flex: 1;
        padding: 0.8rem 1rem;
        background-color: #1e1e1e;
        border: 2px solid #333;
        border-right: none;
        border-radius: 8px 0 0 8px;
        color: white;
        font-size: 1rem;
        outline: none;
        transition: border-color 0.3s;
    }

    #username:focus {
        border-color: #bb86fc;
    }

    #search-btn {
        padding: 0 1.5rem;
        background-color: #bb86fc;
        color: black;
        border: none;
        border-radius: 0 8px 8px 0;
        cursor: pointer;
        font-size: 1rem;
        font-weight: 600;
        transition: background-color 0.3s;
    }

    #search-btn:hover {
        background-color: #a370d9;
    }

    .loading {
        text-align: center;
        margin: 2rem 0;
        display: none;
    }

    .spinner {
        border: 4px solid #222;
        border-radius: 50%;
        border-top: 4px solid #bb86fc;
        width: 40px;
        height: 40px;
        animation: spin 1s linear infinite;
        margin: 0 auto 1rem;
    }

    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
    
    .error {
        color: #ff6b6b;
        background-color: #222;
        padding: 1rem;
        border-radius: 8px;
        margin: 2rem 0;
        text-align: center;
        display: none;
    }

    .profile-container {
        display: none;
        background-color: #1e1e1e;
        border-radius: 8px;
        overflow: hidden;
        width: 90vw;
    }

    .profile-header {
        display: flex;
        flex-wrap: wrap;
        padding: 1.5rem;
        background-color: #222;
        border-bottom: 1px solid #333;
    }

    .profile-image {
        width: 150px;
        height: 150px;
        border-radius: 50%;
        object-fit: cover;
        margin-right: 1.5rem;
        border: 3px solid #1e1e1e;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    }

    .profile-info {
        flex: 1;
        min-width: 250px;
    }

    .profile-name {
        text-align: left;
        font-size: 1.5rem;
        font-weight: bold;
        color: #bb86fc;
        margin-bottom: 0.3rem;
    }

    .profile-id {
        font-size: 1rem;
        color: #a0a0a0;
        margin-bottom: 0.5rem;
    }

    .profile-url {
        display: block;
        margin-bottom: 1rem;
        text-decoration: none;
    }

    .profile-url:hover {
        text-decoration: underline;
    }

    .profile-stats {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
        margin-top: 1rem;
    }

    .stat-item {
        background-color: #2c2c2e;
        padding: 0.8rem 1rem;
        border-radius: 8px;
        min-width: 120px;
    }

    .stat-label {
        font-size: 0.75rem;
        color: #a0a0a0;
        text-transform: uppercase;
        margin-bottom: 0.3rem;
    }

    .stat-value {
        font-size: 1.1rem;
        font-weight: bold;
    }

    .profile-details {
        display: grid;
        grid-template-rows: repeat(4, auto);
        gap: 1rem;
    }

    .two-column {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }

    .detail-section {
        flex: 1;
        min-width: 300px;
        margin: 0.75rem 0rem;
        padding: 0 1rem;
    }

    .section-title {
        font-size: 1.3rem;
        color: #bb86fc;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid #333;
    }

    .stats-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 1rem;
        margin-top: 1rem;
    }

    .stat-card {
        background-color: #2c2c2e;
        padding: 0.5rem;
        border-radius: 8px;
        border: 1px solid #333;
    }

    .stat-card-title {
        font-size: 0.8rem;
        color: #a0a0a0;
        margin-bottom: 0.5rem;
    }

    .stat-card-value {
        font-size: 1.2rem;
        font-weight: bold;
    }

    .favorites-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 1rem;
        margin-top: 1rem;
    }

    .favorite-item {
        background-color: #2c2c2e;
        border-radius: 8px;
        overflow: hidden;
        border: 1px solid #333;
        transition: transform 0.3s, box-shadow 0.3s;
    }

    .favorite-item:hover {
        transform: translateY(-5px);
    }

    .favorite-image {
        width: 100%;
        height: 174px;
        object-fit: cover;
    }

    .favorite-title {
        padding: 0.8rem;
        font-size: 0.9rem;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .no-favorites {
        color: #a0a0a0;
        padding: 1rem;
    }
}