/* Brand Colors */
:root {
    --netcoord-violet: #4A33FF;
    --deep-court-purple: #2D1E80;
    --electric-red: #FF3366;
    --match-green: #32D74B;
    --busy-red: #FF453A;
    --soft-white: #F8F9FF;
    --court-gray: #A9AFC5;
    --slate-shadow: #1B1B2A;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--deep-court-purple);
    background-image:
        repeating-linear-gradient(30deg,
            transparent,
            transparent 2px,
            rgba(74, 51, 255, 0.03) 2px,
            rgba(74, 51, 255, 0.03) 4px);
    min-height: 100vh;
    padding: 0 20px 20px 20px;
    color: var(--soft-white);
    overflow-x: hidden;
    position: relative;
}

/* Tennis Court Watermark Background for Main Page */
body::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 112.5%;
    height: 112.5%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.08;
    background-image: url('assets/tennis-court-watermark.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    transform: translate(-50%, -50%);
    transform-origin: center center;
}

/* Ensure content appears above watermark on main page */
body .container,
body header,
body main {
    position: relative;
    z-index: 1;
}

/* Ladder Title - White Font */
.ladder-title {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--soft-white);
    /* White */
    margin: 15px 0 5px 0;
    /* Space above, small gap before season header */
    padding: 0;
}

/* Season Header - Aggressive, Sporty Font */
.season-header {
    font-family: 'Impact', 'Arial Black', 'Helvetica Neue', 'Helvetica', sans-serif;
    font-size: 2.16rem;
    /* 20% larger than 1.8rem */
    font-weight: 900;
    font-style: italic;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--electric-red);
    /* #FF3366 - same red as logo ball */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0 0 15px 0;
    /* Space below */
    padding: 0;
}

/* Splash Screen */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--deep-court-purple);
    background-image:
        repeating-linear-gradient(30deg,
            transparent,
            transparent 2px,
            rgba(74, 51, 255, 0.03) 2px,
            rgba(74, 51, 255, 0.03) 4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    animation: splashFadeIn 0.204s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.splash-screen.splash-visible {
    opacity: 1;
}

.splash-screen.splash-fade-out {
    animation: splashFadeOut 0.204s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes splashFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes splashFadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.splash-content {
    text-align: center;
    color: var(--soft-white);
    animation: splashContentSlide 0.85s cubic-bezier(0.25, 0.8, 0.25, 1) 0.255s both;
}

@keyframes splashContentSlide {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Splash Images Container */
.splash-images-container {
    position: relative;
    width: 400px;
    height: 400px;
    max-width: 60vw;
    max-height: 60vw;
    margin-bottom: 40px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.splash-rotating-image {
    position: absolute;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    opacity: 0;
    top: 50%;
    left: 52%;
    transform: translate(-50%, -50%) scale(0.8);
    transform-origin: center center;
    margin: 0;
    padding: 0;
}

.splash-rotating-image.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    animation: imagePopIn 0.187s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Scale down the first image (eventreminder) */
.splash-rotating-image[data-index="0"].active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.92);
    animation: imagePopInFirst 0.187s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Scale up the second image (eventcancelled) */
.splash-rotating-image[data-index="1"].active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15);
    animation: imagePopInSecond 0.187s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes imagePopInFirst {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.75);
    }

    60% {
        transform: translate(-50%, -50%) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.92);
    }
}

@keyframes imagePopInSecond {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.75);
    }

    60% {
        transform: translate(-50%, -50%) scale(1.12);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.15);
    }
}

.splash-rotating-image.fading-out {
    transform: translate(-50%, -50%) scale(0.8);
    animation: imagePopOut 0.1275s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes imagePopIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }

    60% {
        transform: translate(-50%, -50%) scale(1.05);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes imagePopOut {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

.splash-logo-container {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.splash-text-logo {
    max-width: 400px;
    width: 80vw;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.95;
        transform: scale(1.02);
    }
}

.splash-tagline {
    font-size: 1.8em;
    font-weight: 400;
    font-style: italic;
    color: var(--soft-white);
    text-shadow: 0 2px 8px rgba(27, 27, 42, 0.4), 0 0 15px rgba(248, 249, 255, 0.2);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
    letter-spacing: 0.05em;
    margin: 0;
}

.container.fade-in {
    animation: containerFadeIn 0.5s ease-in forwards;
    opacity: 1 !important;
    /* Ensure final state is visible */
}

@keyframes containerFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: var(--soft-white);
    margin-bottom: 30px;
    margin-top: 0;
    padding-top: 0;
}

@media (max-width: 968px) {
    header {
        margin-bottom: 15px;
    }
}

@media (max-width: 600px) {
    header {
        margin-bottom: 10px;
    }
}

.header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 15px;
    margin-top: 0;
    flex-wrap: nowrap;
    gap: 5px;
    /* Reduced gap to bring buttons closer */
    position: relative;
    padding-top: 0;
    padding-bottom: 0;
    min-height: 150px;
}

.header-button-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
    z-index: 2;
    align-self: center;
    margin-top: 0;
}

@media (max-width: 968px) {
    .header-button-wrapper {
        align-self: center;
    }
}

.racket-button-header {
    width: 44px;
    height: 44px;
    padding: 0;
    background: var(--netcoord-violet);
    border: none;
    border-radius: 50%;
    color: white;
    font-weight: 500;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 2;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    box-shadow: 0 2px 8px rgba(74, 51, 255, 0.3);
}

.racket-icon-header {
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
    font-size: 20px;
    font-family: 'Material Icons', sans-serif;
    font-weight: normal;
    font-style: normal;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.racket-button-header:hover {
    background: var(--electric-red);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 51, 102, 0.4);
    text-decoration: none;
    color: white;
}

.racket-button-header:hover .racket-icon-header {
    transform: scale(1.1);
}

.racket-button-header:active {
    transform: scale(1.05);
    transition: transform 0.1s ease-out;
}

.button-line {
    display: block;
    white-space: nowrap;
}

.header-branding {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
    z-index: 1;
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    pointer-events: none;
    padding-top: 0;
    margin-top: 0;
}

.header-branding img,
.header-branding a {
    pointer-events: auto;
}

/* Desktop: Position hamburger menu on the right */
.header-branding+.header-button-wrapper {
    margin-left: auto;
    margin-right: 0;
}

.share-button {
    padding: 8px 12px;
    background: transparent;
    border: 1.5px solid var(--soft-white);
    border-radius: 14px;
    color: var(--soft-white);
    font-weight: 500;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
    white-space: nowrap;
}

