/* Version: 5.4.0 */
:root {
    --tc-bg-primary: #1a1a1a;
    --tc-bg-secondary: #141414;
    --tc-bg-card: #1a1a1a;
    --tc-bg-page: #0f0f0f;
    --tc-text-primary: #eeeeee;
    --tc-text-secondary: #959595;
    --tc-text-dark: #eeeeee;
    --tc-text-muted: #888888;
    --tc-border-color: rgba(255, 255, 255, 0.06);
    --tc-border-hover: rgba(255, 255, 255, 0.12);
    --tc-shadow: rgba(0, 0, 0, 0.4);
    --tc-shadow-light: rgba(0, 0, 0, 0.2);

    --tc-primary: #c9a84c;
    --tc-accent: #d4b55e;
    --tc-success: #3DAA6B;
    --tc-warning: #c9a84c;
    --tc-danger: #d44c4c;
    --tc-special: #c9a84c;

    --tc-border-radius: 14px;
    --tc-border-radius-sm: 8px;
    --tc-border-radius-pill: 999px;
    --tc-gap: 8px;
    --tc-padding: 14px 16px;
    --tc-padding-sm: 10px;

    --tc-transition: all 0.18s ease;
    --tc-transition-slow: all 0.28s ease;
}

/* ─── Brand List ─── */
.tc-brands-wrap {
    margin-top: 1rem;
    margin-bottom: 1rem;
}
.tc-brand-list {
    display: flex;
    flex-direction: column;
    gap: var(--tc-gap);
    margin: 1.5rem auto;
}

/* ─── Card ─── */
.tc-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--tc-bg-card);
    padding: var(--tc-padding);
    border-radius: var(--tc-border-radius);
    border: 0.5px solid var(--tc-border-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    flex-wrap: nowrap;
}

.tc-card:hover {
    border-color: var(--tc-border-hover);
    box-shadow: 0 4px 24px var(--tc-shadow-light);
}

.tc-card[data-rank="1"] {
    border-color: var(--tc-primary);
    background: #1c1a14;
}

/* ─── Rank ─── */
.tc-rank {
    font-size: 11px;
    font-weight: 700;
    color: var(--tc-text-secondary);
    min-width: 18px;
    text-align: center;
    flex-shrink: 0;
    /* override absolute positioning from old styles */
    position: static;
    background: none;
    padding: 0;
    border-radius: 0;
    line-height: 1;
    width: auto;
    height: auto;
    top: auto;
    left: auto;
}

.tc-card[data-rank="1"] .tc-rank {
    color: var(--tc-primary);
    font-size: 11px;
    width: auto;
    height: auto;
    box-shadow: none;
}

/* ─── Logo ─── */
.tc-logo {
    width: 48px;
    min-width: 48px;
    height: 48px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 900;
    flex-shrink: 0;
}

.tc-card[data-rank="1"] .tc-logo {
    border: 0.5px solid var(--tc-primary);
}

.tc-logo img {
    padding: 6px;
    height: 100% !important;
    width: 100%;
    object-fit: contain;
    object-position: center;
    position: absolute;
    inset: 0;
    box-sizing: border-box;
    background: inherit !important;
    margin: auto;
}

/* ─── Info ─── */
.tc-info {
    flex: 1;
    min-width: 0;
    padding-left: 2px;
}

.tc-info .h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--tc-text-primary);
    margin: 0 0 3px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tc-info button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: var(--tc-text-primary) !important;
    cursor: pointer;
    text-align: left;
}

.tc-info button:hover {
    opacity: 0.7;
}

.tc-info p {
    font-size: 11px;
    font-weight: 400;
    color: var(--tc-text-secondary) !important;
    background: none;
    border-radius: 0;
    padding: 0;
    margin: 0 0 3px;
    min-width: 0;
    max-width: none;
}

.tc-info p::before {
    content: none;
}

.tc-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    color: var(--tc-warning) !important;
    margin-top: 3px;
}

/* ─── Bottom Actions ─── */
.tc-info-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ─── Buttons ─── */
button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    outline: none;
}

.tc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 16px;
    border-radius: var(--tc-border-radius-pill);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none !important;
    transition: var(--tc-transition);
    white-space: nowrap;
    cursor: pointer;
}

.tc-btn.visit {
    background: #2a2a2a;
    color: #aaaaaa !important;
    border: none;
}

