/* CSS Reset to ensure consistency across browsers */
/* * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
} */

/* Import Google Fonts - display hero, distinctive headings, clean body */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Syne:wght@700;800&display=swap');

/* Design tokens */
:root {
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-muted: rgba(79, 70, 229, 0.12);
    --accent-muted-strong: rgba(79, 70, 229, 0.2);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --surface: #ffffff;
    --surface-elevated: #ffffff;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --radius: 12px;
    --radius-lg: 16px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --duration-fast: 0.25s;
    --duration-normal: 0.4s;
    --duration-slow: 0.7s;
}

/* Ensure no margin and padding on html and body */
html {
    scroll-behavior: smooth;
}

html:focus-within {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html, html:focus-within {
        scroll-behavior: auto;
    }
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Base body styling - modern, clean theme */
body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(180deg, #fafbff 0%, #f1f5f9 50%, #eef2ff 100%);
    background-attachment: fixed;
    color: #1e293b;
    display: flex;
    flex-direction: column;
    position: relative;
    line-height: 1.6;
}

/* Header styling - polished, sticky, glass on scroll */
header {
    position: sticky;
    top: 0;
    background: var(--surface);
    color: var(--text-primary);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    z-index: 100;
    transition: background var(--duration-normal) var(--ease-out),
                backdrop-filter var(--duration-normal) var(--ease-out),
                box-shadow var(--duration-normal) var(--ease-out);
}

header.header-scrolled {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 4px 20px rgba(0, 0, 0, 0.06);
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #6366f1);
    border-radius: 0 0 4px 4px;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.logo {
    width: 52px;
    height: auto;
    transition: transform 0.25s ease;
}

a:hover .logo {
    transform: scale(1.05);
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

header h1 {
    margin: 0;
    margin-bottom: 1rem;
    font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--text-primary) 0%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 0.35rem;
}

nav ul li {
    margin: 0;
}

nav ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
}

nav ul li a:hover {
    color: var(--accent);
    background: var(--accent-muted);
}

nav ul li a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

nav ul li a.rfr3-link {
    display: inline-flex;
    align-items: baseline;
    gap: 0;
    line-height: 1;
    position: relative;
}

nav ul li a.rfr3-link sup {
    font-size: 0.7em;
    margin-left: -0.1em;
    position: relative;
    top: -0.5em;
    line-height: 0;
}

nav ul li a.rfr4-link {
    display: inline-flex;
    align-items: baseline;
    gap: 0;
    line-height: 1;
    position: relative;
}

nav ul li a.rfr4-link sup {
    font-size: 0.7em;
    margin-left: -0.1em;
    position: relative;
    top: -0.5em;
    line-height: 0;
}

main {
    flex: 1;
    padding: 2rem;
    text-align: center;
    padding-bottom: 4rem;
    position: relative;
    z-index: 1;
}

main h2 {
    font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 2.25rem;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

main h2.smaller {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

main h2.smaller {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* ---------- Home page: hero + features ---------- */
.page-home main {
    padding: 0;
    padding-bottom: 0;
    text-align: left;
}

/* Scroll-triggered reveal */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity var(--duration-slow) var(--ease-out-expo),
                transform var(--duration-slow) var(--ease-out-expo);
}

.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

.reveal[data-delay="80"] { transition-delay: 80ms; }
.reveal[data-delay="160"] { transition-delay: 160ms; }
.reveal[data-delay="240"] { transition-delay: 240ms; }
.reveal[data-delay="320"] { transition-delay: 320ms; }
.reveal[data-delay="400"] { transition-delay: 400ms; }
.reveal[data-delay="100"] { transition-delay: 100ms; }
.reveal[data-delay="150"] { transition-delay: 150ms; }
.reveal[data-delay="200"] { transition-delay: 200ms; }
.reveal[data-delay="250"] { transition-delay: 250ms; }
.reveal.in-view[data-delay] { transition-delay: 0ms; }

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Hero */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem 4rem;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(79, 70, 229, 0.18) 0%, transparent 50%),
        radial-gradient(ellipse 80% 50% at 80% 50%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 20% 80%, rgba(79, 70, 229, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, #fafbff 0%, #f1f5f9 40%, #eef2ff 100%);
    background-attachment: fixed;
}

.hero-grain {
    position: absolute;
    inset: 0;
    opacity: 0.4;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.hero-badge {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.25rem;
}

.hero-title {
    font-family: 'Syne', 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
    color: var(--text-primary);
    margin: 0 0 1.25rem;
}

.hero-title-line {
    display: block;
}

.hero-title-accent {
    background: linear-gradient(135deg, var(--accent) 0%, #6366f1 50%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--text-secondary);
    max-width: 32ch;
    margin: 0 auto 3rem;
}

.hero-visual {
    position: relative;
    display: inline-block;
}

.hero-visual-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse at center, rgba(79, 70, 229, 0.2) 0%, transparent 65%);
    pointer-events: none;
}

.hero-image {
    position: relative;
    width: 100%;
    max-width: 420px;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 32px 64px -12px rgba(79, 70, 229, 0.25), 0 0 0 1px rgba(79, 70, 229, 0.08);
    transition: transform var(--duration-normal) var(--ease-out);
}

.hero-visual:hover .hero-image {
    transform: scale(1.02) translateY(-4px);
}

.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 40px;
    border: 2px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8px;
}

.hero-scroll-dot {
    width: 4px;
    height: 8px;
    background: var(--accent);
    border-radius: 2px;
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(6px); opacity: 0.5; }
}

/* Home features section */
.home-features {
    padding: 6rem 2rem;
    background: var(--surface);
}

.home-features-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.home-features-title {
    font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 4vw, 2.75rem);
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-align: center;
}