.share-icon-header {
    font-size: 20px;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    color: #F8F9FF;
    line-height: 1;
    transition: color 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.share-button-label {
    color: var(--soft-white);
    font-weight: 500;
    font-size: 0.85em;
    white-space: nowrap;
}

.share-icon-modal {
    font-size: 24px;
    vertical-align: middle;
    margin-right: 8px;
    display: inline-flex;
    align-items: center;
    color: var(--soft-white);
}

.share-button:hover {
    background: rgba(248, 249, 255, 0.1);
    border-color: var(--soft-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(27, 27, 42, 0.2);
}

.share-button:hover .share-icon-header {
    color: #FF3366;
}

.share-button:active {
    transform: translateY(0);
    transition: transform 0.1s ease-out;
}

.share-notification,
#shareCourtNotification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--match-green);
    color: white;
    padding: 15px 25px;
    border-radius: 18px;
    box-shadow: 0 4px 15px rgba(50, 215, 75, 0.3);
    z-index: 10000;
    font-weight: 600;
    animation: slideInRight 0.24s cubic-bezier(0.25, 0.8, 0.25, 1), fadeOut 0.24s cubic-bezier(0.25, 0.8, 0.25, 1) 1.7s forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.header-icon-logo {
    max-height: 60px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.header-text-logo {
    max-height: 140px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    margin-top: 0;
    padding-top: 0;
    display: block;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Sport Toggle */
.sport-toggle-container {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 10;
}

@media (max-width: 968px) {
    .sport-toggle-container {
        margin-top: 5px;
        margin-bottom: 5px;
    }
}

@media (max-width: 600px) {
    .sport-toggle-container {
        margin-top: 5px;
        margin-bottom: 5px;
    }
}

.refresh-button-header,
.share-button-header {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: var(--netcoord-violet);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: white;
    font-weight: 500;
    font-size: 0.85em;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    flex-shrink: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    box-shadow: 0 2px 8px rgba(74, 51, 255, 0.3);
}

.refresh-button-header:hover,
.share-button-header:hover {
    background: var(--electric-red);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 51, 102, 0.4);
}

.refresh-button-header:disabled,
.share-button-header:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.refresh-button-header:active,
.share-button-header:active {
    transform: scale(1.05);
    transition: transform 0.1s ease-out;
}

.refresh-icon-header,
.share-icon-header {
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
    font-size: 20px;
    font-family: 'Material Icons', sans-serif;
    font-weight: normal;
    font-style: normal;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.button-label {
    font-size: 0.7em;
    line-height: 1.1;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
    font-weight: 500;
    color: var(--soft-white);
    text-align: center;
    margin-top: 2px;
}

.refresh-button-header:hover:not(:disabled) .refresh-icon-header {
    transform: rotate(180deg);
}

.share-button-header:hover:not(:disabled) .share-icon-header {
    transform: scale(1.1);
}

.sport-toggle {
    position: relative;
    display: inline-block;
    width: 165px;
    height: 42px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.sport-toggle input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    cursor: pointer;
    z-index: 100;
}

/* Glass Container */
.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 38px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow:
        inset 0 2px 3px rgba(255, 255, 255, 0.1),
        inset 0 -2px 3px rgba(0, 0, 0, 0.1),
        0 3px 11px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    /* Padding for the knob */
    pointer-events: none;
    z-index: 1;
}

/* Liquid Knob */
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 35px;
    width: 78px;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.8));
    border-radius: 30px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Bouncy spring */
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.15),
        inset 0 2px 2px rgba(255, 255, 255, 1),
        inset 0 -2px 2px rgba(0, 0, 0, 0.05);
    z-index: 1;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.sport-toggle input:checked+.toggle-slider {
    background: rgba(255, 255, 255, 0.15);
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.15),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15),
        0 4px 20px rgba(0, 0, 0, 0.15),
        0 0 15px rgba(74, 51, 255, 0.2);
    /* Subtle glow */
}

/* Slide Calculation: 165px (total) - 3px (padding left) - 3px (padding right) - 78px (knob) = 81px move distance. 
   Left Offset: 4px.
   Right position should be: 165px - 78px - 4px = 83px.
*/
.sport-toggle input:checked+.toggle-slider:before {
    left: 83px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(240, 240, 255, 0.9));
}

.toggle-label-left,
.toggle-label-right {
    position: absolute;
    z-index: 2;
    font-weight: 700;
    font-size: 0.9em;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50%;
    /* Take up half the space */
    height: 100%;
    pointer-events: none;
    user-select: none;
}

.toggle-label-left {
    left: 0;
    color: var(--deep-court-purple);
    opacity: 1;
    transform: scale(1.05);
}

.toggle-label-right {
    right: 0;
    color: rgba(255, 255, 255, 0.7);
    opacity: 0.7;
    transform: scale(0.95);
}

.sport-toggle input:checked~.toggle-slider .toggle-label-left {
    color: rgba(255, 255, 255, 0.7);
    opacity: 0.7;
    transform: scale(0.95);
}

.sport-toggle input:checked~.toggle-slider .toggle-label-right {
    color: var(--netcoord-violet);
    opacity: 1;
    transform: scale(1.05);
}

.main-content {
    display: flex;
    justify-content: center;
    height: calc(100vh - 200px);
}

.court-list-container {
    background: transparent;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(27, 27, 42, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 600px;
}

.court-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

@media (max-width: 768px) {
    .court-list-header {
        gap: 6px;
        margin-bottom: 12px;
    }
    
    .court-list-container {
        padding: 15px;
    }
}

@media (max-width: 600px) {
    .court-list-header {
        gap: 4px;
        margin-bottom: 10px;
    }
    
    .court-list-container {
        padding: 12px;
    }
}

.collapse-all-button {
    padding: 6px 10px;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--soft-white);
    cursor: pointer;
    font-size: 12px;
    outline: none;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.collapse-all-button .material-icons {
    font-size: 16px;
    vertical-align: middle;
}

@media (max-width: 768px) {
    .collapse-all-button {
        padding: 4px 8px;
        font-size: 11px;
        gap: 3px;
    }
    
    .collapse-all-button .material-icons {
        font-size: 14px;
    }
}

@media (max-width: 600px) {
    .collapse-all-button {
        padding: 3px 6px;
        font-size: 10px;
        gap: 2px;
    }
    
    .collapse-all-button .material-icons {
        font-size: 13px;
    }
}

.collapse-all-button:hover {
    border-color: var(--electric-red);
    background: rgba(255, 51, 102, 0.2);
    color: var(--soft-white);
}

.collapse-all-button:active {
    transform: scale(0.98);
}

.court-list-header-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.court-list-header-buttons {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}


.court-list-container h2 {
    margin: 0;
    color: var(--soft-white);
    font-size: 32px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
}

@media (max-width: 768px) {
    .court-list-container h2 {
        font-size: 28px;
    }
}

@media (max-width: 600px) {
    .court-list-container h2 {
        font-size: 24px;
        line-height: 1.2;
    }
}

/* Search bar styling for upcoming matches */
/* Leaderboard header specific styling */
.leaderboard-header {
    align-items: flex-start !important;
}

.leaderboard-header .collapse-all-button {
    align-self: flex-start;
    margin-top: 0;
}

.leaderboard-header-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

@media (max-width: 600px) {
    .leaderboard-header-content {
        padding-right: 2px;
    }
}

/* Search container for upcoming matches */
.search-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.search-icon {
    color: var(--soft-white);
    font-size: 20px;
    flex-shrink: 0;
}

#player-search,
#results-search {
    flex: 1;
    padding: 10px 15px;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--soft-white);
    font-size: 16px;
    /* Prevent zoom on iOS when focusing */
    outline: none;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
    /* Prevent page scroll on mobile when focused */
    touch-action: manipulation;
}

#player-search:focus,
#results-search:focus {
    /* Prevent scroll on focus */
    scroll-margin: 0;
    scroll-padding: 0;
}

#player-search::placeholder,
#results-search::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#player-search:focus,
#results-search:focus {
    border-color: var(--electric-red);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(255, 51, 102, 0.2);
}

#player-search:hover,
#results-search:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.12);
}

#clear-search,
#clear-results-search {
    padding: 8px 12px;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--soft-white);
    cursor: pointer;
    font-size: 12px;
    outline: none;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
    font-weight: 500;
}

#clear-search:hover,
#clear-results-search:hover {
    border-color: var(--electric-red);
    background: rgba(255, 51, 102, 0.2);
    color: var(--soft-white);
}

#clear-search:active,
#clear-results-search:active {
    transform: scale(0.98);
}


.last-updated-text {
    font-size: 13px;
    color: var(--court-gray);
    font-weight: 400;
    line-height: 1.2;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
}

.help-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: var(--netcoord-violet);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: white;
    font-weight: normal;
    font-size: 1.2em;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    flex-shrink: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    box-shadow: 0 2px 8px rgba(74, 51, 255, 0.3);
}

.hamburger-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: var(--netcoord-violet);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: white;
    font-weight: normal;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    flex-shrink: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    box-shadow: 0 2px 8px rgba(74, 51, 255, 0.3);
}

.hamburger-button:hover {
    background: var(--electric-red);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 51, 102, 0.4);
}

.hamburger-button:active {
    transform: scale(1.05);
    transition: transform 0.1s ease-out;
}

.hamburger-icon {
    font-size: 24px;
    line-height: 1;
}

.header-logo-link {
    display: inline-block;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
}

.header-logo-link:hover {
    transform: scale(1.05);
}

.header-logo-link:active {
    transform: scale(0.98);
}

.help-button:hover {
    background: var(--electric-red);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 51, 102, 0.4);
}

.help-button:active {
    transform: scale(1.05);
    transition: transform 0.1s ease-out;
}

.help-icon {
    line-height: 1;
}

