/* ===== Tournament public pages (standalone Bootstrap 5 documents) ===== */
:root {
    --tm-primary: #E86F2C;
    --tm-primary-dark: #C45A1E;
    --tm-accent: #6C5CE7;
    --tm-success: #00B894;
    --tm-warning: #F0A500;
    --tm-danger: #E17055;
    --tm-bg: #FAFBFE;
    --tm-card: #FFFFFF;
    --tm-text: #2D3436;
    --tm-muted: #636E72;
    --tm-border: #E8ECF1;
    --tm-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    --tm-gradient: linear-gradient(135deg, #E86F2C 0%, #FF6B6B 100%);
}

body.tm-body {
    font-family: 'Be Vietnam Pro', 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--tm-bg);
    color: var(--tm-text);
    -webkit-font-smoothing: antialiased;
}

.tm-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--tm-border);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.tm-header .brand { font-weight: 800; font-size: 22px; color: var(--tm-primary); text-decoration: none; }
.tm-header .nav-link { color: var(--tm-muted); font-weight: 600; }

.tm-hero {
    background: linear-gradient(135deg, #FFF5F0 0%, #F0EEFF 50%, #E8F8F5 100%);
    padding: 40px 0 28px;
}
.tm-hero h1 { font-weight: 800; font-size: clamp(26px, 5vw, 40px); margin: 8px 0; }
.tm-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--tm-card); border: 1px solid var(--tm-border); border-radius: 999px;
    padding: 4px 12px; font-size: 13px; font-weight: 600; color: var(--tm-muted); margin: 0 6px 6px 0;
}
.tm-status { font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; color: #fff; background: var(--tm-muted); }
.tm-status.open { background: var(--tm-success); }
.tm-status.closed { background: var(--tm-warning); }
.tm-status.live { background: var(--tm-accent); }
.tm-status.done { background: var(--tm-muted); }
.tm-status.cancelled { background: var(--tm-danger); }

.tm-card {
    background: var(--tm-card); border: 1px solid var(--tm-border); border-radius: 16px;
    box-shadow: var(--tm-shadow); padding: 20px; margin-bottom: 20px;
}
.tm-card h2 { font-size: 18px; font-weight: 800; margin-bottom: 14px; }

.tm-btn {
    display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer;
    background: var(--tm-gradient); color: #fff; font-weight: 700; border-radius: 12px;
    padding: 12px 22px; text-decoration: none;
}
.tm-btn:hover { color: #fff; filter: brightness(1.05); }
.tm-btn:disabled { opacity: .6; cursor: not-allowed; }

.tm-banner { border-radius: 12px; padding: 12px 16px; font-weight: 600; margin-bottom: 16px; }
.tm-banner.info { background: #EEF2FF; color: #3B4CCA; }
.tm-banner.warn { background: #FFF6E5; color: #9A6700; }
.tm-banner.danger { background: #FDECEA; color: #B3261E; }
.tm-banner.success { background: #E6F7F1; color: #0B7A5A; }

.tm-team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tm-team { border: 1px solid var(--tm-border); border-radius: 12px; padding: 12px 14px; }
.tm-team strong { display: block; }
.tm-team small { color: var(--tm-muted); }
.tm-team-pending { border-style: dashed; background: #fffaf3; }
.tm-team-status { display: block; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--tm-warning); }

.tm-prize-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--tm-border); }
.tm-prize-row:last-child { border-bottom: 0; }

/* Registration modal */
.tm-member-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--tm-border); border-radius: 10px; padding: 6px 10px; }
.tm-member { display: flex; align-items: center; gap: 8px; padding: 5px 0; cursor: pointer; }
.tm-member.hidden { display: none; }
.tm-qr { text-align: center; }
.tm-qr img { border-radius: 12px; max-width: 100%; }
.tm-qr .amount { font-size: 24px; font-weight: 800; color: var(--tm-primary); }

/* Tournament list cards */
.tm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.tm-list a.tm-card { text-decoration: none; color: inherit; margin-bottom: 0; transition: transform .15s; }
.tm-list a.tm-card:hover { transform: translateY(-3px); }

/* ===== Public tabs, schedule cards, podium ===== */
.tm-tabs .nav-link { color: var(--tm-muted); font-weight: 600; }
.tm-tabs .nav-link.active { color: var(--tm-primary); border-color: var(--tm-border) var(--tm-border) #fff; }
.tm-table th { font-size: 12px; text-transform: uppercase; color: var(--tm-muted); }

.tm-match { border: 1px solid var(--tm-border); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; background: #fff; }
.tm-match-live { border-color: var(--tm-accent); box-shadow: 0 0 0 2px rgba(108, 92, 231, .12); }
.tm-match-main { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.tm-side { font-weight: 600; }
.tm-side.win { color: #0b7a5a; font-weight: 800; }
.tm-result { font-weight: 800; font-size: 18px; min-width: 56px; text-align: center; }
.tm-match-meta { display: flex; gap: 10px; font-size: 12px; color: var(--tm-muted); margin-top: 2px; }
.tm-live { color: #fff; background: var(--tm-accent); border-radius: 999px; padding: 0 8px; font-weight: 700; }
.tm-games { margin-top: 6px; font-size: 13px; }
.tm-games summary { cursor: pointer; color: var(--tm-primary); }
.tm-games ol { margin: 6px 0 0; padding-left: 20px; }

.tm-podium { display: flex; justify-content: center; align-items: flex-end; gap: 14px; margin-top: 18px; }
.tm-podium-step { text-align: center; flex: 0 1 200px; }
.tm-podium-name { font-weight: 800; font-size: 18px; }
.tm-podium-members { font-size: 12px; color: var(--tm-muted); min-height: 18px; margin-bottom: 6px; }
.tm-podium-block { border-radius: 12px 12px 0 0; display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 800; color: #fff; }
.place-1 .tm-podium-block { height: 130px; background: linear-gradient(180deg, #f5b301, #e08e00); }
.place-2 .tm-podium-block { height: 96px; background: linear-gradient(180deg, #b8c0cc, #8b95a5); }
.place-3 .tm-podium-block { height: 72px; background: linear-gradient(180deg, #d99a6c, #b9743f); }

/* ===== TV mode ===== */
body.tv-body { margin: 0; background: #10131c; color: #f4f6fb; font-family: 'Be Vietnam Pro', sans-serif; height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
.tv-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 40px; background: #171b27; border-bottom: 2px solid var(--tm-primary); }
.tv-title { font-size: 34px; font-weight: 800; }
.tv-sub { font-size: 18px; color: #aeb6c8; }
.tv-clock { font-size: 30px; font-weight: 700; color: var(--tm-primary); }
.tv-stage { flex: 1; position: relative; padding: 24px 40px; overflow: hidden; }
.tv-pane { display: none; height: 100%; overflow: hidden; }
.tv-pane.active { display: block; animation: tvfade .5s; }
@keyframes tvfade { from { opacity: 0; } to { opacity: 1; } }
.tv-pane h2 { font-size: 30px; font-weight: 800; margin-bottom: 16px; color: var(--tm-primary); }
.tv-table { width: 100%; border-collapse: collapse; font-size: 26px; }
.tv-table th { text-align: center; font-size: 16px; color: #8a93a8; text-transform: uppercase; padding: 8px; }
.tv-table td { padding: 10px 12px; border-top: 1px solid #262c3d; text-align: center; }
.tv-table td:nth-child(2) { text-align: left; font-weight: 700; }
.tv-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(560px, 1fr)); gap: 28px; }
.tv-matches { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.tv-match { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; padding: 14px 18px; border-radius: 14px; background: #1b2030; margin-bottom: 12px; font-size: 26px; align-items: center; }
.tv-match .win { color: #4ce0b3; font-weight: 800; }
.tv-match .res { font-weight: 800; font-size: 32px; min-width: 90px; text-align: center; }
.tv-match.live { outline: 2px solid var(--tm-accent); }
.tv-empty { font-size: 28px; color: #8a93a8; padding-top: 80px; text-align: center; }
.tv-podium { display: flex; justify-content: center; align-items: flex-end; gap: 30px; height: 80%; }
.tv-podium .tm-podium-step { flex: 0 1 340px; }
.tv-podium .tm-podium-name { font-size: 32px; }
.tv-podium .tm-podium-members { font-size: 18px; color: #aeb6c8; }
.tv-podium .place-1 .tm-podium-block { height: 240px; font-size: 64px; }
.tv-podium .place-2 .tm-podium-block { height: 180px; font-size: 56px; }
.tv-podium .place-3 .tm-podium-block { height: 130px; font-size: 48px; }
.tv-dots { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; }
.tv-dots span { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #39405a; margin: 0 5px; }
.tv-dots span.on { background: var(--tm-primary); }
body.tv-body .tb-root { --tb-bg: #1b2030; --tb-border: #313851; --tb-muted: #8a93a8; color: #f4f6fb; }
body.tv-body .tb-match-head { background: #232a3f; }
body.tv-body .tb-team { background: #2a3350; color: #f4f6fb; }
body.tv-body .tb-win { background: #163a31; }
body.tv-body .tb-win .tb-team, body.tv-body .tb-win .tb-score { color: #4ce0b3; }
body.tv-body .tb-link { stroke: #4a5375; }