.home-features-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 3rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    position: relative;
    display: block;
    padding: 2rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform var(--duration-normal) var(--ease-out),
                box-shadow var(--duration-normal) var(--ease-out),
                border-color var(--duration-normal) var(--ease-out);
}

.feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, var(--accent), #6366f1, #818cf8);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-out);
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card-icon {
    display: inline-block;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--accent);
    transition: transform var(--duration-fast) var(--ease-out);
}

.feature-card:hover .feature-card-icon {
    transform: scale(1.15);
}

.feature-card-title {
    font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
    text-align: left;
}

.feature-card-desc {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 1rem;
    text-align: left;
}

.feature-card-arrow {
    display: inline-block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent);
    transition: transform var(--duration-fast) var(--ease-out);
}

.feature-card:hover .feature-card-arrow {
    transform: translateX(4px);
}

@media (max-width: 768px) {
    .hero {
        padding: 5rem 1.5rem 3rem;
        min-height: 90vh;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }

    .hero-scroll {
        display: none;
    }

    .home-features {
        padding: 4rem 1rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }
}

footer {
    background: var(--surface);
    color: var(--text-muted);
    text-align: center;
    padding: 1.25rem;
    width: 100%;
    max-width: 100%;
    position: relative;
    bottom: 0;
    border-top: 1px solid var(--border);
    box-sizing: border-box;
    z-index: 1;
    font-size: 0.875rem;
}

footer::before {
    content: '';
    display: block;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.4;
    margin-bottom: 1rem;
}

#rLink {
    text-decoration: none;
    color: inherit;
    cursor: default;
}

/* About page styling - elevated card */
.about-container {
    width: 50%;
    margin: 0 auto;
    text-align: left;
    padding: 2.25rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.about-container:hover {
    box-shadow: var(--shadow-xl);
    border-color: rgba(79, 70, 229, 0.15);
}

.about-container::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--accent), #6366f1);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.about-container h2,
.about-container h3 {
    text-align: center;
    font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
}

.about-container h2 {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.rfr4-venue-image {
    float: right;
    width: auto;
    max-width: min(320px, 100%);
    height: auto;
    margin: 0 0 1rem 1rem;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    transition: box-shadow 0.3s ease;
}

.rfr4-venue-image:hover {
    box-shadow: 0 12px 24px -8px rgba(79, 70, 229, 0.2);
}

.rfr4-clearfix {
    clear: both;
}

/* RFR4 venue image lightbox */
.rfr4-image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    box-sizing: border-box;
}

.rfr4-image-modal.rfr4-image-modal-open {
    display: flex;
}

.rfr4-image-modal img {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.rfr4-image-modal-close {
    position: fixed;
    top: 1rem;
    right: 1.5rem;
    font-size: 2.5rem;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    z-index: 1001;
    transition: color 0.2s ease;
}

.rfr4-image-modal-close:hover {
    color: #cbd5e1;
}

/* How to play container */
.how-to-play-container {
    width: 50%;
    margin: 0 auto;
    text-align: left;
    padding: 2.25rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.how-to-play-container:hover {
    box-shadow: var(--shadow-xl);
    border-color: rgba(79, 70, 229, 0.15);
}

.how-to-play-container::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--accent), #6366f1);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.how-to-play-container h2,
.how-to-play-container h3 {
    text-align: center;
    font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
}

.how-to-play-container h2 {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Gallery styling */
#galleryContainer {
    display: flex;
    justify-content: center;
    padding: 20px;
}

#gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 28px;
    width: 80%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.25rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
}