.admin-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: var(--netcoord-violet);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: white;
    font-weight: normal;
    font-size: 1.2em;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    flex-shrink: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    box-shadow: 0 2px 8px rgba(74, 51, 255, 0.3);
}

.admin-button:hover {
    background: var(--electric-red);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 51, 102, 0.4);
}

.admin-button:active {
    transform: scale(1.05);
    transition: transform 0.1s ease-out;
}

.admin-icon {
    font-size: 24px;
    line-height: 1;
}

.leaderboards-button,
a.leaderboards-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: var(--netcoord-violet);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: white;
    font-weight: normal;
    font-size: 1.2em;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    flex-shrink: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    box-shadow: 0 2px 8px rgba(74, 51, 255, 0.3);
}

.leaderboards-button:hover {
    background: var(--electric-red);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 51, 102, 0.4);
}

.leaderboards-button:active {
    transform: scale(1.05);
    transition: transform 0.1s ease-out;
}

.leaderboards-icon {
    font-size: 24px;
    line-height: 1;
}

.back-button,
a.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: var(--netcoord-violet);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: white;
    font-weight: normal;
    font-size: 1.2em;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    flex-shrink: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}

.back-button:hover {
    background: var(--electric-red);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 51, 102, 0.4);
}

.back-button:active {
    transform: scale(1.05);
    transition: transform 0.1s ease-out;
}

.back-icon {
    font-size: 24px;
    line-height: 1;
}

/* Refresh button spinning animation */
.refreshing .back-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Leaderboard Cards (Landing Page) */
.leaderboard-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid transparent;
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: block;
    color: var(--soft-white);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.leaderboard-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--netcoord-violet);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(74, 51, 255, 0.3);
}

.leaderboard-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    position: relative;
}

.leaderboard-card-icon {
    margin-bottom: 8px;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.leaderboard-card:hover .leaderboard-card-icon {
    transform: scale(1.1);
}

.leaderboard-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--soft-white);
    margin: 0;
    line-height: 1.4;
}

.leaderboard-card-season {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--electric-red);
    margin: 0;
    font-style: italic;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.leaderboard-card-arrow {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.leaderboard-card:hover .leaderboard-card-arrow {
    opacity: 1;
    right: 16px;
}

@media (max-width: 768px) {
    .leaderboard-card {
        padding: 20px;
    }

    .leaderboard-card-title {
        font-size: 1.1rem;
    }

    .leaderboard-card-season {
        font-size: 0.85rem;
    }
}

.refresh-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    color: #667eea;
    transition: all 0.3s;
    white-space: nowrap;
}

.refresh-button:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: translateY(-1px);
}

.refresh-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.refresh-icon {
    font-size: 1.1em;
    display: inline-block;
    transition: transform 0.3s;
}

.refresh-button:hover:not(:disabled) .refresh-icon {
    transform: rotate(180deg);
}

.sort-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: 1.5px solid var(--soft-white);
    border-radius: 14px;
    cursor: pointer;
    font-size: 0.85em;
    color: var(--soft-white);
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
}

.sort-button:hover {
    background: rgba(248, 249, 255, 0.1);
    border-color: var(--soft-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(27, 27, 42, 0.2);
}

.sort-button:active {
    transform: translateY(0);
    transition: transform 0.1s ease-out;
}

.sort-button.active {
    background: var(--netcoord-violet);
    color: white;
    border-color: var(--netcoord-violet);
}

.sort-icon {
    font-size: 18px;
    color: #F8F9FF;
    transition: color 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: inline-flex;
    align-items: center;
}

.sort-button:hover .sort-icon {
    color: #FF3366;
}

/* Last Updated Display - now integrated into header */

.sort-text {
    font-weight: 500;
}

.location-status {
    margin-bottom: 15px;
    font-size: 0.85em;
    min-height: 20px;
}

.location-status span {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
}

.location-loading {
    color: #667eea;
}

.location-success {
    color: #28a745;
    background: #d4edda;
}

.location-error {
    color: #dc3545;
    background: #f8d7da;
}

/* Combined Search and Filter Container */
.search-filter-container {
    margin-bottom: 15px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: stretch;
    -ms-flex-align: stretch;
    align-items: stretch;
    -webkit-box-pack: start;
    -ms-flex-pack: start;
    justify-content: flex-start;
    gap: 0;
    border: 1.5px solid rgba(248, 249, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(169, 175, 197, 0.15);
    transition: border-color 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    width: 100%;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    min-height: 44px;
    /* Ensure minimum touch target size */
    direction: ltr;
    backdrop-filter: blur(10px);
}

.search-filter-container:focus-within {
    border-color: var(--netcoord-violet);
    box-shadow: 0 0 0 3px rgba(74, 51, 255, 0.1);
}

.search-input-combined {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    padding: 12px 15px;
    padding-left: 15px !important;
    padding-right: 15px;
    border: none;
    border-right: 1px solid rgba(248, 249, 255, 0.2);
    font-size: 16px;
    /* Prevent zoom on iOS */
    outline: none;
    background: transparent;
    color: var(--soft-white);
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    min-width: 0;
    /* Allow flex shrinking */
    width: 100%;
    max-width: 100%;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin: 0;
    margin-left: 0 !important;
    margin-right: 0;
    -webkit-tap-highlight-color: transparent;
    text-align: left !important;
    -webkit-text-align: left !important;
    direction: ltr;
    text-align-last: left;
    -webkit-user-select: text;
    user-select: text;
    float: left;
    clear: left;
}

.search-input-combined:not(:last-child) {
    border-right: 1px solid rgba(248, 249, 255, 0.2);
}

.search-input-combined::placeholder {
    color: var(--court-gray);
    opacity: 1;
    /* Ensure placeholder is visible */
}

.filter-sort-button-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    border-left: 1px solid rgba(248, 249, 255, 0.2);
    padding-left: 6px;
}

.filter-sort-button {
    padding: 12px 15px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--soft-white);
    min-width: 50px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
}

.filter-sort-button:hover {
    background-color: rgba(248, 249, 255, 0.1);
    color: var(--electric-red);
}

.filter-sort-button .material-icons {
    font-size: 24px;
    transition: color 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.filter-sort-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    margin-left: 4px;
    margin-right: 4px;
    background: var(--netcoord-violet);
    border-radius: 12px;
    font-size: 0.75em;
    color: var(--soft-white);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
    font-weight: 500;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
}

.filter-sort-indicator .material-icons {
    font-size: 14px !important;
    width: 14px;
    height: 14px;
    line-height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.filter-sort-indicator>span:not(.material-icons) {
    font-size: 0.75em;
    line-height: 1;
}

/* Filter/Sort Modal */
.filter-sort-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-sort-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(27, 27, 42, 0.7);
    backdrop-filter: blur(4px);
}

.filter-sort-modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    background: rgba(45, 30, 128, 0.95);
    border: 1.5px solid rgba(248, 249, 255, 0.2);
    border-radius: 18px;
    box-shadow: 0 10px 40px rgba(27, 27, 42, 0.5);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    z-index: 1001;
    backdrop-filter: blur(20px);
}

.filter-sort-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1.5px solid rgba(248, 249, 255, 0.2);
}

.filter-sort-modal-header h2 {
    margin: 0;
    color: var(--soft-white);
    font-size: 1.5em;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
    font-weight: 600;
}

.filter-sort-close-button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid rgba(248, 249, 255, 0.3);
    background: transparent;
    color: var(--soft-white);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    line-height: 1;
    padding: 0;
}

.filter-sort-close-button:hover {
    background: rgba(248, 249, 255, 0.1);
    border-color: var(--soft-white);
    color: var(--electric-red);
}

.filter-sort-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.filter-sort-section {
    margin-bottom: 30px;
}

.filter-sort-section:last-child {
    margin-bottom: 0;
}

.filter-sort-section h3 {
    margin: 0 0 15px 0;
    color: var(--soft-white);
    font-size: 1.1em;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
}

.filter-sort-radio-group,
.filter-sort-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-sort-radio-label,
.filter-sort-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px;
    border-radius: 12px;
    transition: background 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.filter-sort-radio-label:hover,
.filter-sort-checkbox-label:hover {
    background: rgba(248, 249, 255, 0.1);
}

