/* ═══════════════════════════════════════════════════════════
   TOURNAMENTS PAGE
═══════════════════════════════════════════════════════════ */

.tn-page {
    min-height: 70vh;
    padding: 60px 0 100px;
    background: #0a0b0f;
    position: relative;
    overflow: hidden;
}

/* Subtle grid background */
.tn-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 35% at 50% 0%, rgba(var(--theme-color), 0.06) 0%, transparent 70%),
        repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(255,255,255,0.012) 40px),
        repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(255,255,255,0.012) 40px);
    pointer-events: none;
}

/* ── Hero Header ───────────────────────────────────────────── */

.tn-hero {
    text-align: center;
    padding: 10px 0 20px;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.tn-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.30;
    z-index: 0;
    pointer-events: none;
    -webkit-mask-image:
        linear-gradient(to right,  transparent 0%, black 18%, black 82%, transparent 100%),
        linear-gradient(to bottom, transparent 0%, black 18%, black 82%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(to right,  transparent 0%, black 18%, black 82%, transparent 100%),
        linear-gradient(to bottom, transparent 0%, black 18%, black 82%, transparent 100%);
    mask-composite: intersect;
}

.tn-hero > *:not(.tn-hero-bg) { position: relative; z-index: 1; }

.tn-hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px; height: 76px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--theme-color),.18) 0%, rgba(var(--theme-color),.04) 70%, transparent 100%);
    border: 1px solid rgba(var(--theme-color),.3);
    margin: 0 auto 20px;
    animation: tnFloat 3.5s ease-in-out infinite;
}

.tn-hero-icon i {
    font-size: 30px;
    color: rgba(var(--theme-color), 1);
    filter: drop-shadow(0 0 10px rgba(var(--theme-color), .7));
}

@keyframes tnFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}

.tn-hero-title {
    font-size: 38px;
    font-weight: 900;
    color: #fff;
    margin: 0 0 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.tn-hero-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: rgba(var(--theme-color), 1);
    border-radius: 2px;
    margin: 14px auto 0;
    box-shadow: 0 0 12px rgba(var(--theme-color), .6);
}

.tn-hero-sub {
    margin: 16px 0 0;
    font-size: 15px;
    color: rgba(255,255,255,.4);
    letter-spacing: .5px;
}

/* ── Section label ─────────────────────────────────────────── */

.tn-section-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,.5);
    margin: 36px 0 16px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    position: relative;
    z-index: 1;
}

.tn-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,.06);
    margin-left: 8px;
}

.tn-section-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tn-dot--active {
    background: #ff4d4d;
    box-shadow: 0 0 8px rgba(255,77,77,.8);
    animation: tnPulse 1.4s ease-in-out infinite;
}

.tn-dot--soon {
    background: #4ecdc4;
    box-shadow: 0 0 8px rgba(78,205,196,.6);
}

.tn-dot--coming {
    background: #8b7cf8;
    box-shadow: 0 0 8px rgba(139,124,248,.5);
}

@keyframes tnPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .4; }
}

/* ── Grid ──────────────────────────────────────────────────── */

.tn-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    position: relative;
    z-index: 1;
}

/* ── Card ──────────────────────────────────────────────────── */

.tn-card {
    position: relative;
    height: 200px;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    display: block;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,.07);
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.tn-card:hover {
    transform: translateY(-4px) scale(1.01);
    text-decoration: none;
}

.tn-card--active:hover {
    box-shadow: 0 12px 40px rgba(255,77,77,.2);
    border-color: rgba(255,77,77,.25);
}

.tn-card--get_ready:hover {
    box-shadow: 0 12px 40px rgba(78,205,196,.2);
    border-color: rgba(78,205,196,.25);
}

.tn-card--coming_soon:hover {
    box-shadow: 0 12px 40px rgba(139,124,248,.2);
    border-color: rgba(139,124,248,.25);
}

