/* ==========================================================================
   Design tokens — re-theme a new project by editing THESE values only.
   ========================================================================== */
:root {
    /* Race Day Online brand palette (see docs: #121B2B, #3750A4, #79AAD3, #B6A8DD + lime) */
    --brand:        #3750A4;   /* primary buttons / accents / links   */
    --brand-hover:   #2b4087;  /* primary button hover                */
    --brand-dark:    #121B2B;  /* dark actions, nav-on-dark, headings */
    --brand-light:   #e9eefb;  /* tints / active pills / soft bg      */
    --brand-blue:    #2337d8;  /* vivid brand blue (auth / hero pops) */
    --brand-lime:    #D9F23C;  /* signature lime accent               */
    --brand-sky:     #79AAD3;  /* secondary — soft sky blue           */
    --brand-lavender:#B6A8DD;  /* secondary — soft lavender           */
    --accent:        #34d399;  /* success / positive state            */
    --danger:        #ef4444;  /* destructive / error state           */
    --bg:            #f5f6fa;  /* page background                    */
    --surface:       #ffffff;  /* card / panel background            */
    --text:          #1f2430;  /* default text                       */
    --muted:         #6b7280;  /* secondary text                     */
    --border-color:  #e5e7eb;  /* hairline borders                   */

    --radius-sm: 8px;
    --radius:    14px;
    --radius-lg: 22px;

    --shadow-sm: 0 1px 3px rgba(17, 24, 39, .06);
    --shadow:    0 10px 30px rgba(17, 24, 39, .08);
    --shadow-lg: 0 24px 60px rgba(17, 24, 39, .14);

    --transition: .18s ease;

    --font-body: 'raleway-light-webfont', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-heading: 'comfortaa', 'raleway-medium-webfont', var(--font-body);
    --font-brand: 'comfortaa', system-ui, sans-serif;
}

/* ==========================================================================
   Fonts — paths are relative to THIS file so they work at any URL depth.
   ========================================================================== */
