:root {
    --bg: #070b10;
    --surface: #0f1720;
    --surface-2: #131f2b;
    --surface-3: #182635;
    --line: rgba(207, 216, 226, 0.12);
    --line-strong: rgba(207, 216, 226, 0.22);
    --text: #f5f7fa;
    --muted: #9caab8;
    --green: #8fd14f;
    --green-2: #35d08a;
    --gold: #f5bf4f;
    --blue: #42b7ef;
    --red: #ef6464;
    --orange: #f19645;
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background:
        linear-gradient(180deg, rgba(7, 11, 16, 0.94), rgba(7, 11, 16, 0.98)),
        linear-gradient(135deg, #0d171e 0%, #071018 48%, #101819 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.72), transparent 72%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.page-shell {
    width: min(100%, 1680px);
    margin: 0 auto;
    padding: 22px;
    display: grid;
    gap: 18px;
    position: relative;
}

.notice-banner,
.league-header,
.archive-banner,
.metric-strip article,
.standings-panel,
.rail-card,
.fixture-panel,
.stage-card,
.page-footer,
.modal-shell {
    border: 1px solid var(--line);
    background: rgba(15, 23, 32, 0.92);
    box-shadow: var(--shadow);
}

.notice-banner {
    border-radius: 18px;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.notice-banner span,
.eyebrow {
    color: var(--green);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.notice-banner strong {
    display: block;
    margin-top: 4px;
}

.notice-actions,
.control-row,
.segmented-control {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.btn {
    min-height: 42px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 10px 14px;
    color: var(--text);
    background: rgba(24, 38, 53, 0.92);
    font-size: 13px;
    font-weight: 800;
}

.btn-primary {
    color: #07100b;
    background: linear-gradient(135deg, var(--green), #d5f56f);
    border-color: transparent;
}

.btn-muted {
    color: #d7e2ee;
}

.league-header {
    border-radius: 26px;
    padding: 28px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 22px;
    align-items: stretch;
    background:
        linear-gradient(135deg, rgba(18, 31, 42, 0.96), rgba(10, 16, 23, 0.96)),
        linear-gradient(135deg, rgba(143, 209, 79, 0.18), transparent);
}

.league-title {
    display: grid;
    align-content: center;
    min-width: 0;
}

.league-title h1 {
    margin: 10px 0 12px;
    font-family: "Space Grotesk", Inter, sans-serif;
    font-size: clamp(42px, 7vw, 92px);
    line-height: 0.92;
    letter-spacing: 0;
}

.league-title p {
    width: min(760px, 100%);
    margin: 0;
    color: #c4d0dc;
    font-size: clamp(16px, 2vw, 20px);
    line-height: 1.55;
}

.league-controls {
    min-width: 0;
}

.control-panel {
    height: 100%;
    border-radius: 18px;
    padding: 18px;
    display: grid;
    gap: 14px;
    background: rgba(8, 13, 20, 0.52);
    border: 1px solid var(--line);
}

.control-panel label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.control-panel select {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--text);
    background: #091018;
    outline: none;
}

.segmented-control {
    padding: 4px;
    border-radius: 14px;
    background: rgba(7, 11, 16, 0.72);
    border: 1px solid var(--line);
}

.segmented-control a {
    flex: 1 1 120px;
    padding: 10px 12px;
    border-radius: 10px;
    text-align: center;
    color: #cbd6e2;
    font-size: 13px;
    font-weight: 800;
}

.segmented-control a.active {
    color: #08110a;
    background: var(--green);
}

.status-pill {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.1em;
}

.status-pill.live {
    color: #07100b;
    background: var(--green);
}

.status-pill.archive {
    color: #edf3f9;
    background: rgba(64, 75, 90, 0.9);
}

.archive-banner {
    border-radius: 16px;
    padding: 16px 18px;
    color: #cbd6e2;
}

.archive-banner strong {
    color: var(--text);
}

.metric-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.metric-strip article {
    border-radius: 18px;
    padding: 18px;
    display: grid;
    gap: 7px;
}

.metric-strip span,
.metric-strip small {
    color: var(--muted);
}

.metric-strip span {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.metric-strip strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-family: "Space Grotesk", Inter, sans-serif;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.08;
}

.metric-strip small {
    font-size: 13px;
}

.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: start;
}

.standings-panel,
.rail-card,
.fixture-panel,
.stage-card {
    border-radius: 22px;
    padding: 20px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: end;
    margin-bottom: 16px;
}

.section-head.compact {
    align-items: start;
}

.section-head h2 {
    margin: 6px 0 0;
    font-family: "Space Grotesk", Inter, sans-serif;
    font-size: clamp(24px, 3vw, 34px);
    letter-spacing: 0;
}

.section-head p {
    margin: 0;
    max-width: 420px;
    color: var(--muted);
    line-height: 1.55;
}

.standings-export {
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #0a1119;
}

.table-scroll {
    overflow-x: auto;
}

.puan-tablosu {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
}

.puan-tablosu th,
.puan-tablosu td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.puan-tablosu th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: #d7e1ec;
    background: #162232;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.table-row {
    background: rgba(10, 17, 25, 0.68);
    transition: background 0.16s ease;
}

.table-row:hover {
    background: rgba(24, 38, 53, 0.82);
}

.rank-index {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #e7eef6;
    background: rgba(255,255,255,0.06);
    font-weight: 900;
}

.team-cell {
    min-width: 240px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.team-cell img {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    object-fit: contain;
    padding: 5px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--line);
}

.team-cell strong {
    display: block;
    max-width: 270px;
    overflow: hidden;
    color: #fff;
    text-overflow: ellipsis;
}

.team-cell span {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 12px;
}

.live-dot {
    display: inline-flex;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--red);
    box-shadow: 0 0 0 6px rgba(239,100,100,0.12);
    animation: pulse 1.4s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(0.9); opacity: 0.75; }
    50% { transform: scale(1.18); opacity: 1; }
}