.tn-card--coming_soon .tn-card-timer-value { color: #8b7cf8; text-shadow: 0 0 10px rgba(139,124,248,.4); }
.tn-card-timer-date { font-size: 13px !important; letter-spacing: 0 !important; }

/* Banner image */
.tn-card-bg {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

.tn-card:hover .tn-card-bg {
    transform: scale(1.05);
}

/* Gradient overlay — strong at bottom, light at top */
.tn-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0,0,0,.92) 0%,
        rgba(0,0,0,.55) 45%,
        rgba(0,0,0,.15) 80%,
        rgba(0,0,0,.05) 100%
    );
}

/* Fallback no banner */
.tn-card--no-banner {
    background: linear-gradient(135deg, #1a1b2e 0%, #0f1020 100%);
}
.tn-card--no-banner .tn-card-overlay {
    background: none;
}

/* Status badge — top left */
.tn-badge {
    position: absolute;
    top: 14px; left: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    z-index: 2;
}

.tn-badge--live {
    background: rgba(255,40,40,.22);
    border: 1px solid rgba(255,60,60,.4);
    color: #ff6b6b;
}

.tn-badge-dot {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #ff4d4d;
    box-shadow: 0 0 6px rgba(255,77,77,1);
    animation: tnPulse 1.2s ease-in-out infinite;
}

.tn-badge--soon {
    background: rgba(78,205,196,.18);
    border: 1px solid rgba(78,205,196,.35);
    color: #4ecdc4;
}

.tn-badge--soon i { font-size: 9px; }

.tn-badge--coming {
    background: rgba(139,124,248,.18);
    border: 1px solid rgba(139,124,248,.35);
    color: #8b7cf8;
}

.tn-badge--coming i { font-size: 9px; }

/* Card body — bottom left */
.tn-card-body {
    position: absolute;
    bottom: 0; left: 0; right: 160px;
    padding: 0 18px 18px;
    z-index: 2;
}

.tn-card-name {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,.8);
    line-height: 1.2;
    margin-bottom: 5px;
}

.tn-card-desc {
    font-size: 12px;
    color: rgba(255,255,255,.5);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Timer — bottom right */
.tn-card-timer {
    position: absolute;
    bottom: 14px; right: 14px;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.1);
    padding: 8px 14px;
    border-radius: 10px;
    text-align: center;
    min-width: 130px;
    z-index: 2;
}

.tn-card-timer-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: rgba(255,255,255,.4);
    margin-bottom: 3px;
}

.tn-card-timer-value {
    font-size: 17px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
}

.tn-card--active   .tn-card-timer-value { color: #ff6b6b; text-shadow: 0 0 10px rgba(255,80,80,.4); }
.tn-card--get_ready .tn-card-timer-value { color: #4ecdc4; text-shadow: 0 0 10px rgba(78,205,196,.4); }

/* ── Empty state ───────────────────────────────────────────── */

.tn-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    color: rgba(255,255,255,.25);
    position: relative;
    z-index: 1;
}

.tn-empty i { font-size: 52px; margin-bottom: 18px; opacity: .25; }
.tn-empty p { font-size: 14px; margin: 0; }

/* ═══════════════════════════════════════════════════════════
   TOURNAMENT MODAL
═══════════════════════════════════════════════════════════ */

/* Overlay */
.tn-modal-wrap {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tn-modal-wrap.tn-modal-open {
    display: flex;
}

.tn-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.82);
    backdrop-filter: blur(6px);
    animation: tnFadeIn .2s ease;
}

@keyframes tnFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes tnSlideUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }

/* Panel */
.tn-modal {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1060px;
    max-height: 90vh;
    background: #111320;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: tnSlideUp .25s ease;
    box-shadow: 0 30px 80px rgba(0,0,0,.7);
}