.tc-btn.visit:hover {
    background: #333333;
    color: #eeeeee !important;
}

.tc-card[data-rank="1"] .tc-btn.visit {
    background: var(--tc-primary);
    color: #0f0f0f !important;
}

.tc-card[data-rank="1"] .tc-btn.visit:hover {
    background: var(--tc-accent);
    color: #0f0f0f !important;
    transform: scale(1.03);
}

.tc-btn.review {
    background: #222222 !important;
    color: var(--tc-text-muted) !important;
    border: 0.5px solid var(--tc-border-color) !important;
}

/* ─── Toggle Details ─── */
.tc-toggle-details {
    cursor: pointer;
    width: 100%;
    background: none;
    border: none;
    border-top: 0.5px solid var(--tc-border-color);
    color: var(--tc-text-secondary);
    font-size: 11px;
    font-weight: 600;
    padding: 10px 0 0;
    margin-top: 12px;
    text-align: center;
    transition: color 0.15s;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tc-toggle-details:hover {
    color: var(--tc-primary);
}

.tc-details {
    width: 100%;
    padding-top: 12px;
}

.tc-details-info-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 24px;
}

.tc-details-info-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 0.5px solid var(--tc-border-color);
    font-size: 12px;
}

.tc-details-info-name strong {
    color: var(--tc-text-primary) !important;
    font-weight: 600;
}

.tc-details-info-value {
    color: var(--tc-text-muted) !important;
    font-size: 12px;
}

/* ─── Floating Banner ─── */
.tc-floating-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0f0f0f;
    border-top: 0.5px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    padding: 12px 16px;
    z-index: 9999;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    will-change: transform, opacity;
}

.tc-floating-banner.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.banner-container {
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tc-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.tc-banner-content img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
    background: #1c1a14 !important;
    border: 0.5px solid var(--tc-primary);
    flex-shrink: 0;
    cursor: pointer;
}

.tc-banner-info strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #dddddd;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tc-banner-info span {
    display: block;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    background: rgb(37 37 37 / 50%);
    padding: 4px 8px;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tc-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tc-banner-actions .tc-btn.visit {
    background: var(--tc-primary);
    color: #0f0f0f !important;
    border-radius: var(--tc-border-radius-pill);
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tc-banner-actions .tc-btn.visit:hover {
    background: var(--tc-accent);
    transform: scale(1.04);
}

.tc-banner-close {
    background: rgba(255, 255, 255, 0.06) !important;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    width: 28px;
    height: 28px;
    border-radius: var(--tc-border-radius-pill);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.tc-banner-close:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: rgba(255, 255, 255, 0.7);
}

/* ─── States ─── */
.tc-loading {
    text-align: center;
    padding: 2rem;
    color: var(--tc-text-muted);
}

.tc-loading .tc-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid var(--tc-border-color);
    border-top-color: var(--tc-primary);
    border-radius: 50%;
    animation: tc-spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes tc-spin {
    to {
        transform: rotate(360deg);
    }
}

.tc-error,
.tc-no-data,
.tc-no-matches {
    text-align: center;
    padding: 2rem;
    color: var(--tc-text-secondary);
    font-size: 13px;
}

.tc-error-message {
    text-align: center;
    padding: 1.5rem;
    background: rgba(212, 76, 76, 0.08);
    border: 0.5px solid rgba(212, 76, 76, 0.25);
    border-radius: var(--tc-border-radius);
    color: var(--tc-danger);
    font-size: 13px;
}

.tc-retry-btn {
    margin-top: 1rem;
    padding: 8px 20px;
    background: var(--tc-primary);
    color: #0f0f0f;
    border: none;
    border-radius: var(--tc-border-radius-pill);
    cursor: pointer;
    font-weight: 700;
    font-size: 12px;
    transition: var(--tc-transition);
}

.tc-retry-btn:hover {
    background: var(--tc-accent);
}

/* ─── Matches ─── */
.matches h2 {
    text-align: center;
    padding: 1.5rem 1rem;
    font-size: 16px;
    font-weight: 600;
    color: var(--tc-text-primary);
}

.matches-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 100%;
    margin: 0 auto;
    justify-content: center;
}

