/*
 * TrueHandicap competition detail view
 * Version 1.13 - 9-Sep-2026
 * Opens player-message bubbles by tap and exposes their separate reply action.
 * Version 1.12 - 9-Sep-2026
 * Keeps player-message bubbles inside the mobile Event View viewport.
 * Version 1.11 - 9-Sep-2026
 * Keeps the Field checkbox beside the player count and preserves smaller mobile event names.
 * Version 1.10 - 9-Sep-2026
 * Moves the plain Show tees checkbox into the Field player controls.
 * Version 1.9 - 9-Sep-2026
 * Uses themed Back and booking controls and a checkbox for tee details.
 * Version 1.8 - 9-Sep-2026
 * Matches round format badges to compmain and softens event/course name emphasis.
 * Version 1.7 - 8-Sep-2026
 * Promotes the responsive Event details view to production and removes its preview-status styling.
 * Version 1.6 - 8-Sep-2026
 * Makes the unassigned-player heading and columns use the available width precisely.
 * Version 1.5 - 8-Sep-2026
 * Refines content and team alignment, unassigned-player columns and event-name sizing.
 * Version 1.4 - 8-Sep-2026
 * Matches established event buttons and uses six-pixel spacing between major blocks.
 * Cache version is managed by $CSSVerCompview in sharedheader.php.
 */

html,
body,
#home { min-width: 0 !important; max-width: 100%; }
body { overflow-x: hidden; background: #f3f6f9; }

#home > header { border-bottom: 1px solid #e1e7ee; background: #fff; }
#home > header img {
    width: 145px !important;
    height: auto !important;
    max-width: 100%;
    max-height: 108px;
    object-fit: contain;
}

.thc-compview,
.thc-compview * { box-sizing: border-box; }

.thc-compview {
    width: min(100% - 32px, 1180px);
    margin: 0 auto;
    padding: 0 0 72px;
    color: #172033;
    font-family: Arial, Helvetica, sans-serif;
}

.thc-compview button { font-family: inherit; }

.thc-compview-topline,
.thc-cv-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.thc-cv-bottom { margin-top: 6px; }
.thc-compview-topline > .padu10,
.thc-cv-bottom > .padu10 { padding-top: 6px; }

