/* Ported from /matches/public/css/tournament.css — recoloured for v3 by tools/port_css.php. Do not edit; re-run the tool. */
/* public/css/tournament.css
 *
 * Styles for views/tournament.php — the public-facing single-tournament
 * view (hero header, bracket, teams table, rules tab).
 *
 * Previously this lived as a 38-rule <style> block + 33 inline style=""
 * attributes inside the PHP file. All extracted here.
 *
 * Naming conventions:
 *   .t-*    — top-level tournament page sections (hero, tabs, sections)
 *   .b-*    — bracket-specific elements (bracket cards, team rows, scores)
 *   .teams-table-* — teams listing / standings table
 *   .server-banner — connect-info banner shown to logged-in players
 *   .countdown-* — pre-tournament countdown widget
 */

.t-wrap {
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 16px 60px;
}

/* ── Hero (header) ───────────────────────────────────────────────────── */
.t-hero {
    background: linear-gradient(135deg, #09111f, #0d1828, #09111f);
    border-bottom: 1px solid rgba(47, 139, 255, 0.1);
    padding: 44px 0 36px;
    position: relative;
    overflow: hidden;
}
.t-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 100% at 50% -30%, rgba(47, 139, 255, 0.07) 0%, transparent 65%);
    pointer-events: none;
}
.t-hero-wrap {
    /* Special t-wrap variant inside hero — no top padding */
    padding-top: 0;
}
.t-hero-pill-row {
    /* Wrapper around the status pill */
    margin-bottom: 10px;
}
.t-hero-title {
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 10px;
}
.t-hero-desc {
    color: var(--text-secondary);
    margin: 0 0 14px;
    font-size: .95rem;
    max-width: 600px;
}
.t-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: .82rem;
    color: var(--text-muted);
}
.t-hero-meta-mine {
    /* "you are registered with team X" message */
    color: #35c46a;
}

