/**
 * CEK Indoor Rowing Overlay - Styles
 * Design system based on CEK branding & Stitch Rower Profile Overlay
 */

:root {
    /* Scale factor for overlay sizing (0.8 = 80% of original) */
    --overlay-scale: 0.8;

    --primary: #8CC63F;
    --primary-dark: #76a832;
    --primary-glow: rgba(140, 198, 63, 0.5);
    --background-dark: #051326;
    --secondary-dark: #0a1a35;
    --card-dark: #08152b;
    --white: #ffffff;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --red-600: #dc2626;
    --gold: #FFD700;
    --silver: #C0C0C0;
    --bronze: #CD7F32;
    --shadow-neon: 0 0 10px var(--primary-glow), 0 0 20px rgba(140, 198, 63, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    --font-display: 'Teko', sans-serif;
    --font-body: 'Roboto', sans-serif;
    --font-mono: 'Roboto Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-body); color: var(--white); }
body.display-page { background: transparent; overflow: hidden; width: 1920px; height: 1080px; }
body.control-page { background: var(--background-dark); min-height: 100vh; }

/* Utilities */
.text-primary { color: var(--primary); }
.text-white { color: var(--white); }
.font-display { font-family: var(--font-display); }
.font-mono { font-family: var(--font-mono); }
.uppercase { text-transform: uppercase; }
.flex { display: flex; }
.items-end { align-items: flex-end; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.relative { position: relative; }
.absolute { position: absolute; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }

/* Animations */
@keyframes pulse-live { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes pulse-neon { 0%, 100% { box-shadow: 0 0 5px var(--primary-glow); } 50% { box-shadow: 0 0 25px var(--primary-glow); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-60px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInDown { from { opacity: 0; transform: translateY(-40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

.animate-pulse-live { animation: pulse-live 1s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.animate-pulse-neon { animation: pulse-neon 2s ease-in-out infinite; }
.animate-slide-in-left { animation: slideInLeft 0.5s ease-out forwards; }
.animate-slide-in-right { animation: slideInRight 0.5s ease-out forwards; }
.animate-slide-in-up { animation: slideInUp 0.5s ease-out forwards; }
.animate-slide-in-down { animation: slideInDown 0.5s ease-out forwards; }
.animate-fade-in { animation: fadeIn 0.4s ease-out forwards; }
.animate-fade-out { animation: fadeOut 0.3s ease-in forwards; }

.stagger-1 { animation-delay: 0ms; }
.stagger-2 { animation-delay: 60ms; }
.stagger-3 { animation-delay: 120ms; }
.stagger-4 { animation-delay: 180ms; }
.stagger-5 { animation-delay: 240ms; }
.stagger-6 { animation-delay: 300ms; }

/* Clip Paths */
.clip-blob { border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%; }

/* Overlay Container */
#overlay-container { position: fixed; inset: 0; width: 1920px; height: 1080px; pointer-events: none; }

/*
 * PROFILE OVERLAY STYLES
 * Mimicking Stitch Rower Profile Overlay
 */
.profile-overlay {
    position: absolute;
    bottom: 40px;
    left: 40px;
    /* max-width: 1000px; */
}

/* Current Race Overlay Container */
.current-race-container {
    position: absolute;
    top: 40px;
    left: 40px;
    right: 40px;
}

/* Leaderboard Overlay Container */
.leaderboard-container {
    position: absolute;
    bottom: 40px;
    left: 40px;
    right: 40px;
}

/* Header Section */
.profile-header-container {
    display: flex;
    align-items: flex-end;
    margin-bottom: 16px;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.3));
}

.profile-logo-wrapper {
    position: relative;
    z-index: 20;
    margin-right: -32px; /* -2rem */
    margin-bottom: 0px; /* Adjusted to 0 */
}


.profile-info-bar {
    background-color: var(--background-dark);
    color: var(--white);
    padding: 12px 38px;
    border-top-right-radius: 0.75rem; /* rounded-tr-xl */
    border-bottom-right-radius: 0.125rem; /* rounded-br-sm */
    box-shadow: var(--shadow-xl);
    border-bottom: 4px solid var(--primary);
    transform: skewX(-12deg);
    position: relative;
    flex-grow: 1;
    min-width: 480px;
    max-width: 640px;
    overflow: hidden;
}

.profile-info-content {
    transform: skewX(12deg); /* Counter skew */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-lane-label {
    color: var(--primary);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.125rem; /* lg */
    line-height: 1;
    letter-spacing: 0.1em; /* tracking-widest */
    text-transform: uppercase;
    margin-bottom: 4px;
}

.profile-athlete-name {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    line-height: 1;
    text-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.profile-team-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    border-left: 1px solid var(--gray-600);
    padding-left: 24px;
    margin-left: 24px;
}

.profile-team-label {
    color: var(--gray-400);
    font-size: 0.75rem; /* xs */
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.profile-team-name {
    font-family: var(--font-display);
    font-size: 1.5rem; /* 2xl */
    font-weight: 600;
    color: var(--white);
}

/* Stats Row */
.profile-stats-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
    margin-left: 38px;
    padding-left: 12px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    border-left: 4px solid var(--primary);
    border-top-right-radius: 0.5rem; /* rounded-r-lg */
    border-bottom-right-radius: 0.5rem;
    padding: 12px;
    min-width: 160px;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s;
}
.stat-card:hover { transform: scale(1.05); }

.dark-stat-card {
    background: var(--background-dark);
    border: 1px solid rgba(140, 198, 63, 0.3);
    border-left: 4px solid var(--primary);
    border-radius: 0.5rem;
    padding: 12px;
    min-width: 128px;
    position: relative;
    overflow: hidden;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.stat-label {
    color: var(--gray-500);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.125rem; /* lg */
    text-transform: uppercase;
}
.dark-stat-card .stat-label { color: var(--primary); }

.stat-icon { color: var(--primary); font-size: 14px; }
.dark-stat-card .stat-icon { color: var(--white); }

.stat-value {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.875rem; /* 3xl */
    line-height: 1;
    color: var(--background-dark);
}
.dark-stat-card .stat-value { color: var(--white); }

.stat-unit { font-size: 0.875rem; color: var(--gray-400); margin-left: 4px; }

.stat-progress-bg {
    height: 4px;
    width: 100%;
    background: var(--gray-200); /* gray-200 */
    margin-top: 8px;
    border-radius: 9999px;
    overflow: hidden;
}

.stat-progress-fill {
    height: 100%;
    background: var(--primary);
}

/* Position Badge */
.pos-badge {
    position: absolute;
    top: 25%;
    right: 32px;
    width: 64px;
    height: 64px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-xl);
    border: 4px solid var(--white);
    transform: rotate(-6deg);
    z-index: 20;
}

.pos-label {
    color: var(--background-dark);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    line-height: 1;
}

.pos-value {
    color: var(--background-dark);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.875rem;
    line-height: 1;
}

/* Live Badge */
.live-indicator {
    position: absolute;
    top: 32px;
    right: 32px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(12px);
    padding: 4px 12px;
    border-radius: 9999px;
    border: 1px solid var(--gray-700);
}

.live-dot {
    width: 12px;
    height: 12px;
    background: var(--red-600);
    border-radius: 50%;
}

.live-text {
    color: var(--white);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/*
 * LEADERBOARD STYLES (Adapted to match Stitch theme)
 */
.leaderboard-row {
    display: flex;
    align-items: center;
    background: rgba(8, 21, 43, 0.95); /* card-dark */
    border-radius: 8px;
    margin-bottom: 6px;
    border: 1px solid var(--gray-700);
    overflow: hidden;
    height: 52px;
}
.leaderboard-row.highlighted { border: 2px solid var(--primary); box-shadow: var(--shadow-neon); }
.leaderboard-pos {
    width: 52px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--background-dark);
}
.pos-1 { background: var(--primary); }
.pos-2 { background: var(--white); }
.pos-3 { background: var(--gray-400); }
.pos-other { background: var(--secondary-dark); color: var(--white); border-right: 1px solid var(--gray-700); }

.leaderboard-name { flex: 1; padding: 0 19px; font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; text-transform: uppercase; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-club { color: var(--gray-400); font-size: 0.875rem; font-family: var(--font-mono); margin-left: 12px; }

.leaderboard-stats { display: flex; gap: 32px; padding-right: 24px; }
.l-stat { text-align: right; }
.l-stat-val { font-family: var(--font-mono); font-weight: 700; font-size: 1.25rem; }
.l-stat-lbl { font-size: 0.65rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.1em; }

/*
 * RESULTS STYLES
 */
.results-overlay { position: absolute; inset: 40px; display: flex; flex-direction: column; }
.results-header-bar {
    background: var(--background-dark);
    border-bottom: 4px solid var(--primary);
    padding: 24px 48px;
    margin-bottom: 24px;
    transform: skewX(-12deg);
    margin-left: 40px;
    display: inline-block;
}
.results-header-content { transform: skewX(12deg); }
.results-title-sub { color: var(--primary); font-family: var(--font-display); font-size: 1.25rem; text-transform: uppercase; letter-spacing: 0.1em; }
.results-title-main { color: var(--white); font-family: var(--font-display); font-size: 2.8rem; font-weight: 700; text-transform: uppercase; line-height: 1; }

.results-table { display: flex; flex-direction: column; gap: 8px; max-width: 1120px; }

/*
 * NEW OVERLAY STYLES
 */

/* Startlist Overlay */
.startlist-overlay {
    position: absolute;
    top: 40px;
    left: 40px;
    width: 420px;
    max-width: 420px !important;
}

.startlist-header {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--background-dark);
    padding: 12px 19px;
    border-radius: 8px 8px 0 0;
    border-bottom: 4px solid var(--primary);
}

.startlist-header-content {
    flex: 1;
}

.startlist-event-name {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--white);
    text-transform: uppercase;
    line-height: 1;
}

.startlist-meta {
    display: flex;
    gap: 12px;
    color: var(--gray-400);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    margin-top: 4px;
}

.startlist-divider {
    color: var(--gray-600);
}

.startlist-body {
    background: rgba(8, 21, 43, 0.95);
    border-radius: 0 0 8px 8px;
}

.startlist-row {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-700);
}

.startlist-row:last-child {
    border-bottom: none;
}

.startlist-lane {
    width: 48px;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
}

.startlist-info {
    flex: 1;
    min-width: 0; /* Allow text to shrink in flex context */
    overflow: hidden;
}

.startlist-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    text-transform: uppercase;
}

.startlist-club {
    color: var(--gray-400);
    font-size: 0.875rem;
}

.startlist-footer {
    padding: 8px 16px;
    text-align: center;
    color: var(--gray-500);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0 0 8px 8px;
}

/* Lower Thirds Overlay */
.lower-thirds-container {
    position: absolute;
    bottom: 100px;
    left: 384px; /* 1/5 of 1920px screen */
    right: 100px;
    display: flex;
    justify-content: space-between;
    gap: 40px;
}

.lower-third-panel {
    position: relative;
    background: var(--background-dark);
    border-radius: 8px;
    overflow: hidden;
    min-width: 320px;
    max-width: 480px;
}

.lower-third-panel.left {
    margin: 0;
}

.lower-third-panel.right {
    margin: 0;
}

.lower-third-panel.center {
    margin: 0 auto;
}

/* Single panel - full width */
.lower-third-panel.single {
    flex: 1;
    min-width: 100%;
    max-width: none;
    width: 100%;
    margin: 0;
}

.lower-third-content {
    padding: 16px 19px;
}

.lower-third-lane {
    color: var(--primary);
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.lower-third-name {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
    text-transform: uppercase;
    line-height: 1.1;
}

.lower-third-club {
    color: var(--gray-400);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    margin-top: 4px;
}

.lower-third-accent {
    height: 6px;
    background: var(--primary);
}

/* Standings Overlay */
.standings-overlay {
    position: absolute;
    top: 40px;
    right: 40px;
    max-width: 500px;
    min-width: 400px;
}

.standings-header {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--background-dark);
    padding: 12px 19px;
    border-radius: 8px 8px 0 0;
    border-bottom: 4px solid var(--primary);
}

.standings-header-content {
    flex: 1;
}

.standings-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--white);
    text-transform: uppercase;
    line-height: 1;
}

.standings-subtitle {
    color: var(--primary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.standings-body {
    background: rgba(8, 21, 43, 0.95);
    border-radius: 0 0 8px 8px;
}

.standings-row {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--gray-700);
}

.standings-row:last-child {
    border-bottom: none;
}

.standings-row.highlighted {
    background: rgba(140, 198, 63, 0.15);
    border-left: 4px solid var(--primary);
}

.standings-pos {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    border-radius: 6px;
    margin-right: 10px;
}

.standings-info {
    flex: 1;
    min-width: 0; /* Allow text to shrink in flex context */
    overflow: hidden;
}

.standings-name {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--white);
    text-transform: uppercase;
}

.standings-club {
    color: var(--gray-500);
    font-size: 0.75rem;
}

.standings-stat {
    text-align: right;
}

.standings-stat-value {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.standings-stat-label {
    color: var(--gray-500);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Podium Overlay */
.podium-overlay {
    position: absolute;
    inset: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.podium-header {
    display: flex;
    align-items: center;
    gap: 19px;
    background: var(--background-dark);
    padding: 19px 38px;
    border-radius: 8px;
    border-bottom: 4px solid var(--primary);
    margin-bottom: 38px;
}

.podium-header-content {
    text-align: left;
}

.podium-label {
    color: var(--primary);
    font-family: var(--font-display);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.podium-event {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
    text-transform: uppercase;
    line-height: 1;
}

.podium-body {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 24px;
}

.podium-card-overlay {
    padding: 26px 19px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.podium-card-overlay.gold {
    width: 320px;
    background: linear-gradient(135deg, #FFD700, #B8860B);
    order: 2;
    transform: translateY(-50px) scale(1.1);
}

.podium-card-overlay.silver {
    width: 280px;
    background: linear-gradient(135deg, #C0C0C0, #808080);
    order: 1;
}

.podium-card-overlay.bronze {
    width: 280px;
    background: linear-gradient(135deg, #CD7F32, #8B4513);
    order: 3;
}

.podium-medal {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.2);
    line-height: 1;
}

.podium-athlete-name {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--background-dark);
    text-transform: uppercase;
    margin-top: 8px;
    line-height: 1.1;
}

.podium-athlete-club {
    color: rgba(0, 0, 0, 0.6);
    font-size: 0.875rem;
    margin-top: 4px;
}

.podium-time {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--background-dark);
    margin-top: 12px;
}

/* Manual Lower Third Overlay */
.manual-lower-third-overlay {
    position: absolute;
    bottom: 80px;
    left: 40px;
    background: var(--background-dark);
    border-radius: 8px;
    overflow: hidden;
    min-width: 320px;
    max-width: 480px;
}

.manual-lt-content {
    padding: 20px 24px;
}

.manual-lt-title {
    color: var(--primary);
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.manual-lt-name {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
    text-transform: uppercase;
    line-height: 1.1;
}

.manual-lt-subtitle {
    color: var(--gray-400);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    margin-top: 4px;
}

.manual-lt-accent {
    height: 6px;
    background: var(--primary);
}

/* Clock Overlay */
#clock-container {
    position: fixed;
    top: 40px;
    right: 40px;
    z-index: 1000;
}

.clock-overlay {
    background: var(--background-dark);
    padding: 10px 19px;
    border-radius: 8px;
    border: 2px solid var(--primary);
}

.clock-display {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--white);
}

/* Logo Overlay */
#logo-injection {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.logo-overlay {
    background: var(--background-dark);
    padding: 32px;
    border-radius: 16px;
    border: 4px solid var(--primary);
    box-shadow: 0 0 40px var(--primary-glow);
}

/*
 * OVERFLOW PREVENTION & TEXT CONSTRAINTS
 * Ensures overlays fit within 16:9 format without overflow
 */

/* Text overflow handling for all name elements - with adaptive sizing */
.profile-athlete-name,
.lower-third-name,
.startlist-name,
.standings-name,
.leaderboard-name,
.podium-athlete-name,
.manual-lt-name,
.boat-crew-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    display: block;
    transition: font-size 0.15s ease-out;
}

/* Title/event name elements - adaptive sizing */
.podium-event,
.boat-view-event,
.startlist-event-name,
.standings-title,
.results-title-main {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    display: block;
    transition: font-size 0.15s ease-out;
}

/* Club/subtitle elements - adaptive sizing */
.lower-third-club,
.startlist-club,
.standings-club,
.podium-athlete-club,
.boat-club-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    display: block;
    transition: font-size 0.15s ease-out;
}

/* Profile overlay constraints */
.profile-overlay {
    max-width: 800px;
}

/* Leaderboard row constraints */
.leaderboard-row {
    max-width: 100%;
}

/* Results overlay safe area */
.results-overlay {
    max-width: calc(100% - 80px);
}

/* Ensure all overlay containers don't overflow the viewport */
#overlay-container > * {
    max-width: calc(1920px - 80px);
    max-height: calc(1080px - 80px);
}

/*
 * RACE CHART OVERLAY
 * Shows time difference from winner over distance
 */
.race-chart-overlay {
    position: absolute;
    inset: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.race-chart-overlay svg {
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

/*
 * ALIGNMENT MARKERS OVERLAY
 * Green markers for OBS alignment
 */
.alignment-overlay {
    position: absolute;
    inset: 0;
    width: 1920px;
    height: 1080px;
    pointer-events: none;
}

.alignment-safe-area {
    position: absolute;
    inset: 0;
    border: 4px solid var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.alignment-corner {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 4px solid var(--primary);
    background: transparent;
    box-shadow: 0 0 10px var(--primary-glow);
}

.alignment-corner.top-left {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
}

.alignment-corner.top-right {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
}

.alignment-corner.bottom-left {
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: none;
}

.alignment-corner.bottom-right {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
}

.alignment-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.alignment-crosshair-h {
    position: absolute;
    width: 100px;
    height: 4px;
    background: var(--primary);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--primary-glow);
}

.alignment-crosshair-v {
    position: absolute;
    width: 4px;
    height: 100px;
    background: var(--primary);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--primary-glow);
}

.alignment-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 60px);
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
}

/*

 * BOAT VIEW OVERLAY

 */

.boat-view-overlay {

    position: absolute;

    inset: 40px;

    display: flex;

    flex-direction: column;

}



.boat-view-header {

    display: flex;

    align-items: center;

    gap: 16px;

    background: var(--background-dark);

    padding: 12px 24px;

    border-radius: 8px;

    border-bottom: 4px solid var(--primary);

    margin-bottom: 24px;

    align-self: flex-start;

}



.boat-view-title {

    display: flex;

    flex-direction: column;

}



.boat-view-event {

    font-family: var(--font-display);

    font-size: 1.8rem;

    font-weight: 700;

    color: var(--white);

    text-transform: uppercase;

    line-height: 1;

}



.boat-view-subtitle {

    color: var(--primary);

    font-family: var(--font-mono);

    font-size: 0.8rem;

    text-transform: uppercase;

    letter-spacing: 0.1em;

}



.boat-lanes-container {

    display: flex;

    flex-direction: column;

    gap: 4px;

    flex: 1;

    overflow-y: auto;

    padding-right: 12px;

}



.boat-lane {

    display: flex;

    align-items: center;

    background: rgba(5, 19, 38, 0.95);

    border-radius: 4px;

    height: 56px;

    position: relative;

    border-bottom: 1px solid var(--gray-700);

}



.boat-lane-info {

    width: 280px;

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 0 16px;

    background: rgba(5, 19, 38, 0.95);

    height: 100%;

    z-index: 2;

    border-right: 1px solid var(--gray-700);

}



.boat-lane-pos {

    display: flex;

    flex-direction: column;

    align-items: center;

    width: 32px;

}



.pos-number {

    font-family: var(--font-display);

    font-size: 1.4rem;

    font-weight: 700;

    color: var(--white);

    line-height: 1;

}



.lane-number {

    font-family: var(--font-mono);

    font-size: 0.7rem;

    color: var(--gray-500);

}



.boat-lane-names {

    display: flex;

    flex-direction: column;

    overflow: hidden;

    flex: 1;

}



.boat-crew-name {

    font-family: var(--font-display);

    font-size: 1.1rem;

    font-weight: 600;

    color: var(--white);

    text-transform: uppercase;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

}



.boat-club-name {

    font-family: var(--font-mono);

    font-size: 0.75rem;

    color: var(--gray-400);

    text-transform: uppercase;

}



.boat-track {

    flex: 1;

    position: relative;

    height: 100%;

    background: rgba(255, 255, 255, 0.02);

    margin: 0 4px;

}



/* Grid Lines */

.grid-line {

    position: absolute;

    top: 0;

    bottom: 0;

    width: 1px;

    background: rgba(255, 255, 255, 0.1);

}



.grid-line span {

    position: absolute;

    bottom: 2px;

    left: 4px;

    font-family: var(--font-mono);

    font-size: 0.6rem;

    color: var(--gray-600);

}



.finish-line {

    position: absolute;

    right: 0;

    top: 0;

    bottom: 0;

    width: 2px;

    background: var(--red-600);

    z-index: 1;

    display: flex;

    align-items: center;

    justify-content: center;

}



.finish-line span {

    position: absolute;

    right: 6px;

    font-family: var(--font-mono);

    font-size: 0.7rem;

    color: var(--red-600);

    font-weight: 700;

    transform: rotate(-90deg);

    white-space: nowrap;

}



.boat-marker-container {



    position: absolute;



    top: 50%;



    transform: translate(0, -50%); /* Align left edge to position */



    z-index: 10;



    transition: left 1s linear;



    width: 60px;



    height: 16px;



}



/* Rowing Shell Shape */



.boat-shape {



    width: 100%;



    height: 100%;



    background: var(--primary);



    clip-path: polygon(100% 50%, 85% 0, 0 0, 0 100%, 85% 100%); /* Rotated 180 degrees */



    box-shadow: 0 0 10px var(--primary-glow);



    position: relative;



}







.boat-shape::after {



    content: '';



    position: absolute;



    left: 0; /* Changed from right to left */



    top: 0;



    bottom: 0;



    width: 4px;



    background: rgba(255, 255, 255, 0.5);



}







/* Stats Column */

.boat-lane-stats {

    display: flex;

    align-items: center;

    gap: 16px;

    padding: 0 16px;

    background: rgba(5, 19, 38, 0.95);

    height: 100%;

    border-left: 1px solid var(--gray-700);

    width: 240px;

    justify-content: flex-end;

}



.stat-box {

    display: flex;

    flex-direction: column;

    align-items: flex-end;

    min-width: 50px;

}



.stat-val {

    font-family: var(--font-mono);

    font-size: 1.1rem;

    font-weight: 700;

    color: var(--white);

    line-height: 1;

}



.boat-split { color: var(--primary); }



.stat-unit {

    font-size: 0.65rem;

    color: var(--gray-500);

    text-transform: uppercase;

}
