* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    background: #0b1118;
    min-height: 100vh;
    color: #e8edf5;
    font-family: 'Montserrat', Arial, Helvetica, sans-serif;
}

button {
    font-family: inherit;
    cursor: pointer;
}

.torneio-page {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 0 28px;
    padding-bottom: max(28px, env(safe-area-inset-bottom));
}

/* Breadcrumb */
.torneio-breadcrumb {
    padding: 12px 14px 8px;
}

.torneio-breadcrumb-trail {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 12px;
    font-weight: 600;
}

.torneio-breadcrumb-link {
    color: #8b95a8;
    background: none;
    border: 0;
    padding: 0;
    text-decoration: none;
    white-space: nowrap;
}

.torneio-breadcrumb-sep {
    color: #5c6575;
    font-size: 10px;
    flex-shrink: 0;
}

.torneio-breadcrumb-current {
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Banner */
.torneio-banner {
    position: relative;
    margin: 0 12px;
    border-radius: 16px;
    overflow: hidden;
    min-height: 220px;
    background: linear-gradient(135deg, #0f2a1a 0%, #1a3d28 40%, #0b1118 100%);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.torneio-banner-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.55;
}

.torneio-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(5, 10, 16, 0.15) 0%, rgba(5, 10, 16, 0.88) 100%);
}

.torneio-stage-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.06em;
}

.torneio-stage-live {
    background: rgba(220, 38, 38, 0.92);
    color: #fff;
    box-shadow: 0 0 16px rgba(220, 38, 38, 0.45);
}

.torneio-live-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
    animation: torneioPulse 1.2s ease-in-out infinite;
}

@keyframes torneioPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.torneio-banner-card {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.torneio-banner-card-left {
    min-width: 0;
    flex: 1;
}

.torneio-banner-name {
    font-size: clamp(14px, 3.8vw, 17px);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 4px;
}

.torneio-banner-prize {
    font-size: clamp(22px, 6vw, 28px);
    font-weight: 900;
    color: #22c55e;
    line-height: 1;
    margin-bottom: 6px;
}

.torneio-banner-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #cbd5e1;
}