#gallery img {
    width: 180px;
    height: 180px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    background-color: #f8fafc;
}

#gallery img:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(79, 70, 229, 0.15);
    z-index: 10;
}

.thumbnail {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    background-color: #f8fafc;
}

.thumbnail:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(79, 70, 229, 0.15);
}

/* Slideshow styling */
.slideshow {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.slideshow img {
    max-width: 90%;
    max-height: 90%;
}

.slideshow .prev,
.slideshow .next {
    position: absolute;
    top: 50%;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    user-select: none;
}

.slideshow .prev {
    left: 10px;
}

.slideshow .next {
    right: 10px;
}

/* Player Modal styling */
#bioContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    -webkit-tap-highlight-color: transparent;
}

#bioText {
    width: 100%;
    text-align: left;
    margin: 0;
}

#bioName {
    text-align: center;
    width: 100%;
    margin-bottom: 20px;
    font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.5rem;
}

#bioImage {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 20px;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Modal styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    padding-top: 60px;
}

.modal-content {
    background: var(--surface-elevated);
    margin: 5% auto;
    padding: 28px;
    border: 1px solid var(--border);
    width: 80%;
    max-width: 600px;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.03);
    color: #1e293b;
}

.close {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
    background: #f1f5f9;
    border: none;
    border-radius: 10px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: var(--accent);
    background: var(--accent-muted);
    text-decoration: none;
    cursor: pointer;
}

/* Players table styling */
#playersTable {
    margin: 2rem auto;
    border-collapse: collapse;
    width: 60%;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

#playersTable th, #playersTable td {
    border: 1px solid var(--border);
    padding: 0.75rem 1rem;
    text-align: left;
}

#playersTable th {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

#playersTable tbody tr:nth-child(even) {
    background-color: #fff;
}

#playersTable tbody tr:nth-child(odd) {
    background-color: #fafbff;
}

#playersTable tbody tr:hover {
    background-color: var(--accent-muted);
}

/* Events table */
#eventsTable {
    width: auto;
    min-width: 900px;
    max-width: 95%;
    margin: 2rem auto;
    table-layout: auto;
}

#eventsTable th,
#eventsTable td {
    white-space: nowrap;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
}

#eventsTable th:nth-child(1),
#eventsTable td:nth-child(1) {
    width: 40%;
    min-width: 300px;
}

#eventsTable th:nth-child(2),
#eventsTable td:nth-child(2) {
    width: 25%;
    min-width: 150px;
}

#eventsTable th:nth-child(3),
#eventsTable td:nth-child(3) {
    width: 20%;
    min-width: 120px;
}

#eventsTable th:nth-child(4),
#eventsTable td:nth-child(4) {
    width: 15%;
    min-width: 100px;
}

#eventsTable td:nth-child(2) {
    color: var(--text-primary);
    font-weight: 600;
}

#playersTable td a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

#playersTable td a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* General content styling */
section {
    margin-bottom: 2rem;
    text-align: center;
}

strong,
em strong {
    color: #0f172a;
    font-weight: 600;
}

/* Event name links */
#eventsTable a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    transition: background 0.2s ease, color 0.2s ease;
    background: var(--accent-muted);
}

#eventsTable a:hover {
    background: var(--accent-muted-strong);
    color: var(--accent-hover);
}

/* Summary links */
#eventsTable td a[href*="event-summary"] {
    color: var(--text-muted);
    font-weight: 500;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
    background: transparent;
}

#eventsTable td a[href*="event-summary"]:hover {
    background: var(--accent-muted);
    color: var(--text-primary);
}

h2, h3 {
    margin-top: 1rem;
    margin-bottom: 1rem;
    font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
}

h3 {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    margin-top: 2rem;
}

blockquote {
    margin: 1.5rem 2rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #fafbff 0%, #f8fafc 100%);
    border-left: 4px solid var(--accent);
    border-radius: 0 10px 10px 0;
    font-style: italic;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
}

blockquote em,
blockquote strong {
    color: #1e293b;
    font-weight: 600;
}

ul, ol {
    text-align: center;
    display: inline-block;
    text-align: left;
    padding-left: 0;
}