.match-card {
    max-width: 290px;
    width: 100%;
    background: var(--tc-bg-card);
    border: 0.5px solid var(--tc-border-color);
    border-radius: var(--tc-border-radius);
    padding: 14px;
    transition: border-color 0.2s ease;
    display: flex;
    flex-direction: column;
}

.match-card:hover {
    border-color: var(--tc-border-hover);
}

.match-card p {
    margin: 4px 0;
    font-size: 11px;
    text-align: center;
    color: var(--tc-text-muted);
}

.match-date {
    text-align: center;
    font-size: 11px;
    color: var(--tc-text-secondary);
    margin-bottom: 4px;
}

.match-league {
    text-align: center;
    font-style: italic;
    font-size: 11px;
    color: var(--tc-text-secondary);
    margin-bottom: 10px;
}

.teams {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 10px 0;
}

.team {
    max-width: 90px;
    width: 100%;
    text-align: center;
}

.team img {
    width: 36px;
    height: 36px;
    margin: 0 auto 6px;
    display: block;
}

.team span {
    display: block;
    font-weight: 600;
    font-size: 12px;
    color: var(--tc-text-primary);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 36px;
}

.vs {
    font-size: 11px;
    font-weight: 700;
    color: var(--tc-text-secondary);
    letter-spacing: 0.05em;
}

.match-result {
    background: #222222;
    border-radius: var(--tc-border-radius-sm);
    padding: 8px 12px;
    text-align: center;
    margin: 10px 0;
}

.match-result strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--tc-text-primary);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.match-odds {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    padding: 6px 0;
}

.match-odds span {
    padding: 7px 10px;
    border-radius: var(--tc-border-radius-sm);
    font-weight: 700;
    font-size: 12px;
    min-width: 46px;
    text-align: center;
    border: 0.5px solid var(--tc-border-color);
    background: #222222;
    color: var(--tc-text-primary);
    transition: var(--tc-transition);
    position: relative;
}

.match-odds span::after {
    content: attr(data-type);
    display: block;
    font-size: 9px;
    font-weight: 500;
    color: var(--tc-text-secondary);
    margin-top: 1px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.match-odds span:hover {
    background: var(--tc-primary);
    color: #0f0f0f;
    border-color: var(--tc-primary);
    transform: translateY(-1px);
}

.match-odds span:hover::after {
    color: rgba(15, 15, 15, 0.6);
}

.visit-btn {
    display: block;
    background: var(--tc-primary);
    color: #0f0f0f;
    text-decoration: none !important;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.06em;
    padding: 9px 20px;
    text-align: center;
    border-radius: var(--tc-border-radius-pill);
    transition: var(--tc-transition);
    margin-top: auto;
}

.visit-btn:hover {
    background: var(--tc-accent);
    color: #0f0f0f;
}

/* ─── Brand Wrapper Layout ─── */
.brand-wrapper {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.brand-wrapper .matches {
    max-width: 270px;
    width: 100%;
    order: 2;
}

.brand-wrapper .tc-brand-list {
    order: 1;
    flex: 1;
}

/* ─── Debug ─── */
.geo-debug {
    background: #1a1a1a;
    color: #888 !important;
    padding: 12px;
    border-radius: var(--tc-border-radius-sm);
    margin-top: 16px;
    font-family: monospace;
    font-size: 11px;
    border: 0.5px solid var(--tc-border-color);
}

.geo-debug summary {
    cursor: pointer;
    font-weight: 700;
    color: #666;
}

.debug-content {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 0.5px solid var(--tc-border-color);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .tc-details-info-items {
        grid-template-columns: 1fr;
    }

    .brand-wrapper {
        flex-direction: column;
    }

    .brand-wrapper .matches {
        max-width: 100%;
        order: -1;
    }
}

@media (max-width: 600px) {
    .tc-card {
        flex-wrap: wrap;
    }

    .tc-info .h3 {
        text-align: center;
    }

    .tc-info {
        text-align: center;
        width: 100%;
        padding: 0;
    }

    .tc-rating {
        justify-content: center;
    }

    .tc-info-bottom {
        width: 100%;
        justify-content: center;
    }

    .tc-btn.visit {
        width: 100%;
        text-align: center;
    }

    .banner-container {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    .tc-banner-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .match-odds {
        gap: 5px;
    }

    .match-odds span {
        padding: 6px 8px;
        font-size: 12px;
        min-width: 40px;
    }

    .teams {
        gap: 14px;
    }
}