.filter-sort-radio-label span,
.filter-sort-checkbox-label span {
    color: var(--soft-white);
    font-size: 1em;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
}

.filter-sort-radio,
.filter-sort-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--netcoord-violet);
}

.filter-sort-modal-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 20px;
    border-top: 1.5px solid rgba(248, 249, 255, 0.2);
}

.filter-sort-clear-button,
.filter-sort-confirm-button {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1em;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.filter-sort-clear-button {
    background: rgba(248, 249, 255, 0.1);
    color: var(--soft-white);
    border: 1.5px solid rgba(248, 249, 255, 0.3);
}

.filter-sort-clear-button:hover {
    background: rgba(248, 249, 255, 0.2);
    border-color: var(--soft-white);
}

.filter-sort-confirm-button {
    background: var(--netcoord-violet);
    color: var(--soft-white);
}

.filter-sort-confirm-button:hover {
    background: var(--electric-red);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 51, 102, 0.4);
}

.filter-sort-confirm-button:active {
    transform: translateY(0);
}

.court-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.court-list::-webkit-scrollbar {
    width: 8px;
}

.court-list::-webkit-scrollbar-track {
    background: var(--court-gray);
    border-radius: 4px;
}

.court-list::-webkit-scrollbar-thumb {
    background: var(--netcoord-violet);
    border-radius: 4px;
}

.pull-to-refresh-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    color: var(--soft-white);
    font-size: 14px;
    font-weight: 500;
    background: rgba(74, 51, 255, 0.8);
    border-radius: 12px;
    margin: 10px auto;
    width: fit-content;
    transition: transform 0.2s ease-out;
    position: relative;
    z-index: 10;
}

.pull-to-refresh-indicator .material-icons {
    transition: transform 0.2s ease-out;
}

.pull-to-refresh-indicator .material-icons.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.court-list::-webkit-scrollbar-thumb:hover {
    background: var(--electric-red);
}

/* Park item styles */
.park-item {
    margin-bottom: 10px;
    border: 1.5px solid rgba(248, 249, 255, 0.2);
    border-radius: 20px;
    overflow: hidden;
    background: rgba(45, 30, 128, 0.6);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(27, 27, 42, 0.2);
}

.park-header {
    padding: 15px;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    user-select: none;
}

.park-header:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--netcoord-violet);
}

.park-item.expanded .park-header {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1.5px solid rgba(248, 249, 255, 0.2);
}

.park-availability-indicator {
    font-size: 1.2em;
    flex-shrink: 0;
}

.availability-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.availability-icon.available {
    background-color: var(--match-green);
}

.availability-icon.unavailable {
    background-color: var(--busy-red);
}

.availability-icon.loading {
    background-color: var(--court-gray);
}

.park-share-button {
    font-size: 24px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0;
    width: auto;
    height: auto;
    border-radius: 0;
    color: var(--court-gray);
}

.park-share-button .material-icons {
    font-size: 24px;
    color: var(--court-gray);
    transition: color 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.park-share-button:hover {
    background: transparent;
    border: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(27, 27, 42, 0.2);
}

.park-share-button:hover .material-icons {
    color: #FF3366;
}

.park-share-button:active {
    transform: translateY(0);
    transition: transform 0.1s ease-out;
}

.park-favorite-icon {
    font-size: 20px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--court-gray);
    width: 24px;
    height: 24px;
}

.park-favorite-icon:hover {
    transform: scale(1.15);
    color: var(--electric-red);
}

.park-favorite-icon.favorited {
    color: var(--electric-red);
}

.park-favorite-icon.favorited:hover {
    color: var(--electric-red);
    transform: scale(1.15);
}

.park-name {
    flex: 1;
    font-weight: 600;
    color: var(--soft-white);
    font-size: 17px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
}

.park-expand-icon {
    color: var(--court-gray);
    font-size: 0.9em;
    transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), color 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    flex-shrink: 0;
    margin-right: 4px;
}

.park-item.expanded .park-expand-icon {
    transform: rotate(90deg);
    color: var(--electric-red);
}

.park-distance {
    font-size: 13px;
    font-weight: 400;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: var(--soft-white);
    font-weight: 600;
    white-space: nowrap;
    margin-right: 8px;
}

.park-courts {
    background: transparent;
    padding: 0;
    display: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.park-item.expanded .park-courts {
    display: block;
    max-height: 2000px;
}

.park-courts .court-item {
    border: none;
    border-top: 1px solid rgba(248, 249, 255, 0.1);
    border-radius: 0;
    margin-bottom: 0;
    padding-left: 40px;
    background: rgba(255, 255, 255, 0.03);
}

.park-courts .court-item:last-child {
    border-bottom: none;
}

.park-courts .court-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.park-courts .court-name {
    color: var(--soft-white);
}

.court-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1.5px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.court-item-with-badge {
    padding-left: 4px !important;
}

.court-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
    border-color: var(--netcoord-violet);
}

.court-item.active {
    background: var(--netcoord-violet);
    color: white;
    font-weight: 600;
    border-color: var(--netcoord-violet);
}