li {
    list-style: none;
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

li:not(nav li):not(nav ul li)::before {
    content: '•';
    color: var(--accent);
    font-size: 1.1em;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0.8;
}

nav li,
nav ul li {
    padding-left: 0;
    margin-bottom: 0;
}

nav li::before,
nav ul li::before {
    content: none;
}

ul ul li::before {
    content: '◦';
    color: var(--accent);
    opacity: 0.7;
}

ol {
    counter-reset: item;
}

ol li {
    counter-increment: item;
}

ol li::before {
    content: counter(item) '.';
    color: var(--accent);
    font-weight: 600;
}

.table-container {
    overflow-x: auto;
}

/* General table styling */
table {
    margin: 0 auto;
    border-collapse: collapse;
    width: 80%;
    max-width: 800px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

table th, table td {
    border: 1px solid var(--border);
    padding: 0.75rem 1rem;
    text-align: center;
}

table th {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    color: var(--text-primary);
    font-weight: 600;
    font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

table tbody tr:nth-child(even) {
    background-color: #fff;
}

table tbody tr:nth-child(odd) {
    background-color: #fafbff;
}

table tbody tr:hover {
    background-color: var(--accent-muted);
}

/* Modal (duplicate block - ensure consistent) */
.modal-content {
    position: relative;
    background: var(--surface-elevated);
    margin: 5% auto;
    padding: 28px;
    border: 1px solid var(--border);
    width: 80%;
    max-width: 600px;
    max-height: 80%;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.03);
    color: #1e293b;
    overflow-y: auto;
}

.modal-content img {
    max-width: 100%;
    height: auto;
}

.close-event {
    position: absolute;
    top: 10px;
    right: 20px;
    color: var(--text-muted);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
    background: #f1f5f9;
    border: none;
    border-radius: 10px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close-event:hover,
.close-event:focus {
    color: var(--accent);
    background: var(--accent-muted);
    text-decoration: none;
    cursor: pointer;
}

/* Visual aids */
.visual-aids-gallery {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    margin-top: 1rem;
}

.visual-aids-gallery img {
    width: 45%;
    height: auto;
    object-fit: cover;
    cursor: pointer;
    margin: 0 auto;
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    transition: box-shadow 0.25s ease;
}

.visual-aids-gallery img:hover {
    box-shadow: var(--shadow-lg);
}

/* Hamburger menu */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #1e293b;
    font-size: 2rem;
    cursor: pointer;
}

.navigation {
    display: flex;
}

.home-image-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
    padding: 2.5rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    transition: box-shadow 0.3s ease;
}

.home-image-container:hover {
    box-shadow: var(--shadow-xl);
}

.home-image {
    width: 90%;
    height: auto;
    object-fit: cover;
    display: block;
    margin: 0 auto;
    border-radius: 10px;
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.12), 0 4px 8px -4px rgba(79, 70, 229, 0.08);
}

@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    .header-container {
        flex-direction: row;
        justify-content: space-between;
    }

    .logo {
        order: 1;
    }

    .header-content {
        order: 2;
        flex-direction: row;
        align-items: center;
        text-align: left;
    }

    .menu-toggle {
        order: 3;
        display: block;
    }

    .navigation {
        display: none;
        flex-direction: column;
        width: 100%;
    }

    .navigation ul {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        padding: 0;
        margin: 0;
    }

    .navigation ul li {
        margin: 0;
        width: 100%;
        text-align: center;
    }

    .navigation ul li a {
        display: block;
        width: 100%;
        padding: 1rem;
        background: #f8fafc;
        color: #1e293b;
        border-radius: 0;
    }

    .navigation ul li a:hover {
        background: var(--accent-muted);
        color: var(--accent);
    }

    .navigation.active {
        display: flex;
    }

    .home-image-container {
        width: 100%;
        max-width: 100%;
        height: 50vh;
        min-height: 200px;
        padding: 1rem;
        box-sizing: border-box;
    }

    .home-image {
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center;
    }

    main {
        padding: 1rem;
        text-align: left;
        max-width: 100%;
        box-sizing: border-box;
    }

    main h2 {
        font-size: 1.35rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    main h2.smaller {
        font-size: 1.1rem;
    }

    #gallery img {
        width: 100%;
        max-width: 90%;
        height: 100%;
        object-fit: cover;
        cursor: pointer;
        margin: 0 auto;
    }

    .about-container,
    #gallery,
    #playersTable,
    .visual-aids-gallery,
    .how-to-play-container {
        width: 100%;
        max-width: none;
        padding: 0 1rem;
        box-sizing: border-box;
    }

    .rfr4-venue-image {
        float: none;
        display: block;
        margin: 1rem auto;
        max-width: min(320px, 100%);
    }

    .visual-aids-gallery img {
        width: 90%;
    }

    ul, ol {
        text-align: left;
        display: block;
        padding-left: 1rem;
    }

    h1, h2, h3 {
        text-align: center;
    }

    .about-container,
    .how-to-play-container {
        box-sizing: border-box;
        padding: 1rem;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    .how-to-play-container .table-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -0.5rem;
    }

    .how-to-play-container .table-container table {
        min-width: 400px;
        font-size: 0.8rem;
    }

    #playersTable {
        width: 100%;
        font-size: 0.9rem;
    }

    #playersTable th, #playersTable td {
        padding: 0.5rem 0.25rem;
    }

    .event-summary-container {
        padding: 1rem;
        max-width: 100%;
        box-sizing: border-box;
    }

    .event-header {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .event-logo img {
        height: auto;
        max-height: 200px;
        max-width: 100%;
    }

    .event-images {
        grid-template-columns: repeat(2, 80px);
        grid-template-rows: repeat(3, 80px);
        gap: 10px;
    }

    .event-images img {
        width: 80px;
        height: 80px;
    }

    .event-winner img {
        height: auto;
        max-height: 280px;
        max-width: 100%;
    }

    .event-summary-container table {
        width: 100%;
        font-size: 0.9rem;
    }

    .modal-content {
        width: calc(100vw - 2rem);
        max-width: calc(100vw - 2rem);
        max-height: 85vh;
        overflow-y: auto;
        overflow-x: hidden;
        margin: 1rem auto;
        padding: 1rem;
        box-sizing: border-box;
    }

    .modal-content img {
        max-width: 100%;
    }

    #bioContainer {
        max-width: 100%;
    }

    #bioImage {
        max-width: 100%;
    }
}

