﻿/* UAE Falconers League page (Widgets/League/League.ascx, modules/league.js). One file for both languages: sides are
   written as "inline-start / inline-end", so the page follows the direction of its container.
   The look is the website's own: its maroon (#89211b, the colour of .btn-primary) and gold, its text colours, and the
   cards, pill buttons and notes of the E-Preparation page (site.ar.css ".e-prep"). */
.league { --lg-main: #89211b; --lg-main-dark: #701a15; --lg-gold: #a39062; --lg-ink: #1c1c1c; --lg-muted: #5f5f5f; --lg-line: #ece9e1; --lg-soft: #f3f1ec;
    --lg-sand: #f1eadb; --lg-green: #1e5e34; --lg-green-soft: #e4f1e8; --lg-red: #8a1f17; --lg-red-soft: #fbe2df; --lg-gold-ink: #6b5a2e; --lg-gold-soft: #f4eedf;
    max-width: 1040px; margin: 0 auto; color: var(--lg-ink); position: relative; min-height: 260px; font-size: 16px; }
.league * { box-sizing: border-box; }
.league a { text-decoration: none; }
.league h1, .league h2, .league h3, .league p { margin: 0; }
.league.lg-busy { cursor: progress; }
.league.lg-busy::after { content: ""; position: absolute; top: 0; inset-inline: 0; height: 3px; background: linear-gradient(90deg, var(--lg-main), var(--lg-gold), var(--lg-main)); background-size: 200% 100%; animation: lg-slide 1s linear infinite; border-radius: 2px; }
@keyframes lg-slide { from { background-position: 0 0; } to { background-position: 200% 0; } }
.lg-loading { text-align: center; padding: 60px 0; font-size: 28px; color: var(--lg-gold); }