.torneio-participate-btn {
    flex-shrink: 0;
    min-height: 40px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(180deg, #22c55e, #15803d);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
}

/* Countdown */
.torneio-countdown-bar {
    margin: 14px 12px 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(18, 26, 36, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.torneio-countdown-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.torneio-countdown-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #22c55e;
}

.torneio-countdown-time {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-variant-numeric: tabular-nums;
}

.torneio-cd-segment b {
    font-size: 16px;
    font-weight: 900;
    color: #fff;
}

.torneio-cd-segment em {
    font-style: normal;
    font-size: 11px;
    font-weight: 700;
    color: #8b95a8;
    margin-left: 2px;
    margin-right: 4px;
}

.torneio-countdown-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #8b95a8;
}

/* Tabs */
.torneio-tabs-container {
    margin-top: 14px;
    padding: 0 12px;
}

.torneio-tabs-row {
    display: flex;
    gap: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 14px;
}

.torneio-tab-btn {
    flex: 1;
    border: 0;
    background: transparent;
    color: #8b95a8;
    font-size: 13px;
    font-weight: 700;
    padding: 12px 8px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.torneio-tab-btn.is-active {
    color: #22c55e;
    border-bottom-color: #22c55e;
}

.torneio-tab-content {
    margin-top: 4px;
}

/* Info grid */
.torneio-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.torneio-info-card {
    background: rgba(18, 26, 36, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.torneio-info-label {
    font-size: 10px;
    font-weight: 700;
    color: #8b95a8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.torneio-info-value {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.torneio-info-range {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #8b95a8;
}

.torneio-info-range b {
    color: #fff;
    font-weight: 900;
}

/* Podium */
.torneio-podium {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.torneio-podium-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(18, 26, 36, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.torneio-podium-item-1 {
    border-color: rgba(250, 204, 21, 0.35);
    background: linear-gradient(90deg, rgba(234, 179, 8, 0.12), rgba(18, 26, 36, 0.95));
}

.torneio-podium-item-2 {
    border-color: rgba(148, 163, 184, 0.3);
}

.torneio-podium-item-3 {
    border-color: rgba(180, 83, 9, 0.35);
}

.torneio-podium-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.torneio-podium-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: #1e293b;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.torneio-podium-avatar-1 { border-color: #facc15; }
.torneio-podium-avatar-2 { border-color: #94a3b8; }
.torneio-podium-avatar-3 { border-color: #d97706; }

.torneio-podium-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.torneio-avatar-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-size: 16px;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(135deg, #334155, #1e293b);
}

.torneio-avatar-fallback-sm {
    font-size: 11px;
}

.torneio-podium-place {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 10px;
    font-weight: 900;
    color: #0b1118;
    border: 2px solid #0b1118;
}

.torneio-podium-place-1 { background: #facc15; }
.torneio-podium-place-2 { background: #cbd5e1; }
.torneio-podium-place-3 { background: #d97706; color: #fff; }

.torneio-podium-content {
    flex: 1;
    min-width: 0;
}

.torneio-podium-top-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.torneio-podium-name,
.torneio-lb-name {
    border: 0;
    background: none;
    padding: 0;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    text-align: left;
}

.torneio-podium-prize,
.torneio-lb-col-prize {
    color: #22c55e;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.premio-coin {
    width: 14px;
    height: 14px;
    object-fit: contain;
    margin-right: 6px;
    vertical-align: -2px;
    filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.25));
}

.torneio-podium-points {
    font-size: 12px;
    font-weight: 700;
    color: #8b95a8;
    margin-bottom: 4px;
}

.torneio-podium-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.torneio-sparkline-area {
    fill: rgba(34, 197, 94, 0.15);
}

.torneio-sparkline-line {
    fill: none;
    stroke: #22c55e;
    stroke-width: 1.5;
}

.torneio-podium-meta-text,
.torneio-lb-name-meta {
    font-size: 10px;
    font-weight: 600;
    color: #8b95a8;
}

.torneio-meta-dot,
.torneio-meta-rate {
    color: #22c55e;
}

/* Leaderboard */
.torneio-lb-header,
.torneio-lb-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 64px 72px;
    gap: 8px;
    align-items: center;
    padding: 10px 8px;
}

.torneio-lb-header {
    font-size: 10px;
    font-weight: 800;
    color: #8b95a8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 4px;
}

.torneio-lb-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 12px;
}

.torneio-lb-row:last-child {
    border-bottom: 0;
}

.torneio-lb-col-num {
    font-weight: 800;
    color: #8b95a8;
}

.torneio-lb-col-name {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.torneio-lb-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #1e293b;
    display: grid;
    place-items: center;
}

.torneio-lb-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.torneio-lb-name-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.torneio-lb-col-points {
    font-weight: 800;
    text-align: right;
}

.torneio-lb-col-prize {
    text-align: right;
}

/* Empty panels */
.torneio-tab-panel[hidden] {
    display: none !important;
}

.torneio-empty-panel {
    text-align: center;
    padding: 32px 16px;
    background: rgba(18, 26, 36, 0.95);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.torneio-empty-ranking {
    margin-bottom: 12px;
}

.torneio-empty-panel i {
    font-size: 32px;
    color: #22c55e;
    margin-bottom: 12px;
}

.torneio-empty-panel h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.torneio-empty-panel p {
    font-size: 13px;
    color: #8b95a8;
    margin-bottom: 16px;
    line-height: 1.4;
}

.torneio-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 20px;
    border-radius: 10px;
    background: linear-gradient(180deg, #22c55e, #15803d);
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 900;
}

.torneio-rules {
    background: rgba(18, 26, 36, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 16px;
}

.torneio-rules h3 {
    font-size: 15px;
    margin-bottom: 12px;
}

.torneio-rules ul,
.torneio-rules-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0;
}

.torneio-rules li,
.torneio-rules-list-item {
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.5;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.torneio-rules-list-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.torneio-rules-content {
    background: rgba(18, 26, 36, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    overflow: hidden;
    padding: 4px 16px;
}

/* Premios tab */
.torneio-premios-card {
    background: rgba(18, 26, 36, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    overflow: hidden;
}

.torneio-premios-header,
.torneio-premios-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
}

.torneio-premios-header {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8b95a8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.torneio-premios-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.torneio-premios-row:last-child {
    border-bottom: 0;
}

.torneio-premios-pos {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
}

.torneio-premios-valor {
    text-align: right;
    white-space: nowrap;
    color: #22c55e;
    font-size: 13px;
    font-weight: 900;
}

@media (min-width: 768px) {
    .torneio-page {
        max-width: 820px;
        padding-top: 8px;
    }

    .torneio-banner {
        min-height: 260px;
    }

    .torneio-info-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 380px) {
    .torneio-lb-header,
    .torneio-lb-row {
        grid-template-columns: 28px minmax(0, 1fr) 52px 62px;
        gap: 4px;
        font-size: 11px;
    }

    .torneio-participate-btn {
        padding: 0 12px;
        font-size: 12px;
    }
}
