:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --primary-color: #3b82f6;
    --secondary-color: #f59e0b;
    --accent-color: #ec4899;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Noto Sans JP', 'Inter', sans-serif;
    --font-heading: 'Oswald', 'Noto Sans JP', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    text-transform: uppercase;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    display: block;
    width: 50%;
    height: 4px;
    background: var(--primary-color);
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

/* Glass Header */
.glass-header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.2rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
}

.logo {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: white;
}

.highlight {
    color: var(--secondary-color);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2.5rem;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    position: relative;
    overflow: hidden;
    padding-top: 80px;
    /* Account for fixed header */
}

/* Animated Background Blobs */
.hero::before {
    content: '';
    position: absolute;
    width: 60vw;
    height: 60vw;
    background: var(--primary-color);
    filter: blur(120px);
    opacity: 0.15;
    border-radius: 50%;
    top: -20%;
    left: -20%;
    z-index: 0;
    animation: float 10s infinite alternate;
}

.hero::after {
    content: '';
    position: absolute;
    width: 50vw;
    height: 50vw;
    background: var(--secondary-color);
    filter: blur(120px);
    opacity: 0.15;
    border-radius: 50%;
    bottom: -10%;
    right: -10%;
    z-index: 0;
    animation: float 8s infinite alternate-reverse;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(30px, 30px);
    }
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 90%;
    max-width: 1200px;
    z-index: 1;
    gap: 2rem;
}

.hero-content {
    flex: 1;
    text-align: left;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.floating-image {
    max-width: 100%;
    height: auto;
    max-height: 80vh;
    /* Prevent it from being too tall */
    filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.4));
    animation: slowFloat 4s ease-in-out infinite;
    mask-image: radial-gradient(circle at center, black 60%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at center, black 60%, transparent 100%);
}

.glow-effect {
    filter: drop-shadow(0 0 15px rgba(245, 158, 11, 0.6)) drop-shadow(0 0 30px rgba(59, 130, 246, 0.4));
}

@keyframes slowFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

.hero-content {
    z-index: 1;
    position: relative;
}

h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), #60a5fa, var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    opacity: 0.8;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-button {
    display: inline-block;
    padding: 1rem 3.5rem;
    background: linear-gradient(90deg, var(--primary-color), #2563eb);
    color: white;
    text-decoration: none;
    font-weight: 700;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.5);
}

/* Sections */
.container {
    padding: 6rem 10%;
    position: relative;
    z-index: 1;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
}

.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 2.5rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

.glass-card h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.glass-card p {
    color: rgba(255, 255, 255, 0.8);
}

footer {
    text-align: center;
    padding: 3rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    background: #0b1120;
}

/* Gallery Styles */
.gallery-grid {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.gallery-item {
    max-width: 400px;
    padding: 1rem;
    text-align: center;
}

.gallery-item img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Mobiel Responsive */
@media (max-width: 768px) {
    .glass-header {
        padding: 1rem;
    }

    nav ul {
        display: none;
        /* For simplicity in this demo, usually would be a hamburger */
    }

    .hero-container {
        flex-direction: column-reverse;
        /* Text on top (visually) but code order -> Content first, Image second. Column reverse -> Image first. */
        flex-direction: column;
        text-align: center;
        padding-top: 2rem;
    }

    .hero-content {
        text-align: center;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .floating-image {
        max-height: 40vh;
        margin-top: 2rem;
    }

    .subtitle {
        margin-left: auto;
        margin-right: auto;
    }
}

/* Page Header for Subpages */
.page-header {
    height: 50vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    position: relative;
    overflow: hidden;
    padding-top: 80px;
}

.page-header::before,
.page-header::after {
    content: '';
    position: absolute;
    width: 40vw;
    height: 40vw;
    filter: blur(100px);
    opacity: 0.1;
    border-radius: 50%;
    z-index: 0;
}

.page-header::before {
    background: var(--primary-color);
    top: -10%;
    left: -10%;
    /* animation: float 10s infinite alternate; */
}

.page-header::after {
    background: var(--secondary-color);
    bottom: -10%;
    right: -10%;
    /* animation: float 8s infinite alternate-reverse; */
}

.header-content {
    z-index: 1;
    position: relative;
}

/* Rules Specific Styles */
.rules-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.rule-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    transition: transform 0.3s ease;
}

.rule-item:hover {
    transform: translateX(10px);
}

.rule-number {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.1);
    line-height: 1;
}

.rule-content h3 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.bg-darker {
    background: rgba(0, 0, 0, 0.2);
}

nav a.active {
    color: var(--primary-color);
    position: relative;
}

nav a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
}

/* Rule Details Layout */
.rule-detail-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    align-items: center;
}

.diagram-container {
    flex: 1;
    min-width: 300px;
    display: flex;
    justify-content: center;
}

.text-content {
    flex: 1;
    min-width: 300px;
}

.detail-list {
    margin-top: 1.5rem;
    padding-left: 1.5rem;
    list-style-type: disc;
}

.detail-list li {
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

.detail-list strong {
    color: var(--secondary-color);
}

/* CSS Court Diagram */
.court {
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border: 3px solid white;
    position: relative;
    display: flex;
    flex-direction: column;
}

.net-area {
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.net-line {
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.5);
}

.court-side {
    flex: 1;
    position: relative;
    background: #1e3a8a;
    /* Blue court color */
}

.attack-line {
    position: absolute;
    top: 33%;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.7);
}

.position {
    position: absolute;
    width: 40px;
    height: 40px;
    background: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #0f172a;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    font-size: 1.2rem;
}

.position span {
    font-size: 0.5rem;
    position: absolute;
    bottom: -18px;
    white-space: nowrap;
    color: white;
    text-shadow: 0 1px 2px black;
}

/* Position locations */
.p4 {
    top: 10%;
    left: 15%;
}

.p3 {
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
}

.p2 {
    top: 10%;
    left: 15%;
}

.p5 {
    top: 60%;
    left: 15%;
}

.p6 {
    top: 60%;
    left: 50%;
    transform: translateX(-50%);
}

.p1 {
    top: 60%;
    right: 15%;
    background: white;
    color: var(--primary-color);
}

/* Server distinct color */

.rotation-arrow {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Steps Flow */
.steps-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.step-card {
    flex: 1;
    min-width: 280px;
    text-align: center;
    position: relative;
    padding-top: 0;
    /* Reset padding */
    padding-bottom: 2rem;
    overflow: hidden;
    /* For image clipping */
    display: flex;
    flex-direction: column;
}

.step-image-container {
    width: 100%;
    height: 200px;
    background: rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    position: relative;
}

.step-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.step-card:hover .step-image {
    transform: scale(1.1);
}

.step-placeholder-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    background: radial-gradient(circle, #1e293b, #0f172a);
}

.step-icon {
    position: absolute;
    top: 175px;
    /* Adjust based on image height (200px) - half icon height (25px) */
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    border: 4px solid var(--bg-color);
    z-index: 2;
}

.step-icon-separator {
    font-size: 2rem;
    color: var(--secondary-color);
    font-weight: bold;
}

@media (max-width: 768px) {
    .step-icon-separator {
        transform: rotate(90deg);
        width: 100%;
        text-align: center;
        margin: 1rem 0;
    }
}

/* Foul Grid */
.foul-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.foul-item {
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid var(--accent-color);
    padding: 1.5rem;
    border-radius: 0 10px 10px 0;
}

.foul-item h4 {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.foul-item p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
}