/* Close button */
.tn-modal-close {
    position: absolute;
    top: 14px; right: 14px;
    z-index: 10;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.15);
    background: rgba(0,0,0,.5);
    color: rgba(255,255,255,.7);
    font-size: 13px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s, color .2s;
}
.tn-modal-close:hover {
    background: rgba(255,60,60,.25);
    color: #fff;
    border-color: rgba(255,60,60,.4);
}

/* ── Banner ──────────────────────────────────────────────── */

.tn-modal-banner {
    position: relative;
    height: 210px;
    background: linear-gradient(135deg, #1a1b2e, #0f1020);
    flex-shrink: 0;
    overflow: hidden;
}

.tn-modal-banner-img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}

.tn-modal-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(17,19,32,1)   0%,
        rgba(17,19,32,.6) 40%,
        rgba(0,0,0,.2)    100%
    );
}

.tn-modal-banner-body {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 0 22px 20px;
    z-index: 2;
}

.tn-modal-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    margin-bottom: 8px;
}

.tn-modal-name {
    font-size: 26px;
    font-weight: 900;
    color: #fff;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0,0,0,.9);
    line-height: 1.2;
}

/* ── Body ────────────────────────────────────────────────── */

.tn-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 22px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
    position: relative;
}

.tn-modal-body-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.1;
    z-index: 0;
    pointer-events: none;
}

.tn-modal-body > *:not(.tn-modal-body-bg) {
    position: relative;
    z-index: 1;
}

.tn-modal-body::-webkit-scrollbar { width: 4px; }
.tn-modal-body::-webkit-scrollbar-track { background: transparent; }
.tn-modal-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }

/* Countdown bar */
.tn-modal-countdown {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 16px;
}

.tn-modal-countdown-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: rgba(255,255,255,.4);
}

.tn-modal-countdown-value {
    font-size: 18px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
    color: rgba(var(--theme-color), 1);
    text-shadow: 0 0 12px rgba(var(--theme-color), .4);
}

/* Description */
.tn-modal-desc {
    font-size: 13px;
    color: rgba(255,255,255,.5);
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Loading spinner */
.tn-modal-loading {
    display: flex;
    justify-content: center;
    padding: 30px 0;
    color: rgba(255,255,255,.25);
    font-size: 22px;
}

/* ── Sections ────────────────────────────────────────────── */

.tn-modal-section {
    margin-bottom: 22px;
}

.tn-modal-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,.35);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.tn-modal-section-title i {
    color: rgba(var(--theme-color), .8);
}