.court-item.active .court-distance {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.court-name {
    flex: 1;
    font-size: 17px;
    font-weight: 600;
    color: var(--soft-white);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
}

.court-item-with-badge .court-name {
    gap: 0;
    margin-left: -8px;
}

.player-badge-icon {
    height: 52px;
    width: auto;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
    filter: brightness(0) invert(1);
    margin-right: 4px;
    cursor: pointer;
}

.baker-tooltip {
    position: fixed;
    background: rgba(27, 27, 42, 0.95);
    color: var(--soft-white);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 280px;
    line-height: 1.4;
}

.court-distance {
    font-size: 13px;
    font-weight: 400;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: var(--soft-white);
    white-space: nowrap;
}

.availability-container {
    background: transparent;
    border-radius: 12px;
    padding: 30px;
    box-shadow: none;
    overflow-y: auto;
    color: var(--soft-white);
}

.availability-container::-webkit-scrollbar {
    width: 8px;
}

.availability-container::-webkit-scrollbar-track {
    background: var(--court-gray);
    border-radius: 4px;
}

.availability-container::-webkit-scrollbar-thumb {
    background: var(--netcoord-violet);
    border-radius: 4px;
}

.availability-container::-webkit-scrollbar-thumb:hover {
    background: var(--electric-red);
}

.loading-message,
.error-message,
.no-selection {
    text-align: center;
    padding: 60px 20px;
    color: var(--soft-white);
}

.loading-message p,
.error-message p,
.no-selection p {
    font-size: 1.2em;
}

.error-message {
    color: #dc3545;
}

.error-message p {
    line-height: 1.6;
}

.cors-warning {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    color: #856404;
}

.cors-warning h3 {
    color: #856404;
    margin-bottom: 15px;
}

.cors-warning ol {
    margin: 15px 0;
    padding-left: 25px;
}

.cors-warning li {
    margin: 8px 0;
}

.availability-view {
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.availability-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.availability-view h2 {
    color: var(--soft-white);
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    flex: 1;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
}

.share-court-button {
    padding: 8px 12px;
    background: transparent;
    border: 1.5px solid var(--soft-white);
    border-radius: 14px;
    color: var(--soft-white);
    font-weight: 500;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
    backdrop-filter: blur(10px);
}

.share-court-button .share-icon-header {
    font-size: 20px;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    color: #F8F9FF;
    line-height: 1;
    transition: color 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.share-court-button .share-button-label {
    color: var(--soft-white);
    font-weight: 500;
    font-size: 0.85em;
    white-space: nowrap;
}

.share-court-button:hover {
    background: rgba(248, 249, 255, 0.1);
    border-color: var(--soft-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(27, 27, 42, 0.2);
}

.share-court-button:hover .share-icon-header {
    color: var(--netcoord-violet);
}

.share-court-button:active {
    transform: translateY(0);
    transition: transform 0.1s ease-out;
}

.share-court-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Availability note in tear sheet */
.availability-note {
    background: rgba(255, 255, 255, 0.05);
    border-left: 4px solid var(--netcoord-violet);
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: 12px;
}

.availability-note p {
    margin: 0;
    color: var(--soft-white);
    font-size: 15px;
    line-height: 1.5;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
}

.availability-note strong {
    color: var(--soft-white);
    font-weight: 600;
}

.date-section {
    margin-bottom: 40px;
}

.date-section h3 {
    color: var(--soft-white);
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border-left: 4px solid var(--netcoord-violet);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
}

.no-availability {
    color: var(--soft-white);
    font-style: italic;
    padding: 20px;
    text-align: center;
}

.time-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.time-slot {
    padding: 12px 15px;
    background: var(--netcoord-violet);
    color: white;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(74, 51, 255, 0.3);
    font-weight: 600;
    font-size: 0.95em;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 5px rgba(102, 126, 234, 0.3);
}

.time-slot:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(74, 51, 255, 0.4);
}

.time-slot-shortened {
    background: linear-gradient(135deg, rgba(74, 51, 255, 0.6) 0%, rgba(128, 35, 255, 0.6) 100%);
    box-shadow: 0 2px 8px rgba(74, 51, 255, 0.2);
    border: 1.5px solid rgba(248, 249, 255, 0.3);
}

.time-slot-shortened:hover {
    box-shadow: 0 4px 10px rgba(74, 51, 255, 0.3);
}

.time-slot-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.walk-in-traffic-label {
    font-size: 0.7em;
    color: var(--busy-red);
    margin-top: 4px;
    font-weight: 500;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
}

.time-slot-label {
    font-size: 0.7em;
    color: var(--soft-white);
    margin-top: 4px;
    font-weight: 500;
    text-align: center;
}

/* Tear Sheet Modal */
.tear-sheet {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.tear-sheet-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s;
}

.tear-sheet-content {
    position: relative;
    background: rgba(45, 30, 128, 0.75);
    width: 100%;
    max-width: 800px;
    max-height: 85vh;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(27, 27, 42, 0.3);
    display: flex;
    backdrop-filter: blur(10px);
    flex-direction: column;
    animation: fadeInScale 0.3s ease-out;
    z-index: 10001;
    overflow: hidden;
    margin: auto;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.tear-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1.5px solid rgba(248, 249, 255, 0.2);
    background: linear-gradient(135deg, #4A33FF 0%, #8023FF 50%, #FF3366 100%);
    color: var(--soft-white);
    flex-shrink: 0;
}

.tear-sheet-header h2 {
    color: var(--soft-white);
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    flex: 1;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
}

.tear-sheet-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tear-sheet-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid rgba(248, 249, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: var(--court-gray);
    font-size: 1.5em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    line-height: 1;
    padding: 0;
}

.tear-sheet-close:hover {
    background: rgba(74, 51, 255, 0.1);
    border-color: var(--netcoord-violet);
    color: var(--netcoord-violet);
    transform: rotate(90deg);
}

.tear-sheet-close:active {
    transform: rotate(90deg) scale(0.95);
    transition: transform 0.1s ease-out;
}

.tear-sheet-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    color: var(--soft-white);
}

.tear-sheet-body::-webkit-scrollbar {
    width: 8px;
}

.tear-sheet-body::-webkit-scrollbar-track {
    background: var(--court-gray);
    border-radius: 4px;
}

.tear-sheet-body::-webkit-scrollbar-thumb {
    background: var(--netcoord-violet);
    border-radius: 4px;
}

.tear-sheet-body::-webkit-scrollbar-thumb:hover {
    background: var(--electric-red);
}

/* Responsive design */
@media (max-width: 968px) {
    .main-content {
        height: auto;
        min-height: calc(100vh - 155px);
    }

    .court-list-container {
        max-height: calc(100vh - 175px);
    }

    .tear-sheet {
        padding: 15px;
    }

    .tear-sheet-content {
        max-height: 85vh;
    }

    .tear-sheet-header {
        padding: 15px 20px;
    }

    .tear-sheet-header h2 {
        font-size: 1.4em;
    }

    .tear-sheet-body {
        padding: 20px;
    }

    .header-top {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 5px;
        padding-bottom: 10px;
        min-height: 100px;
    }

    .header-branding {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        z-index: 1;
        pointer-events: none;
        width: auto;
        max-width: 50%;
    }

    .header-branding img,
    .header-branding a {
        pointer-events: auto;
    }

    /* Position hamburger menu on the right */
    .header-branding+.header-button-wrapper {
        margin-left: auto;
        margin-right: 0;
    }

    /* Ensure buttons don't overlap the centered logo */
    .header-top>.header-button-wrapper {
        min-width: 50px;
        flex-shrink: 0;
    }

    .racket-button-header,
    .admin-button,
    .help-button,
    .leaderboards-button,
    a.leaderboards-button,
    .back-button,
    a.back-button,
    .refresh-button-header,
    .share-button-header {
        width: 40px;
        height: 40px;
    }

    .racket-icon-header,
    .admin-icon,
    .leaderboards-icon,
    .back-icon {
        font-size: 18px;
    }

    .help-button {
        font-size: 1em;
    }

    .button-label {
        font-size: 0.6em;
    }

    .header-icon-logo {
        max-height: 40px;
    }

    .header-text-logo {
        max-height: 100px;
    }

    header h1 {
        font-size: 2em;
    }

    .time-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .splash-images-container {
        width: 300px;
        height: 300px;
        max-width: 50vw;
        max-height: 50vw;
        margin-bottom: 30px;
    }

    .splash-text-logo {
        max-width: 300px;
        width: 70vw;
    }

    .splash-tagline {
        font-size: 1.4em;
    }

    .header-icon-logo {
        max-height: 50px;
    }

    .header-text-logo {
        max-height: 110px;
    }
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5em;
    }

    .header-icon-logo {
        max-height: 40px;
    }

    .header-text-logo {
        max-height: 100px;
    }

    .header-branding {
        gap: 15px;
    }

    .sport-toggle-container {
        gap: 10px;
        margin-top: 5px;
        margin-bottom: 5px;
    }



    .racket-button-header,
    .help-button,
    .refresh-button-header,
    .share-button-header {
        width: 40px;
        height: 40px;
    }

    .help-button {
        font-size: 1em;
    }

    .refresh-icon-header,
    .share-icon-header {
        font-size: 18px;
    }

    .button-label {
        font-size: 0.6em;
    }

    .time-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }

    .time-slot {
        padding: 10px 8px;
        font-size: 0.85em;
    }

    .park-header {
        padding: 12px;
        font-size: 0.95em;
    }

    .park-name {
        font-size: 1em;
    }

    .park-courts .court-item {
        padding-left: 30px;
    }

    .search-filter-container {
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
        -ms-flex-direction: row;
        flex-direction: row;
        -webkit-box-align: stretch;
        -ms-flex-align: stretch;
        align-items: stretch;
        -webkit-box-pack: start;
        -ms-flex-pack: start;
        justify-content: flex-start;
        border-radius: 12px;
        min-height: 44px;
    }

    .search-input-combined {
        border-right: 1px solid rgba(248, 249, 255, 0.2);
        border-bottom: none;
        border-radius: 12px 0 0 12px;
        padding: 12px 15px;
        padding-left: 15px !important;
        padding-right: 15px;
        font-size: 16px;
        width: auto;
        max-width: 100%;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
        -webkit-box-flex: 1;
        -ms-flex: 1;
        flex: 1;
        min-width: 0;
        text-align: left !important;
        -webkit-text-align: left !important;
        direction: ltr;
        text-align-last: left;
        -webkit-user-select: text;
        user-select: text;
        align-self: stretch;
        -webkit-align-self: stretch;
        margin: 0;
        margin-left: 0 !important;
        margin-right: 0;
        float: left;
        clear: left;
    }

    .filter-sort-button-wrapper {
        border-left: 1px solid rgba(248, 249, 255, 0.2);
        border-top: none;
        border-radius: 0 12px 12px 0;
        width: auto;
        padding: 0;
        padding-left: 6px;
        justify-content: center;
    }

    .filter-sort-button {
        min-width: 50px;
        padding: 12px 15px;
    }

    .filter-sort-indicator {
        font-size: 0.65em;
        max-width: 100px;
    }

    .splash-images-container {
        width: 250px;
        height: 250px;
        max-width: 50vw;
        max-height: 50vw;
        margin-bottom: 25px;
    }

    .splash-text-logo {
        max-width: 250px;
        width: 70vw;
    }

    .splash-tagline {
        font-size: 1.2em;
    }
}

/* Share Modal Styles */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-out;
}

