/* brand/forms.css — Forms, light-mode readability, auth/players/cards, nav hides (Wave 3 split + W4f register brand-pass) */
/* -------------------------------------------------------------------------- */
/* v1.8.0 — Light-mode competition UI readability (empty cards, forms, etc.)  */
/* -------------------------------------------------------------------------- */
html[data-theme="light"] .tmg-empty-card,
body.tmg-theme-light .tmg-empty-card {
    background: #FFFFFF;
    border-color: color-mix(in srgb, var(--tmg-teal) 40%, #c5d0d4);
    color: var(--tmg-muted);
}

html[data-theme="light"] .tmg-empty-card .tmg-empty-title,
body.tmg-theme-light .tmg-empty-card .tmg-empty-title,
html[data-theme="light"] .tmg-empty-card > p:first-child,
body.tmg-theme-light .tmg-empty-card > p:first-child {
    color: #0B1214;
}

html[data-theme="light"] .tmg-empty-card .tmg-empty-hint,
body.tmg-theme-light .tmg-empty-card .tmg-empty-hint {
    color: var(--tmg-muted);
}

html[data-theme="light"] .tmg-form,
body.tmg-theme-light .tmg-form,
html[data-theme="light"] .tmg-card:not(article),
body.tmg-theme-light .tmg-card:not(article),
html[data-theme="light"] .tmg-panel,
body.tmg-theme-light .tmg-panel,
html[data-theme="light"] .tmg-msg,
body.tmg-theme-light .tmg-msg {
    background: #FFFFFF;
    color: #0B1214;
}

html[data-theme="light"] .tmg-form label,
body.tmg-theme-light .tmg-form label {
    color: #0B1214;
}

html[data-theme="light"] .tmg-form .description,
body.tmg-theme-light .tmg-form .description {
    color: var(--tmg-muted);
}

html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="url"],
html[data-theme="light"] input[type="email"],
html[data-theme="light"] input[type="number"],
html[data-theme="light"] input[type="search"],
html[data-theme="light"] input[type="password"],
html[data-theme="light"] select,
html[data-theme="light"] textarea,
body.tmg-theme-light input[type="text"],
body.tmg-theme-light input[type="url"],
body.tmg-theme-light input[type="email"],
body.tmg-theme-light input[type="number"],
body.tmg-theme-light input[type="search"],
body.tmg-theme-light input[type="password"],
body.tmg-theme-light select,
body.tmg-theme-light textarea {
    background: #FFFFFF;
    border-color: #c5d0d4;
    color: #0B1214;
}

html[data-theme="light"] .tmg-activity-title,
body.tmg-theme-light .tmg-activity-title {
    color: #0B1214;
}

html[data-theme="light"] .tmg-activity-summary,
body.tmg-theme-light .tmg-activity-summary,
html[data-theme="light"] .tmg-activity-when,
body.tmg-theme-light .tmg-activity-when {
    color: var(--tmg-muted);
}

html[data-theme="light"] .tmg-activity-card,
body.tmg-theme-light .tmg-activity-card {
    background: #FFFFFF;
    border-color: #c5d0d4;
}

html[data-theme="light"] .tmg-home-comp-card,
body.tmg-theme-light .tmg-home-comp-card,
html[data-theme="light"] .tmg-home-hero-card,
body.tmg-theme-light .tmg-home-hero-card {
    border-color: #c5d0d4;
}

html[data-theme="light"] .tmg-home-comp-card h4,
body.tmg-theme-light .tmg-home-comp-card h4,
html[data-theme="light"] .tmg-home-section-head h3,
body.tmg-theme-light .tmg-home-section-head h3,
html[data-theme="light"] .tmg-home-hero-copy h1,
body.tmg-theme-light .tmg-home-hero-copy h1 {
    color: #0B1214;
}

html[data-theme="light"] .tmg-auth-hello,
body.tmg-theme-light .tmg-auth-hello {
    color: #0B1214;
}

html[data-theme="light"] .tmg-leaderboard th,
body.tmg-theme-light .tmg-leaderboard th,
html[data-theme="light"] .tmg-leaderboard td,
body.tmg-theme-light .tmg-leaderboard td {
    color: #0B1214;
}

html[data-theme="light"] .tmg-leaderboard tr.tmg-empty td,
body.tmg-theme-light .tmg-leaderboard tr.tmg-empty td {
    color: var(--tmg-muted);
}

html[data-theme="light"] .tmg-leaderboard tr.tmg-empty .tmg-empty-title,
body.tmg-theme-light .tmg-leaderboard tr.tmg-empty .tmg-empty-title {
    color: #0B1214;
}


/* Frame HOTP / bubble boxes — never crop ribbon (8–10% inset in assets). */
.tmg-hot-press-card .tmg-home-hero-art.tmg-hot-press-thumb {
    background-size: contain;
}
.tmg-news-card-thumb,
.tmg-news-featured-art {
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    object-fit: contain;
}