@font-face {
    font-family: 'raleway-light-webfont';
    src: url('../fonts/raleway-light-webfont.woff2') format('woff2'),
         url('../fonts/raleway-light-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'raleway-medium-webfont';
    src: url('../fonts/raleway-medium-webfont.woff2') format('woff2'),
         url('../fonts/raleway-medium-webfont.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'comfortaa';
    src: url('../fonts/Comfortaa/Comfortaa_Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'comfortaa';
    src: url('../fonts/Comfortaa/Comfortaa_Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'caviardreams-webfont';
    src: url('../fonts/caviardreams-webfont.woff2') format('woff2'),
         url('../fonts/caviardreams-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'kingthings_exeter-webfont';
    src: url('../fonts/kingthings_exeter-webfont.woff2') format('woff2'),
         url('../fonts/kingthings_exeter-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'montserratalternates-extralight-webfont';
    src: url('../fonts/montserratalternates-extralight-webfont.woff2') format('woff2'),
         url('../fonts/montserratalternates-extralight-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'playfairdisplaysc-regular-webfont';
    src: url('../fonts/playfairdisplaysc-regular-webfont.woff2') format('woff2'),
         url('../fonts/playfairdisplaysc-regular-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'lanenar_-webfont';
    src: url('../fonts/lanenar_-webfont.woff2') format('woff2'),
         url('../fonts/lanenar_-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   Base
   ========================================================================== */
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
}
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
}
a {
    text-decoration: none;
}
.pointer { cursor: pointer; }
.fade-in {
    opacity: 0;
    transition: opacity .5s ease;
}
.fade-in.show { opacity: 1; }

/* Utility classes that replace repeated inline styles in views/templates. */
.show-form-iframe { width: 100%; height: 100vh; border: none; }
.hidden-template { display: none; }

/* ==========================================================================
   Brand logo (inline SVG runner mark + Comfortaa wordmark)
   Rendered by views/partials/logo.php — colored via currentColor.
   ========================================================================== */
.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    color: var(--brand-dark);
    font-family: var(--font-brand);
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}
.brand-logo .brand-logo-mark {
    width: 42px;
    height: 35px;
    flex: 0 0 auto;
}
.brand-logo .brand-logo-text {
    font-size: 1.35rem;
    letter-spacing: -.02em;
    text-transform: lowercase;
}
.brand-logo .brand-logo-online {
    font-size: .55em;
    font-weight: 400;
    opacity: .75;
    vertical-align: super;
    margin-left: .15rem;
}
.brand-logo--light { color: #fff; }
.brand-logo--stacked {
    flex-direction: column;
    gap: .8rem;
    text-align: center;
}
.brand-logo--stacked .brand-logo-mark {
    width: 96px;
    height: 80px;
}
.brand-logo--stacked .brand-logo-text {
    font-size: 2.2rem;
    line-height: 1.05;
}

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar {
    background-color: rgba(255, 255, 255, .9);
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius);
    padding-top: .5rem;
    padding-bottom: .5rem;
}
.navbar .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border-color: var(--border-color) !important;
}
.nav-logo {
    max-height: 40px;
    display: block;
}
.navbar-nav .nav-link {
    color: var(--text);
    font-weight: 500;
    border-radius: 999px;
    padding: .5rem 1rem !important;
    margin: 0 .15rem;
    transition: background-color var(--transition), color var(--transition);
}
.navbar-nav .nav-link:hover {
    background: var(--brand-light);
    color: var(--brand-dark);
}
.navbar-nav .nav-link.active {
    background: var(--brand);
    color: #fff;
}
.navbar-nav .dropdown-menu {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: .5rem;
    margin-top: .5rem;
}
.navbar-nav .dropdown-item {
    border-radius: var(--radius-sm);
    padding: .55rem .9rem;
    transition: background-color var(--transition);
}
.navbar-nav .dropdown-item:hover {
    background: var(--brand-light);
}
#user_logged_in .btn {
    border-color: var(--border-color);
    font-weight: 500;
}
#user_logged_in .btn:hover {
    background: var(--brand-light);
}

/* ==========================================================================
   Hero banner — used both as a big landing hero (home) and a compact page
   header (generated create/edit/index/view templates).
   ========================================================================== */
.hero-section {
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-dark) 100%);
    color: #fff;
    padding: 56px 0;
    text-align: center;
    border-radius: var(--radius-lg);
    margin-top: 1rem;
}
.hero-section h1,
.hero-section h2,
.hero-section h3 {
    color: #fff;
    font-weight: 600;
    margin-bottom: .5rem;
}
.hero-section p {
    color: rgba(255, 255, 255, .85);
}
.hero-section-lg {
    padding: 96px 0;
}
.hero-section-mini {
    background: transparent;
    color: var(--text);
    padding: 20px 0;
    text-align: center;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.button1 {
    color: #fff !important;
    background: var(--brand);
    border: none;
    font-weight: 600;
    transition: background-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.button1:hover {
    color: #fff;
    background: var(--brand-hover);
    box-shadow: var(--shadow-sm);
}
.button1.disabled, .button1:disabled {
    background-color: var(--accent);
}
.search-btn,
.create-btn,
.submit-btn {
    border: none;
    font-weight: 600;
    border-radius: 999px;
    padding: .55rem 1.4rem;
    transition: background-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.search-btn {
    background: var(--brand-dark);
    color: #fff;
}
.search-btn:hover {
    background: #10152b;
    color: #fff;
}
.create-btn {
    background: var(--brand);
    color: #fff;
}
.create-btn:hover {
    background: var(--brand-hover);
    color: #fff;
}
.submit-btn {
    background: var(--brand);
    color: #fff;
}
.submit-btn:hover {
    background: var(--brand-hover);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.table-button {
    margin: 0;
    border-radius: 999px;
    border-color: var(--brand) !important;
    color: var(--brand-dark);
    transition: background-color var(--transition), color var(--transition);
}
.table-button:hover {
    background: var(--brand);
    color: #fff;
}
.view-text {
    font-size: 23px;
    display: block;
}

/* Brand override: Bootstrap "warning" yellow → Race Day lime (CTAs, badges). */
.btn-warning,
.text-bg-warning {
    background-color: var(--brand-lime) !important;
    border-color: var(--brand-lime) !important;
    color: var(--brand-dark) !important;
}
.btn-warning:hover,
.btn-warning:focus {
    background-color: #cbe32e !important;
    border-color: #cbe32e !important;
}

/* ==========================================================================
   Forms — shared polish for generated create/edit views and account pages.
   ========================================================================== */
.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border-color: var(--border-color);
    padding: .6rem .9rem;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem var(--brand-light);
}
.search-input {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    border-color: var(--border-color);
}
.form-check-input {
    width: 25px;
    height: 25px;
    margin-right: 5px;
    transition: background-color var(--transition);
    border: none;
    background-image: none;
    background-color: var(--muted);
    float: none !important;
}
.form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}
.form-check-label {
    padding-top: 2px;
    color: var(--text);
}
.nav-tabs {
    border-bottom: 1px solid var(--border-color);
    gap: .25rem;
}
.nav-tabs .nav-link {
    border: none;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 500;
    padding: .5rem 1.1rem;
}
.nav-tabs .nav-item.show .nav-link,
.nav-tabs .nav-link.active {
    background-color: var(--brand-light);
    color: var(--brand-dark);
    border: none;
}

/* ==========================================================================
   Breadcrumb (sits inside the colored hero banner)
   ========================================================================== */
.breadcrumb {
    display: inline-flex;
    background: rgba(255, 255, 255, .16);
    border-radius: 999px;
    padding: .35rem .9rem;
    margin-bottom: 0;
}
.breadcrumb a {
    color: rgba(255, 255, 255, .85);
}
.breadcrumb .active {
    color: #fff;
}
.breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, .6);
}

/* ==========================================================================
   Cards / lists / tables (used by generated index & view pages)
   ========================================================================== */
.category-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: transform var(--transition), box-shadow var(--transition);
}
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}
.category-icon {
    font-size: 42px;
    color: var(--brand);
}
.stats-label-text {
    font-size: small;
    color: var(--muted);
}
.stats-label {
    font-size: large;
    color: var(--brand-dark);
    font-weight: 600;
}
.filter-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 5px;
}
.filter-list a { cursor: pointer; }
.filter-list a:hover { color: var(--brand); }
.filter-list-link {
    color: var(--brand-dark);
    transition: color var(--transition);
}
.filter-list-link:hover { color: var(--brand); }
.list-group-item.active {
    color: #fff;
    background-color: var(--accent);
    border: none;
}
.list-group-item.active.filter-list-link {
    color: #fff !important;
}
th, td {
    padding: 15px !important;
    text-align: left;
}
thead {
    background-color: var(--brand-dark);
    color: #fff;
    border-bottom: 1px solid var(--border-color);
}
tr:first-child { padding-top: 15px; }

