/* Channel special "alerte" + hub */
.subchannels li.channel-item--alert {
    border-color: rgba(250, 204, 21, 0.45);
    background:
        linear-gradient(110deg, rgba(250, 204, 21, 0.13), rgba(250, 204, 21, 0.05)),
        rgba(22, 24, 31, 0.92);
}

.subchannels li.channel-item--alert .channel-li-name {
    color: #facc15;
}

.subchannels li.channel-item--alert.is-active {
    border-color: rgba(250, 204, 21, 0.75);
    box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.28);
}

.channel-special-pill {
    display: inline-flex;
    align-items: center;
    margin-left: 0.4rem;
    margin-right: 0.4rem;
    padding: 0.08rem 0.38rem;
    border: 1px solid rgba(250, 204, 21, 0.55);
    border-radius: 0;
    color: #facc15;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.channel-view--alert #messagesContainer {
    padding: 1.25rem;
}

.special-channel-hub {
    width: min(980px, 100%);
    margin: 0 auto;
    border: none;
    background: transparent;
    border-radius: 0;
    padding: 0;
}

.special-channel-kicker {
    margin: 0;
    color: rgba(250, 204, 21, 0.86);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-size: 0.72rem;
}

.special-channel-title {
    margin: 0.25rem 0 0.2rem;
    color: #fde68a;
    font-size: 1.15rem;
}

.special-channel-subtitle {
    margin: 0 0 1rem;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.86rem;
}

.special-channel-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.special-channel-card {
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 0;
    background: rgba(12, 14, 18, 0.55);
    color: #e5e7eb;
    padding: 1.35rem 0.9rem 1.1rem;
    min-height: 164px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.05rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.special-channel-card:hover {
    border-color: rgba(250, 204, 21, 0.72);
    background: rgba(250, 204, 21, 0.06);
    transform: none;
}

.special-channel-card .lucide {
    width: 52px;
    height: 52px;
    color: #facc15;
}

.special-channel-card-title {
    font-weight: 700;
    width: 100%;
    text-align: center;
    font-size: 0.88rem;
    letter-spacing: 0.08em;
}

.special-running-matches {
    margin-top: 1rem;
    border-top: 1px solid rgba(250, 204, 21, 0.22);
    padding-top: 0.75rem;
}

.special-running-matches h3 {
    margin: 0 0 0.55rem;
    font-family: 'Orbitron', 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(250, 204, 21, 0.95);
}

.special-running-list {
    display: grid;
    gap: 0.45rem;
}

.special-running-item {
    border: 1px solid rgba(250, 204, 21, 0.3);
    background: rgba(8, 10, 12, 0.82);
    color: rgba(248, 250, 252, 0.94);
    padding: 0.45rem 0.5rem;
    text-align: left;
    display: grid;
    gap: 0.15rem;
    cursor: pointer;
}

.special-running-item:hover {
    border-color: rgba(250, 204, 21, 0.62);
    background: rgba(250, 204, 21, 0.09);
}

.special-running-name {
    font-size: 0.78rem;
    letter-spacing: 0.03em;
}

.special-running-meta {
    font-size: 0.66rem;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.68);
}

.gallery-channel-hub .special-channel-title {
    color: #93c5fd;
}

.gallery-count {
    margin: 0 0 0.9rem;
    color: rgba(191, 219, 254, 0.85);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.gallery-create-fab {
    position: fixed;
    right: max(14px, calc(14px + env(safe-area-inset-right, 0px)));
    bottom: max(14px, calc(14px + env(safe-area-inset-bottom, 0px)));
    width: 52px;
    height: 52px;
    border-radius: 999px;
    border: 1px solid rgba(125, 211, 252, 0.68);
    background: linear-gradient(180deg, rgba(2, 132, 199, 0.95), rgba(3, 105, 161, 0.92));
    color: #ecfeff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 28px rgba(2, 132, 199, 0.36);
    z-index: 25;
}

.gallery-create-fab .lucide {
    width: 22px;
    height: 22px;
    stroke-width: 2.4;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.9rem;
}

.gallery-card {
    text-align: left;
    border: 1px solid rgba(148, 163, 184, 0.42);
    background: linear-gradient(165deg, rgba(15, 23, 42, 0.78), rgba(30, 41, 59, 0.58));
    color: #e2e8f0;
    padding: 0;
    cursor: pointer;
    min-height: 290px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.gallery-card:hover {
    border-color: rgba(147, 197, 253, 0.72);
    box-shadow: 0 8px 24px rgba(30, 64, 175, 0.22);
    transform: translateY(-2px);
}

.gallery-card-sheet {
    display: grid;
    grid-template-rows: 170px 1fr;
    height: 100%;
}

.gallery-card-sheet--portrait-only {
    grid-template-rows: 1fr;
}

.gallery-card-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 23, 0.75);
    overflow: hidden;
    position: relative;
    aspect-ratio: 3 / 4;
}