.points {
    color: #fff;
    font-weight: 900;
}

.positive {
    color: var(--green-2);
    font-weight: 800;
}

.negative {
    color: #ff9b9b;
    font-weight: 800;
}

.mat-durum {
    display: inline-flex;
    min-width: 58px;
    min-height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 900;
}

.mat-bos {
    min-width: 32px;
    color: #91a0b1;
    background: rgba(145,160,177,0.12);
}

.mat-sampiyon {
    color: #fff4c8;
    background: rgba(245,191,79,0.18);
}

.mat-n2 {
    color: #ddffe8;
    background: rgba(53,208,138,0.18);
}

.mat-n3 {
    color: #ffe7d0;
    background: rgba(241,150,69,0.18);
}

.mat-tpsc {
    color: #dff5ff;
    background: rgba(66,183,239,0.18);
}

.mat-po {
    color: #e4ecff;
    background: rgba(95,129,255,0.2);
}

.mat-elendi {
    color: #ffe0e0;
    background: rgba(239,100,100,0.18);
}

.form-kutulari,
.son-mac-form-grid {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.form-kutu,
.mac-kutu {
    width: 25px;
    height: 25px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 900;
}

.mac-kutu {
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

.form-galibiyet,
.mac-g {
    color: #052112;
    background: var(--green-2);
}

.form-maglubiyet,
.mac-m {
    color: #fff;
    background: var(--red);
}

.form-bilinmiyor,
.mac-bilinmiyor {
    color: #d8e1ea;
    background: #4b5868;
}

.side-rail {
    display: grid;
    gap: 14px;
}

.rail-card {
    display: grid;
    gap: 14px;
}

.rail-list,
.legend-list {
    display: grid;
    gap: 9px;
}

.rail-list div,
.legend-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 11px 12px;
    background: rgba(24, 38, 53, 0.48);
}

.rail-list span,
.legend-list span {
    color: var(--muted);
    font-size: 13px;
}

.rail-list strong {
    font-size: 18px;
}

.fixture-grid,
.stage-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.match-list,
.stage-list {
    display: grid;
    gap: 10px;
}

.match-row,
.stage-match-card,
.stage-empty,
.fixture-item {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    background: rgba(10, 17, 25, 0.62);
}

.match-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.match-row span,
.match-row small,
.stage-meta,
.stage-note,
.fixture-meta-top,
.fixture-meta-bottom {
    color: var(--muted);
    font-size: 12px;
}

.match-row strong {
    display: block;
    margin-top: 4px;
    font-size: 15px;
}

.match-row > div:last-child {
    display: grid;
    gap: 8px;
    justify-items: end;
}

.match-status,
.stage-status,
.stage-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 11px;
    font-style: normal;
    font-weight: 900;
}

.match-status.canli,
.stage-status.canli {
    color: #ffe2e2;
    background: rgba(239,100,100,0.18);
}

.match-status.bitti,
.stage-status.bitti {
    color: #dcffe9;
    background: rgba(53,208,138,0.18);
}

.match-status.oynanacak,
.stage-status.oynanacak {
    color: #d8e1ea;
    background: rgba(145,160,177,0.16);
}