/* Event filter dropdown */
#eventFilterContainer {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 1rem;
}

#eventFilter {
    width: 600px;
    min-width: 600px;
    max-width: 100%;
    padding: 0.85rem 1.25rem;
    font-size: 1rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--surface-elevated);
    border: 2px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234f46e5' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.25rem center;
    padding-right: 3rem;
    box-sizing: border-box;
}

#eventFilter:hover {
    border-color: rgba(79, 70, 229, 0.4);
}

#eventFilter:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-muted);
}

#eventFilter option {
    background-color: var(--surface);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    padding: 0.5rem;
}

@media (max-width: 768px) {
    #eventFilter {
        width: 90%;
        min-width: unset;
        max-width: 90%;
        padding: 1rem;
        font-size: 1rem;
    }

    #eventFilterContainer {
        padding: 0.5rem;
    }

    #gallery {
        width: 95%;
        padding: 1rem;
        gap: 15px;
    }

    #gallery img {
        width: 140px;
        height: 140px;
    }
}

@media (max-width: 768px) {
    table {
        width: 100%;
        font-size: 0.9rem;
    }

    table th, table td {
        padding: 4px;
    }

    .events-table-wrapper {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
        box-sizing: border-box;
    }

    #eventsTable {
        min-width: 900px;
        width: 900px;
        display: block;
    }
}

/* Event summary page */
.event-summary-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    text-align: center;
}

.event-summary-container h2 {
    font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
    font-weight: 700;
    display: block;
    font-size: 1.5em;
    margin-block-start: 0.83em;
    margin-block-end: 0.83em;
    margin-inline-start: 0px;
    margin-inline-end: 0px;
    unicode-bidi: isolate;
    color: var(--text-primary);
}

.event-header {
    display: flex;
    gap: 20px;
    margin-bottom: 1rem;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
}

.event-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.event-logo img {
    height: 400px;
    width: auto;
}

.event-images {
    display: grid;
    grid-template-columns: repeat(2, 120px);
    grid-template-rows: repeat(3, 120px);
    gap: 20px;
    justify-content: center;
    align-content: center;
}

.event-images img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: var(--shadow-md);
}

.event-summary,
.event-comments,
.event-winner {
    margin-top: 1rem;
}

.event-winner {
    padding: 1.75rem;
    background: linear-gradient(135deg, #fafbff 0%, #f8fafc 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
}

.event-winner h3 {
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.event-winner img {
    width: auto;
    height: 600px;
    display: block;
    margin: 0 auto;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
}

.event-comments .comment {
    margin-bottom: 1rem;
}

.event-summary-container table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.event-summary-container table th,
.event-summary-container table td {
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.event-summary-container table th {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    color: var(--text-primary);
    font-weight: 600;
    font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.event-summary-container table tbody tr:nth-child(even) {
    background-color: #fff;
}

.event-summary-container table tbody tr:nth-child(odd) {
    background-color: #fafbff;
}

.event-summary-container table tbody tr:hover {
    background-color: var(--accent-muted);
}