/* -------------------------------------------------------------------------- */
/* HTML/CSS article cards (1.8.6) — interactive TMG teal components           */
/* Spec: ARCHITECT-HTML-COMPONENTS.md                                         */
/* -------------------------------------------------------------------------- */
article.tmg-card {
    background: var(--tmg-panel, #142026);
    border: 1px solid var(--tmg-home-border, #243038);
    border-radius: 22px;
    box-shadow: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    isolation: isolate;
    overflow: hidden;
    padding: 0;
    position: relative;
    text-decoration: none;
    transition: border-color .28s ease, box-shadow .28s ease, transform .28s ease;
}

article.tmg-card:hover,
article.tmg-card:focus-within {
    border-color: rgba(0, 201, 177, .5);
    box-shadow: 0 0 28px rgba(0, 201, 177, .14);
    transform: translateY(-2px);
}

.tmg-card__media {
    background: #0a0c0e;
    display: block;
    isolation: isolate;
    overflow: hidden;
    padding: 8% 8% 10%;
    position: relative;
    text-decoration: none !important;
    width: 100%;
}

.tmg-card__media > img {
    aspect-ratio: 16 / 10;
    background-color: #0a0c0e;
    border-radius: 10px;
    display: block;
    height: auto;
    object-fit: cover;
    object-position: center;
    width: 100%;
}

.tmg-card__media-placeholder {
    aspect-ratio: 16 / 10;
    background:
        linear-gradient(135deg, #1a2830, #0b1214 65%),
        radial-gradient(circle at 60% 40%, rgba(0, 201, 177, .28), transparent 50%);
    border-radius: 10px;
    display: block;
    width: 100%;
}

/* CSS text ribbon — readable white on teal, rotated, inset so never cropped */
.tmg-ribbon {
    background: #00C9B1;
    box-shadow:
        0 2px 0 #005A52,
        0 0 0 2px #005A52;
    color: #FFFFFF;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: clamp(1.1rem, 2.8vw, 2.4rem);
    font-stretch: condensed;
    font-weight: 800;
    letter-spacing: .08em;
    line-height: 1.15;
    max-width: 72%;
    padding: .42em .85em .48em;
    pointer-events: none;
    position: absolute;
    right: 10%;
    text-align: center;
    text-shadow:
        0 0 2px #000,
        0 1px 0 #000,
        1px 0 0 #000,
        -1px 0 0 #000,
        0 -1px 0 #000,
        1px 1px 0 #000,
        -1px 1px 0 #000;
    text-transform: uppercase;
    top: 12%;
    transform: rotate(-12deg);
    transform-origin: center center;
    -webkit-text-stroke: .35px #000;
    z-index: 2;
}

.tmg-ribbon--hotp {
    font-size: clamp(1rem, 2.5vw, 2.1rem);
    letter-spacing: .06em;
    max-width: 85%;
}

.tmg-ribbon--review,
.tmg-ribbon--news {
    letter-spacing: .12em;
}
/* Larger ribbon on hero / single featured overlays (Captain) */
.tmg-card--hero .tmg-ribbon,
.tmg-card--featured .tmg-ribbon,
.single .tmg-card__media .tmg-ribbon,
.tmg-post-ribbon {
    font-size: clamp(1.6rem, 4vw, 3.2rem);
}


/* Optional PNG ribbon fallback (filter tmg_bubble_use_png_ribbon / .tmg-ribbon--png) */
.tmg-ribbon--png {
    background: transparent;
    box-shadow: none;
    color: transparent;
    font-size: 0;
    letter-spacing: 0;
    max-width: none;
    padding: 0;
    right: 0;
    text-shadow: none;
    top: 0;
    transform: none;
    -webkit-text-stroke: 0;
    width: 100%;
}

.tmg-ribbon--png img {
    display: block;
    height: auto;
    object-fit: contain;
    pointer-events: none;
    width: 100%;
}

.tmg-score {
    background: #0b1214;
    border: 1.5px solid #00C9B1;
    border-radius: 999px;
    color: #E8EEF0;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .02em;
    line-height: 1;
    padding: 7px 12px;
    pointer-events: none;
    position: absolute;
    right: 10%;
    top: 10%;
    z-index: 3;
}

.tmg-score span {
    color: rgba(232, 238, 240, .72);
    font-size: .78em;
    font-weight: 700;
    margin-left: 1px;
}

.tmg-card__slash {
    background: #00C9B1;
    bottom: 0;
    clip-path: polygon(0 28%, 100% 0, 100% 100%, 0 100%);
    height: 18px;
    left: 0;
    pointer-events: none;
    position: absolute;
    right: 0;
    z-index: 2;
}

.tmg-card__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px 20px;
}

.tmg-card__by {
    color: rgba(232, 238, 240, .88);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .01em;
    margin: 0;
}

.tmg-card__by a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(0, 201, 177, .45);
    text-underline-offset: 2px;
}

.tmg-card__by a:hover,
.tmg-card__by a:focus-visible {
    color: #00C9B1;
    text-decoration-color: #00C9B1;
}

.tmg-card__date {
    color: var(--tmg-muted, #A8BCC4);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    margin: 0;
    text-transform: uppercase;
}

.tmg-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 2px 0 0;
    padding: 0;
}

.tmg-card__tags li {
    margin: 0;
    padding: 0;
}

.tmg-card__tags a,
.tmg-card__tags li {
    border: 1px solid #00C9B1;
    border-radius: 999px;
    color: #00C9B1;
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    padding: 4px 10px;
    text-decoration: none;
    text-transform: uppercase;
}

.tmg-card__tags a:hover,
.tmg-card__tags a:focus-visible {
    background: rgba(0, 201, 177, .12);
    color: #E8EEF0;
}

.tmg-card__title {
    color: var(--tmg-mist, #E8EEF0) !important;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -.01em;
    line-height: 1.25;
    margin: 4px 0 0;
}

.tmg-card__title a {
    color: inherit !important;
    text-decoration: none !important;
}

.tmg-card__title a:hover,
.tmg-card__title a:focus-visible {
    color: #00C9B1 !important;
}

article.tmg-card.tmg-card--featured .tmg-card__title,
article.tmg-card.tmg-card--hero .tmg-card__title,
article.tmg-card.tmg-bubble-card--featured .tmg-card__title,
article.tmg-card.tmg-bubble-card--hero .tmg-card__title {
    font-size: clamp(1.2rem, 2.2vw, 1.55rem);
}

article.tmg-card.tmg-card--hero,
article.tmg-card.tmg-bubble-card--hero {
    height: 100%;
    min-height: 100%;
}

/* Home news grid keeps prior spanning; cards fill cells. */
.tmg-home-news.tmg-bubble-grid article.tmg-card.tmg-home-article {
    min-height: 0;
}

.tmg-home-news.tmg-bubble-grid article.tmg-card.tmg-home-article-featured {
    grid-row: span 2;
}

.tmg-home-news.tmg-bubble-grid article.tmg-card.tmg-home-article-wide {
    grid-column: 2 / span 2;
}

/* News page card layout */
.tmg-news-bubble-layout {
    align-items: start;
    display: grid;
    gap: 20px;
    grid-template-columns: 1.15fr .85fr;
}

.tmg-news-bubble-layout .tmg-news-feature {
    margin: 0;
}

.tmg-news-secondary.tmg-bubble-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tmg-news-secondary.tmg-bubble-grid .tmg-news-item {
    margin: 0;
}

@media (max-width: 900px) {
    .tmg-news-bubble-layout {
        grid-template-columns: 1fr;
    }

    .tmg-home-news.tmg-bubble-grid article.tmg-card.tmg-home-article-featured,
    .tmg-home-news.tmg-bubble-grid article.tmg-card.tmg-home-article-wide {
        grid-column: auto;
        grid-row: auto;
    }
}

/* Light mode readability */
html[data-theme="light"] article.tmg-card,
body.tmg-theme-light article.tmg-card {
    background: #FFFFFF;
    border-color: #c5d0d4;
}

html[data-theme="light"] .tmg-card__by,
body.tmg-theme-light .tmg-card__by,
html[data-theme="light"] .tmg-card__title,
body.tmg-theme-light .tmg-card__title {
    color: #0B1214 !important;
}

html[data-theme="light"] .tmg-card__date,
body.tmg-theme-light .tmg-card__date {
    color: var(--tmg-muted);
}

html[data-theme="light"] .tmg-score,
body.tmg-theme-light .tmg-score {
    background: #FFFFFF;
    color: #0B1214;
}

html[data-theme="light"] .tmg-score span,
body.tmg-theme-light .tmg-score span {
    color: var(--tmg-muted);
}

html[data-theme="light"] .tmg-card__media,
body.tmg-theme-light .tmg-card__media {
    background: #E8EEF0;
}

html[data-theme="light"] .tmg-card__tags a:hover,
body.tmg-theme-light .tmg-card__tags a:hover {
    color: #0B1214;
}


/* -------------------------------------------------------------------------- */
/* 1.8.8 — Hero Preview Cup (upper-right) + square card grids                 */
/* -------------------------------------------------------------------------- */

/* Preview Cup surface rules live in brand/home.css. */

/* 2×3 equal square article cards */
.tmg-card-grid {
    display: grid;
    gap: 16px;
}

.tmg-card-grid--2x3 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
}

.tmg-card-grid--2x3 > .tmg-msg {
    grid-column: 1 / -1;
}

/* News 2×3: minmax keeps columns honest if chrome legacy layout MQ fires. */
.tmg-news-layout.tmg-card-grid--2x3 {
    align-items: stretch;
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Square cards (home/news grids): whole card is 1:1; text sits over image.
 * Media/body layout is scoped to .tmg-card--square only — never bleed onto
 * non-square cards that share .tmg-card-grid. */
article.tmg-card.tmg-card--square {
    aspect-ratio: 1 / 1;
    gap: 0;
    height: auto;
    min-height: 0;
    padding: 0;
    position: relative;
}

/* Beat legacy chrome .tmg-news-card padding when used as bubble squares. */
article.tmg-card.tmg-news-card.tmg-card--square {
    gap: 0;
    padding: 0;
}

/* Home squares: override legacy home.css min-heights / block display. */
article.tmg-card.tmg-home-article.tmg-card--square {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 0;
    padding: 0;
}

article.tmg-card.tmg-card--square .tmg-card__media {
    aspect-ratio: auto;
    bottom: 0;
    height: 100%;
    left: 0;
    padding: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    z-index: 0;
}

article.tmg-card.tmg-card--square .tmg-card__media > img,
article.tmg-card.tmg-card--square .tmg-card__media-placeholder {
    aspect-ratio: auto;
    border-radius: 0;
    height: 100%;
    object-fit: cover;
    object-position: center;
    width: 100%;
}

article.tmg-card.tmg-card--square .tmg-card__slash {
    height: 12px;
}

article.tmg-card.tmg-card--square .tmg-card__body {
    background: linear-gradient(
        180deg,
        rgba(10, 12, 14, 0) 0%,
        rgba(10, 12, 14, .72) 28%,
        rgba(10, 12, 14, .94) 100%
    );
    bottom: 0;
    gap: 6px;
    left: 0;
    padding: 28px 14px 14px;
    position: absolute;
    right: 0;
    z-index: 2;
}

article.tmg-card.tmg-card--square .tmg-card__title {
    -webkit-box-orient: vertical;
    display: -webkit-box;
    font-size: 1rem;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    margin: 2px 0 0;
    overflow: hidden;
}

@media (max-width: 900px) {
    .tmg-news-layout.tmg-card-grid--2x3,
    .tmg-card-grid--2x3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .tmg-news-layout.tmg-card-grid--2x3,
    .tmg-card-grid--2x3 {
        grid-template-columns: 1fr;
    }
}

/* Single type bubble (pill) in card body — not a second banner on the image */
.tmg-type-badge-wrap {
    margin: 0 0 2px;
}

.tmg-type-badge,
a.tmg-type-badge {
    background: rgba(0, 201, 177, .14);
    border: 1px solid #00C9B1;
    border-radius: 999px;
    color: #00C9B1 !important;
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    line-height: 1.2;
    padding: 4px 10px;
    text-decoration: none !important;
    text-transform: uppercase;
}

a.tmg-type-badge:hover,
a.tmg-type-badge:focus-visible {
    background: rgba(0, 201, 177, .22);
    color: #E8EEF0 !important;
}

.tmg-type-badge--hotp {
    letter-spacing: .04em;
}

/* Single post HOTP: ribbon overlays featured banner; image remains visible */
.tmg-single-hotp-media {
    display: block;
    isolation: isolate;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.tmg-single-hotp-media img {
    display: block;
    height: auto;
    max-width: 100%;
    width: 100%;
}

.tmg-single-hotp-media .tmg-ribbon,
.tmg-single-hotp-media .tmg-post-ribbon {
    max-width: 78%;
    pointer-events: none;
    right: 8%;
    top: 10%;
    z-index: 2;
}

@media (max-width: 900px) {
    .tmg-card-grid--2x3,
    .tmg-home-news.tmg-card-grid--2x3,
    .tmg-news-layout.tmg-card-grid--2x3 {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }
}

@media (max-width: 560px) {
    .tmg-card-grid--2x3,
    .tmg-home-news.tmg-card-grid--2x3,
    .tmg-news-layout.tmg-card-grid--2x3 {
        grid-template-columns: 1fr;
    }
}

/* Light mode — type badge + hero cup */
html[data-theme="light"] .tmg-type-badge,
body.tmg-theme-light .tmg-type-badge,
html[data-theme="light"] a.tmg-type-badge,
body.tmg-theme-light a.tmg-type-badge {
    background: rgba(0, 201, 177, .1);
    color: #007A6E !important;
}

html[data-theme="light"] a.tmg-type-badge:hover,
body.tmg-theme-light a.tmg-type-badge:hover {
    color: #0B1214 !important;
}

/* Preview Cup theme/surface rules live in brand/home.css. */

/* -------------------------------------------------------------------------- */
/* 1.8.10 — Home title flush, Spark-only hero, sitewide chrome / dark-first   */
/* -------------------------------------------------------------------------- */

/* Hide theme "Home" (and other redundant) page titles on front page. */
body.home .wp-block-post-title,
body.home .entry-title,
body.home h1.wp-block-post-title,
body.home .wp-block-post-title.alignwide,
body.home .wp-block-post-title.alignfull,
body.front-page .wp-block-post-title,
body.front-page .entry-title,
body.front-page h1.wp-block-post-title,
body:has(.tmg-home) .wp-block-post-title,
body:has(.tmg-home) .entry-title,
body:has(.tmg-home) h1.wp-block-post-title {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
}

/* Sitewide: hide flush-left duplicate page titles when TMG shortcode owns chrome. */
body:has(.tmg-news-page) .wp-block-post-title,
body:has(.tmg-news-page) .entry-title,
body:has(.tmg-leaderboard-live) .wp-block-post-title,
body:has(table.tmg-leaderboard) .wp-block-post-title,
body:has(.tmg-activity) .wp-block-post-title,
body:has(.tmg-tournament) .wp-block-post-title,
body:has(.tmg-form.tmg-submit-match) .wp-block-post-title {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Prefer hiding page titles on competition shell pages (slug-based). */
body.page-ladder .wp-block-post-title,
body.page-standings .wp-block-post-title,
body.page-tournaments .wp-block-post-title,
body.page-members .wp-block-post-title,
body.page-account .wp-block-post-title,
body.page-news .wp-block-post-title,
.page-slug-ladder .wp-block-post-title,
.page-slug-standings .wp-block-post-title,
.page-slug-tournaments .wp-block-post-title,
.page-slug-members .wp-block-post-title,
.page-slug-account .wp-block-post-title,
.page-slug-news .wp-block-post-title,
body.page-ladder .entry-title,
body.page-standings .entry-title,
body.page-tournaments .entry-title {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Pull main content up flush under sticky nav on home. */
body.home .wp-site-blocks > main,
body.home main.wp-block-group,
body.front-page .wp-site-blocks > main,
body:has(.tmg-home) .wp-site-blocks > main {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

body.home .entry-content,
body.home .wp-block-post-content,
body:has(.tmg-home) .entry-content,
body:has(.tmg-home) .wp-block-post-content {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.tmg-home {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.tmg-home-hero {
    margin-top: 0 !important;
    padding-top: 8px;
}

/* Dark-first reinforcement — never OS prefers-color-scheme; honor data-theme only. */
html:not([data-theme="light"]) {
    color-scheme: dark;
}

html:not([data-theme="light"]) body,
html[data-theme="dark"] body,
body.tmg-theme-dark {
    background-color: var(--tmg-ink, #0B1214) !important;
    color: var(--tmg-mist, #E8EEF0) !important;
}

/* Standings / ladder pages: kill accidental light canvas from TT5 groups. */
body.page-standings .wp-site-blocks,
body.page-ladder .wp-site-blocks,
body.page-tournaments .wp-site-blocks,
.page-slug-standings .wp-site-blocks,
.page-slug-ladder .wp-site-blocks,
html[data-theme="dark"] .wp-site-blocks,
html:not([data-theme="light"]) .wp-site-blocks {
    background-color: var(--tmg-bg) !important;
    color: var(--tmg-fg) !important;
}

html:not([data-theme="light"]) .wp-block-group:not(.has-background),
html[data-theme="dark"] .wp-block-group:not(.has-background) {
    background-color: transparent !important;
}

/* Chrome slot + fallback — sitewide Dark/Light when header host is late/missing. */
.tmg-chrome-slot {
    align-items: center;
    display: flex;
    gap: 8px;
    pointer-events: none;
    position: fixed;
    right: 24px;
    top: 14px;
    z-index: 120;
}

.tmg-chrome-slot:empty,
.tmg-chrome-slot[aria-hidden="true"]:empty {
    display: none;
}

.tmg-chrome-slot:not(:empty) {
    pointer-events: auto;
}

.tmg-chrome-fallback.tmg-theme-toggle,
.tmg-chrome-fallback.tmg-account-btn,
.tmg-chrome-fallback.tmg-account-menu {
    position: fixed;
    right: 24px;
    top: 14px;
    z-index: 120;
}

.tmg-chrome-fallback.tmg-account-btn,
.tmg-chrome-fallback.tmg-account-menu {
    right: 140px;
}

@media (max-width: 720px) {
    .tmg-chrome-slot,
    .tmg-chrome-fallback.tmg-theme-toggle,
    .tmg-chrome-fallback.tmg-account-btn,
    .tmg-chrome-fallback.tmg-account-menu {
        right: 12px;
        top: 10px;
    }
}


/* -------------------------------------------------------------------------- */
/* 1.8.12 — Functional layout lock: cup contrast, auth chrome, chooser/dir    */
/* -------------------------------------------------------------------------- */

/* UM login/register: product dark canvas (not bare TT5 light shell). */
body.um.um-page-login,
body.um.um-page-register,
body.page-slug-login,
body.page-slug-register,
body.page-id-login,
html[data-theme="dark"] body.um,
body.tmg-theme-dark.um,
body.tmg-theme-dark.page-template-default:has(.um),
body.tmg-theme-dark:has(.um-login),
body.tmg-theme-dark:has(.um-register) {
    background: var(--tmg-bg, #0B1214) !important;
    color: var(--tmg-text, #E8EEF0) !important;
}

body.tmg-theme-dark .um .um-form,
body.tmg-theme-dark .um-login,
body.tmg-theme-dark .um-register,
html[data-theme="dark"] .um .um-form {
    background: transparent;
    color: var(--tmg-text, #E8EEF0);
}

/* Extra cart kill on auth shells (Woo sometimes re-injects). */
body.um .wp-block-woocommerce-mini-cart,
body.um .wc-block-mini-cart,
body.um .wc-block-mini-cart__button,
body.page-slug-login .wc-block-mini-cart,
body.page-slug-register .wc-block-mini-cart,
body.tmg-auth-page .wc-block-mini-cart,
body.tmg-auth-page .wp-block-woocommerce-mini-cart {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Contextual rules links (ladder / tournament / league) */
.tmg-rules-link-wrap {
    margin: 0 0 0.85rem;
}
.tmg-rules-link {
    color: var(--tmg-teal, #00C9B1) !important;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
}
.tmg-rules-link:hover,
.tmg-rules-link:focus-visible {
    text-decoration: underline !important;
}
.tmg-rules-link.is-placeholder {
    cursor: default;
}
.tmg-ladder-welcome {
    color: var(--tmg-muted, #A8BCC4);
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.45;
    margin: 0 0 0.75rem;
}
.tmg-ladder-login-hint {
    margin: 0 0 1rem;
}
.tmg-ladder-login-hint a {
    color: var(--tmg-teal, #00C9B1) !important;
    font-weight: 700;
    text-decoration: none !important;
}
.tmg-ladder-login-hint a:hover,
.tmg-ladder-login-hint a:focus-visible {
    text-decoration: underline !important;
}
.tmg-tournament-header .tmg-rules-link-wrap,
.tmg-tournaments-list > .tmg-rules-link-wrap {
    margin-top: 0.25rem;
}
.tmg-rules-anchors {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

/* Ladder mode chooser */
.tmg-ladder-chooser {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 1.25rem;
}
.tmg-ladder-chooser-label {
    color: var(--tmg-muted, #A8BCC4);
    flex: 0 0 100%;
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 4px;
}
.tmg-ladder-tab {
    background: var(--tmg-panel, #142026);
    border: 1px solid var(--tmg-border, #243038);
    border-radius: 999px;
    color: var(--tmg-muted, #A8BCC4) !important;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 14px;
    text-decoration: none !important;
}
.tmg-ladder-tab.is-active,
.tmg-ladder-tab:hover,
.tmg-ladder-tab:focus-visible {
    border-color: var(--tmg-teal, #00C9B1);
    color: var(--tmg-teal, #00C9B1) !important;
}
html[data-theme="light"] .tmg-ladder-tab,
body.tmg-theme-light .tmg-ladder-tab {
    background: #fff;
    border-color: #c5d0d4;
    color: #3A4A50 !important;
}
html[data-theme="light"] .tmg-ladder-tab.is-active,
body.tmg-theme-light .tmg-ladder-tab.is-active {
    color: #007A6E !important;
}

/* Tournaments list */
.tmg-tournaments-list {
    display: grid;
    gap: 16px;
}
.tmg-tournaments-card {
    background: var(--tmg-panel, #142026);
    border: 1px solid var(--tmg-border, #243038);
    border-radius: 12px;
    color: inherit !important;
    display: block;
    padding: 18px 20px;
    text-decoration: none !important;
}
.tmg-tournaments-card h3 {
    color: var(--tmg-text, #E8EEF0);
    font-size: 1.15rem;
    margin: 0 0 6px;
}
.tmg-tournaments-meta {
    color: var(--tmg-muted, #A8BCC4);
    font-size: 13px;
}
html[data-theme="light"] .tmg-tournaments-card,
body.tmg-theme-light .tmg-tournaments-card {
    background: #fff;
    border-color: #c5d0d4;
}
html[data-theme="light"] .tmg-tournaments-card h3,
body.tmg-theme-light .tmg-tournaments-card h3 {
    color: #0B1214;
}

/* Members directory */
.tmg-members {
    margin: 0 auto;
    max-width: var(--tmg-content-max, 1240px);
}
.tmg-members-head h2 {
    color: var(--tmg-text, #E8EEF0);
    font-size: 1.35rem;
    margin: 0 0 12px;
}
.tmg-members-list {
    display: grid;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.tmg-members-item a,
.tmg-members-item span {
    align-items: center;
    background: var(--tmg-panel, #142026);
    border: 1px solid var(--tmg-border, #243038);
    border-radius: 10px;
    color: var(--tmg-text, #E8EEF0) !important;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 12px 14px;
    text-decoration: none !important;
}
.tmg-members-tag {
    color: var(--tmg-teal, #00C9B1);
    font-size: 13px;
    font-weight: 700;
}
html[data-theme="light"] .tmg-members-head h2,
body.tmg-theme-light .tmg-members-head h2 {
    color: #0B1214;
}
html[data-theme="light"] .tmg-members-item a,
body.tmg-theme-light .tmg-members-item a,
html[data-theme="light"] .tmg-members-item span,
body.tmg-theme-light .tmg-members-item span {
    background: #fff;
    border-color: #c5d0d4;
    color: #0B1214 !important;
}

/* 1.8.16 — hide the empty Ultimate Member members shell behind TMG directory. */
.um-page-members .um-members-wrapper:empty,
.um-page-members .um-members-overlay {
    display: none !important;
}

/* 1.8.15 — auth shell: hide cart chrome, keep toggle slot, dark-first canvas */
body.tmg-auth-page .wp-block-woocommerce-mini-cart,
body.tmg-auth-page .wc-block-mini-cart,
body.tmg-auth-page .wc-block-mini-cart__button,
body.tmg-auth-page a[href*="cart"],
body.tmg-auth-page .wp-block-navigation-item a[href*="cart"] {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
body.tmg-auth-page #tmg-chrome-slot.tmg-chrome-slot:not(:empty) {
    display: flex !important;
    visibility: visible !important;
}
body.tmg-auth-page {
    background: var(--tmg-bg, #0B1214);
    color: var(--tmg-text, #E8EEF0);
}


/* 1.8.19 — Player directory + card + per-ladder panels (functional only) */
.tmg-players,
.tmg-players.tmg-members {
    margin: 0 auto;
    max-width: var(--tmg-content-max, 1240px);
}
.tmg-players-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.tmg-players-head h2 {
    margin: 0;
}
.tmg-players-search {
    display: flex;
    gap: 8px;
    flex: 1 1 220px;
    max-width: 360px;
}
.tmg-players-search input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    background: var(--tmg-panel, #142026);
    border: 1px solid var(--tmg-border, #243038);
    border-radius: 8px;
    color: var(--tmg-text, #E8EEF0);
    padding: 8px 10px;
}
.tmg-players-search button {
    background: var(--tmg-teal, #00C9B1);
    border: 0;
    border-radius: 8px;
    color: #0B1214;
    cursor: pointer;
    font-weight: 700;
    padding: 8px 12px;
}
.tmg-players-list {
    display: grid;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.tmg-players-handle {
    font-weight: 600;
}

.tmg-player-card {
    background: var(--tmg-panel, #142026);
    border: 1px solid var(--tmg-border, #243038);
    border-radius: 12px;
    margin: 0 0 20px;
    padding: 16px 18px;
}
.tmg-player-card-main {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.tmg-player-card-avatar img,
.tmg-player-card-avatar-img {
    border-radius: 50%;
    display: block;
    height: 72px;
    width: 72px;
}
.tmg-player-card-handle {
    color: var(--tmg-text, #E8EEF0);
    font-size: 1.35rem;
    margin: 0 0 6px;
}
.tmg-player-card-gamertag {
    color: var(--tmg-muted, #9AA8AE);
    font-size: 0.95rem;
    margin: 0 0 10px;
}
.tmg-player-card-gamertag .tmg-stat-label {
    color: var(--tmg-teal, #00C9B1);
    font-weight: 700;
    margin-right: 6px;
}
.tmg-player-card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.tmg-player-link-chip {
    background: rgba(0, 201, 177, 0.12);
    border: 1px solid var(--tmg-teal, #00C9B1);
    border-radius: 999px;
    color: var(--tmg-teal, #00C9B1) !important;
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    text-decoration: none !important;
}
.tmg-player-card-placements {
    border-top: 1px solid var(--tmg-border, #243038);
    display: grid;
    gap: 8px;
    list-style: none;
    margin: 14px 0 0;
    padding: 14px 0 0;
}
.tmg-player-card-place {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.tmg-player-card-place-rank {
    color: var(--tmg-teal, #00C9B1);
    font-weight: 800;
    min-width: 2.5rem;
}
.tmg-player-card-place-ladder {
    flex: 1 1 auto;
    font-weight: 600;
}
.tmg-player-card-place-elo {
    color: var(--tmg-muted, #9AA8AE);
    font-size: 0.9rem;
}
.tmg-player-card-bio-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--tmg-border, #243038);
}
.tmg-player-card-bio-heading {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 650;
}

.tmg-ladder-panels-grid {
    display: grid;
    gap: 14px;
}
.tmg-ladder-panel {
    background: var(--tmg-panel, #142026);
    border: 1px solid var(--tmg-border, #243038);
    border-radius: 12px;
    padding: 14px 16px;
}
.tmg-ladder-panel-head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}
.tmg-ladder-panel-title {
    color: var(--tmg-text, #E8EEF0);
    font-size: 1.1rem;
    margin: 0;
}
.tmg-ladder-panel-stats {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}
.tmg-ladder-panel-stats li {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 8px;
    padding: 8px 10px;
}
.tmg-stat-label {
    color: var(--tmg-muted, #9AA8AE);
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.tmg-stat-value {
    color: var(--tmg-text, #E8EEF0);
    font-size: 1.05rem;
    font-weight: 700;
}
.tmg-ladder-panel-empty {
    color: var(--tmg-muted, #9AA8AE);
    font-size: 0.9rem;
    margin: 0;
}
.tmg-ladder-panel-matches {
    margin-top: 4px;
}

html[data-theme="light"] .tmg-players-search input[type="search"],
body.tmg-theme-light .tmg-players-search input[type="search"] {
    background: #fff;
    border-color: #c5d0d4;
    color: #0B1214;
}
html[data-theme="light"] .tmg-player-card,
body.tmg-theme-light .tmg-player-card,
html[data-theme="light"] .tmg-ladder-panel,
body.tmg-theme-light .tmg-ladder-panel {
    background: #fff;
    border-color: #c5d0d4;
}
html[data-theme="light"] .tmg-player-card-handle,
body.tmg-theme-light .tmg-player-card-handle,
html[data-theme="light"] .tmg-ladder-panel-title,
body.tmg-theme-light .tmg-ladder-panel-title,
html[data-theme="light"] .tmg-stat-value,
body.tmg-theme-light .tmg-stat-value {
    color: #0B1214;
}
html[data-theme="light"] .tmg-ladder-panel-stats li,
body.tmg-theme-light .tmg-ladder-panel-stats li {
    background: #f3f6f7;
}


/* === 1.8.21 player avatar + team logo === */
.tmg-players-link {
    align-items: center;
    display: flex;
    gap: 10px;
    text-decoration: none;
}
.tmg-players-thumb {
    border-radius: 50%;
    display: block;
    flex: 0 0 auto;
    height: 36px;
    object-fit: cover;
    width: 36px;
}
.tmg-avatar-upload,
.tmg-team-logo-upload {
    background: var(--tmg-panel, #142026);
    border: 1px solid var(--tmg-border, #243038);
    border-radius: 10px;
    margin: 12px 0 0;
    padding: 12px 14px;
}
.tmg-avatar-upload-title,
.tmg-team-logo-upload-title {
    font-size: 1rem;
    margin: 0 0 8px;
}
.tmg-avatar-upload-msg {
    color: var(--tmg-teal, #00C9B1);
    font-size: 0.9rem;
    margin: 0 0 8px;
}
.tmg-avatar-upload-preview,
.tmg-team-logo-preview {
    border-radius: 50%;
    display: block;
    height: 72px;
    margin: 0 0 10px;
    object-fit: cover;
    width: 72px;
}
.tmg-team-logo-preview {
    border-radius: 8px;
}
.tmg-avatar-upload-hint,
.tmg-avatar-upload-hint {
    color: var(--tmg-muted, #9AA8AE);
    font-size: 0.8rem;
    margin: 6px 0 10px;
}
.tmg-avatar-upload-form input[type="file"],
.tmg-team-logo-form input[type="file"] {
    display: block;
    margin: 0 0 6px;
    max-width: 100%;
}
.tmg-btn-secondary {
    background: transparent;
    border: 1px solid var(--tmg-border, #243038);
    color: var(--tmg-muted, #9AA8AE);
    cursor: pointer;
    margin-top: 8px;
    padding: 6px 12px;
}
.tmg-teams-list {
    display: grid;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.tmg-teams-item {
    background: var(--tmg-panel, #142026);
    border: 1px solid var(--tmg-border, #243038);
    border-radius: 10px;
    padding: 10px 12px;
}
.tmg-team-label {
    align-items: center;
    display: inline-flex;
    gap: 10px;
}
.tmg-team-logo {
    border-radius: 6px;
    display: block;
    height: 32px;
    object-fit: cover;
    width: 32px;
}
.tmg-team-name {
    font-weight: 700;
}
.tmg-team-logo-upload-block {
    border-top: 1px solid var(--tmg-border, #243038);
    margin-top: 12px;
    padding-top: 12px;
}
.tmg-team-logo-upload-block:first-of-type {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

/* 1.8.22 — Privacy: hide UM legal-name fields on public profiles */
body.tmg-privacy-profile .um-field-first_name,
body.tmg-privacy-profile .um-field-last_name,
body.tmg-privacy-profile .um-field-full_name,
body.tmg-privacy-profile .um-field[data-key="first_name"],
body.tmg-privacy-profile .um-field[data-key="last_name"],
body.tmg-privacy-profile .um-field[data-key="full_name"],
body.um-page-user .um-field-first_name,
body.um-page-user .um-field-last_name,
body.um-page-user .um-field-full_name {
    display: none !important;
}

/* Profile About tab: beat UM inline .um-{id} max-width:600px on .um-profile-body */
body.um-page-user {
    --wp--style--global--content-size: var(--tmg-content-max, 1240px);
}
body.um-page-user h1.wp-block-post-title,
body.um-page-user .wp-block-post-title {
    display: none !important;
}
body.um-page-user .um-cover,
body.um-page-user .um-header,
body.um-page-user .um-profile-photo,
body.um-page-user .um-name,
body.um-page-user .um-profile-status,
body.um-page-user .um-profile-note,
body.um-page-user .um-meta,
body.um-page-user .um-field-account_status {
    display: none !important;
}
body.um-page-user .um,
body.um-page-user .um[class*="um-"],
body.um-page-user .um-form,
body.um-page-user .um-profile-body,
body.um-page-user .tmg-profile-competition,
body.um-page-user .tmg-player-card {
    max-width: var(--tmg-content-max, 1240px) !important;
    width: 100% !important;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}
body.um-page-user .tmg-player-card--profile {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0;
    background: transparent;
    border: 0;
}
body.um-page-user .tmg-player-hero,
body.um-page-user .tmg-player-card-bio-section {
    background: var(--tmg-panel, #142026);
    border: 1px solid var(--tmg-border, #243038);
    border-radius: 12px;
    overflow: hidden;
}
body.um-page-user .tmg-player-hero .tmg-player-card-main {
    align-items: center;
    padding: 16px 18px 18px;
}
body.um-page-user .tmg-player-banner {
    width: 100%;
    overflow: hidden;
    aspect-ratio: 2.7 / 1;
    max-height: min(280px, 32vw);
    background: #0b1214;
}
body.um-page-user .tmg-player-banner-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
body.um-page-user .tmg-player-card-avatar img,
body.um-page-user .tmg-player-card-avatar-img {
    width: clamp(72px, 18vw, 112px);
    height: clamp(72px, 18vw, 112px);
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--tmg-panel, #142026);
    box-shadow: 0 0 0 1px var(--tmg-border, #243038);
}
body.um-page-user .tmg-player-card-since {
    margin: 8px 0 0;
    color: var(--tmg-muted, #9AA8AE);
    font-size: 0.9rem;
}
body.um-page-user .tmg-player-card-bio-section {
    margin-top: 0;
    padding: 14px 16px;
}
/* W4h5i — remove About/Posts/Comments bar; admin gear lives in TMG player card */
body.um-page-user .um-profile-navbar,
body.um-page-user .um-profile-nav,
body.um-page-user .um-profile-nav-item {
    display: none !important;
}

/* Player card title + admin gear */
.tmg-player-card-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.tmg-player-card-title-row .tmg-player-card-handle {
    margin: 0;
}
.tmg-profile-admin-gear {
    position: relative;
    margin-left: auto;
}
.tmg-profile-admin-gear-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid var(--tmg-border, #243038);
    background: var(--tmg-panel, #142026);
    color: var(--tmg-muted, #9AA8AE);
    cursor: pointer;
}
.tmg-profile-admin-gear-btn:hover,
.tmg-profile-admin-gear-btn[aria-expanded="true"] {
    color: var(--tmg-teal, #00C9B1);
    border-color: var(--tmg-teal, #00C9B1);
}
.tmg-profile-admin-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 40;
    min-width: 160px;
    padding: 6px;
    background: var(--tmg-panel, #142026);
    border: 1px solid var(--tmg-border, #243038);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.tmg-profile-admin-item {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    color: var(--tmg-text, #E8EEF0);
    font: inherit;
    font-weight: 600;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
}
.tmg-profile-admin-item:hover {
    background: rgba(0, 201, 177, 0.12);
}
.tmg-profile-admin-danger {
    color: #e07a7a;
}

/* Social icon bar under player name — equal size clickable icons */
.tmg-player-social-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
}
.tmg-player-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid var(--tmg-border, #243038);
    background: rgba(0, 201, 177, 0.08);
    color: var(--tmg-text, #E8EEF0);
    text-decoration: none;
}
.tmg-player-social-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}
.tmg-player-social-icon:hover {
    color: var(--tmg-teal, #00C9B1);
    border-color: var(--tmg-teal, #00C9B1);
}

.tmg-profile-match-facing {
    display: block;
    font-weight: 700;
    color: var(--tmg-text, #E8EEF0);
}
.tmg-profile-match-vs-sep {
    margin: 0 6px;
    color: var(--tmg-muted, #9AA8AE);
    font-weight: 600;
}
.tmg-profile-match-facing .tmg-team-link {
    color: inherit;
    text-decoration: none;
}
.tmg-profile-match-facing .tmg-team-link:hover {
    color: var(--tmg-teal, #00C9B1);
    text-decoration: underline;
}

@media (max-width: 700px) {
    body.um-page-user .tmg-player-banner {
        max-height: 160px;
        aspect-ratio: 16 / 7;
    }
}

/* 1.8.22 — Aggregate stat badges */
.tmg-stat-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.tmg-stat-badge {
    align-items: center;
    background: rgba(0, 201, 177, 0.1);
    border: 1px solid var(--tmg-border, #243038);
    border-radius: 999px;
    display: inline-flex;
    gap: 8px;
    padding: 6px 12px;
}
.tmg-stat-badge-label {
    color: var(--tmg-muted, #9AA8AE);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.tmg-stat-badge-value {
    color: var(--tmg-text, #E8EEF0);
    font-weight: 800;
}
.tmg-stat-badge-w {
    border-color: rgba(0, 201, 177, 0.45);
}
.tmg-stat-badge-l {
    border-color: rgba(220, 80, 80, 0.4);
}

/* 1.8.22 — Ladder context from leaderboard deep-link */
.tmg-ladder-context-card {
    background: var(--tmg-panel, #142026);
    border: 1px solid var(--tmg-teal, #00C9B1);
    border-radius: 12px;
    padding: 14px 16px;
}
.tmg-ladder-context-title {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

/* 1.8.22 — Match history search */
.tmg-profile-matches-head {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 10px;
}
.tmg-profile-matches-head .tmg-profile-heading {
    margin: 0;
}
.tmg-match-search {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 420px;
}
.tmg-match-search input[type="search"] {
    background: var(--tmg-panel, #142026);
    border: 1px solid var(--tmg-border, #243038);
    border-radius: 8px;
    color: var(--tmg-text, #E8EEF0);
    flex: 1 1 160px;
    min-width: 0;
    padding: 8px 10px;
}
.tmg-match-search button {
    background: var(--tmg-teal, #00C9B1);
    border: 0;
    border-radius: 8px;
    color: #0B1214;
    cursor: pointer;
    font-weight: 700;
    padding: 8px 12px;
}
.tmg-match-search-clear {
    align-self: center;
    color: var(--tmg-muted, #9AA8AE);
    font-size: 0.9rem;
}

/* 1.8.22 — Bio */
.tmg-player-card-bio {
    color: var(--tmg-muted, #9AA8AE);
    line-height: 1.55;
    margin: 0;
    white-space: pre-wrap;
}
.tmg-bio-edit {
    border-top: 1px solid var(--tmg-border, #243038);
    margin-top: 14px;
    padding-top: 12px;
}
.tmg-bio-edit-title {
    font-size: 0.95rem;
    margin: 0 0 8px;
}
.tmg-bio-edit textarea {
    background: var(--tmg-bg, #0B1214);
    border: 1px solid var(--tmg-border, #243038);
    border-radius: 8px;
    color: var(--tmg-text, #E8EEF0);
    display: block;
    max-width: 100%;
    padding: 8px 10px;
    width: 100%;
}
.tmg-bio-edit-hint {
    color: var(--tmg-muted, #9AA8AE);
    font-size: 0.85rem;
    margin: 6px 0 8px;
}
.tmg-bio-edit-form button {
    background: var(--tmg-teal, #00C9B1);
    border: 0;
    border-radius: 8px;
    color: #0B1214;
    cursor: pointer;
    font-weight: 700;
    padding: 8px 12px;
}
.tmg-bio-edit-msg {
    color: var(--tmg-teal, #00C9B1);
    font-weight: 600;
}


/* 1.8.26 / 1.8.30 — Hide Rules + Standings nav chrome (header/footer). Ladder stays. */
header .wp-block-navigation-item:has(> a[href*="/standings"]),
header .wp-block-navigation-item:has(> a[href*="/rules"]:not([href*="/league/rules"])),
.site-header .wp-block-navigation-item:has(> a[href*="/standings"]),
.site-header .wp-block-navigation-item:has(> a[href*="/rules"]:not([href*="/league/rules"])),
nav.wp-block-navigation .wp-block-navigation-item:has(> a[href*="/standings"]),
nav.wp-block-navigation .wp-block-navigation-item:has(> a[href*="/rules"]:not([href*="/league/rules"])),
footer .wp-block-navigation-item:has(> a[href*="/standings"]),
footer .wp-block-navigation-item:has(> a[href*="/rules"]:not([href*="/league/rules"])),
.site-footer .wp-block-navigation-item:has(> a[href*="/standings"]),
.site-footer .wp-block-navigation-item:has(> a[href*="/rules"]:not([href*="/league/rules"])),
.wp-block-template-part[area="footer"] .wp-block-navigation-item:has(> a[href*="/standings"]),
.wp-block-template-part[area="footer"] .wp-block-navigation-item:has(> a[href*="/rules"]:not([href*="/league/rules"])),
.wp-block-template-part[area="header"] .wp-block-navigation-item:has(> a[href*="/standings"]),
.wp-block-template-part[area="header"] .wp-block-navigation-item:has(> a[href*="/rules"]:not([href*="/league/rules"])),
header .menu-item:has(> a[href*="/standings"]),
header .menu-item:has(> a[href*="/rules"]:not([href*="/league/rules"])),
.site-header .menu-item:has(> a[href*="/standings"]),
.site-header .menu-item:has(> a[href*="/rules"]:not([href*="/league/rules"])),
/* Class / data attr set by PHP filter or JS backup */
header .wp-block-navigation-item[data-tmg-nav-hide],
header .menu-item[data-tmg-nav-hide],
.site-header .wp-block-navigation-item[data-tmg-nav-hide],
.site-header .menu-item[data-tmg-nav-hide],
nav .wp-block-navigation-item[data-tmg-nav-hide],
nav .menu-item[data-tmg-nav-hide],
header .tmg-nav-hide,
.site-header .tmg-nav-hide,
nav .tmg-nav-hide,
footer .wp-block-navigation-item[data-tmg-nav-hide],
footer .tmg-nav-hide,
/* Aria-label / title fallbacks when href is relative without path match */
header .wp-block-navigation-item:has(> a[aria-label="Rules"]),
header .wp-block-navigation-item:has(> a[aria-label="Standings"]),
header .wp-block-navigation-item:has(> a[title="Rules"]),
header .wp-block-navigation-item:has(> a[title="Standings"]) {
	display: none !important;
}

/* -------------------------------------------------------------------------- */
/* W4f — Register/login auth brand-pass (Scout M4). Stay 1.8.45.              */
/* Token-driven shell / type / fields / primary button / Turnstile spacing.   */
/* Scoped to login+register auth shells so UM profile/account do not regress. */
/* OUT: new fields, anti-spam rewrite, Mailgun/verify changes, live deploy.   */
/* -------------------------------------------------------------------------- */

/* Shared auth form scope (login already cleaned; register aligned). */
body.tmg-auth-page.um-page-register,
body.tmg-auth-page.um-page-login,
body.tmg-auth-page.page-slug-register,
body.tmg-auth-page.page-slug-login,
body.page-slug-register.tmg-auth-page,
body.page-slug-login.tmg-auth-page {
	/* canvas already set by earlier auth-shell rules; keep mist type. */
	color: var(--tmg-text, #E8EEF0);
}

/* Page title — TopMid weight/spacing, not stock UM chrome. */
body.tmg-auth-page.um-page-register h1.wp-block-post-title,
body.tmg-auth-page.um-page-login h1.wp-block-post-title,
body.page-slug-register h1.wp-block-post-title,
body.page-slug-login h1.wp-block-post-title,
body.tmg-auth-page.um-page-register .wp-block-post-title,
body.tmg-auth-page.um-page-login .wp-block-post-title {
	color: var(--tmg-mist, #E8EEF0);
	font-size: clamp(1.75rem, 2.5vw, 2.15rem);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.15;
	margin: 0 0 1.1rem;
	text-align: center;
}

/* UM form card shell */
body.tmg-auth-page.um-page-register .um.um-register,
body.tmg-auth-page.um-page-login .um.um-login,
body.page-slug-register .um.um-register,
body.page-slug-login .um.um-login {
	background: var(--tmg-panel, #142026) !important;
	border: 1px solid var(--tmg-border, #243038) !important;
	border-radius: 12px !important;
	box-shadow: var(--tmg-shadow, 0 12px 30px rgb(0 0 0 / 22%)) !important;
	box-sizing: border-box;
	color: var(--tmg-text, #E8EEF0) !important;
	margin-left: auto !important;
	margin-right: auto !important;
	max-width: 480px !important;
	padding: 1.35rem 1.4rem 1.55rem !important;
}

body.tmg-auth-page.um-page-register .um .um-form,
body.tmg-auth-page.um-page-login .um .um-form,
body.page-slug-register .um .um-form,
body.page-slug-login .um .um-form {
	background: transparent !important;
	color: var(--tmg-text, #E8EEF0) !important;
}

/* Field rhythm */
body.tmg-auth-page.um-page-register .um-field,
body.tmg-auth-page.um-page-login .um-field,
body.page-slug-register .um-field,
body.page-slug-login .um-field {
	margin: 0 0 0.95rem !important;
	padding: 0 !important;
}

body.tmg-auth-page.um-page-register .um-row,
body.tmg-auth-page.um-page-login .um-row,
body.page-slug-register .um-row,
body.page-slug-login .um-row {
	margin-bottom: 0.35rem !important;
}

/* Labels */
body.tmg-auth-page.um-page-register .um-field-label,
body.tmg-auth-page.um-page-login .um-field-label,
body.page-slug-register .um-field-label,
body.page-slug-login .um-field-label {
	margin: 0 0 0.35rem !important;
	padding: 0 !important;
}

body.tmg-auth-page.um-page-register .um-field-label label,
body.tmg-auth-page.um-page-login .um-field-label label,
body.page-slug-register .um-field-label label,
body.page-slug-login .um-field-label label {
	color: var(--tmg-mist, #E8EEF0) !important;
	font-size: 0.82rem !important;
	font-weight: 700 !important;
	letter-spacing: 0.02em;
	line-height: 1.3 !important;
}

/* Inputs — beat UM stock field chrome */
body.tmg-auth-page.um-page-register .um-form-field,
body.tmg-auth-page.um-page-login .um-form-field,
body.page-slug-register .um-form-field,
body.page-slug-login .um-form-field,
body.tmg-auth-page.um-page-register .um input[type="text"],
body.tmg-auth-page.um-page-register .um input[type="password"],
body.tmg-auth-page.um-page-register .um input[type="email"],
body.tmg-auth-page.um-page-register .um input[type="url"],
body.tmg-auth-page.um-page-register .um input[type="number"],
body.tmg-auth-page.um-page-register .um input[type="search"],
body.tmg-auth-page.um-page-register .um select,
body.tmg-auth-page.um-page-register .um textarea,
body.tmg-auth-page.um-page-login .um input[type="text"],
body.tmg-auth-page.um-page-login .um input[type="password"],
body.tmg-auth-page.um-page-login .um input[type="email"],
body.tmg-auth-page.um-page-login .um select,
body.tmg-auth-page.um-page-login .um textarea,
body.page-slug-register .um input[type="text"],
body.page-slug-register .um input[type="password"],
body.page-slug-register .um input[type="email"],
body.page-slug-register .um input[type="url"],
body.page-slug-login .um input[type="text"],
body.page-slug-login .um input[type="password"] {
	background: color-mix(in srgb, var(--tmg-ink, #0B1214) 55%, var(--tmg-panel, #142026)) !important;
	border: 1px solid var(--tmg-border, #243038) !important;
	border-radius: 0.45rem !important;
	box-shadow: none !important;
	box-sizing: border-box !important;
	color: var(--tmg-mist, #E8EEF0) !important;
	font-size: 0.95rem !important;
	font-weight: 500 !important;
	height: auto !important;
	line-height: 1.4 !important;
	min-height: 2.55rem;
	padding: 0.65rem 0.75rem !important;
	width: 100% !important;
}

body.tmg-auth-page.um-page-register .um-form-field:focus,
body.tmg-auth-page.um-page-login .um-form-field:focus,
body.page-slug-register .um-form-field:focus,
body.page-slug-login .um-form-field:focus,
body.tmg-auth-page.um-page-register .um input:focus,
body.tmg-auth-page.um-page-login .um input:focus,
body.page-slug-register .um input:focus,
body.page-slug-login .um input:focus {
	border-color: var(--tmg-teal, #2EC4B6) !important;
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--tmg-teal, #2EC4B6) 28%, transparent) !important;
	outline: none !important;
}

body.tmg-auth-page.um-page-register .um-form-field::placeholder,
body.tmg-auth-page.um-page-login .um-form-field::placeholder,
body.page-slug-register .um-form-field::placeholder,
body.page-slug-login .um-form-field::placeholder {
	color: var(--tmg-muted, #A8BCC4) !important;
	opacity: 1 !important;
}

/* Primary CTA — teal brand button (not UM blue). */
body.tmg-auth-page.um-page-register input.um-button:not(.um-alt),
body.tmg-auth-page.um-page-login input.um-button:not(.um-alt),
body.page-slug-register input.um-button:not(.um-alt),
body.page-slug-login input.um-button:not(.um-alt),
body.tmg-auth-page.um-page-register a.um-button:not(.um-alt),
body.tmg-auth-page.um-page-login a.um-button:not(.um-alt),
body.page-slug-register a.um-button:not(.um-alt),
body.page-slug-login a.um-button:not(.um-alt),
body.tmg-auth-page.um-page-register .um-button:not(.um-alt),
body.tmg-auth-page.um-page-login .um-button:not(.um-alt),
body.page-slug-register .um-button:not(.um-alt),
body.page-slug-login .um-button:not(.um-alt) {
	background: var(--tmg-teal, #2EC4B6) !important;
	border: 1px solid var(--tmg-teal, #2EC4B6) !important;
	border-radius: 10px !important;
	box-shadow: 0 8px 24px rgba(46, 196, 182, 0.25) !important;
	color: #0B1214 !important;
	cursor: pointer !important;
	font-size: 0.92rem !important;
	font-weight: 800 !important;
	letter-spacing: 0.01em;
	line-height: 1.2 !important;
	min-height: 2.7rem;
	padding: 0.7rem 1.1rem !important;
	text-align: center !important;
	text-decoration: none !important;
	text-shadow: none !important;
	transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease !important;
	width: 100% !important;
}

body.tmg-auth-page.um-page-register input.um-button:not(.um-alt):hover,
body.tmg-auth-page.um-page-login input.um-button:not(.um-alt):hover,
body.page-slug-register input.um-button:not(.um-alt):hover,
body.page-slug-login input.um-button:not(.um-alt):hover,
body.tmg-auth-page.um-page-register a.um-button:not(.um-alt):hover,
body.tmg-auth-page.um-page-login a.um-button:not(.um-alt):hover,
body.page-slug-register .um-button:not(.um-alt):hover,
body.page-slug-login .um-button:not(.um-alt):hover,
body.tmg-auth-page.um-page-register input.um-button:not(.um-alt):focus,
body.tmg-auth-page.um-page-login input.um-button:not(.um-alt):focus,
body.page-slug-register .um-button:not(.um-alt):focus-visible,
body.page-slug-login .um-button:not(.um-alt):focus-visible {
	background: var(--tmg-teal-deep, #1A9B8E) !important;
	border-color: var(--tmg-teal-deep, #1A9B8E) !important;
	box-shadow: 0 0 24px rgba(46, 196, 182, 0.45) !important;
	color: #fff !important;
	transform: translateY(-1px);
}

/* Alt / secondary (Login↔Register) — ghost, matches home language */
body.tmg-auth-page.um-page-register a.um-button.um-alt,
body.tmg-auth-page.um-page-login a.um-button.um-alt,
body.page-slug-register a.um-button.um-alt,
body.page-slug-login a.um-button.um-alt,
body.tmg-auth-page.um-page-register .um-button.um-alt,
body.tmg-auth-page.um-page-login .um-button.um-alt,
body.page-slug-register .um-button.um-alt,
body.page-slug-login .um-button.um-alt {
	background: transparent !important;
	border: 1px solid var(--tmg-border, #243038) !important;
	border-radius: 10px !important;
	box-shadow: none !important;
	color: var(--tmg-mist, #E8EEF0) !important;
	font-weight: 700 !important;
	text-shadow: none !important;
	width: 100% !important;
}

body.tmg-auth-page.um-page-register a.um-button.um-alt:hover,
body.tmg-auth-page.um-page-login a.um-button.um-alt:hover,
body.page-slug-register a.um-button.um-alt:hover,
body.page-slug-login a.um-button.um-alt:hover,
body.tmg-auth-page.um-page-register .um-button.um-alt:focus-visible,
body.tmg-auth-page.um-page-login .um-button.um-alt:focus-visible {
	border-color: var(--tmg-teal, #2EC4B6) !important;
	color: var(--tmg-teal, #2EC4B6) !important;
}

/* Button row */
body.tmg-auth-page.um-page-register .um-col-alt,
body.tmg-auth-page.um-page-login .um-col-alt,
body.page-slug-register .um-col-alt,
body.page-slug-login .um-col-alt {
	display: flex !important;
	flex-wrap: wrap;
	gap: 0.65rem;
	margin-top: 0.35rem !important;
}

body.tmg-auth-page.um-page-register .um-col-alt .um-half,
body.tmg-auth-page.um-page-login .um-col-alt .um-half,
body.page-slug-register .um-col-alt .um-half,
body.page-slug-login .um-col-alt .um-half {
	float: none !important;
	flex: 1 1 calc(50% - 0.35rem);
	margin: 0 !important;
	max-width: none !important;
	width: auto !important;
}

/* Cloudflare Turnstile spacing (widget unchanged) */
body.tmg-auth-page.um-page-register .cf-turnstile,
body.page-slug-register .cf-turnstile,
body.tmg-auth-page.um-page-register .um-form .cf-turnstile {
	display: block;
	margin: 0.85rem 0 1rem !important;
}

/* Keep honeypot off-canvas (do not restyle into view) */
body.tmg-auth-page.um-page-register .tmg-hp-field,
body.page-slug-register .tmg-hp-field {
	height: 1px !important;
	left: -9999px !important;
	overflow: hidden !important;
	position: absolute !important;
	top: auto !important;
	width: 1px !important;
}

/* Error / notice text on auth forms */
body.tmg-auth-page.um-page-register .um-field-error,
body.tmg-auth-page.um-page-login .um-field-error,
body.page-slug-register .um-field-error,
body.page-slug-login .um-field-error,
body.tmg-auth-page.um-page-register .um-notice,
body.tmg-auth-page.um-page-login .um-notice {
	color: var(--tmg-danger, #E85D4C) !important;
}

/* Light theme readability on auth forms */
html[data-theme="light"] body.tmg-auth-page.um-page-register h1.wp-block-post-title,
html[data-theme="light"] body.tmg-auth-page.um-page-login h1.wp-block-post-title,
body.tmg-theme-light.um-page-register h1.wp-block-post-title,
body.tmg-theme-light.um-page-login h1.wp-block-post-title,
html[data-theme="light"] body.page-slug-register h1.wp-block-post-title,
html[data-theme="light"] body.page-slug-login h1.wp-block-post-title {
	color: #0B1214;
}

html[data-theme="light"] body.tmg-auth-page.um-page-register .um.um-register,
html[data-theme="light"] body.tmg-auth-page.um-page-login .um.um-login,
body.tmg-theme-light.um-page-register .um.um-register,
body.tmg-theme-light.um-page-login .um.um-login,
html[data-theme="light"] body.page-slug-register .um.um-register,
html[data-theme="light"] body.page-slug-login .um.um-login {
	background: #FFFFFF !important;
	border-color: #c5d0d4 !important;
	color: #0B1214 !important;
}

html[data-theme="light"] body.tmg-auth-page.um-page-register .um-field-label label,
html[data-theme="light"] body.tmg-auth-page.um-page-login .um-field-label label,
body.tmg-theme-light.um-page-register .um-field-label label,
body.tmg-theme-light.um-page-login .um-field-label label,
html[data-theme="light"] body.page-slug-register .um-field-label label,
html[data-theme="light"] body.page-slug-login .um-field-label label {
	color: #0B1214 !important;
}

html[data-theme="light"] body.tmg-auth-page.um-page-register .um-form-field,
html[data-theme="light"] body.tmg-auth-page.um-page-login .um-form-field,
body.tmg-theme-light.um-page-register .um-form-field,
body.tmg-theme-light.um-page-login .um-form-field,
html[data-theme="light"] body.page-slug-register .um-form-field,
html[data-theme="light"] body.page-slug-login .um-form-field,
html[data-theme="light"] body.tmg-auth-page.um-page-register .um input[type="text"],
html[data-theme="light"] body.tmg-auth-page.um-page-register .um input[type="password"],
html[data-theme="light"] body.tmg-auth-page.um-page-register .um input[type="email"],
html[data-theme="light"] body.tmg-auth-page.um-page-login .um input[type="text"],
html[data-theme="light"] body.tmg-auth-page.um-page-login .um input[type="password"] {
	background: #FFFFFF !important;
	border-color: #c5d0d4 !important;
	color: #0B1214 !important;
}

html[data-theme="light"] body.tmg-auth-page.um-page-register a.um-button.um-alt,
html[data-theme="light"] body.tmg-auth-page.um-page-login a.um-button.um-alt,
body.tmg-theme-light.um-page-register a.um-button.um-alt,
body.tmg-theme-light.um-page-login a.um-button.um-alt {
	border-color: #c5d0d4 !important;
	color: #0B1214 !important;
}

@media (max-width: 520px) {
	body.tmg-auth-page.um-page-register .um-col-alt .um-half,
	body.tmg-auth-page.um-page-login .um-col-alt .um-half,
	body.page-slug-register .um-col-alt .um-half,
	body.page-slug-login .um-col-alt .um-half {
		flex: 1 1 100%;
	}
}

/* W4f.1 — Beat um_default_css by matching its selectors under auth scope + background-color. */
body.tmg-auth-page.um-page-register .um input[type="submit"].um-button,
body.tmg-auth-page.um-page-login .um input[type="submit"].um-button,
body.page-slug-register .um input[type="submit"].um-button,
body.page-slug-login .um input[type="submit"].um-button,
body.tmg-auth-page.um-page-register .um a.um-button:not(.um-alt),
body.tmg-auth-page.um-page-login .um a.um-button:not(.um-alt),
body.page-slug-register .um a.um-button:not(.um-alt),
body.page-slug-login .um a.um-button:not(.um-alt) {
	background: var(--tmg-teal, #2EC4B6) !important;
	background-color: var(--tmg-teal, #2EC4B6) !important;
	border: 1px solid var(--tmg-teal, #2EC4B6) !important;
	color: #0B1214 !important;
}

body.tmg-auth-page.um-page-register .um input[type="submit"].um-button:hover,
body.tmg-auth-page.um-page-login .um input[type="submit"].um-button:hover,
body.page-slug-register .um input[type="submit"].um-button:hover,
body.page-slug-login .um input[type="submit"].um-button:hover,
body.tmg-auth-page.um-page-register .um a.um-button:not(.um-alt):hover,
body.tmg-auth-page.um-page-login .um a.um-button:not(.um-alt):hover {
	background: var(--tmg-teal-deep, #1A9B8E) !important;
	background-color: var(--tmg-teal-deep, #1A9B8E) !important;
	border-color: var(--tmg-teal-deep, #1A9B8E) !important;
	color: #fff !important;
}

body.tmg-auth-page.um-page-register .um .um-field-label,
body.tmg-auth-page.um-page-login .um .um-field-label,
body.page-slug-register .um .um-field-label,
body.page-slug-login .um .um-field-label,
body.tmg-auth-page.um-page-register .um .um-field-label label,
body.tmg-auth-page.um-page-login .um .um-field-label label,
body.page-slug-register .um .um-field-label label,
body.page-slug-login .um .um-field-label label {
	color: var(--tmg-mist, #E8EEF0) !important;
}

body.tmg-auth-page.um-page-register .um .um-form input[type="text"],
body.tmg-auth-page.um-page-register .um .um-form input[type="password"],
body.tmg-auth-page.um-page-register .um .um-form input[type="email"],
body.tmg-auth-page.um-page-login .um .um-form input[type="text"],
body.tmg-auth-page.um-page-login .um .um-form input[type="password"],
body.page-slug-register .um .um-form input[type="text"],
body.page-slug-register .um .um-form input[type="password"],
body.page-slug-register .um .um-form input[type="email"],
body.page-slug-login .um .um-form input[type="text"],
body.page-slug-login .um .um-form input[type="password"] {
	background: var(--tmg-panel, #142026) !important;
	background-color: var(--tmg-panel, #142026) !important;
	border: 1px solid var(--tmg-border, #243038) !important;
	border-radius: 10px !important;
	color: var(--tmg-mist, #E8EEF0) !important;
}

body.tmg-auth-page.um-page-register .cf-turnstile,
body.page-slug-register .cf-turnstile {
	display: block !important;
	visibility: visible !important;
	min-height: 65px;
	margin: 0.85rem 0 1rem !important;
}

/* —— W4h: Ladder teams hub (/ladder/; /teams/ redirects W4h5g2) — not league season teams —— */
.tmg-ladder-teams {
	display: grid;
	gap: 1.25rem;
	margin: 0 auto;
	max-width: var(--tmg-content-max, 1240px);
}
.tmg-ladder-teams-header,
.tmg-ladder-teams-panel {
	display: grid;
	gap: 0.75rem;
}
.tmg-ladder-teams-kicker {
	color: var(--tmg-accent, #3dd6c6);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	margin: 0;
	text-transform: uppercase;
}
.tmg-ladder-teams-title {
	font-size: clamp(1.6rem, 2.4vw, 2rem);
	margin: 0;
}
.tmg-ladder-teams-lead,
.tmg-ladder-teams-section-lead {
	color: var(--tmg-muted, #9aa8ae);
	margin: 0;
}
.tmg-ladder-teams-section-title {
	font-size: 1.15rem;
	margin: 0;
}
.tmg-ladder-teams-actions,
.tmg-ladder-teams-cta-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
}
.tmg-ladder-teams-list,
.tmg-ladder-teams-join-list {
	display: grid;
	gap: 0.65rem;
	list-style: none;
	margin: 0;
	padding: 0;
}
.tmg-ladder-teams-card {
	align-items: center;
	background: var(--tmg-panel, #142026);
	border: 1px solid var(--tmg-border, #243038);
	border-radius: 10px;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: space-between;
	padding: 0.75rem 1rem;
}
.tmg-ladder-teams-card.is-highlight {
	border-color: var(--tmg-accent, #3dd6c6);
	box-shadow: 0 0 0 1px var(--tmg-accent, #3dd6c6);
}
.tmg-ladder-teams-card-main {
	display: grid;
	gap: 0.25rem;
}
.tmg-ladder-teams-flash {
	border-radius: 8px;
	padding: 0.65rem 0.9rem;
}
.tmg-ladder-teams-flash--ok {
	background: rgba(61, 214, 198, 0.12);
	border: 1px solid var(--tmg-accent, #3dd6c6);
}
.tmg-ladder-teams-flash--err {
	background: rgba(220, 80, 80, 0.12);
	border: 1px solid #c44;
	color: #f2b0b0;
}
.tmg-ladder-teams-form label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.35rem;
}
.tmg-ladder-teams-form input[type="text"] {
	max-width: 28rem;
	width: 100%;
}
.tmg-ladder-teams-inline-form {
	margin: 0;
}
.tmg-account-sep {
	border-top: 1px solid var(--tmg-border, #243038);
	color: var(--tmg-muted, #9aa8ae);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	margin: 0.35rem 0 0.15rem;
	padding: 0.45rem 0.85rem 0.15rem;
	text-transform: uppercase;
}

/* —— W4h2: request-join hub tabs, My Teams badge, team page —— */
.tmg-ladder-teams-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}
.tmg-ladder-teams-tabs .tmg-ladder-tab.is-disabled {
	opacity: 0.45;
	pointer-events: none;
}
.tmg-ladder-teams-search-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 0.5rem;
	max-width: 28rem;
}
.tmg-ladder-teams-search-row input[type="search"] {
	min-width: 0;
	width: 100%;
	max-width: none;
}
.tmg-ladder-teams-search-row a {
	grid-column: 1 / -1;
}
.tmg-ladder-teams-search-hint {
	margin: 0.35rem 0 0;
	font-size: 0.85rem;
}
.tmg-ladder-teams-card-link {
	color: inherit;
	text-decoration: none;
}
.tmg-ladder-teams-card-link:hover .tmg-team-name,
.tmg-ladder-teams-card-link:focus-visible .tmg-team-name {
	color: var(--tmg-accent, #3dd6c6);
}
.tmg-ladder-teams-desc {
	margin: 0.15rem 0 0;
	font-size: 0.9rem;
	color: var(--tmg-muted, #9aa8ae);
}
.tmg-ladder-teams-resolve {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}
.tmg-ladder-teams-back {
	margin: 0 0 0.5rem;
}
.tmg-ladder-teams-record {
	align-self: center;
}
.tmg-teams-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.25rem;
	height: 1.25rem;
	padding: 0 0.35rem;
	margin-left: 0.35rem;
	border-radius: 999px;
	background: var(--tmg-accent, #3dd6c6);
	color: #042028;
	font-size: 0.7rem;
	font-weight: 800;
	line-height: 1;
	vertical-align: middle;
}
.tmg-my-teams {
	display: grid;
	gap: 1.25rem;
	margin: 0 auto;
	max-width: var(--tmg-content-max, 1240px);
}
.tmg-my-teams .tmg-type-badge--ladder {
	border-color: var(--tmg-accent, #3dd6c6);
}
.tmg-my-teams .tmg-type-badge--league {
	border-color: #c9a227;
}

/* —— W4h5c3: My Teams compact professional rows —— */
.tmg-my-teams .tmg-ladder-teams-lead {
	margin: 0.25rem 0 0;
	max-width: 42rem;
}
.tmg-my-teams .tmg-ladder-teams-header {
	gap: 0.55rem;
}
.tmg-my-teams-list {
	display: grid;
	gap: 0.55rem;
	list-style: none;
	margin: 0;
	padding: 0;
}
.tmg-my-teams-list .tmg-ladder-teams-card,
.tmg-my-teams-list .tmg-my-teams-card {
	align-items: center;
	display: flex;
	flex-wrap: nowrap;
	gap: 0.75rem 1rem;
	justify-content: space-between;
	padding: 0.65rem 0.85rem;
}
.tmg-my-teams-card-main {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 0.2rem;
	min-width: 0;
}
.tmg-my-teams-name {
	display: inline-flex;
	align-items: center;
	min-width: 0;
}
.tmg-my-teams-list .tmg-team-logo {
	height: 40px;
	width: 40px;
	flex-shrink: 0;
}
.tmg-my-teams-list .tmg-team-label {
	gap: 0.55rem;
}
.tmg-my-teams-list .tmg-team-name {
	font-size: 1rem;
	line-height: 1.25;
}
.tmg-my-teams-meta {
	align-items: center;
	color: var(--tmg-muted, #9aa8ae);
	display: flex;
	flex-wrap: wrap;
	font-size: 0.82rem;
	gap: 0.25rem 0.4rem;
	line-height: 1.35;
}
.tmg-my-teams-meta .tmg-type-badge {
	font-size: 0.68rem;
	letter-spacing: 0.04em;
	padding: 0.12rem 0.45rem;
}
.tmg-my-teams-sep {
	color: var(--tmg-border, #243038);
	font-weight: 700;
	user-select: none;
}
.tmg-my-teams-captain {
	color: var(--tmg-mist, #e8eef0);
}
.tmg-my-teams-captain .tmg-player-link {
	color: var(--tmg-accent, #3dd6c6);
	font-weight: 600;
	text-decoration: none;
}
.tmg-my-teams-captain .tmg-player-link:hover,
.tmg-my-teams-captain .tmg-player-link:focus-visible {
	text-decoration: underline;
}
.tmg-my-teams-chip {
	background: rgba(61, 214, 198, 0.1);
	border: 1px solid rgba(61, 214, 198, 0.35);
	border-radius: 999px;
	color: var(--tmg-accent, #3dd6c6);
	display: inline-flex;
	font-size: 0.72rem;
	font-weight: 700;
	line-height: 1.2;
	padding: 0.12rem 0.5rem;
	text-decoration: none;
	white-space: nowrap;
}
a.tmg-my-teams-chip:hover,
a.tmg-my-teams-chip:focus-visible {
	background: rgba(61, 214, 198, 0.18);
	text-decoration: none;
}
.tmg-my-teams-card-action {
	align-items: center;
	display: inline-flex;
	flex: 0 0 auto;
	gap: 0.45rem;
}
.tmg-my-teams-list .tmg-btn-secondary,
.tmg-my-teams-card-action .tmg-btn-secondary {
	margin-top: 0;
	white-space: nowrap;
}
@media (max-width: 640px) {
	.tmg-my-teams-list .tmg-ladder-teams-card,
	.tmg-my-teams-list .tmg-my-teams-card {
		align-items: flex-start;
		flex-wrap: wrap;
		padding: 0.7rem 0.8rem;
	}
	.tmg-my-teams-card-action {
		margin-left: auto;
	}
	.tmg-my-teams-list .tmg-team-logo {
		height: 36px;
		width: 36px;
	}
}
.tmg-ladder-teams-form textarea {
	max-width: 28rem;
	width: 100%;
}
.tmg-ladder-teams-panel.is-focus {
	box-shadow: 0 0 0 1px var(--tmg-accent, #3dd6c6);
}

/* W4h3 — ladder challenge / result pills */
.tmg-stat-badge-elo {
	border-color: var(--tmg-teal, #0d9488);
}
.tmg-result-pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2rem;
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	font-weight: 700;
	font-size: 0.85rem;
}
.tmg-result-pill--w {
	background: color-mix(in srgb, #16a34a 18%, transparent);
	color: #16a34a;
}
.tmg-result-pill--l {
	background: color-mix(in srgb, #dc2626 18%, transparent);
	color: #dc2626;
}
.tmg-ladder-result-card {
	align-items: center;
	gap: 0.75rem;
}
.tmg-ladder-challenge-report {
	display: block;
	margin-bottom: 1rem;
}
.tmg-ladder-challenge-report .tmg-ladder-teams-form {
	margin-top: 0.75rem;
}


/* === W4h5c: team page banner + roster + hide duplicate Teams WP title === */
body:has(.tmg-ladder-teams) .wp-block-post-title,
body:has(.tmg-ladder-teams) .entry-title,
body.page-teams .wp-block-post-title,
body.page-teams .entry-title,
body.page-my-teams .wp-block-post-title,
body.page-my-teams .entry-title,
.page-slug-teams .wp-block-post-title,
.page-slug-teams .entry-title,
.page-slug-my-teams .wp-block-post-title,
.page-slug-my-teams .entry-title {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.tmg-team-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1.25rem 1.5rem;
}
.tmg-team-banner-logo {
    flex: 0 0 auto;
}
.tmg-team-banner-logo-img {
    width: 160px;
    height: 160px;
    max-width: 40vw;
    object-fit: cover;
    border-radius: 18px;
    border: 2px solid var(--tmg-border, #243038);
    background: var(--tmg-bg, #0B1214);
    display: block;
}
.tmg-team-banner-logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 160px;
    height: 160px;
    max-width: 40vw;
    border-radius: 18px;
    border: 2px solid var(--tmg-border, #243038);
    background: rgba(0, 201, 177, 0.12);
    color: var(--tmg-teal, #00C9B1);
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}
.tmg-team-banner-main {
    flex: 1 1 220px;
    min-width: 0;
}
.tmg-team-banner-kicker {
    margin: 0 0 0.35rem;
    color: var(--tmg-teal, #00C9B1);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.tmg-team-banner-title {
    margin: 0 0 0.4rem;
    font-size: clamp(1.75rem, 3.2vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.tmg-team-banner-captain {
    margin: 0 0 0.75rem;
    color: var(--tmg-muted, #9AA8AE);
    font-size: 1rem;
}
.tmg-team-banner-actions {
    flex: 0 0 auto;
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.65rem;
    align-items: center;
    justify-content: flex-end;
    max-width: 100%;
}
.tmg-team-banner-actions .tmg-home-btn {
    white-space: nowrap;
    text-decoration: none !important;
}
.tmg-team-banner-actions a.tmg-home-btn.tmg-btn-secondary {
    /* Mirror .tmg-btn-secondary so theme anchor rules cannot collapse this into a text link. */
    background: transparent !important;
    border: 1px solid var(--tmg-border, #243038) !important;
    color: var(--tmg-muted, #9AA8AE) !important;
    cursor: pointer;
    margin-top: 8px;
    padding: 6px 12px;
}
.tmg-team-roster-row {
    align-items: center;
}
.tmg-team-roster-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    align-items: baseline;
    font-weight: 700;
}
.tmg-team-roster-wl {
    color: var(--tmg-text, #E8EEF0);
}
.tmg-team-roster-elo {
    color: var(--tmg-teal, #00C9B1);
}
/* W4h5c2 — Team Settings shares Account .tmg-settings overlay (league.css z-index 100000). Explicit rules so portal-to-body stays above theme stacking. */
.tmg-team-settings.tmg-settings {
    position: fixed;
    inset: 0;
    z-index: 100000;
}
.tmg-team-settings.tmg-settings[hidden] {
    display: none !important;
}
.tmg-team-settings .tmg-team-logo-upload-title,
.tmg-team-settings .tmg-team-logo-upload-name {
    display: none;
}
.tmg-team-settings-logo-preview {
    width: 96px;
    height: 96px;
    border-radius: 14px;
    object-fit: cover;
    margin-bottom: 8px;
}
.tmg-team-settings-delete {
    background: #c44 !important;
    color: #fff !important;
}
body.tmg-team-settings-open {
    overflow: hidden;
}


/* —— W4h5f: one-line ladder standings rows —— */
.tmg-ladder-standings {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	list-style: none;
	margin: 0;
	padding: 0;
}
.tmg-ladder-standings-row {
	align-items: center;
	background: var(--tmg-panel, #142026);
	border: 1px solid var(--tmg-border, #243038);
	border-radius: 10px;
	display: grid;
	gap: 0.65rem 0.85rem;
	grid-template-columns: 2.5rem 2.75rem minmax(0, 1fr) auto auto auto;
	grid-template-areas: "rank logo name elo record view";
	padding: 0.55rem 0.85rem;
}
.tmg-ladder-standings-meta {
	display: contents;
}
.tmg-ladder-standings-rank {
	grid-area: rank;
	color: var(--tmg-muted, #9aa8ae);
	font-size: 0.95rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}
.tmg-ladder-standings-logo {
	grid-area: logo;
	display: inline-flex;
	height: 40px;
	width: 40px;
}
.tmg-ladder-standings-logo img {
	border-radius: 8px;
	height: 40px;
	object-fit: cover;
	width: 40px;
}
.tmg-ladder-standings-logo-fallback {
	align-items: center;
	background: rgba(61, 214, 198, 0.12);
	border: 1px solid var(--tmg-border, #243038);
	border-radius: 8px;
	color: var(--tmg-accent, #3dd6c6);
	display: inline-flex;
	font-size: 0.75rem;
	font-weight: 700;
	height: 40px;
	justify-content: center;
	width: 40px;
}
.tmg-ladder-standings-name {
	grid-area: name;
	display: flex;
	flex-direction: column;
	font-weight: 650;
	gap: 0.1rem;
	min-width: 0;
	overflow: hidden;
}
.tmg-ladder-standings-name-text {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.tmg-ladder-standings-captain {
	font-size: 0.78rem;
	font-weight: 500;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.tmg-ladder-standings-elo {
	grid-area: elo;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	white-space: nowrap;
}
.tmg-ladder-standings-elo-label {
	color: var(--tmg-muted, #9aa8ae);
	font-size: 0.8rem;
	font-weight: 500;
}
.tmg-ladder-standings-record {
	grid-area: record;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	min-width: 3.5rem;
	text-align: right;
	white-space: nowrap;
}
.tmg-ladder-standings-view {
	grid-area: view;
	justify-self: end;
	white-space: nowrap;
}
/* Phone standings card: identity, stats, action. Desktop stays one line (areas above). */
@media (max-width: 782px) {
	.tmg-ladder-standings-row {
		grid-template-columns: 2.5rem 2.75rem minmax(0, 1fr);
		grid-template-areas:
			"rank logo name"
			"meta meta meta"
			"view view view";
	}
	.tmg-ladder-standings-meta {
		grid-area: meta;
		display: flex;
		flex-wrap: wrap;
		gap: 0.75rem 1.25rem;
	}
	.tmg-ladder-standings-name,
	.tmg-ladder-standings-name-text,
	.tmg-ladder-standings-captain {
		overflow: visible;
		text-overflow: unset;
		white-space: normal;
	}
	.tmg-ladder-standings-view {
		justify-self: stretch;
		text-align: center;
	}
}

/* W4h5f last-resort: WP page content must not resurface submit/rules on ladder hub */
.tmg-ladder-teams--hub ~ #tmg-submit,
.tmg-ladder-teams--hub ~ .tmg-submit-wrap,
.tmg-ladder-teams--hub ~ .tmg-rules-link-wrap,
body.tmg-is-ladder-page #tmg-submit,
body.tmg-is-ladder-page .tmg-submit-wrap,
body.tmg-is-ladder-page .tmg-rules-link-wrap {
	display: none !important;
}
/* W4h5g2: footer accordion stays visible. Orphan bare .tmg-ladder-rules
   blocks in page content (not inside our footer) are rare; CSS cannot
   reliably :not() nest — rely on PHP strip of page-content rules links. */


/* —— W4h5g2: ladder hub cleanup (no welcome / less top gap; rules accordion visible) —— */
body.tmg-is-ladder-page .tmg-ladder-welcome,
.page-slug-ladder .tmg-ladder-welcome,
body.page-ladder .tmg-ladder-welcome {
	display: none !important;
	margin: 0 !important;
	padding: 0 !important;
	height: 0 !important;
	overflow: hidden !important;
}
body.tmg-is-ladder-page .entry-content,
body.tmg-is-ladder-page .wp-block-post-content,
.page-slug-ladder .entry-content,
.page-slug-ladder .wp-block-post-content {
	padding-top: 0 !important;
	margin-top: 0 !important;
}
body.tmg-is-ladder-page .tmg-ladder-teams,
.page-slug-ladder .tmg-ladder-teams {
	margin-top: 0;
	gap: 1rem;
}
body.tmg-is-ladder-page .tmg-ladder-teams-header,
.page-slug-ladder .tmg-ladder-teams-header {
	margin-top: 0;
}
.tmg-ladder-teams-footer {
	margin-top: 0.5rem;
}
.tmg-ladder-rules > summary {
	cursor: pointer;
	list-style: none;
}
.tmg-ladder-rules > summary::-webkit-details-marker {
	display: none;
}
.tmg-ladder-rules-body {
	margin-top: 0.75rem;
}
.tmg-ladder-rules-list {
	margin: 0;
	padding-left: 1.2rem;
	color: var(--tmg-muted, #9aa8ae);
}
.tmg-ladder-rules-more {
	margin: 0.75rem 0 0;
	font-size: 0.9rem;
}


/* —— W4h5h4: tip-top unified rhythm under sticky nav (ladder hub) —— */
body.tmg-is-ladder-page:not(.home):not(.front-page) .wp-site-blocks > main,
body.tmg-is-ladder-page:not(.home):not(.front-page) .wp-site-blocks > main.wp-block-group,
body.page-slug-ladder:not(.home):not(.front-page) .wp-site-blocks > main,
body.page-slug-ladder:not(.home):not(.front-page) .wp-site-blocks > main.wp-block-group,
.page-slug-ladder:not(.home):not(.front-page) .wp-site-blocks > main,
body.page-ladder:not(.home):not(.front-page) .wp-site-blocks > main,
body:has(.tmg-ladder-teams):not(.home):not(.front-page) .wp-site-blocks > main {
	margin-top: 0.35rem !important;
	padding-top: 0 !important;
}
body.tmg-is-ladder-page:not(.home):not(.front-page) .wp-site-blocks > main > .wp-block-group,
body.tmg-is-ladder-page:not(.home):not(.front-page) .wp-site-blocks > main > .wp-block-group.alignfull,
body.page-slug-ladder:not(.home):not(.front-page) .wp-site-blocks > main > .wp-block-group,
body.page-slug-ladder:not(.home):not(.front-page) .wp-site-blocks > main > .wp-block-group.alignfull,
.page-slug-ladder:not(.home):not(.front-page) .wp-site-blocks > main > .wp-block-group,
body.page-ladder:not(.home):not(.front-page) .wp-site-blocks > main > .wp-block-group,
body:has(.tmg-ladder-teams):not(.home):not(.front-page) .wp-site-blocks > main > .wp-block-group {
	margin-top: 0 !important;
	padding-top: 0.65rem !important;
}
body.tmg-is-ladder-page .tmg-ladder-teams,
.page-slug-ladder .tmg-ladder-teams,
body:has(.tmg-ladder-teams) .tmg-ladder-teams {
	margin-top: 0 !important;
	padding-top: 0 !important;
}
body.tmg-is-ladder-page .tmg-ladder-teams-header,
.page-slug-ladder .tmg-ladder-teams-header {
	margin-top: 0 !important;
	padding-top: 0.65rem;
}
/* Invisible duplicate WP title must not reserve space under sticky nav */
body.tmg-is-ladder-page .wp-block-post-title,
body.tmg-is-ladder-page .entry-title,
body.tmg-is-ladder-page h1.wp-block-post-title,
.page-slug-ladder .wp-block-post-title,
.page-slug-ladder .entry-title,
body:has(.tmg-ladder-teams) .wp-block-post-title,
body:has(.tmg-ladder-teams) .entry-title,
body:has(.tmg-ladder-teams) h1.wp-block-post-title {
	clip: rect(0, 0, 0, 0) !important;
	display: none !important;
	height: 0 !important;
	margin: 0 !important;
	overflow: hidden !important;
	padding: 0 !important;
	position: absolute !important;
	visibility: hidden !important;
	width: 0 !important;
}

/* W4h5n — pick/ban form controls */
.tmg-pickban-form select,
.tmg-pickban-form textarea {
  max-width: 28rem;
  width: 100%;
}
html[data-theme="light"] .tmg-pickban-turn,
body.tmg-theme-light .tmg-pickban-turn {
  background: rgba(40, 50, 70, .05);
  border-color: rgba(40, 50, 70, .18);
}
html[data-theme="light"] .tmg-pickban-table th,
body.tmg-theme-light .tmg-pickban-table th {
  background: rgba(40, 50, 70, .06);
}

/* 1.8.69 — cadence ladder cups (phase 1). No bracket. */
.tmg-event-calendar {
    display: grid;
    gap: 8px;
    margin: 0 0 28px;
}
.tmg-event-calendar-head h2 {
    color: var(--tmg-text, #E8EEF0);
    font-size: 1.35rem;
    margin: 0 0 6px;
}
.tmg-event-calendar-head p,
.tmg-event-meta {
    color: var(--tmg-muted, #A8BCC4);
    font-size: 14px;
    margin: 0 0 8px;
}
.tmg-event-day {
    color: var(--tmg-text, #E8EEF0);
    font-size: 1rem;
    margin: 14px 0 8px;
}
.tmg-event-list {
    display: grid;
    gap: 12px;
}
@media (min-width: 800px) {
    .tmg-event-list {
        grid-template-columns: 1fr 1fr;
    }
}
.tmg-event-card {
    background: var(--tmg-panel, #142026);
    border: 1px solid var(--tmg-border, #243038);
    border-radius: 12px;
    padding: 16px 18px;
}
.tmg-event-card h4 {
    color: var(--tmg-text, #E8EEF0);
    font-size: 1.05rem;
    margin: 0 0 6px;
}
.tmg-event-opt {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.tmg-event-opt select,
.tmg-event-opt button {
    min-height: 40px;
}
html[data-theme="light"] .tmg-event-card,
body.tmg-theme-light .tmg-event-card {
    background: #fff;
    border-color: #c5d0d4;
}
html[data-theme="light"] .tmg-event-card h4,
html[data-theme="light"] .tmg-event-day,
html[data-theme="light"] .tmg-event-calendar-head h2,
body.tmg-theme-light .tmg-event-card h4,
body.tmg-theme-light .tmg-event-day,
body.tmg-theme-light .tmg-event-calendar-head h2 {
    color: #0B1214;
}

/* 1.8.72 — Fours cups are team entrants only. Bare player rows render as a missing team. */
/* 1.8.71 — one Fours register form and a date list. No per-cup opt-in cards. */
.tmg-cup-register,
.tmg-cup-dates-wrap,
.tmg-cup-seeding {
    margin: 8px 0 18px;
}
.tmg-cup-register h3,
.tmg-cup-dates-wrap h3,
.tmg-cup-seeding h3 {
    color: var(--tmg-text, #E8EEF0);
    font-size: 1.05rem;
    margin: 12px 0 8px;
}
.tmg-cup-register-form {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.tmg-cup-register-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 14rem;
}
.tmg-cup-register-form select,
.tmg-cup-register-form input[type="text"],
.tmg-cup-register-form button {
    min-height: 40px;
}
.tmg-cup-dates {
    display: grid;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.tmg-cup-date {
    align-items: baseline;
    background: var(--tmg-panel, #142026);
    border: 1px solid var(--tmg-border, #243038);
    border-radius: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 12px 14px;
}
.tmg-cup-date a {
    color: var(--tmg-text, #E8EEF0);
    font-weight: 600;
}
.tmg-cup-date-name,
.tmg-cup-date-count,
.tmg-cup-date-status {
    color: var(--tmg-muted, #A8BCC4);
    font-size: 14px;
}
.tmg-cup-back {
    margin: 0 0 8px;
}
html[data-theme="light"] .tmg-cup-date,
body.tmg-theme-light .tmg-cup-date {
    background: #fff;
    border-color: #c5d0d4;
}
html[data-theme="light"] .tmg-cup-date a,
html[data-theme="light"] .tmg-cup-register h3,
html[data-theme="light"] .tmg-cup-dates-wrap h3,
html[data-theme="light"] .tmg-cup-seeding h3,
body.tmg-theme-light .tmg-cup-date a,
body.tmg-theme-light .tmg-cup-register h3,
body.tmg-theme-light .tmg-cup-dates-wrap h3,
body.tmg-theme-light .tmg-cup-seeding h3 {
    color: #0B1214;
}


/* 1.8.78 — Players search row fits the mobile content column (kept). */
@media (max-width: 782px) {
  .tmg-players-head {
    align-items: stretch;
    flex-direction: column;
  }
  .tmg-players-search {
    flex: 1 1 auto;
    max-width: none;
    width: 100%;
    min-width: 0;
  }
  .tmg-players-search input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    width: 1%;
  }
  .tmg-players-search button {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}


/* 1.8.84 — phone profile handle: wrap inside hero (overflow:hidden must not clip). Desktop unchanged. */
@media (max-width: 782px) {
  body.um-page-user .tmg-player-card-title-row {
    min-width: 0;
    width: 100%;
  }
  body.um-page-user .tmg-player-card-title-row .tmg-player-card-handle,
  body.um-page-user .tmg-player-card-handle {
    min-width: 0;
    flex: 1 1 auto;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  body.um-page-user .tmg-player-hero .tmg-player-card-main {
    min-width: 0;
  }
}