/* Segmented list/table view toggle (generated index pages) */
.view-toggle {
    display: inline-flex;
    background: var(--brand-light);
    border-radius: 999px;
    padding: 3px;
}
.view-toggle span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 34px;
    border-radius: 999px;
    cursor: pointer;
    color: var(--muted);
    transition: background-color var(--transition), color var(--transition);
}
.view-toggle span:hover { color: var(--brand-dark); }
.view-toggle span.selected {
    background: var(--surface);
    color: var(--brand-dark);
    box-shadow: var(--shadow-sm);
}
/* keep old markup working if a project still uses the bare-icon variant */
#viewToggle span i { cursor: pointer; }

/* Record list cards (list view) */
.record-list-item {
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: .75rem;
    transition: box-shadow var(--transition), transform var(--transition);
}
.record-list-item:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}
.record-list-item h5 { margin-bottom: .35rem; color: var(--text); }

/* Detail table (view page) */
.detail-table th { width: 220px; color: var(--brand-dark); }

/* Empty / error state */
.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 3rem 1rem;
}
.empty-state i {
    font-size: 2.5rem;
    color: var(--border-color);
    margin-bottom: .75rem;
    display: block;
}
.empty-state p { margin-bottom: 1rem; }

/* Pager */
.pager-btn {
    height: 38px;
    width: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: var(--radius-sm) !important;
    background: transparent;
    border: 1px solid var(--border-color);
}
.pager-btn:hover { background: var(--brand-light); }
.pager-select {
    min-width: 250px;
    text-align: center;
    background: transparent;
}

#show_table {
    width: 95vw;
    overflow-x: auto;
}
.search input[type="text"],
.search input[type="search"],
.search select {
    background-color: transparent;
}
.page-link { color: var(--muted) !important; }
#_pagination { background: transparent; }

/* ==========================================================================
   Auth pages (login / register / reset / set-password) + account body
   ========================================================================== */
