/* ===================================================
   Tablet (1200px und kleiner)
=================================================== */

@media (max-width: 1200px) {

/* ===================================================
       Layout
    =================================================== */

    .content {
        margin-left: 250px;
        width: calc(100% - 250px);
        padding: 28px 22px 50px;
    }

    /* ===================================================
       Page Header
    =================================================== */

    .page-header-grid {

        gap: 30px;

    }

    .page-header-icon {

        margin-right: 0;

    }

    .page-header-icon img {

        width: 78px;

        height: 78px;

    }

    /* ===================================================
       Hero Banner
    =================================================== */

    .hero-banner {

        height: 420px;

    }

    .banner-icons {

        gap: 18px;

    }

    .banner-icons img {

        width: 60px;

        height: 60px;

    }

    /* ===================================================
       API Info Bar
    =================================================== */

    .stats-bar {

        grid-template-columns: repeat(2, 1fr);

        gap: 20px;

    }

    /* ===================================================
       Raid Übersicht
    =================================================== */

    .difficulty-grid {

        grid-template-columns: repeat(2, 1fr);

    }

    .difficulty-card:last-child {

        grid-column: 1 / -1;

    }

    /* ===================================================
       Raid Ranking
    =================================================== */

    .ranking-grid {

        grid-template-columns: 1fr;

    }

    /* ===================================================
       Gildenleitung
    =================================================== */

    .team-card {

        grid-template-columns: 250px 1fr;

        gap: 24px;

    }

    .team-image img {

        width: 220px;

        max-width: 100%;

    }


    .team-tasks {

        grid-template-columns: 1fr;

    }

}



/* ===================================================
   Smartphone (768px und kleiner)
=================================================== */

.mobile-menu-button {

    display: none;

}

.mobile-overlay {

    display: none;

}

@media (max-width: 768px) {

    /* ===================================================
       Layout
    =================================================== */

    .layout {

        display: block;

    }

    .content {

        margin-left: 0;

        width: 100%;

        padding: 24px 18px 40px;

    }

    /* ===================================================
   Hero Banner
=================================================== */

.hero-banner {

    height: 260px;

    background-position: center;

}

.banner-icons {

    top: 14px;

    gap: 12px;

}

.banner-icons img {

    width: 48px;

    height: 48px;

}

.hero-divider {

    margin: 20px 0 24px;

}

/* ===================================================
   API Info Bar
=================================================== */

.stats-bar {

    grid-template-columns: repeat(2, 1fr);

    gap: 18px;

    padding: 0;

}

.stat-item {

    padding: 14px 8px;

    background: rgba(255,255,255,.03);

    border: 1px solid rgba(212,175,55,.18);

    border-radius: 12px;

}

.stat-header {

    gap: 8px;

    margin-bottom: 8px;

    font-size: 14px;

}

.stat-header img {

    width: 28px;

    height: 28px;

}

.stat-value {

    font-size: 22px;

}

/* ===================================================
   Page Header
=================================================== */

.page-header-grid {

    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 24px;

    text-align: center;

}

.page-header {

    margin-bottom: 30px;

}

/* ===================================================
   Raid Übersicht
=================================================== */

.raid-panel {

    padding: 20px;

}

.difficulty-grid {

    grid-template-columns: repeat(2, 1fr);

    gap: 14px;

}

.difficulty-card:last-child {

    grid-column: 1 / -1;

}

.difficulty-card {

    padding: 14px;

}

.difficulty-card img {

    width: 56px;

    height: 56px;

}

.difficulty-card h3 {

    font-size: 18px;

    margin-bottom: 10px;

}

.difficulty-value {

    font-size: 26px;

}

.difficulty-bar {

    width: 100%;

}

/* ===================================================
   Hall of Fame
=================================================== */

.hof-panel {

    padding: 18px;

}

.hof-player {

    gap: 14px;

    padding: 12px 14px;

    margin-bottom: 12px;

}

.hof-left {

    gap: 12px;

}

.hof-rank {

    width: 34px;

    font-size: 24px;

}

.hof-name {

    font-size: 18px;

}

.hof-score {

    font-size: 20px;

    gap: 8px;

}

.hof-score img {

    width: 28px;

    height: 28px;

}

.hof-right {

    gap: 6px;

}

.hof-dungeon {

    font-size: 14px;

    margin: 4px 0;

}

.hof-link {

    font-size: 14px;

}

/* ===================================================
   Gildenleitung
=================================================== */

.team-card {

    grid-template-columns: 1fr;

    gap: 18px;

    padding: 18px;

    text-align: center;

}

.team-image img {

    width: 170px;

    max-width: 100%;

}


.team-title {

    font-size: 26px;

    margin-bottom: 12px;

}

.team-description {

    margin-bottom: 18px;

}

.team-tasks {

    grid-template-columns: 1fr;

    gap: 10px;

}

.team-task {

    justify-content: flex-start;

    text-align: left;

}

.page-header-content {

    order: 2;

}

.page-header-icon {

    order: 1;

    margin-right: 0;

}

.page-header-icon img {

    width: 120px;

    height: 120px;

}

.page-header p {

    max-width: 100%;

}

    /* ===================================================
       Sidebar
    =================================================== */

    .sidebar {

        position: fixed;

        top: 0;

        left: 0;

        transform: translateX(-100%);

        height: 100vh;

        width: 260px;

        display: block;

        z-index: 2001;

        transition: transform .25s ease;

    }

    .sidebar.open {

        transform: translateX(0);

    }

    .sidebar .sidebar-header {

        padding-top: 68px;

    }
    
    /* ===================================================
       Mobile Button
    =================================================== */

    .mobile-menu-button {

        display: flex;

        justify-content: center;

        align-items: center;

        position: fixed;

        top: 16px;

        left: 16px;

        width: 52px;

        height: 52px;

        border: 1px solid rgba(64,214,248,.35);

        border-radius: 12px;

        background: var(--panel-light);

        color: var(--accent-cyan);

        font-size: 26px;

        cursor: pointer;

        z-index: 2002;

        box-shadow: 0 8px 20px rgba(0,0,0,.4);

        transition:
            background .25s,
            border-color .25s,
            transform .25s;

    }

    .mobile-menu-button:hover {

        border-color: var(--accent-cyan);

    }

    /* ===================================================
       Overlay
    =================================================== */

    .mobile-overlay {

        display: block;

        position: fixed;

        inset: 0;

        background: rgba(0,0,0,.55);

        opacity: 0;

        visibility: hidden;

        transition: .25s;

        z-index: 2000;

    }

    .mobile-overlay.show {

        opacity: 1;

        visibility: visible;

    }

    /* ===================================================
   Grids
=================================================== */

.ranking-grid {

    grid-template-columns: 1fr;

    gap: 10px;

}

.next-raid-content {

    grid-template-columns: 1fr;

}

.dashboard-grid {

    grid-template-columns: 1fr;

}

.stats-grid {

    grid-template-columns: 1fr;

}

.features-grid {

    grid-template-columns: 1fr;

}

}