.share-modal.visible {
    opacity: 1;
    pointer-events: auto;
    display: flex;
}

.share-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.share-modal-content {
    background: rgba(45, 30, 128, 0.75);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: 0 15px 40px rgba(27, 27, 42, 0.3);
    transform: scale(0.9);
    transition: transform 0.24s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.24s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 10001;
    backdrop-filter: blur(10px);
}

.share-modal.visible .share-modal-content {
    transform: scale(1);
    opacity: 1;
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1.5px solid rgba(248, 249, 255, 0.2);
    background: linear-gradient(135deg, #4A33FF 0%, #8023FF 50%, #FF3366 100%);
    color: var(--soft-white);
    flex-shrink: 0;
}

.share-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--soft-white);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
}

.share-close-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid rgba(248, 249, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: var(--court-gray);
    font-size: 1.5em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    line-height: 1;
    padding: 0;
    position: relative;
    overflow: hidden;
    text-indent: -9999px;
    flex-shrink: 0;
}

.share-close-button::before {
    content: '×';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    line-height: 1;
    color: var(--court-gray);
    text-indent: 0;
    transition: color 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform-origin: center center;
}

.share-close-button:hover {
    background: rgba(74, 51, 255, 0.1);
    border-color: var(--netcoord-violet);
}

.share-close-button:hover::before {
    color: var(--netcoord-violet);
    transform: translate(-50%, -50%) rotate(90deg);
}

.share-close-button:active {
    transform: scale(0.95);
}

.share-close-button:active::before {
    transform: translate(-50%, -50%) rotate(90deg) scale(1);
}

.share-modal-body {
    padding: 30px;
    color: var(--soft-white);
    position: relative;
}

.share-body-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.share-modal-body p {
    margin: 0;
    font-size: 15px;
    color: var(--soft-white);
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
}

.share-sort-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 0.9em;
    color: var(--soft-white);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
}

.share-sort-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--netcoord-violet);
    flex-shrink: 0;
}

.share-sort-checkbox-text {
    font-weight: 500;
    color: var(--soft-white);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
}

.share-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.share-option-button {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: 1.5px solid rgba(248, 249, 255, 0.3);
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-align: left;
    width: 100%;
}

.share-option-button:hover {
    background: rgba(255, 255, 255, 1);
    border-color: var(--netcoord-violet);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 51, 255, 0.2);
}

.share-option-icon {
    font-size: 2em;
    flex-shrink: 0;
    line-height: 1;
}

.share-option-text {
    font-weight: 600;
    font-size: 1.3em;
    color: #000000;
    flex: 1;
    display: block;
    margin-bottom: 4px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
}

.share-option-desc {
    font-size: 1.1em;
    color: #333333;
    display: block;
    line-height: 1.5;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
    font-weight: 400;
}

/* Help Modal Styles */
.help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    display: none;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.help-modal.visible {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.help-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    /* Fallback for browsers that don't support backdrop-filter */
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

/* Fallback for browsers without backdrop-filter support */
@supports not (backdrop-filter: blur(4px)) {
    .help-modal-backdrop {
        background: rgba(0, 0, 0, 0.7);
    }
}

.help-modal-content {
    background: rgba(45, 30, 128, 0.75);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(10px);
    position: relative;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    animation: fadeInScale 0.3s ease-out forwards;
}

.help-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1.5px solid rgba(248, 249, 255, 0.2);
    background: linear-gradient(135deg, #4A33FF 0%, #8023FF 50%, #FF3366 100%);
    color: var(--soft-white);
}

.help-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--soft-white);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
}

.help-close-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid rgba(248, 249, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: var(--court-gray);
    font-size: 1.5em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    line-height: 1;
    padding: 0;
}

.help-close-button:hover {
    background: rgba(74, 51, 255, 0.1);
    border-color: var(--netcoord-violet);
    color: var(--netcoord-violet);
    transform: rotate(90deg);
}

.help-close-button:active {
    transform: rotate(90deg) scale(0.95);
    transition: transform 0.1s ease-out;
}

.help-modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.help-section {
    margin-bottom: 30px;
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section h3 {
    color: var(--soft-white);
    font-size: 20px;
    margin-bottom: 10px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
}

.help-section p {
    color: var(--soft-white);
    line-height: 1.6;
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
}

.help-section ul {
    margin: 10px 0;
    padding-left: 25px;
    color: var(--soft-white);
}

.help-section li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.help-emoji {
    font-size: 1.1em;
    margin-right: 5px;
}

.help-section strong {
    color: #667eea;
    font-weight: 600;
}

/* Responsive help modal */
@media (max-width: 768px) {
    .help-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .help-modal-header {
        padding: 20px;
    }

    .help-modal-header h2 {
        font-size: 1.4em;
    }

    .help-modal-body {
        padding: 20px;
    }

    .help-section h3 {
        font-size: 1.1em;
    }
}

/* Hamburger Menu */
.hamburger-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 320px;
    height: 100vh;
    z-index: 10002;
    display: none;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease-out;
    overflow: hidden;
}

.hamburger-menu.visible {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

.hamburger-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: -1;
}

.hamburger-menu-content {
    background: rgba(45, 30, 128, 0.95);
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
}

.hamburger-menu.visible .hamburger-menu-content {
    transform: translateX(0);
}

.hamburger-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1.5px solid rgba(248, 249, 255, 0.2);
    background: linear-gradient(135deg, #4A33FF 0%, #8023FF 50%, #FF3366 100%);
    color: var(--soft-white);
}

.hamburger-menu-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--soft-white);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
}

.hamburger-close-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid rgba(248, 249, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: var(--court-gray);
    font-size: 1.5em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    line-height: 1;
    padding: 0;
}

.hamburger-close-button:hover {
    background: rgba(74, 51, 255, 0.1);
    border-color: var(--netcoord-violet);
    color: var(--netcoord-violet);
    transform: rotate(90deg);
}

.hamburger-close-button:active {
    transform: rotate(90deg) scale(0.95);
    transition: transform 0.1s ease-out;
}

.hamburger-menu-body {
    padding: 20px 0;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.hamburger-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 30px;
    background: transparent;
    border: none;
    color: var(--soft-white);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-align: left;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
    width: 100%;
    box-sizing: border-box;
}

.hamburger-menu-item:hover {
    background: rgba(74, 51, 255, 0.2);
    color: var(--soft-white);
}

.hamburger-menu-item:active {
    background: rgba(74, 51, 255, 0.3);
    transform: scale(0.98);
}

.hamburger-menu-icon {
    font-size: 24px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hamburger-menu-text {
    flex: 1;
}

.hamburger-menu-footer {
    padding: 20px 30px;
    border-top: 1.5px solid rgba(248, 249, 255, 0.1);
    margin-top: auto;
}

.hamburger-menu-about {
    color: rgba(248, 249, 255, 0.7);
    font-size: 12px;
    line-height: 1.5;
    margin: 0;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
}

.hamburger-menu-about a {
    color: var(--soft-white);
    text-decoration: underline;
    transition: color 0.2s ease;
}

.hamburger-menu-about a:hover {
    color: var(--electric-red);
}

@media (max-width: 600px) {
    .hamburger-menu {
        max-width: 100%;
    }

    .hamburger-menu-header {
        padding: 20px 25px;
    }

    .hamburger-menu-item {
        padding: 16px 25px;
        font-size: 15px;
    }

    .hamburger-menu-footer {
        padding: 15px 25px;
    }

    .hamburger-menu-about {
        font-size: 11px;
    }
}

/* Racket Services Modal */
.racket-services-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    display: none;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.racket-services-modal.visible {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.racket-services-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

@supports not (backdrop-filter: blur(4px)) {
    .racket-services-modal-backdrop {
        background: rgba(0, 0, 0, 0.7);
    }
}

.racket-services-modal-content {
    background: rgba(45, 30, 128, 0.75);
    border-radius: 20px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(10px);
    position: relative;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    animation: fadeInScale 0.3s ease-out forwards;
}

.racket-services-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1.5px solid rgba(248, 249, 255, 0.2);
    background: linear-gradient(135deg, #4A33FF 0%, #8023FF 50%, #FF3366 100%);
    color: var(--soft-white);
}

.racket-services-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--soft-white);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
}