.thc-cv-event-state {
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.thc-cv-event-state.is-upcoming { color: #1d5d31; background: #dff5e5; }
.thc-cv-event-state.is-live { color: #7a4b00; background: #fff0c2; }
.thc-cv-event-state.is-completed { color: #596476; background: #e7ebf0; }

.thc-cv-hero {
    margin: 6px 0;
    padding: 18px 20px;
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr) auto;
    align-items: center;
    gap: 17px;
    border-radius: 15px;
    color: #fff;
    background: linear-gradient(135deg, #132e54 0%, #29419c 66%, #3159c0 100%);
    box-shadow: 0 10px 28px rgba(25, 48, 89, .18);
}

.thc-cv-date-tile {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 12px;
    background: rgba(255,255,255,.12);
}

.thc-cv-date-tile span { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.thc-cv-date-tile strong { font-size: 27px; line-height: 1.02; }
.thc-cv-date-tile small { font-size: 10px; opacity: .86; }
.thc-cv-group { margin: 0 0 4px; color: #cbd8ff; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.thc-cv-hero h1 { margin: 0; color: #fff; font-size: 16px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.thc-cv-date-range { margin: 6px 0 0; color: #eef3ff; font-size: 13px; }
.thc-cv-hero-copy,
.thc-cv-round > div:last-child,
.thc-cv-gender-block { min-width: 0; }
.thc-cv-hero-copy,
.thc-cv-hero-copy h1,
.thc-cv-hero-copy p { text-align: left !important; }
.thc-cv-hero h1,
.thc-cv-round h3,
.thc-cv-round p,
.thc-cv-day-tees h4 { white-space: normal !important; overflow-wrap: anywhere; }
.thc-cv-chips { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.thc-cv-chips span { padding: 4px 8px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; color: #fff; font-size: 11px; font-weight: 700; background: rgba(255,255,255,.1); }

.thc-cv-logo-wrap {
    width: 112px;
    height: 84px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #fff;
}
.thc-cv-logo-wrap img { display: block; max-width: 100%; max-height: 100%; width: auto !important; height: auto !important; object-fit: contain; }

.thc-cv-actions {
    margin-bottom: 6px;
    padding: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border: 1px solid #dbe2eb;
    border-radius: 12px;
    background: #fff;
}

.thc-cv-action {
    height: 31px;
    padding: 0 9px;
    border: 1px solid #000066;
    border-radius: 5px;
    color: #000066;
    font-size: 12px;
    font-weight: 400;
    background: #fff;
    cursor: pointer;
}
.thc-cv-action:hover, .thc-cv-action:focus { background: #f3f6ff; }

.thc-cv-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(330px, .85fr); align-items: start; gap: 6px; }
.thc-cv-main, .thc-cv-aside { min-width: 0; display: grid; gap: 6px; }
.thc-cv-aside { position: sticky; top: 12px; }

.thc-cv-card {
    min-width: 0;
    padding: 20px;
    border: 1px solid #dbe2eb;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(23, 32, 51, .055);
}

.thc-cv-card-heading { margin-bottom: 16px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.thc-cv-card-heading p { margin: 0 0 3px; color: #29419c; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.thc-cv-card-heading h2 { margin: 0; color: #172033; font-size: 20px; font-weight: 800; line-height: 1.25; }
.thc-cv-count { color: #617086; font-size: 12px; font-weight: 700; white-space: nowrap; }
.thc-cv-field-controls { display: inline-flex; align-items: center; justify-content: flex-end; gap: 10px; }
.thc-cv-show-tees { display: inline-flex; align-items: center; gap: 5px; color: #34415a; font-size: 12px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.thc-cv-show-tees input { width: 16px; height: 16px; margin: 0; appearance: auto; -webkit-appearance: checkbox; accent-color: #29419c; }

.thc-cv-round-list { display: grid; gap: 10px; }
.thc-cv-round { padding: 15px; display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 13px; border: 1px solid #e0e6ee; border-radius: 10px; background: #f8fafc; }
.thc-cv-round > div:last-child,
.thc-cv-round h3,
.thc-cv-round p,
.thc-cv-round-meta { text-align: left !important; justify-content: flex-start; }
.thc-cv-round-number { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-size: 16px; font-weight: 800; background: #29419c; }
.thc-cv-round h3 { margin: 0; color: #172033; font-size: 15px; font-weight: 600; line-height: 1.35; }
.thc-cv-round p { margin: 4px 0 0; color: #657084; font-size: 13px; }
.thc-cv-round-meta { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 7px; }
.thc-cv-round-meta span:not(.thc-cv-format) { padding: 5px 8px; border-radius: 6px; color: #34415a; font-size: 12px; font-weight: 700; background: #e9edf4; }
.thc-cv-round-meta .thc-cv-format { padding: 2px 7px; font-size: 12px; font-weight: 600; line-height: 1.3; }

.thc-cv-division-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.thc-cv-gender-block { padding: 14px; border: 1px solid #e0e6ee; border-radius: 10px; }
.thc-cv-gender-block,
.thc-cv-gender-block > h3,
.thc-cv-day-tees h4 { text-align: left !important; }
.thc-cv-gender-block > h3 { margin: 0 0 12px; color: #172033; font-size: 16px; }
.thc-cv-day-tees + .thc-cv-day-tees { margin-top: 14px; padding-top: 14px; border-top: 1px solid #e2e7ee; }
.thc-cv-day-tees h4 { margin: 0 0 8px; color: #4d5a70; font-size: 13px; line-height: 1.4; }
.thc-cv-division-row { padding: 9px 0; display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: start; gap: 10px; border-top: 1px solid #edf0f4; }
.thc-cv-division-row:first-of-type { border-top: 0; }
.thc-cv-division-name { color: #34415a; font-size: 13px; font-weight: 800; }
.thc-cv-division-name small { margin-top: 3px; display: block; color: #788397; font-size: 11px; font-weight: 600; }
.thc-cv-tees { width: 100%; display: grid; grid-template-columns: 1fr; gap: 3px; }
.thc-cv-tee { width: 100%; min-height: 28px; padding: 6px 9px; display: block; border: 0; border-radius: 2px; font-size: 12px; line-height: 16px; text-align: left; overflow-wrap: anywhere; }

.thc-cv-rich + .thc-cv-rich { margin-top: 16px; padding-top: 16px; border-top: 1px solid #e1e6ed; }
.thc-cv-content-card,
.thc-cv-content-card * { text-align: left !important; }
.thc-cv-rich h3 { margin: 0 0 7px; color: #34415a; font-size: 14px; }
.thc-cv-rich div { overflow-wrap: anywhere; color: #4e5a6e; font-size: 14px; line-height: 1.6; }
.thc-cv-rich p { margin: 0 0 8px; }
.thc-cv-rich img { max-width: 100%; height: auto; }

.thc-cv-summary dl { margin: 0; }
.thc-cv-summary dl > div { padding: 10px 0; display: grid; grid-template-columns: 32% minmax(0, 1fr); gap: 12px; border-top: 1px solid #e7ebf1; }
.thc-cv-summary dl > div:first-child { padding-top: 0; border-top: 0; }
.thc-cv-summary dt { color: #697488; font-size: 12px; font-weight: 700; text-align: left; }
.thc-cv-summary dd { margin: 0; color: #253047; font-size: 13px; font-weight: 800; text-align: left; overflow-wrap: anywhere; }
.thc-cv-my-status { margin-top: 14px; padding: 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-radius: 9px; background: #f2f5f9; }
.thc-cv-my-status span { color: #637085; font-size: 12px; font-weight: 700; }
.thc-cv-my-status strong { font-size: 13px; text-transform: uppercase; }
.thc-cv-my-status .is-playing { color: #187135; }
.thc-cv-my-status .is-not-playing { color: #b22b2b; }
.thc-cv-my-status .is-no-response { color: #5e6879; }

.thc-compview-people { overflow: hidden; }
.thc-compview-people table { width: 100% !important; border-collapse: collapse; color: #29354a; font-size: 12px; }
.thc-compview-people td { height: auto !important; padding: 8px 6px !important; border-bottom: 1px solid #e5eaf0; }
.thc-compview-people .bg_dgreen, .thc-compview-people .bg_red { color: #fff !important; font-weight: 800; }
.thc-compview-people .bg_dgreen { background: #24753a !important; }
.thc-compview-people .bg_red { background: #a83a3a !important; }
.thc-compview-people .subheader { color: #5f6b7e; background: #eef2f6; }
.thc-compview-people .bst1, .thc-compview-people .bst2 { background: #fff; }
@media (min-width: 621px) {
    .thc-compview-people table { table-layout: auto; }
    .thc-compview-people table tr > td:nth-child(2) { width: 100% !important; }
    .thc-compview-people table tr > td:nth-child(3) { width: 26px !important; min-width: 26px; max-width: 26px; padding-left: 3px !important; padding-right: 3px !important; }
}
.thc-cv-people-gap { height: 14px; }
.thc-cv-team-list { display: grid; gap: 10px; }
.thc-cv-team { border: 1px solid #e0e6ee; border-radius: 9px; overflow: hidden; }
.thc-cv-team h3 { margin: 0; padding: 10px 12px; color: #fff; font-size: 14px; background: #29419c; }
.thc-cv-team ol { margin: 0; padding: 6px 12px 6px 38px; }
.thc-cv-team li { padding: 6px 4px; color: #34415a; font-size: 13px; }
.thc-compview-people,
.thc-compview-people .thc-cv-card-heading,
.thc-compview-people .thc-cv-card-heading p,
.thc-compview-people .thc-cv-card-heading h2,
.thc-cv-team-list,
.thc-cv-team,
.thc-cv-team h3,
.thc-cv-team ol,
.thc-cv-team li { text-align: left !important; }
.thc-cv-unassigned table { table-layout: auto !important; }
.thc-cv-unassigned tr:first-child td { text-align: left !important; }
.thc-cv-unassigned td:first-child { width: 20px !important; }
.thc-cv-unassigned td:nth-child(2) { width: auto !important; text-align: left !important; }
.thc-cv-unassigned td:last-child { width: 1px !important; white-space: nowrap; text-align: right !important; }
.thc-cv-open-place { color: #8a94a5; font-style: italic; }
.thc-cv-created { margin: 18px 0 0; color: #758095; font-size: 11px; text-align: right; }

.thc-cv-environment {
    position: fixed;
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 1100;
    padding: 8px 11px;
    border-radius: 7px;
    font: 800 11px/15px Arial, Helvetica, sans-serif;
    box-shadow: 0 2px 8px rgba(0,0,0,.16);
}
.thc-cv-environment { right: max(12px, env(safe-area-inset-right)); color: #fff; }
.thc-cv-environment.is-test { background: #b66a0f; }
.thc-cv-environment.is-dev { background: #7a1fa2; }

#myCompModal .modal-content { width: min(950px, calc(100% - 24px)) !important; margin: 6vh auto !important; max-height: 88vh; overflow: auto; border-radius: 12px; }

@media (max-width: 900px) {
    .thc-cv-layout { grid-template-columns: 1fr; }
    .thc-cv-aside { position: static; }
    .thc-cv-division-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .thc-compview a.repmsg:hover span,
    .thc-compview a.repmsg:focus span,
    .thc-compview a.repmsg.is-open span {
        position: fixed;
        top: auto;
        right: 12px;
        bottom: 12px;
        left: 12px;
        width: auto;
        max-height: 55vh;
        overflow-y: auto;
        transform: none;
        pointer-events: auto;
    }
    .thc-compview a.repmsg:hover span::after,
    .thc-compview a.repmsg:focus span::after,
    .thc-compview a.repmsg.is-open span::after { display: none; }
    .thc-compview a.repmsg .repmsg-reply { cursor: pointer; text-decoration: underline; }
}

@media (max-width: 620px) {
    #myCompModal .modal-content { width: 100% !important; margin: 0 !important; padding: 12px !important; max-height: calc(100dvh - 20px); }
    #myCompModal .thc-startsheet-modal-table,
    #myCompModal .thc-startsheet-table { width: 100% !important; max-width: 100% !important; table-layout: fixed; }
    #myCompModal .thc-startsheet-table td { overflow-wrap: anywhere; }
    #myCompModal .thc-startsheet-mobile { display: grid; gap: 10px; width: 100%; color: #15213d; }
    #myCompModal .thc-startsheet-mobile-intro { padding: 4px 8px 8px; text-align: left; font-size: 14px; }
    #myCompModal .thc-startsheet-mobile-flight { overflow: hidden; border: 1px solid #ccd8e7; border-radius: 10px; background: #fff; box-shadow: 0 1px 3px rgba(18, 42, 78, .12); }
    #myCompModal .thc-startsheet-mobile-flight h3 { margin: 0; padding: 10px 12px; color: #fff; background: #253f86; font-size: 15px; line-height: 1.3; text-align: left; }
    #myCompModal .thc-startsheet-mobile-player { min-height: 38px; padding: 9px 12px; border-top: 1px solid #dbe4ef; font-size: 15px; line-height: 1.35; text-align: left; }
    #myCompModal .thc-startsheet-mobile-player:nth-child(odd) { background: #edf5fd; }
    #myCompModal .thc-startsheet-mobile-player:empty { display: none; }
    #home > header img { width: 116px !important; max-height: 92px; }
    .thcmenuxxx { display: none !important; }
    table.txt_dblue { width: 100% !important; max-width: 100vw !important; table-layout: fixed; }
    table.txt_dblue > tbody > tr > td { width: 100% !important; padding: 0 !important; }
    .thc-compview { width: calc(100vw - 12px); max-width: calc(100vw - 12px); padding: 0 0 64px; }
    .thc-compview-topline { gap: 6px; }
    .thc-cv-event-state { padding: 6px 8px; font-size: 10px; }
    .thc-cv-hero { padding: 14px; grid-template-columns: 58px minmax(0, 1fr); align-items: start; gap: 11px; }
    .thc-cv-date-tile { width: 58px; min-height: 64px; grid-row: 1 / span 2; }
    .thc-cv-date-tile strong { font-size: 23px; }
    .thc-cv-hero h1 { font-size: 16px; }
    .thc-cv-date-range { font-size: 12px; line-height: 1.35; }
    .thc-cv-chips { grid-column: 1 / -1; margin-top: 2px; }
    .thc-cv-logo-wrap { display: none; }
    .thc-cv-actions { padding: 6px; }
    .thc-cv-action { flex: 1 1 calc(50% - 3px); min-width: 0; padding: 0 9px; }
    .thc-cv-card { padding: 15px; }
    .thc-cv-card-heading { align-items: flex-start; }
    .thc-cv-card-heading h2 { font-size: 18px; }
    .thc-cv-round { padding: 12px; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; }
    .thc-cv-round-number { width: 36px; height: 36px; font-size: 14px; }
    .thc-cv-division-row { grid-template-columns: 84px minmax(0, 1fr); gap: 8px; }
    .thc-cv-summary dl > div { grid-template-columns: 34% minmax(0, 1fr); }
    .thc-compview-people { padding-left: 10px; padding-right: 10px; overflow-x: auto; }
    .thc-compview-people .thc-cv-card-heading { padding: 0 5px; }
    .thc-compview-people table { min-width: 330px; }
    .thc-cv-environment { bottom: max(8px, env(safe-area-inset-bottom)); padding: 7px 8px; font-size: 9px; line-height: 13px; }
    .thc-cv-environment { right: max(8px, env(safe-area-inset-right)); }
}