.stage-match-top,
.fixture-meta-top,
.fixture-meta-bottom {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.stage-pill.playoff {
    color: #ffe7d0;
    background: rgba(241,150,69,0.18);
}

.stage-pill.final {
    color: #fff4c8;
    background: rgba(245,191,79,0.18);
}

.stage-week {
    margin: 12px 0 8px;
    color: #dce6ef;
    font-size: 13px;
    font-weight: 800;
}

.stage-scoreline,
.fixture-scoreline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.stage-scoreline strong:last-child,
.fixture-scoreline strong:last-child {
    text-align: right;
}

.stage-scoreline span,
.fixture-scoreline span {
    color: var(--gold);
    font-family: "Space Grotesk", Inter, sans-serif;
    font-size: 22px;
    font-weight: 900;
}

.stage-note {
    margin-top: 8px;
}

.empty-state,
.empty-cell,
.detail-empty {
    padding: 18px;
    color: var(--muted);
    text-align: center;
    border: 1px dashed var(--line-strong);
    border-radius: 14px;
}

.page-footer {
    border-radius: 18px;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    color: var(--muted);
}

.page-footer strong {
    color: var(--text);
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    overflow-y: auto;
    background: rgba(3, 7, 12, 0.84);
    backdrop-filter: blur(10px);
}

.modal-shell {
    width: min(96%, 1440px);
    margin: 24px auto;
    border-radius: 22px;
    overflow: hidden;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 4;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: #fff;
    background: rgba(7, 11, 16, 0.72);
    font-size: 28px;
    line-height: 1;
}

.profile-modal {
    background: var(--surface);
}

.profile-hero {
    padding: 28px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(135deg, #122032, #0b121b);
}

.profile-hero-main {
    display: flex;
    gap: 18px;
    align-items: center;
}

.profile-logo-wrap {
    width: 112px;
    height: 112px;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,0.06);
}

.profile-logo {
    width: 84px;
    height: 84px;
    object-fit: contain;
}

.profile-type-badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 7px 10px;
    color: #07100b;
    background: var(--green);
    font-size: 11px;
    font-weight: 900;
}

.profile-hero-copy h2 {
    margin: 10px 0;
    font-family: "Space Grotesk", Inter, sans-serif;
    font-size: clamp(32px, 5vw, 52px);
    line-height: 1;
}

.profile-hero-copy p {
    margin: 0;
    color: var(--muted);
}

.profile-metrics {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.profile-metric,
.detail-card,
.sidebar-card-lite,
.profile-article,
.honor-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    background: rgba(24, 38, 53, 0.42);
}

.profile-metric span,
.detail-card span,
.honor-row span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.profile-metric strong {
    display: block;
    margin-top: 4px;
    font-size: 24px;
}

.profile-form-band {
    margin-top: 18px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.profile-form-band > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.profile-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
}

.profile-layout.player-layout-mode {
    grid-template-columns: 1fr;
}

.profile-layout.player-layout-mode .profile-sidebar {
    display: none;
}

.profile-sidebar,
.profile-main {
    padding: 22px;
}

.profile-sidebar {
    border-right: 1px solid var(--line);
    background: #111b26;
    display: grid;
    gap: 14px;
}

.profile-main {
    display: grid;
    gap: 14px;
    background: #0c141d;
}

.detail-card-grid,
.honor-grid,
.player-overview-grid,
.player-stat-grid {
    display: grid;
    gap: 12px;
}

.player-overview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.modal-tab-bar,
.fixture-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.modal-tab-btn,
.fixture-nav-btn {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 9px 12px;
    color: #d8e1ea;
    background: rgba(24, 38, 53, 0.76);
    font-weight: 800;
}

.modal-tab-btn.active {
    color: #07100b;
    background: var(--green);
}

.modal-tab-panel {
    display: none;
}

.modal-tab-panel.active {
    display: grid;
    gap: 14px;
}

.fixture-tab-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.fixture-tab-header h3 {
    margin: 0 0 4px;
}

.fixture-tab-header p {
    margin: 0;
    color: var(--muted);
}

.fixture-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.modal-loading,
.modal-error {
    padding: 28px;
    text-align: center;
}

.modal-loading p,
.modal-error p,
.profile-article p,
.sidebar-card-lite p,
.honor-row p {
    color: var(--muted);
    line-height: 1.6;
}

@media (max-width: 1180px) {
    .league-header,
    .content-layout,
    .fixture-grid,
    .stage-grid {
        grid-template-columns: 1fr;
    }

    .league-controls {
        width: 100%;
    }

    .side-rail {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .page-shell {
        padding: 12px;
    }

    .league-header,
    .standings-panel,
    .fixture-panel,
    .stage-card {
        border-radius: 18px;
        padding: 16px;
    }

    .metric-strip,
    .side-rail,
    .profile-metrics,
    .player-overview-grid,
    .player-stat-grid {
        grid-template-columns: 1fr;
    }

    .section-head,
    .match-row,
    .fixture-tab-header,
    .page-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .match-row > div:last-child {
        justify-items: start;
    }

    .profile-hero-main {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-layout {
        grid-template-columns: 1fr;
    }

    .profile-sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
}

@media (max-width: 560px) {
    .league-title h1 {
        font-size: 42px;
    }

    .notice-banner,
    .control-row,
    .segmented-control {
        align-items: stretch;
    }

    .notice-actions,
    .btn,
    .segmented-control a {
        width: 100%;
    }
}