.racket-services-close-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid rgba(248, 249, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: var(--court-gray);
    font-size: 1.5em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    line-height: 1;
    padding: 0;
}

.racket-services-close-button:hover {
    background: rgba(74, 51, 255, 0.1);
    border-color: var(--netcoord-violet);
    color: var(--netcoord-violet);
    transform: rotate(90deg);
}

.racket-services-close-button:active {
    transform: rotate(90deg) scale(0.95);
    transition: transform 0.1s ease-out;
}

.racket-services-modal-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

.racket-services-modal-body iframe {
    width: 100%;
    height: 2605px;
    border: none;
}

.racket-services-modal-body::-webkit-scrollbar {
    width: 8px;
}

.racket-services-modal-body::-webkit-scrollbar-track {
    background: var(--court-gray);
    border-radius: 4px;
}

.racket-services-modal-body::-webkit-scrollbar-thumb {
    background: var(--netcoord-violet);
    border-radius: 4px;
}

.racket-services-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--electric-red);
}

/* Responsive racket services modal */
@media (max-width: 768px) {
    .racket-services-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .racket-services-modal-header {
        padding: 20px;
    }

    .racket-services-modal-header h2 {
        font-size: 1.4em;
    }

    .racket-services-modal-body iframe {
        height: 100%;
        min-height: 500px;
    }
}

/* Footer */

/* iOS Safari specific fixes for search input alignment */
@supports (-webkit-touch-callout: none) {
    .search-input-combined {
        padding-left: 15px !important;
        text-align: left !important;
        -webkit-text-align: left !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .search-filter-container {
        -webkit-box-pack: start !important;
        -ms-flex-pack: start !important;
        justify-content: flex-start !important;
    }

    @media (max-width: 600px) {
        .search-input-combined {
            padding-left: 15px !important;
            text-align: left !important;
            -webkit-text-align: left !important;
            margin-left: 0 !important;
        }
    }
}

/* ==================== NFC CHECK-IN/CHECK-OUT PAGE ==================== */
.nfc-checkin-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
}

.nfc-checkin-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    padding: 40px;
    text-align: center;
}

.nfc-checkin-header {
    margin-bottom: 30px;
}

.nfc-checkin-header h2 {
    margin: 0;
    color: #333;
    font-size: 28px;
    font-weight: 600;
}

.nfc-checkin-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.nfc-status-message {
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 10px;
}

.nfc-status-message p {
    margin: 0;
    color: #666;
    font-size: 16px;
    line-height: 1.5;
}

.nfc-checkin-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.nfc-action-button {
    padding: 16px 32px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nfc-checkin-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.nfc-checkin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.nfc-checkin-btn:active {
    transform: translateY(0);
}

.nfc-checkout-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.nfc-checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 87, 108, 0.4);
}

.nfc-checkout-btn:active {
    transform: translateY(0);
}

.nfc-action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.nfc-action-button:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

.nfc-info {
    padding: 15px;
    background: #e8f4f8;
    border-radius: 8px;
    margin-top: 10px;
}

.nfc-info p {
    margin: 8px 0;
    color: #555;
    font-size: 14px;
}

.nfc-info p:first-child {
    margin-top: 0;
}

.nfc-info p:last-child {
    margin-bottom: 0;
    font-weight: 600;
    color: #667eea;
}

.nfc-back-link {
    margin-top: 30px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: block;
    /* Ensure it's always visible */
    z-index: 10;
    position: relative;
}

.nfc-back-link-text {
    color: var(--netcoord-violet);
    text-decoration: none;
    font-size: 16px;
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(74, 51, 255, 0.1);
    cursor: pointer;
    font-weight: 500;
    border: 1px solid rgba(74, 51, 255, 0.3);
}

.nfc-back-link-text:hover {
    background: rgba(74, 51, 255, 0.2);
    color: var(--netcoord-violet);
    text-decoration: none;
    border-color: rgba(74, 51, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(74, 51, 255, 0.2);
}

.nfc-back-link-text:active {
    background: rgba(74, 51, 255, 0.15);
    transform: translateY(0);
}

@media (max-width: 600px) {
    .nfc-checkin-container {
        padding: 30px 20px;
        margin: 10px;
    }

    .nfc-checkin-header h2 {
        font-size: 24px;
    }

    .nfc-action-button {
        padding: 14px 24px;
        font-size: 16px;
    }
}


@media (max-width: 768px) {
    .main-content {
        min-height: calc(100vh - 135px);
    }

    .court-list-container {
        max-height: calc(100vh - 155px);
    }

    .share-button {
        max-width: 80px;
        padding: 6px 10px;
        gap: 6px;
    }
}

/* Admin Page Styles */
.admin-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.admin-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 1200px;
    width: 100%;
    padding: 40px;
    margin: 20px 0;
}

.admin-header h2 {
    margin: 0 0 30px 0;
    color: #333;
    font-size: 28px;
    font-weight: 600;
}

.admin-auth-form {
    text-align: center;
}

.admin-auth-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.admin-input-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.admin-input-group input,
.admin-input-group select {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.admin-input-group input:focus,
.admin-input-group select:focus {
    outline: none;
    border-color: var(--netcoord-violet);
}

.admin-login-button,
.admin-action-button {
    padding: 12px 24px;
    background: var(--netcoord-violet);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-login-button:hover,
.admin-action-button:hover {
    background: var(--electric-red);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 51, 102, 0.3);
}

.admin-error {
    color: #d32f2f;
    padding: 12px;
    background: #ffebee;
    border-radius: 8px;
    font-size: 14px;
}

.admin-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.admin-dashboard-header h2 {
    margin: 0;
    color: #333;
    font-size: 28px;
    font-weight: 600;
}

.admin-logout-button {
    padding: 10px 20px;
    background: #f5f5f5;
    color: #333;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-logout-button:hover {
    background: #e0e0e0;
}

.admin-visualizations {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.admin-viz-section {
    padding: 30px;
    background: #f9f9f9;
    border-radius: 12px;
}

.admin-viz-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 22px;
    font-weight: 600;
}

.admin-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
    margin-bottom: 30px;
}

.admin-controls .admin-input-group {
    flex: 1;
    min-width: 200px;
}

.timeline-container {
    min-height: 200px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.timeline-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.timeline-slot {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    min-width: 80px;
    text-align: center;
}

.timeline-slot.available {
    background: #4caf50;
    color: white;
}

.timeline-slot.unavailable {
    background: #f5f5f5;
    color: #999;
}

.timeline-slot.busy {
    background: #ff9800;
    color: white;
}

.timeline-slot.very-busy {
    background: #f44336;
    color: white;
}

.timeline-slot-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

.comparison-container {
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    position: relative;
    height: 400px;
}

.busiest-hours-container {
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    position: relative;
    height: 600px;
    margin-top: 20px;
}

.admin-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.admin-back-link {
    margin-top: 40px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.admin-back-link-text {
    color: var(--netcoord-violet);
    text-decoration: none;
    font-size: 16px;
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(74, 51, 255, 0.1);
    border: 1px solid rgba(74, 51, 255, 0.3);
    cursor: pointer;
}

.admin-back-link-text:hover {
    background: rgba(74, 51, 255, 0.2);
    color: var(--netcoord-violet);
    text-decoration: none;
}

@media (max-width: 600px) {
    .admin-container {
        padding: 30px 20px;
    }

    .admin-controls {
        flex-direction: column;
    }

    .admin-controls .admin-input-group {
        min-width: 100%;
    }
}

/* Leaderboards Page Styles */
.leaderboards-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.leaderboards-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 1200px;
    width: 100%;
    padding: 40px;
    margin: 20px 0;
}

.leaderboards-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 20px;
}

.leaderboards-header h2 {
    margin: 0;
    color: #333;
    font-size: 28px;
    font-weight: 600;
}

.leaderboards-back-button {
    background: var(--netcoord-violet);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.leaderboards-back-button:hover {
    background: var(--electric-red);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 51, 102, 0.4);
}