/* Status pill — one shape, multiple state colors */
.t-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.t-pill.live     { background: rgba(255, 154, 107, 0.12); color: #ff9a6b; border: 1px solid rgba(255, 154, 107, 0.3); }
.t-pill.upcoming { background: rgba(47, 139, 255, 0.1);  color: #2f8bff; border: 1px solid rgba(47, 139, 255, 0.25); }
.t-pill.done     { background: rgba(53, 196, 106, 0.1);  color: #35c46a; border: 1px solid rgba(53, 196, 106, 0.25); }
.t-pill.inprog   { background: rgba(255, 193, 7, 0.1);  color: #FFC107; border: 1px solid rgba(255, 193, 7, 0.25); }

/* Countdown to tournament start */
.t-countdown {
    margin-top: 14px;
    padding: 12px 16px;
    background: rgba(47, 139, 255, 0.06);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.t-countdown-label {
    color: var(--text-muted);
    font-size: .85rem;
}
.t-countdown-clock {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: .04em;
}

/* ── Tabs ────────────────────────────────────────────────────────────── */
.t-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    margin: 24px 0 0;
}
.t-tab {
    background: none;
    border: 0;
    font-family: inherit;
    padding: 10px 20px;
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all .2s;
}
.t-tab.active {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}
.t-tab:hover:not(.active) { color: var(--text-primary); }
.server-banner .btn { margin-left: auto; }
@media (max-width: 768px) { .server-banner .btn { margin-left: 0; } }

.t-section { display: none; padding-top: 24px; }
.t-section.active { display: block; }

/* ── Server banner ───────────────────────────────────────────────────── */
.server-banner {
    background: rgba(47, 139, 255, 0.05);
    border: 1px solid rgba(47, 139, 255, 0.15);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.server-banner--top {
    /* Variant when banner is positioned at top of content area */
    margin-top: 20px;
}
.sb-label {
    color: var(--accent-primary);
    font-weight: 600;
}
.sb-pwd-label {
    color: var(--text-muted);
}
.sb-code {
    background: rgba(255, 255, 255, 0.06);
    padding: 4px 10px;
    border-radius: 6px;
    color: #fff;
    font-size: .88rem;
}

/* ── Bracket ─────────────────────────────────────────────────────────── */
.bracket-wrap {
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 20px;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
}
.bracket-grid {
    display: flex;
    gap: 0;
    min-width: max-content;
    align-items: flex-start;
    padding: 8px 0;
}
.bracket-round {
    display: flex;
    flex-direction: column;
    min-width: 220px;
    position: relative;
    scroll-snap-align: start;
}
.bracket-round + .bracket-round { margin-left: 32px; }

.bracket-round-title {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--accent-primary);
    margin-bottom: 12px;
    text-align: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(47, 139, 255, 0.15);
    /* stays visible while scrolling a tall bracket */
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--bg-primary, var(--bg-secondary));
}

.b-match {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
    transition: border-color .2s;
    position: relative;
}
.b-match.completed { border-color: rgba(53, 196, 106, 0.25); }
.b-match.ready     { border-color: rgba(47, 139, 255, 0.2); }
.b-match.bye       { opacity: 0.45; }

.b-team {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
    font-size: .88rem;
    min-height: 40px;
}
.b-team:last-child { border-bottom: none; }
.b-team.winner { background: rgba(53, 196, 106, .07); }
.b-team.loser  { opacity: .5; }

.b-team-logo {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .65rem;
    font-weight: 700;
    color: var(--accent-primary);
    flex-shrink: 0;
    overflow: hidden;
}
.b-team-logo img { width: 100%; height: 100%; object-fit: cover; }

.b-team-name { flex: 1; color: #fff; font-weight: 500; }
.b-team-name.tbd { color: var(--text-muted); font-style: italic; }

.b-score {
    font-weight: 700;
    font-size: .9rem;
    min-width: 20px;
    text-align: right;
}
/* Winning team's score is green, losing team's score is grey.
   Replaces inline style="color:...". */
.b-score--winner { color: #35c46a; }
.b-score--loser  { color: #888; }

.b-match-label {
    position: absolute;
    top: 4px;
    right: 7px;
    font-size: .58rem;
    color: rgba(255, 255, 255, .2);
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ── Empty states ────────────────────────────────────────────────────── */
.t-empty {
    /* Used for "no bracket yet" and "no teams registered yet" placeholders */
    text-align: center;
    padding: 60px;
    color: var(--text-muted);
}
.t-empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

/* ── Teams table (standings) ─────────────────────────────────────────── */
.teams-table-wrap {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    overflow: hidden;
}

.teams-table { width: 100%; border-collapse: collapse; }
.teams-table th {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.teams-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: .9rem;
}
.teams-table tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* Per-cell helpers used inside the team rows */
.tt-rank-cell {
    color: var(--text-muted);
    font-size: .82rem;
}
.tt-team-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.tt-team-logo {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    background: rgba(47, 139, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 700;
    color: var(--accent-primary);
    overflow: hidden;
    flex-shrink: 0;
}
.tt-team-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tt-team-name {
    color: #fff;
}
.tt-team-tag {
    color: var(--text-muted);
    font-size: .75rem;
}
.tt-players-cell {
    color: var(--text-muted);
    font-size: .82rem;
}
.tt-wins-cell { color: #35c46a; font-weight: 600; }
.tt-loss-cell { color: #ff9a6b; font-weight: 600; }

/* Status badge inside the team row — replaces dynamic inline color */
.tt-status {
    font-size: .8rem;
    font-weight: 600;
}
.tt-status--winner     { color: #FFD700; }
.tt-status--eliminated { color: #ff9a6b; }
.tt-status--confirmed  { color: #35c46a; }
.tt-status--pending    { color: #FFC107; }
.tt-status--unknown    { color: #888; }

/* ── Group stage standings ───────────────────────────────────────────── */
.gs-standings {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 28px;
}
.gs-table { width: 100%; border-collapse: collapse; }
.gs-table thead th {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    white-space: nowrap;
}
.gs-th-rank { width: 36px; }
.gs-table tbody td { padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.gs-table tbody tr:last-child td { border-bottom: none; }
.gs-table tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }

.gs-row--leader td { background: rgba(47, 139, 255, 0.03); }
.gs-row--advancing td { border-left: 2px solid rgba(53, 196, 106, 0.4); }
.gs-row--advancing .gs-rank::after { content: '↑'; font-size: .65rem; color: #35c46a; margin-left: 3px; vertical-align: middle; }

.gs-rank { color: var(--text-muted); font-size: .82rem; font-weight: 600; }
.gs-row--leader .gs-rank { color: #FFD700; }

.gs-team-cell { display: flex; align-items: center; gap: 10px; }
.gs-team-logo {
    width: 30px; height: 30px; border-radius: 7px;
    background: rgba(47, 139, 255, 0.08);
    display: flex; align-items: center; justify-content: center;
    font-size: .62rem; font-weight: 700; color: var(--accent-primary);
    overflow: hidden; flex-shrink: 0;
}
.gs-team-logo img { width: 100%; height: 100%; object-fit: cover; }
.gs-team-name { color: #fff; font-weight: 600; font-size: .9rem; }
.gs-team-tag  { color: var(--text-muted); font-size: .75rem; margin-left: 4px; }

.gs-num     { color: var(--text-secondary); font-size: .88rem; text-align: center; }
.gs-wins    { color: #35c46a; font-weight: 600; }
.gs-losses  { color: #ff9a6b; }
.gs-gd--pos { color: #35c46a; font-weight: 600; }
.gs-gd--neg { color: #ff9a6b; }
.gs-pts     { color: #fff; font-weight: 700; font-size: .95rem; text-align: center; }

/* ── Group stage match list ──────────────────────────────────────────── */
.gs-matches { margin-top: 4px; }
.gs-matches-title {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.gs-match {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 6px;
    gap: 12px;
}
.gs-match.completed { border-color: rgba(53, 196, 106, 0.2); }

.gs-match-team {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    font-size: .88rem;
    color: var(--text-secondary);
}
.gs-match-team--right { flex-direction: row-reverse; }
.gs-match-team--winner span { color: #fff; font-weight: 700; }

.gs-match-logo {
    width: 24px; height: 24px; border-radius: 5px;
    background: rgba(255, 255, 255, 0.06);
    display: flex; align-items: center; justify-content: center;
    font-size: .6rem; font-weight: 700; color: var(--accent-primary);
    overflow: hidden; flex-shrink: 0;
}
.gs-match-logo img { width: 100%; height: 100%; object-fit: cover; }

.gs-match-score {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .95rem;
    font-weight: 700;
    min-width: 70px;
    justify-content: center;
}
.gs-score-sep { color: var(--text-muted); font-weight: 400; }
.gs-match-vs  { color: var(--text-muted); font-size: .75rem; font-weight: 600; letter-spacing: .05em; }

/* ── Clickable bracket match ─────────────────────────────────────────── */
.b-match--link { cursor: pointer; }
.b-match--link:hover { border-color: rgba(47, 139, 255, 0.35); background: rgba(18, 24, 38, 1); }

/* ── Match detail modal ──────────────────────────────────────────────── */
.md-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 9999;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 24px 16px;
}
.md-overlay.open { display: flex; }

.md-box {
    background: #0d1422;
    border: 1px solid rgba(47, 139, 255, 0.18);
    border-radius: 18px;
    padding: 28px;
    max-width: 780px;
    width: 100%;
    margin: auto;
    position: relative;
}

.md-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}
.md-close:hover { color: #fff; }

.md-loading {
    text-align: center;
    padding: 48px;
    color: var(--text-muted);
    font-size: .9rem;
}
.md-error { color: #ff9a6b; padding: 20px; text-align: center; }

/* Series header */
.md-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.md-team-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}
.md-team-block--right { align-items: center; }

.md-team-logo {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: rgba(47, 139, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.md-team-logo-img { width: 100%; height: 100%; object-fit: cover; }
.md-team-logo-txt { font-size: .75rem; font-weight: 700; color: var(--accent-primary); }

.md-team-name {
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
}
.md-team-name--winner { color: #fff; font-weight: 700; }

.md-series-score {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 2rem;
    font-weight: 800;
    flex-shrink: 0;
}
.md-score-sep { color: var(--text-muted); font-size: 1.4rem; }
.md-score--win  { color: #35c46a; }
.md-score--loss { color: rgba(255, 255, 255, 0.25); }

/* Map card row */
.md-maps {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.md-map-card {
    display: block;
    font: inherit;
    color: inherit;
    flex: 1;
    min-width: 90px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    text-align: center;
    transition: border-color .15s, background .15s;
}
.md-map-card:hover { border-color: rgba(47, 139, 255, 0.25); }
.md-map-card--active {
    border-color: var(--accent-primary);
    background: rgba(47, 139, 255, 0.07);
}
.md-map-name {
    display: block;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.md-map-card--active .md-map-name { color: var(--accent-primary); }
.md-map-score {
    font-size: .95rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    justify-content: center;
    gap: 5px;
}

/* Per-map stats panel */
.md-map-stats { display: none; }
.md-map-stats--active { display: block; }

.md-stats-team-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--accent-primary);
    margin: 16px 0 6px;
}

.md-table-wrap { overflow-x: auto; margin-bottom: 4px; }
.md-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
}
.md-table th {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    white-space: nowrap;
}
.md-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
}
.md-table tr:hover td { background: rgba(255, 255, 255, 0.02); }
.md-player-name { color: #fff; font-weight: 500; }
.md-stat--pos { color: #35c46a; font-weight: 600; }
.md-stat--neg { color: #ff9a6b; }

.md-no-stats {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-size: .9rem;
}

/* Demo links */
.md-demos {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.md-demos-title {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.md-demo-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    background: rgba(47, 139, 255, 0.06);
    border: 1px solid rgba(47, 139, 255, 0.2);
    color: var(--accent-primary);
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    margin-right: 8px;
}
.md-demo-link:hover { background: rgba(47, 139, 255, 0.12); }

/* ── Rules tab ───────────────────────────────────────────────────────── */
.rules-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 24px;
}
.rules-text {
    color: var(--text-secondary);
    font-size: .9rem;
    line-height: 1.8;
    margin: 0;
    white-space: pre-wrap;
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .t-wrap { padding: 0 12px 48px; }
    .t-hero { padding: 28px 0 22px; }

    .t-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        padding-bottom: 2px;
    }
    .t-tab { white-space: nowrap; flex-shrink: 0; padding: 10px 14px; }

    /* Bracket scrolls horizontally — add scroll hint */
    .bracket-wrap {
        position: relative;
        padding-bottom: 24px;
    }
    .bracket-wrap::after {
        content: '← scroll →';
        display: block;
        text-align: center;
        font-size: .7rem;
        color: var(--text-muted);
        margin-top: 6px;
        letter-spacing: .04em;
    }
    .bracket-round { min-width: 180px; }

    .teams-table-wrap { overflow-x: auto; }
    .teams-table { min-width: 480px; }

    .t-empty { padding: 36px 16px; }

    .server-banner { flex-direction: column; align-items: flex-start; gap: 8px; }
    
    .rules-card { padding: 16px; }
}

@media (max-width: 480px) {
    .t-hero { padding: 20px 0 16px; }
    .t-hero-meta { gap: 10px; font-size: .78rem; }
    .t-tab { padding: 8px 10px; font-size: .82rem; }
    .bracket-round { min-width: 160px; }
    .b-team { padding: 8px 10px; font-size: .82rem; }
    .bracket-round + .bracket-round { margin-left: 20px; }
}

/* ==================== TOURNAMENT MOBILE POLISH ==================== */

@media (max-width: 768px) {
    /* Prize / stats row — 2 cols on mobile */
    .t-stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .t-stat-box { padding: 12px; border-radius: 10px; }
    .t-stat-value { font-size: 1.4rem; }
    .t-stat-label { font-size: 0.75rem; }

    /* Registration form */
    .t-reg-form input,
    .t-reg-form select,
    .t-reg-form textarea {
        font-size: 16px !important;
        min-height: 46px;
        padding: 10px 12px;
    }
    .t-reg-btn { min-height: 50px; font-size: 1rem; border-radius: 10px; }

    /* Bracket horizontal scroll hint */
    .bracket-scroll-hint { display: block !important; }

    /* Team list card */
    .t-team-card { padding: 12px; border-radius: 10px; }
    .t-team-avatar { width: 36px; height: 36px; }
    .t-team-name { font-size: 0.9rem; }

    /* Server banner */
    .server-banner {
        padding: 10px 12px;
        border-radius: 8px;
    }
    .server-connect-code { font-size: 0.8rem; }
    
    /* Rules card */
    .rules-card p, .rules-card li { font-size: 0.88rem; }
}

@media (max-width: 375px) {
    .t-hero h1 { font-size: 1.3rem; }
    .t-stats-row { grid-template-columns: 1fr 1fr; gap: 8px; }
    .t-stat-value { font-size: 1.2rem; }
    .t-tab { padding: 6px 8px; font-size: 0.76rem; }
    .bracket-round { min-width: 140px; }
    .b-team { padding: 6px 8px; font-size: 0.76rem; }
}