.account-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(160deg, var(--brand-blue) 0%, var(--brand) 55%, var(--brand-dark) 100%);
}
/* Lime primary action on auth pages, per brand (lime pills on vivid blue) */
.account-body .button1 {
    background: var(--brand-lime);
    color: var(--brand-dark) !important;
}
.account-body .button1:hover {
    background: #cbe32e;
    color: var(--brand-dark);
}
/* The layout wraps @yield('content') in a plain ".content" div — it has to
   participate in the flex chain too, otherwise .az-signin-wrapper below has
   nothing to center within and the card sticks to the top-left. */
.account-body > .content {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}
.account-logo {
    max-width: 220px;
    border-radius: var(--radius);
    background: var(--surface);
    padding: 12px;
    box-shadow: var(--shadow-sm);
}
.az-signin-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.az-card-signin {
    background: var(--surface);
    width: 100%;
    max-width: 440px;
    padding: 40px 36px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.az-signin-header h2 {
    font-weight: 600;
    color: var(--brand-dark);
    letter-spacing: -.5px;
}
.az-signin-header h4 {
    font-weight: 400;
    color: var(--text);
    margin-bottom: 25px;
}
.az-signin-header label { color: var(--muted); }
.az-signin-header .form-control,
.az-signin-header .form-select {
    color: var(--text);
    border-width: 1px;
    border-color: var(--border-color);
    background: var(--bg);
}
.az-signin-header .form-control:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem var(--brand-light);
}
.az-signin-header .form-control::placeholder { color: var(--muted); }
.az-signin-header .btn { margin-top: 25px; }
.az-signin-footer p { color: var(--muted); }
.az-signin-footer p:first-child { margin-bottom: 5px; }
.az-signin-footer p:last-child { margin-bottom: 0; }
.az-signin-footer a {
    color: var(--brand-dark);
    font-weight: 700;
}
.az-signin-footer a:hover,
.az-signin-footer a:focus { color: var(--brand); }

/* Auth-card input groups (login/register/reset/set-password use these) */
.az-card-signin .input-group {
    border-radius: var(--radius-sm);
}
.az-card-signin .input-group-text,
.az-card-signin .form-control {
    border-color: var(--border-color) !important;
    background: var(--bg) !important;
    color: var(--text) !important;
}
.az-card-signin .input-group-text i { color: var(--muted); }
.az-card-signin .form-control::placeholder { color: var(--muted); }

/* Secondary links on auth pages ("forgot password", "create an account"...) */
.auth-link {
    color: var(--brand-dark);
    font-weight: 500;
}
.auth-link:hover { color: var(--brand); }