/* ===================================================
   Kleine Smartphones (480px und kleiner)
=================================================== */

@media (max-width: 480px) {



}


/* ===================================================
   Neues Header-/Content-Layout
=================================================== */

@media (max-width: 1200px) {
    .content {
        width: min(100% - 36px, 1500px);
        padding-top: 24px;
    }
}

/* Tablets behalten die feste Desktop-Sidebar. Die Inhaltsbreite muss deshalb
   den Platz neben der Sidebar verwenden – nicht die volle Fensterbreite. */
@media (min-width: 769px) and (max-width: 1200px) {
    .content {
        width: calc(100% - 224px);
        margin-left: 224px;
        margin-right: 0;
        padding: clamp(20px, 2.7vw, 30px);
    }
}

@media (max-width: 768px) {
    .content {
        width: calc(100% - 24px);
        padding: 18px 0 40px;
    }
}


/* ===================================================
   Sidebar on small screens
=================================================== */
@media (max-width: 768px) {
    .sidebar {
        top: 62px;
        height: calc(100vh - 62px);
        width: 250px;
        left: -270px;
        transition: left .25s ease;
        box-shadow: 14px 0 36px rgba(0,0,0,.35);
        z-index: 4500;
    }

    .sidebar.open {
        left: 0;
    }

    .content {
        margin-left: 0;
        width: 100%;
        padding: 24px 18px 40px;
    }

    .mobile-menu-button {
        display: none !important;
    }

    .mobile-overlay {
        position: fixed;
        inset: 62px 0 0 0;
        background: rgba(0,0,0,.48);
        z-index: 4400;
    }

    .mobile-overlay.show {
        display: block;
    }
}

@media (max-width: 768px) { .sidebar { top: 62px; height: calc(100vh - 62px); } .mobile-overlay { inset: 62px 0 0 0; } }


/* v8 mobile finalization */
@media (max-width: 768px) {
    .sidebar {
        top: 62px !important;
        height: calc(100vh - 62px) !important;
    }

    .mobile-overlay {
        inset: 62px 0 0 0 !important;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 238px !important;
    }
}

/* Einheitliche, überlaufsichere Inhaltsbreite auf Smartphone und Tablet. */
@media (max-width: 768px) {
    .content > *,
    .page-section,
    .page-header,
    .page-header-grid,
    .page-header-content,
    .page-tabs-section,
    .raid-details-tabs-section,
    .dashboard-tabs-section,
    .page-tab-panel,
    .dashboard-tab-panels,
    .dashboard-tab-panel,
    .card,
    .card-grid {
        min-width: 0;
        max-width: 100%;
    }

    /* Das Icon bleibt links im passenden Rahmen und ist nicht größer als
       sein Rahmen. So bleiben Überschriften auch auf schmalen Displays ruhig. */
    .page-header-grid {
        flex-direction: row;
        align-items: center;
        gap: 14px;
        text-align: left;
    }

    .page-header-content {
        order: 2;
        flex: 1 1 auto;
        min-width: 0;
    }

    .page-header-icon {
        order: 1;
        flex: 0 0 72px;
        width: 72px;
        height: 72px;
        margin: 0;
    }

    .page-header-icon img {
        width: 48px;
        height: 48px;
    }

    /* Die beiden historischen Raid-Raster hatten eine Mindestbreite von
       320px und konnten damit auf schmalen Smartphones herausragen. */
    #guild-monitor,
    .raid-history-panel {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 480px) {
    .page-header-grid {
        gap: 12px;
    }

    .page-header-icon {
        flex-basis: 60px;
        width: 60px;
        height: 60px;
    }

    .page-header-icon img {
        width: 40px;
        height: 40px;
    }
}