.lg-title { font-size: 26px; font-weight: 800; color: var(--lg-main); margin-bottom: 16px !important; }
.lg-title i { color: var(--lg-gold); margin-inline-end: 6px; }
.league h2 { font-size: 22px; font-weight: 700; color: #000; line-height: 1.5; }
.league h3 { font-size: 17px; font-weight: 700; color: #000; line-height: 1.5; }
.lg-sub { font-size: 13px; color: var(--lg-muted); }
.lg-text { font-size: 14px; color: var(--lg-muted); }
.lg-kicker { display: block; font-size: 14px; font-weight: 600; color: #7e6a3f; }
.lg-num { color: var(--lg-main); font-weight: 700; font-variant-numeric: tabular-nums; }
.lg-blue { color: #1e3a66; }
.lg-red { color: #8a1c1c; font-weight: 700; }
.lg-center { text-align: center; margin-top: 10px !important; }
.lg-section-title { margin: 20px 0 10px !important; }

/* the three parts */
.lg-stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.lg-stages a { height: 52px; border-radius: 6px; border: 1px solid var(--lg-main); background: rgba(137, 33, 27, .1); display: flex; align-items: center; justify-content: center; color: var(--lg-main); font-size: 17px; font-weight: 500; transition: background .15s; }
.lg-stages a.active { background: var(--lg-main); color: #fff; font-weight: 700; }
.lg-stages a:hover:not(.active) { background: rgba(137, 33, 27, .18); }

/* pills */
.lg-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.lg-pills a { height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--lg-line); background: #fff; color: #2c2c2c; display: inline-flex; align-items: center; font-size: 15px; font-weight: 500; white-space: nowrap; }
.lg-pills a.active { border-color: var(--lg-main); background: var(--lg-main); color: #fff; font-weight: 700; }
.lg-pills a:hover:not(.active) { border-color: var(--lg-gold); }

/* cards */
.lg-card { background: #fff; border: 1px solid var(--lg-line); border-radius: 16px; box-shadow: 0 2px 8px rgba(0, 0, 0, .04); padding: 18px 20px; margin-bottom: 16px; }
.lg-card.lg-flush { padding: 0; overflow: hidden; }
.lg-row { display: flex; align-items: center; gap: 12px; }
.lg-row-top { align-items: flex-start; }
.lg-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lg-fill { flex: 1; min-width: 0; }
.lg-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0 10px; }
.lg-head h2 { text-wrap: balance; }
.lg-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.lg-two > .lg-card, .lg-two > .lg-box { margin-bottom: 0; }
.lg-two { margin-bottom: 14px; }

.lg-avatar { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; background: var(--lg-sand); color: var(--lg-main); display: inline-flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800; }
.lg-avatar-lg { width: 46px; height: 46px; font-size: 19px; background: var(--lg-main); color: #fff; }
.lg-avatar-xl { width: 54px; height: 54px; font-size: 22px; background: var(--lg-main); color: #fff; }
.lg-avatar-soft { background: var(--lg-soft); color: #3d3830; }
.lg-rank { width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; background: var(--lg-soft); color: #3d3830; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; }
.lg-rank-1 { background: #e8c766; color: #3a2e05; }
.lg-rank-2 { background: #d3d7dd; color: #2b2f36; }
.lg-rank-3 { background: #d9a47c; color: #3a1f0b; }

.lg-chips { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 2px; }
.lg-chip { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 8px; padding: 1px 8px; }
.lg-chip-green { background: var(--lg-green-soft); color: var(--lg-green); }
.lg-chip-red { background: var(--lg-red-soft); color: var(--lg-red); }
.lg-chip-gold { background: var(--lg-gold-soft); color: var(--lg-gold-ink); }
.lg-chip-main { background: var(--lg-main); color: #fff; }
a.lg-chip:hover { filter: brightness(.95); }
.lg-tag { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; font-size: 12px; font-weight: 700; border-radius: 10px; padding: 3px 10px; white-space: nowrap; }
.lg-tag-main { background: var(--lg-main); color: #fff; margin-top: 4px; }
.lg-tag-green { background: var(--lg-green-soft); color: var(--lg-green); }
.lg-tag-soft { background: var(--lg-soft); color: var(--lg-muted); }

/* my team card */
.lg-mine-card { border-color: #dccfa9; background: #fffdf8; }
.lg-actions { display: flex; gap: 10px; margin-top: 12px; }
.lg-actions .lg-btn { flex: 1; }
.lg-btn { height: 46px; padding: 0 28px; border-radius: 999px; background: var(--lg-main); color: #fff !important; border: 1px solid var(--lg-main); display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 16px; font-weight: 500; cursor: pointer; transition: background .15s, border-color .15s; }
.lg-btn:hover { background: var(--lg-main-dark); border-color: var(--lg-main-dark); }
.lg-btn-outline { background: #fff; color: var(--lg-main) !important; }
.lg-btn-outline:hover { background: #fbf3f2; }
.lg-btn-danger { background: #fff; color: #a33a3a !important; border-color: #a33a3a; }
.lg-btn-danger:hover { background: #fbf3f2; }
.lg-btn-sm { height: 40px; font-size: 14px; padding: 0 20px; }
.lg-btn-block { display: flex; width: 100%; margin-top: 12px; }
.lg-btn.disabled { opacity: .45; pointer-events: none; }
.lg-round-danger { width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%; border: 1px solid #a33a3a; background: #fff; color: #a33a3a !important; display: inline-flex; align-items: center; justify-content: center; }
.lg-round-danger:hover { background: #fbf3f2; }
.lg-link { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; font-size: 14px; font-weight: 700; color: var(--lg-main) !important; }
.lg-back { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; margin-bottom: 8px; font-size: 14px; font-weight: 700; color: var(--lg-main) !important; }

/* ranking */
.lg-ranking { list-style: none; margin: 0 0 14px; padding: 0; }
.lg-ranking li + li { border-top: 1px solid var(--lg-line); }
.lg-rank-row { display: flex; align-items: center; gap: 14px; min-height: 66px; padding: 10px 20px; color: var(--lg-ink) !important; }
.lg-rank-row:hover { background: #faf7f1; }
.lg-rank-row.lg-mine, .lg-table tr.lg-mine td { background: #fbf5e6; }
.lg-team-name { display: block; font-size: 17px; font-weight: 700; color: #000; }
.lg-points { display: flex; flex-direction: column; align-items: center; min-width: 54px; }
.lg-points b { font-size: 20px; font-weight: 700; color: var(--lg-main); line-height: 1.2; font-variant-numeric: tabular-nums; }
.lg-points small { font-size: 11px; color: var(--lg-muted); }
.lg-final-banner > i { font-size: 34px; color: var(--lg-gold); }

/* tables */
.lg-table-wrap { overflow-x: auto; }
.lg-table { width: 100%; border-collapse: collapse; margin: 0; }
.lg-table thead tr { background: var(--lg-main); }
.lg-table th { background: var(--lg-main); color: #fff; font-size: 14px; font-weight: 500; text-align: center; padding: 14px 10px; white-space: nowrap; }
.lg-table th a { color: #fff !important; text-decoration: underline dotted; text-underline-offset: 3px; }
.lg-table td { text-align: center; padding: 12px 10px; border-top: 1px solid var(--lg-line); font-size: 16px; vertical-align: middle; font-variant-numeric: tabular-nums; }
.lg-table .lg-th-team, .lg-table .lg-td-team { text-align: start; }
.lg-td-team a { display: flex; align-items: center; gap: 8px; color: var(--lg-ink) !important; font-weight: 700; }
.lg-td-team a.lg-mine-name, .lg-draw li.lg-mine-name { color: var(--lg-main) !important; font-weight: 800; }
.lg-td-team .lg-rank { width: 24px; height: 24px; font-size: 12px; }
.lg-table tr.lg-qualified td { background: #f2f8f3; }
.lg-table .lg-total { font-weight: 700; color: var(--lg-main); }
/* points table: the team and the total stay in place; the races scroll between them when they do not all fit */
.lg-points-table .lg-th-team, .lg-points-table .lg-td-team { position: sticky; inset-inline-start: 0; z-index: 1; width: 32%; min-width: 230px; }
.lg-points-table .lg-th-total, .lg-points-table td.lg-total { position: sticky; inset-inline-end: 0; z-index: 1; min-width: 68px; }
.lg-points-table td.lg-td-team, .lg-points-table td.lg-total { background: #fff; }
.lg-points-table .lg-td-team::after, .lg-points-table td.lg-total::after { content: ""; position: absolute; top: 0; bottom: 0; width: 1px; background: var(--lg-line); }
.lg-points-table .lg-td-team::after { inset-inline-end: 0; }
.lg-points-table td.lg-total::after { inset-inline-start: 0; }
.lg-points-table .lg-th-race { white-space: normal; min-width: 64px; max-width: 120px; line-height: 1.35; }
.lg-points-table .lg-td-team a span:last-child { min-width: 0; }
.lg-ring { white-space: nowrap; }
.lg-td-team a.lg-team-inline { display: none; margin-top: 4px; color: var(--lg-gold-ink) !important; }
.lg-time { color: #3d3830; white-space: nowrap; }
.lg-swatch { width: 12px; height: 12px; flex-shrink: 0; margin-top: 4px; border-radius: 3px; background: var(--lg-green-soft); border: 1px solid #9cc9a8; }
.lg-scale h3 { font-size: 14px; margin-bottom: 8px !important; }
.lg-scale-row { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; text-align: center; margin-bottom: 6px; }
.lg-scale-row span { display: flex; flex-direction: column; border-radius: 6px; background: #f6f3ee; padding: 4px 0; }
.lg-scale-row small { font-size: 11px; color: var(--lg-muted); }
.lg-scale-row b { font-size: 14px; font-weight: 800; color: var(--lg-main); }

/* draw and race cards */
.lg-draw-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.lg-draw-grid .lg-card { margin-bottom: 0; }
.lg-draw { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
.lg-draw li { display: flex; align-items: flex-start; gap: 6px; font-size: 14px; min-height: 26px; line-height: 1.4; }
.lg-draw-name { display: flex; flex-direction: column; min-width: 0; padding-top: 1px; }
.lg-draw-name small { font-size: 12px; font-weight: 400; color: var(--lg-muted); }
.lg-n { width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; background: var(--lg-sand); color: var(--lg-main); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; }
.lg-result-line { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--lg-line); font-size: 14px; margin-top: 6px; }
.lg-result-line + .lg-result-line { margin-top: 0; }
.lg-place { width: 68px; flex-shrink: 0; color: var(--lg-muted); }

/* lists inside cards */
.lg-list-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--lg-line); }
.lg-card > h3 + .lg-list-row, .lg-card > .lg-sub + .lg-list-row { margin-top: 8px; }
.lg-bird { font-size: 20px; color: var(--lg-gold); flex-shrink: 0; }
.lg-bar { height: 6px; border-radius: 3px; background: #f1ece3; overflow: hidden; margin: 5px 0; }
.lg-bar span { display: block; height: 100%; border-radius: 3px; background: var(--lg-gold); }
.lg-bar-lg { height: 8px; border-radius: 4px; margin-top: 8px; }
.lg-own { margin-top: 12px; }
.lg-foot { padding-top: 10px; border-top: 1px solid var(--lg-line); }
.lg-label { display: block; font-size: 13px; font-weight: 700; color: #3d3830; margin-bottom: 6px; }

/* boxes and notes */
.lg-box { border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.lg-box.lg-between, .lg-box.lg-row { flex-direction: row; }
.lg-box-green { background: var(--lg-green-soft); color: var(--lg-green); }
.lg-box-green .lg-sub { color: #2f4a37; }
.lg-box-soft { background: var(--lg-soft); color: #3d3830; }
.lg-box-blue { background: #eef3fb; color: #1e3a66; font-size: 14px; margin-top: 0; }
.lg-count { font-size: 14px; font-weight: 700; margin-top: 2px; }
.lg-note { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; color: var(--lg-muted); margin: 0 0 14px !important; }
.lg-note i { margin-top: 3px; }
.lg-empty { text-align: center; padding: 28px 16px; color: var(--lg-muted); }
.lg-empty i { font-size: 34px; color: var(--lg-gold); margin-bottom: 8px; }
.lg-signin { font-size: 14px; color: var(--lg-muted); border-top: 1px solid var(--lg-line); padding-top: 12px; margin-top: 6px !important; }
.lg-signin a { color: var(--lg-main) !important; font-weight: 700; }

/* all falcons / my team's */
.lg-segment { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--lg-soft); border-radius: 10px; padding: 3px; margin-bottom: 16px; max-width: 420px; }
.lg-segment a { height: 38px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #3d3830; font-size: 14px; font-weight: 500; }
.lg-segment a.active { background: #fff; color: var(--lg-ink); font-weight: 700; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }

/* add-falcon window */
.lg-modal { position: fixed; inset: 0; z-index: 1050; background: rgba(20, 14, 10, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.lg-modal-box { background: #fff; border-radius: 16px; width: 100%; max-width: 560px; max-height: 88vh; display: flex; flex-direction: column; padding: 18px; gap: 12px; }
.lg-modal-box .lg-note { margin: 0 !important; }
.lg-modal-close { width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%; background: #f1ece3; color: #3d3830 !important; display: inline-flex; align-items: center; justify-content: center; font-size: 24px; line-height: 1; }
.lg-modal-list { overflow-y: auto; min-height: 120px; }
.lg-modal-list .lg-list-row:first-child { border-top: 0; }
.lg-search { display: flex; align-items: center; gap: 8px; height: 46px; border: 1px solid var(--lg-line); border-radius: 10px; padding: 0 12px; background: #fbfaf7; }
.lg-search i { color: var(--lg-muted); }
.lg-search input { flex: 1; border: 0; background: transparent; font-size: 15px; color: var(--lg-ink); outline: none; }
.lg-refusal { display: flex; gap: 8px; align-items: flex-start; background: var(--lg-red-soft); color: var(--lg-red); border-radius: 10px; padding: 10px 12px; }
.lg-refusal i { margin-top: 3px; }
.lg-prep-head { margin-bottom: 12px; }
.lg-prep-list { padding-top: 6px; padding-bottom: 6px; }
.lg-prep-list .lg-list-row:first-child { border-top: 0; }

@media (max-width: 767px) {
    .lg-title { font-size: 21px; }
    .lg-two, .lg-draw-grid { grid-template-columns: minmax(0, 1fr); }
    .lg-stages a { font-size: 15px; height: 40px; }
    .lg-card { padding: 14px; }
    .lg-rank-row { padding: 6px 12px; gap: 10px; }
    .lg-table th { font-size: 12px; padding: 9px 4px; white-space: normal; }
    .lg-table td { padding: 8px 4px; font-size: 14px; }
    .lg-points-table .lg-th-team, .lg-points-table .lg-td-team { width: auto; min-width: 136px; max-width: 150px; padding-inline-start: 8px; }
    .lg-points-table .lg-th-total, .lg-points-table td.lg-total { min-width: 50px; }
    .lg-points-table .lg-th-race { min-width: 50px; max-width: 70px; }
    .lg-points-table .lg-td-team a { gap: 6px; font-size: 13px; line-height: 1.35; }
    .lg-points-table .lg-td-team a span:last-child { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
    .lg-results .lg-col-team { display: none; }
    .lg-td-team a.lg-team-inline { display: inline-block; }
    .lg-head h2 { font-size: 20px; }
    .lg-actions { flex-direction: column; }
}