/* ==========================================================================
   Loading overlay / global modals
   ========================================================================== */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 24, 39, .55);
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}
#loadingOverlay.d-none { display: none; }
.overlay-content { text-align: center; }
.overlay-content .spinner-border { color: var(--brand) !important; }
.modal-content {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.modal-header {
    background: var(--brand-light);
    border-bottom: 1px solid var(--border-color);
}
.modal input,
.modal select {
    background-color: transparent;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

/* ==========================================================================
   Embedded mode — pages rendered inside the Event Console tabs (?embed=1).
   Drop the redundant page hero/breadcrumb; the console supplies the header.
   ========================================================================== */
body.embed { background: var(--surface); }
body.embed .hero-section,
body.embed .breadcrumb,
body.embed nav[aria-label="breadcrumb"] { display: none !important; }
body.embed .content > .container,
body.embed .content > .container-fluid,
body.embed .content > .container-xl { padding-top: 1rem; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    color: var(--muted);
    padding: 24px 0;
    text-align: center;
}

/* ==========================================================================
   Misc small helpers used across guest/account pages
   ========================================================================== */
.default-text-block { position: relative; margin-bottom: 40px; }
#dropdownMenuButton:hover { background: transparent; }
#iframe_a {
    width: 100%;
    border: none;
    min-height: 80vh;
}
.row > * { padding-left: 0; }

/* ==========================================================================
   Legacy admin/dashboard styles (out of scope for this retheme — left as-is
   for pages not covered here: users/currency listings, internal dashboards).
   ========================================================================== */
.nav-dropdown {
    background: var(--brand-dark);
    color: #fff;
    width: auto;
}
.nav-dropdown .dropdown-item { color: #fff; }
.nav-dropdown .dropdown-item:not(:first-child) {
    border-top: 1px solid rgba(255, 255, 255, .15);
}
.nav-dropdown .dropdown-item:hover {
    color: var(--brand);
    background: transparent;
}
.bg-green { background: #fff; }
.bg-nav { background: var(--brand-dark); }
.text-green { color: #00A85A; }
.text-yellow { color: #ff9800; }
.acc-btn {
    background: #0d47a1;
    color: #fff !important;
}
.acc-btn:hover {
    background: #0b3981;
    color: #fff;
}
.acc-alt-link { color: #ff9800; }
.acc-alt-link:hover { color: #333; }
.s-item.active { color: #ffff00; }
.d-tab { min-height: 60vh; }
.az-content-header-right .media label { color: #fff; }
.az-dashboard-nav .nav:last-child .nav-link { color: #fff; }
.az-header {
    background-color: #5D4037;
    border-bottom: 2px solid #ff9800;
}
.az-footer {
    background-color: #0e0202;
    border-top: 1px solid #4CAF50;
    margin-top: auto;
    display: none;
}
.az-header-menu .nav-item > .nav-link { color: #22534f; }
.az-dashboard-nav .nav:first-child .nav-link.active { color: #333; }
.az-dashboard-nav .nav:first-child .nav-link:hover { color: #ccc; }

/* Color / background / border swatch utilities used by some legacy pages. */
.color-sdagreen { color: #005e56; }
.color-sdagold { color: #c89b2d; }
.bg-sdagold { background-color: #c89b2d; }
.color-1 { color: #a8216b; }
.color-2 { color: #ec1a4a; }
.color-3 { color: #f26a44; }
.color-4 { color: #f7db69; }
.color-5 { color: #2e9598; }
.border-1 { border: 1px solid; border-color: #a8216b !important; }
.border-2 { border: 1px solid; border-color: #ec1a4a !important; }
.border-3 { border: 1px solid; border-color: #f26a44 !important; }
.border-4 { border: 1px solid; border-color: #f7db69 !important; }
.border-5 { border: 1px solid; border-color: #2e9598 !important; }
.bg-1 { background-color: #a8216b; }
.bg-2 { background-color: #ec1a4a; }
.bg-3 { background-color: #f26a44; }
.bg-4 { background-color: #f7db69; }
.bg-5 { background-color: #2e9598; }

.lanenar-font { font-family: 'lanenar_-webfont', sans-serif; }
.playfair-font { font-family: 'playfairdisplaysc-regular-webfont', sans-serif; }
.montserratalternates-font { font-family: 'montserratalternates-extralight-webfont', sans-serif; }
.caviardreams-font { font-family: 'caviardreams-webfont', sans-serif; }
.logo { font-family: 'kingthings_exeter-webfont', sans-serif; font-weight: bold; }

.small-font { font-size: 16px; line-height: 40px; letter-spacing: 3px; }
.normal-font { font-size: 22px; line-height: 50px; letter-spacing: 3px; }
.large-font { font-size: 35px; line-height: 80px; letter-spacing: 3px; }

.dark-mode { background-color: #001d1a; color: #ffffff; }
.light-mode { background-color: #fcf6e9; color: #005e56; }

/* --- Idle session timer (see views/partials/session-timer.php) ------------- */
.session-timer {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 1040;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 190px;
    padding: 10px 14px;
    color: #fff;
    background: rgba(20, 67, 76, .94);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(14, 45, 51, .2);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
    visibility: hidden;
}
.session-timer-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    visibility: visible;
}
.session-timer > i { color: #ffd082; font-size: 1.15rem; }
.session-timer-copy { display: flex; flex-direction: column; line-height: 1.2; }
.session-timer-copy small { opacity: .78; font-size: .7rem; }
.session-timer-copy strong { font-size: .82rem; font-weight: 700; }
.session-timer-warning { background: rgba(145, 76, 15, .96); animation: session-pulse 1.5s ease-in-out infinite; }
@keyframes session-pulse { 50% { box-shadow: 0 0 0 5px rgba(228, 169, 83, .18); } }
@media (max-width: 575.98px) {
    .session-timer { left: 10px; bottom: 10px; min-width: 174px; padding: 8px 11px; }
}

/* --- Embedded (Event Console iframe) -------------------------------------
   Companion to the server-side check in layouts/main.php. That check relies on
   ?embed=1 or Sec-Fetch-Dest, and the latter is not sent over plain HTTP, so
   this is what actually hides the chrome until the site is on HTTPS. The class
   is set in <head> (see partials/head.php) so nothing paints first. */
.is-embedded > body > nav.navbar,
.is-embedded > body > .footer,
.is-embedded #sessionTimer {
    display: none !important;
}

/* --- Progressive frame viewer --------------------------------------------
   Thumbnail first, native-resolution swap when it arrives. See
   initFrameViewers() in media-format.js. */
.frame-viewer { position: relative; display: block; overflow: hidden; }
.frame-viewer > img { display: block; width: 100%; height: auto; }

.frame-viewer-status {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    display: none;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    font-size: .8rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    background: rgba(17, 24, 39, .82);
    border-radius: 999px;
    backdrop-filter: blur(6px);
    pointer-events: none;
}
.frame-viewer.is-loading .frame-viewer-status { display: inline-flex; }

/* Subtle hint that what you are looking at is not the final image yet. */
.frame-viewer.is-loading > img { filter: saturate(.92) contrast(.97); }
.frame-viewer > img { transition: filter .25s ease; }

/* --- Frame / clip carousel ------------------------------------------------
   The still and the clip cut around it occupy one space, switched by the pill
   group. Panes are stacked rather than swapped out of the DOM so the <video>
   keeps its buffer when the reviewer flips back to the photo. */
.frame-stage { position: relative; width: 100%; }
.frame-stage-pane { display: none; }
.frame-stage-pane > video { display: block; width: 100%; height: auto; background: #000; }
.frame-stage[data-pane="photo"] > .frame-stage-pane[data-pane="photo"],
.frame-stage[data-pane="video"] > .frame-stage-pane[data-pane="video"] { display: block; }

.frame-stage-tabs {
    position: absolute;
    top: 1rem; right: 1rem;
    z-index: 6;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(17, 24, 39, .72);
    backdrop-filter: blur(6px);
}
.frame-stage-tabs .btn {
    border: 0;
    border-radius: 0;
    color: rgba(255, 255, 255, .75);
    font-weight: 600;
    padding: .35rem .9rem;
}
.frame-stage-tabs .btn:hover { color: #fff; background: rgba(255, 255, 255, .12); }
.frame-stage-tabs .btn.active { color: #fff; background: var(--bs-primary, #0d6efd); }

/* Covers the video while ffmpeg cuts the window. */
.frame-stage-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
    color: #fff;
    background: rgba(17, 24, 39, .88);
    border-radius: .375rem;
}
.frame-stage-overlay[hidden] { display: none; }
.frame-stage-overlay.is-error { color: #ffd7d7; }

/* --- Athlete typeahead ----------------------------------------------------
   Replaces a select of every athlete in the event; see athlete-picker.js. */
.athlete-picker { position: relative; }
.athlete-picker-control { position: relative; }
.athlete-picker-input { padding-right: 2rem; }
.athlete-picker.has-selection .athlete-picker-input { font-weight: 600; }

.athlete-picker-clear {
    position: absolute;
    right: .5rem; top: 50%;
    transform: translateY(-50%);
    border: 0; background: none;
    font-size: 1.25rem; line-height: 1;
    color: var(--bs-secondary-color, #6c757d);
    cursor: pointer;
}

.athlete-picker-menu {
    position: absolute;
    z-index: 1060;
    left: 0; right: 0; top: calc(100% + 4px);
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: .75rem;
    box-shadow: 0 12px 32px rgba(16, 24, 40, .14);
}

.athlete-picker-option {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    padding: .5rem .75rem;
    cursor: pointer;
}
.athlete-picker-option + .athlete-picker-option { border-top: 1px solid rgba(0, 0, 0, .05); }
.athlete-picker-option.is-active { background: rgba(13, 110, 253, .08); }
.athlete-picker-option.is-disabled { opacity: .5; cursor: not-allowed; }

.athlete-picker-bib {
    flex: 0 0 auto;
    min-width: 3.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.athlete-picker-name { flex: 1 1 auto; }
.athlete-picker-club,
.athlete-picker-note {
    flex: 0 0 auto;
    font-size: .75rem;
    color: var(--bs-secondary-color, #6c757d);
    white-space: nowrap;
}
.athlete-picker-note { font-style: italic; }
.athlete-picker-empty { padding: .75rem; color: var(--bs-secondary-color, #6c757d); }
