[hidden] { display: none !important; }

:root {
    --nav-h: 72px;
    --tab-h: 52px;
}

.gangs-hero { padding: 104px 0 28px; --img-pos: center; }

@media (min-width: 720px) and (max-width: 2329px) {
    .gangs-hero { height: 262px; --img-pos: calc(50% + 35px) center; }
}

.gangs-hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.gangs-hero p { margin-top: 0.6rem; }

.gang-tabs-bar {
    position: sticky;
    top: var(--nav-h);
    z-index: 40;
    background: rgba(10, 10, 10, 0.92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}

.gang-tabs {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.gang-tabs::-webkit-scrollbar { display: none; }

.gang-tab {
    flex: 0 0 auto;
    padding: 0 0.9rem;
    line-height: var(--tab-h);
    font-size: 0.92rem;
    color: var(--mute);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s, border-color 0.2s;
}

.gang-tab:first-child { margin-left: auto; }
.gang-tab:last-child { margin-right: auto; }
.gang-tab:hover { color: var(--dim); }
.gang-tab.active { color: var(--text); border-color: var(--text); }

.map-panel { height: calc(100dvh - var(--nav-h) - var(--tab-h) - 2px); min-height: 360px; }
.map-panel iframe { display: block; width: 100%; height: 100%; border: 0; }

.map-mode { padding-top: var(--nav-h); }
.map-mode .gangs-hero,
.map-mode .gangs-main,
.map-mode footer { display: none; }
.map-mode .navbar {
    background: rgba(10, 10, 10, 0.92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-color: var(--line);
}

.gangs-main { padding-top: 2.5rem; padding-bottom: 6rem; min-height: 60vh; }

.panel-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    margin-bottom: 1.75rem;
}

.panel-head h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); }
.panel-head p { max-width: 620px; margin: 0.5rem 0 0; color: var(--dim); }
.panel-head strong { color: var(--text); }

.org-mark {
    --org-color: var(--text);
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    font: 700 0.78rem/1 var(--f-body);
    letter-spacing: 0.02em;
    color: var(--org-color);
    background: color-mix(in srgb, var(--org-color) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--org-color) 45%, transparent);
    border-radius: 9px;
}

.empty-state {
    margin: 0;
    padding: 2rem 1.25rem;
    color: var(--mute);
    text-align: center;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}

.strike-board {
    display: grid;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.strike-board > .empty-state { border: none; }

.strike-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 4rem 11rem;
    align-items: center;
    gap: 1.25rem;
    padding: 0.8rem 1.1rem;
    font: inherit;
    color: inherit;
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    transition: background 0.2s;
}

.strike-row:last-child { border-bottom: none; }
.strike-row:hover { background: rgba(255, 255, 255, 0.03); }

.strike-org { display: flex; align-items: center; gap: 0.75rem; min-width: 0; font-weight: 500; }
.strike-org span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pips { display: flex; gap: 0.3rem; }

.pip {
    width: 22px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.pip.on { background: var(--text); }
.at-limit .pip.on { background: #ff7a7a; }

.strike-count { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.at-limit .strike-count { color: #ff7a7a; }

.strike-last { font-size: 0.85rem; color: var(--mute); text-align: right; }

.list-title { margin: 3rem 0 1rem; font-size: 1.2rem; }

.penalty-list { display: grid; gap: 0.75rem; }

.penalty {
    padding: 1rem 1.15rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.penalty.expired { opacity: 0.55; }

.penalty-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.penalty-org {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    padding: 0;
    font: 500 0.95rem/1.2 var(--f-body);
    color: var(--text);
    background: none;
    border: 0;
    cursor: pointer;
}

.penalty-org .org-mark { width: 28px; height: 28px; font-size: 0.7rem; border-radius: 7px; }
.penalty-org:hover span:last-child { text-decoration: underline; text-underline-offset: 3px; }

.penalty-date { flex: 0 0 auto; font-size: 0.85rem; color: var(--mute); }

.penalty-reason { margin: 0.7rem 0 0; color: var(--dim); white-space: pre-line; overflow-wrap: anywhere; }

.penalty-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 1rem;
    margin-top: 0.7rem;
    font-size: 0.8rem;
    color: var(--mute);
}

.tag {
    padding: 0.15rem 0.55rem;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.org-filter { display: grid; gap: 0.3rem; min-width: 220px; font-size: 0.8rem; color: var(--mute); }

.org-filter select {
    padding: 0.65rem 0.9rem;
    font: inherit;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
}


.org-list {
    display: grid;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.org-list > .empty-state { border: none; }

.org-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.1rem;
    font: inherit;
    color: inherit;
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    transition: background 0.2s;
}

.org-row:last-child { border-bottom: none; }
.org-row:hover { background: rgba(255, 255, 255, 0.03); }

.org-row-text { display: grid; gap: 0.1rem; min-width: 0; }
.org-row-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-row-desc { font-size: 0.88rem; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.org-row-strikes { font-size: 0.85rem; color: var(--mute); font-variant-numeric: tabular-nums; }
.org-row-strikes.has { color: #ff9a9a; }

.org-row-arrow { font-size: 1.3rem; line-height: 1; color: var(--mute); transition: transform 0.2s, color 0.2s; }
.org-row:hover .org-row-arrow { color: var(--text); transform: translateX(3px); }

.org-dialog {
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 0;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.org-dialog::backdrop { background: rgba(0, 0, 0, 0.75); }

.org-dialog-inner { position: relative; display: grid; gap: 1.25rem; padding: 1.75rem; }

.org-dialog-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    font-size: 1rem;
    color: var(--dim);
    background: none;
    border: 1px solid var(--line);
    border-radius: 50%;
    cursor: pointer;
}

.org-dialog-close:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.4); }

.org-dialog-head { display: flex; align-items: center; gap: 1rem; padding-right: 3rem; }
.org-dialog-head .org-mark { width: 54px; height: 54px; font-size: 1.05rem; border-radius: 12px; }
.org-dialog-head h2 { font-size: 1.7rem; overflow-wrap: anywhere; }

.org-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.org-stats > div { display: grid; gap: 0.15rem; padding: 0.8rem 1rem; }
.org-stats > div + div { border-left: 1px solid var(--line); }
.stat-value { font-size: 1.3rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 0.78rem; color: var(--mute); }

.org-description { margin: 0; color: var(--dim); white-space: pre-line; overflow-wrap: anywhere; }

.org-no-discord { margin: 0; font-size: 0.9rem; color: var(--mute); }

.load-error { padding: 1rem 1.2rem; color: #ff9a9a; border: 1px solid rgba(255, 122, 122, 0.35); border-radius: 10px; }

@media (max-width: 720px) {
    .strike-row { grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem 1rem; }
    .strike-row .pips { grid-column: 1; grid-row: 2; }
    .strike-count { grid-column: 2; grid-row: 1; }
    .strike-last { grid-column: 2; grid-row: 2; }
    .org-filter { width: 100%; }
}