.gallery-card-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-card-hero .lucide {
    width: 64px;
    height: 64px;
    color: rgba(191, 219, 254, 0.9);
}

.gallery-card-nameplate {
    position: absolute;
    right: 0.55rem;
    bottom: 0.5rem;
    padding: 0.32rem 0.5rem;
    border: 1px solid rgba(191, 219, 254, 0.66);
    background: rgba(15, 23, 42, 0.82);
    color: #e2e8f0;
    font-size: 0.73rem;
    letter-spacing: 0.04em;
    max-width: calc(100% - 1.1rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-viewer-open {
    overflow: hidden;
}

.gallery-viewer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.82);
    z-index: 12000;
    padding: 1rem max(1rem, env(safe-area-inset-right, 0px)) calc(1rem + env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-viewer-dialog {
    width: min(960px, 100%);
    max-height: 96vh;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.45);
    display: grid;
    grid-template-rows: 1fr auto;
    position: relative;
}

.gallery-viewer-btn {
    border: 1px solid rgba(148, 163, 184, 0.44);
    background: rgba(30, 41, 59, 0.7);
    color: #e2e8f0;
    padding: 0.35rem 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    text-transform: uppercase;
    font-size: 0.66rem;
    letter-spacing: 0.04em;
    min-height: 34px;
}

.gallery-viewer-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.gallery-viewer-body {
    overflow: auto;
    padding: 0.6rem 0.8rem 0.6rem;
}

.gallery-viewer-page-stage {
    min-height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-bottom: 0.4rem;
}

.gallery-viewer-page-content {
    width: max-content;
    max-width: none;
    will-change: transform;
}

.gallery-viewer-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0.42rem 0.5rem calc(0.42rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    background: linear-gradient(180deg, rgba(7, 11, 18, 0.97), rgba(7, 11, 18, 0.9));
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.gallery-viewer-sheet {
    width: min(760px, 100%);
    margin: 0 auto;
    background: rgba(248, 250, 252, 0.97);
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.18);
    padding: 1rem;
    min-height: min(70vh, 760px);
}

.gallery-viewer-sheet-header {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 1rem;
}

.gallery-viewer-portrait {
    width: 100%;
    height: 230px;
    background: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gallery-viewer-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-viewer-iconline {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #1e293b;
}

.gallery-viewer-corestats {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem;
}

.gallery-viewer-corestats div,
.gallery-viewer-stats-grid div {
    border: 1px solid rgba(15, 23, 42, 0.2);
    padding: 0.5rem;
    display: flex;
    justify-content: space-between;
}

.gallery-viewer-page-title {
    margin-top: 0;
}

.gallery-viewer-meta-line {
    color: #334155;
}

.gallery-viewer-stats-grid {
    margin-top: 1rem;
    display: grid;
    gap: 0.45rem;
}

.gallery-viewer-lore {
    line-height: 1.55;
    white-space: normal;
}

.gallery-viewer-real-page {
    width: 100%;
    overflow: auto;
}

.gallery-viewer-fiche-preview {
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    overflow: auto !important;
}

.gallery-viewer-fiche-preview .sheet {
    pointer-events: none;
    width: 210mm;
    max-width: 210mm;
    min-width: 210mm;
    min-height: 297mm;
    aspect-ratio: 210 / 297;
}

.gallery-viewer-body[data-zoomed="true"] {
    overflow: auto;
    touch-action: pan-x pan-y;
}

@media (max-width: 900px) {
    .channel-view--alert #messagesContainer {
        padding: 0.8rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }

    .gallery-card {
        min-height: 0;
        aspect-ratio: 3 / 4;
    }

    .gallery-card-sheet {
        grid-template-rows: 1fr;
    }

    .gallery-card-sheet--portrait-only .gallery-card-hero {
        height: 100%;
        aspect-ratio: auto;
    }

    .gallery-viewer-dialog {
        max-height: 100dvh;
        width: 100%;
        height: 100dvh;
        border: 0;
    }

    .gallery-viewer-overlay {
        padding: 0;
    }

    .gallery-viewer-btn {
        font-size: 0.6rem;
        padding: 0.34rem 0.44rem;
    }

    .gallery-viewer-body {
        padding: 0.35rem;
    }

    .gallery-viewer-sheet {
        min-height: 0;
        padding: 0.72rem;
    }

    .gallery-viewer-sheet-header {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .gallery-viewer-portrait {
        height: 190px;
    }

    .gallery-viewer-corestats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
    }

    .gallery-viewer-fiche-preview .sheet-inner {
        min-height: 297mm;
    }
}

@media (max-width: 560px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .gallery-viewer-btn span {
        display: none;
    }

    .gallery-viewer-page-indicator {
        font-size: 0.63rem;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .gallery-viewer-btn {
        min-width: 42px;
        justify-content: center;
    }
}