.leaderboards-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.leaderboard-section,
.matchups-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
}

.leaderboard-section h3,
.matchups-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 22px;
    font-weight: 600;
}

.leaderboard-container,
.matchups-container {
    color: #666;
}

/* Bracket Cards */
.bracket-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bracket-card h4 {
    margin: 0 0 15px 0;
    color: var(--netcoord-violet);
    font-size: 18px;
    font-weight: 600;
}

.bracket-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 6px;
    margin: -20px -20px 15px -20px;
    transition: background 0.2s ease;
}

.bracket-header:hover {
    background: #e8e8e8;
}

.bracket-toggle {
    font-size: 12px;
    color: var(--netcoord-violet);
    transition: transform 0.2s ease;
}

.bracket-content {
    margin-top: 10px;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table thead {
    background: var(--netcoord-violet);
    color: white;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.leaderboard-table th {
    font-weight: 600;
    font-size: 14px;
}

.leaderboard-table td {
    color: #333;
    font-size: 14px;
}

.leaderboard-table tbody tr:hover {
    background: #f5f5f5;
}

.leaderboard-table tbody tr:last-child td {
    border-bottom: none;
}

/* Matchup Cards */
.matchup-card {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.matchup-info {
    flex: 1;
}

.matchup-players {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.matchup-details {
    font-size: 14px;
    color: #666;
}

@media (max-width: 600px) {
    .leaderboards-container {
        padding: 20px;
    }

    .leaderboards-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .leaderboards-header h2 {
        font-size: 24px;
    }

    .leaderboard-table {
        font-size: 12px;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 8px;
    }

    .matchup-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Graph Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    /* High z-index to stay on top */
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    opacity: 0;
    animation: simpleFadeIn 0.3s forwards;
}

@keyframes simpleFadeIn {
    to {
        opacity: 1;
    }
}

.modal-container {
    background: #1e1e2f;
    /* Fallback dark */
    background: var(--slate-shadow, #1e1e2f);
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    /* Full screen tear sheet feel */
    border-radius: 12px;
    padding: 20px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 100;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.modal-close-btn:hover {
    opacity: 1;
    color: var(--electric-red, #ff3366);
}

.modal-content {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    /* Important for flex child with canvas */
}

/* Graph icon button in header */
.graph-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 5px;
    margin-left: 10px;
    transition: all 0.2s;
}

.graph-btn:hover {
    color: var(--electric-blue, #4A33FF);
    transform: scale(1.1);
}

/* ==========================================================================
   PREMIUM THEME OVERRIDES (LEADERBOARD ONLY)
   ========================================================================== */

.section-hidden {
    display: none !important;
}

/* Scoped Barlow Condensed / Inter Stack */
body.premium-theme {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 0 20px 20px 20px;
    position: relative;
    background: var(--deep-court-purple);
    background-image:
        repeating-linear-gradient(30deg,
            transparent,
            transparent 2px,
            rgba(74, 51, 255, 0.03) 2px,
            rgba(74, 51, 255, 0.03) 4px);
    overflow-x: hidden;
}

/* Tennis Court Watermark Background */
body.premium-theme::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 112.5%;
    height: 112.5%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.08;
    background-image: url('assets/tennis-court-watermark.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    transform: translate(-50%, -50%);
    transform-origin: center center;
}

/* Ensure content appears above watermark */
body.premium-theme .container,
body.premium-theme header,
body.premium-theme main {
    position: relative;
    z-index: 1;
}

.premium-theme .ladder-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--soft-white);
    margin: 20px 0 0 0;
    padding: 0;
}

.premium-theme .season-header {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 2.2rem;
    font-weight: 900;
    font-style: italic;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    color: var(--electric-red);
    margin: -5px 0 20px 0;
    padding: 0;
    text-shadow: 0 0 10px rgba(255, 51, 102, 0.2);
}

/* Premium Buttons & Icons (The Lean) */
.premium-theme .refresh-button-header,
.premium-theme .share-button-header,
.premium-theme .back-button,
.premium-theme a.back-button {
    border-radius: 4px;
    transform: skewX(-10deg);
}

/* Override for leaderboard page - make back button circular */
body.premium-theme .header-top .header-button-wrapper:first-child .back-button,
body.premium-theme .header-top .header-button-wrapper:first-child a.back-button {
    border-radius: 50%;
    transform: none;
}

body.premium-theme .header-top .header-button-wrapper:first-child .back-button:hover,
body.premium-theme .header-top .header-button-wrapper:first-child a.back-button:hover {
    transform: scale(1.1);
}

body.premium-theme .header-top .header-button-wrapper:first-child .back-icon {
    transform: none;
}

.premium-theme .refresh-button-header:hover,
.premium-theme .share-button-header:hover,
.premium-theme .back-button:hover,
.premium-theme a.back-button:hover {
    transform: skewX(-10deg) scale(1.1);
}

.premium-theme .refresh-icon-header,
.premium-theme .share-icon-header,
.premium-theme .back-icon,
.premium-theme .park-header>* {
    transform: skewX(10deg);
}

.premium-theme .button-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 5px;
}

/* Premium View Selector / Slider */
.premium-theme .view-selector-container {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
    margin-top: 10px;
    width: 100%;
    transform: skewX(-10deg);
}

.premium-theme .view-selector {
    display: flex;
    position: relative;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 4px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 320px;
    height: 40px;
}

.premium-theme .view-selector input[type="radio"] {
    display: none;
}

.premium-theme .view-selector label {
    flex: 1;
    z-index: 2;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-style: normal;
    transform: skewX(10deg);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.premium-theme .view-selector input[type="radio"]:checked+label {
    color: white;
}

.premium-theme .selector-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc((100% - 8px) / 3);
    height: calc(100% - 8px);
    background: var(--electric-red);
    border-radius: 4px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
    box-shadow: 0 4px 15px rgba(255, 51, 102, 0.3);
}

.premium-theme #view-standings:checked~.selector-slider {
    transform: translateX(0);
}

.premium-theme #view-results:checked~.selector-slider {
    transform: translateX(100%);
}

.premium-theme #view-upcoming:checked~.selector-slider {
    transform: translateX(200%);
}

/* Premium List Containers (Glassmorphism) */
.premium-theme .court-list-container {
    background: transparent;
    border-radius: 4px;
    padding: 0 25px 25px 25px;
    max-width: 650px;
    backdrop-filter: none;
    box-shadow: none;
    border: none;
    margin: 0 auto 30px auto;
}

.premium-theme .court-list-container h2 {
    color: white;
    font-size: 2.2rem;
    /* Reduced from 3.5rem */
    font-weight: 700;
    /* Reduced from 900 */
    font-family: 'Barlow Condensed', sans-serif;
    font-style: normal;
    /* Removed italic */
    text-transform: uppercase;
    letter-spacing: 1px;
    /* Increased from -2px */
    line-height: 1.1;
    margin-bottom: 20px;
}

.premium-theme .park-item {
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.02);
    /* Reduced opacity */
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.premium-theme .park-header {
    padding: 20px;
    transform: skewX(-10deg);
}

/* Scoreboard Bracket Styles */
.premium-theme .scoreboard-bracket {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.premium-theme .scoreboard-bracket .bracket-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    opacity: 0.5;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.premium-theme .scoreboard-bracket .bracket-number {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 3.5rem;
    font-weight: 900;
    font-style: italic;
    color: var(--electric-red);
    line-height: 0.8;
    text-shadow: 0 0 20px rgba(255, 51, 102, 0.4);
}

/* Premium Items */
.premium-theme .court-name {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    text-transform: uppercase;
    text-shadow: none;
    /* Removed glow */
}

.premium-theme .park-distance {
    font-family: 'Barlow Condensed', sans-serif;
    font-style: italic;
    font-weight: 700;
    font-size: 1.1rem;
    background: transparent;
    border: none;
    padding: 0;
    color: var(--electric-red);
    text-transform: uppercase;
    text-shadow: none;
}

.premium-theme .graph-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-left: 15px;
}

.premium-theme .graph-btn:hover {
    border-color: var(--electric-red);
    background: rgba(255, 255, 255, 0.1);
}