/* Tiers */
.tn-modal-tiers {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tn-tier {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 8px;
    padding: 7px 10px;
}

.tn-tier-medal {
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 800;
    flex-shrink: 0;
}

.tn-medal--gold    { background: rgba(255,200,0,.18); border: 1px solid rgba(255,200,0,.4); color: #ffd700; }
.tn-medal--silver  { background: rgba(180,180,200,.15); border: 1px solid rgba(180,180,200,.35); color: #c0c0d0; }
.tn-medal--bronze  { background: rgba(200,130,50,.15); border: 1px solid rgba(200,130,50,.35); color: #cd7f32; }
.tn-medal--default { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); color: rgba(255,255,255,.5); }

.tn-tier-label {
    font-size: 11px;
    color: rgba(255,255,255,.5);
    margin-bottom: 1px;
}

.tn-tier-reward {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

/* Ranking rows */
.tn-modal-ranking {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tn-rank-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.05);
    border-radius: 8px;
}

.tn-rank-pos {
    width: 32px;
    font-size: 13px;
    font-weight: 800;
    color: rgba(255,255,255,.4);
    flex-shrink: 0;
}

.tn-rank--gold   { color: #ffd700; }
.tn-rank--silver { color: #c0c0d0; }
.tn-rank--bronze { color: #cd7f32; }

.tn-rank-name {
    flex: 1;
    font-size: 14px;
    color: rgba(255,255,255,.85);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tn-rank-pts {
    font-size: 12px;
    color: rgba(255,255,255,.4);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* ── Two-column row (prizes + ranking) ──────────────────── */

.tn-modal-cols {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 16px;
    margin-bottom: 22px;
    align-items: flex-start;
}

.tn-modal-cols > .tn-modal-section {
    width: calc(50% - 8px) !important;
    flex: 0 0 calc(50% - 8px) !important;
    min-width: 0;
    margin-bottom: 0 !important;
}

/* ── Goals / Participation Rewards ──────────────────────── */

.tn-goals {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tn-goal {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px;
    overflow: hidden;
}

.tn-goal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
}

.tn-goal-rewards--open {
    border-top: 1px solid rgba(255,255,255,.05);
}

.tn-goal-pts-badge {
    background: rgba(var(--theme-color), .12);
    border: 1px solid rgba(var(--theme-color), .3);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 800;
    color: rgba(var(--theme-color), 1);
    white-space: nowrap;
    flex-shrink: 0;
}

.tn-goal-pts-label {
    font-size: 11px;
    color: rgba(255,255,255,.35);
    margin-top: 2px;
}

.tn-goal-rewards {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 10px 14px;
}

.tn-goal-rewards--open {
    display: flex;
}

.tn-goal-reward-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.tn-chip--normal {
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.12);
    color: rgba(255,255,255,.75);
}

.tn-chip--premium {
    background: rgba(255,185,0,.1);
    border: 1px solid rgba(255,185,0,.3);
    color: #ffb900;
}

.tn-chip-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
    image-rendering: pixelated;
}

.tn-chip-icon {
    font-size: 15px;
    flex-shrink: 0;
    opacity: .8;
}

.tn-chip-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tn-chip-tier {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .6px;
    opacity: .7;
    flex-shrink: 0;
}

/* ── Goal rewards toggle ─────────────────────────────────── */

.tn-goal-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
    padding: 3px 9px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.5);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
    white-space: nowrap;
}

.tn-goal-toggle:hover,
.tn-goal-toggle--open {
    background: rgba(var(--theme-color),.12);
    color: rgba(var(--theme-color),1);
    border-color: rgba(var(--theme-color),.3);
}

.tn-goal-toggle i {
    font-size: 9px;
    transition: transform .2s;
}

/* ── Footer / CTA ────────────────────────────────────────── */

.tn-modal-footer {
    padding: 16px 22px;
    border-top: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}

.tn-modal-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    border-radius: 10px;
    background: rgba(var(--theme-color), 1);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    text-decoration: none;
    transition: opacity .2s, transform .2s, box-shadow .2s;
    box-shadow: 0 4px 20px rgba(var(--theme-color), .35);
}

.tn-modal-cta:hover {
    opacity: .9;
    transform: translateY(-1px);
    box-shadow: 0 6px 28px rgba(var(--theme-color), .5);
    color: #fff;
    text-decoration: none;
}

.tn-modal-cta-arrow {
    margin-left: auto;
    font-size: 11px;
    opacity: .7;
}

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 900px) {
    .tn-grid { grid-template-columns: 1fr; }
    .tn-card { height: 180px; }
    .tn-hero-title { font-size: 28px; }
}

@media (max-width: 560px) {
    .tn-modal-cols { flex-direction: column; }
}

@media (max-width: 600px) {
    .tn-page { padding: 40px 0 70px; }
    .tn-card { height: 160px; }
    .tn-card-name { font-size: 17px; }
    .tn-card-desc { display: none; }
    .tn-card-timer { min-width: 110px; padding: 6px 10px; }
    .tn-card-timer-value { font-size: 14px; }
    .tn-card-body { right: 130px; }
    .tn-hero-title { font-size: 24px; letter-spacing: 1px; }
    .tn-hero-icon { width: 60px; height: 60px; }
    .tn-hero-icon i { font-size: 24px; }
    .tn-modal-name { font-size: 20px; }
    .tn-modal-banner { height: 160px; }
    .tn-modal-wrap { padding: 10px; }
}
