@charset "UTF-8";

/* ==========================================================================
   Anniversary Cup - Base Variables & Setup
   ========================================================================== */
:root {
    --color-bg-dark: #0A0510;
    --color-bg-panel: #1A0A2E;
    --color-gold: #E5C07B;
    --color-gold-dim: rgba(229, 192, 123, 0.4);
    --color-purple: #7835B1;
    --color-purple-light: #9B51E0;
    --color-text-main: #FFFFFF;
    --color-text-muted: #A09BB0;
    --font-heading: 'Shippori Mincho', serif;
    --font-body: 'Noto Sans JP', sans-serif;
}

body {
    background-color: var(--color-bg-dark);
    color: var(--color-text-main);
    font-family: var(--font-body);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    margin: 0;
    letter-spacing: 0.05em;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: var(--color-text-main);
    text-transform: uppercase;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
    margin: 15px auto 0;
}

.section-title .sub {
    display: block;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--color-gold);
    letter-spacing: 0.2em;
    margin-bottom: 5px;
    font-weight: 500;
}

/* ==========================================================================
   Global Navigation
   ========================================================================== */
.lp-global-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 30px;
    z-index: 1000;
    background: linear-gradient(to bottom, rgba(10,5,16,0.9) 0%, rgba(10,5,16,0) 100%);
    box-sizing: border-box;
}

.back-link {
    color: var(--color-text-main);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--color-gold);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: radial-gradient(circle at center, #2a114c 0%, var(--color-bg-dark) 70%);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAuMDUiLz4KPC9zdmc+') repeat;
    pointer-events: none;
}

.hero-content {
    text-align: center;
    z-index: 10;
}

.hero-logo {
    width: 450px;
    max-width: 80%;
    height: auto;
    margin: 0 auto;
    filter: drop-shadow(0 0 30px rgba(229, 192, 123, 0.4));
    animation: float 6s ease-in-out infinite;
}

.hero-title-fallback {
    font-size: 4rem;
    font-family: 'Shippori Mincho', serif;
    color: #fff;
    text-align: center;
    text-shadow: 0 0 20px rgba(229, 192, 123, 0.6);
    background: linear-gradient(135deg, var(--color-gold) 0%, #fff 50%, var(--color-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: float 6s ease-in-out infinite;
    letter-spacing: 2px;
}

.scroll-down {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    color: var(--color-gold);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
    40% { transform: translateY(-15px) translateX(-50%); }
    60% { transform: translateY(-7px) translateX(-50%); }
}

/* ==========================================================================
   Tournament Bracket Section
   ========================================================================== */
.bracket-section {
    padding: 80px 0;
    background: linear-gradient(180deg, var(--color-bg-dark) 0%, #150A25 100%);
}

.bracket-wrapper {
    padding: 20px 0;
    width: 100%;
    overflow: hidden; /* Remove scrollbars entirely */
    display: flex;
    justify-content: center;
}

.bracket-split {
    display: flex;
    justify-content: center;
    min-width: 1100px; /* Increased to prevent final match overlapping */
    height: 500px;
}

.bracket-half {
    display: flex;
    flex: 1;
    gap: 30px;
}

.bracket-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 10px; /* Adjusted to match 10px lines */
    z-index: 5;
    min-width: 200px;
    position: relative;
}

/* ================= FLEXBOX TREE BRACKET ================= */
.tree-branch {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    position: relative;
    gap: 20px; /* Reduced from 30px */
}

.tree-leaves {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    flex: 1;
    align-self: stretch;
    position: relative;
}

.tree-node {
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.match {
    background: rgba(35, 20, 60, 0.9);
    border: 1px solid rgba(160, 90, 220, 0.4);
    border-radius: 6px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5), inset 0 0 10px rgba(120, 53, 177, 0.1);
    z-index: 2;
    width: 120px;
    height: 60px;
    box-sizing: border-box;
}

/* Single team seed match (Bye) */
.match.bye-match {
    height: 30px;
    margin-top: 15px;
    margin-bottom: 15px;
    gap: 0;
    padding: 4px 16px;
}

/* Completely empty match block */
.match.empty-match {
    visibility: hidden;
}

/* ================= LEFT HALF LINES ================= */
.left-half .tree-branch { flex-direction: row; }

/* Align leaves to the right so they connect with the tree node */
.left-half .tree-leaves {
    align-items: flex-end;
}

/* Horizontal line leaving match to the right */
.left-half .match::after {
    content: ''; position: absolute; right: -10px; top: 50%; width: 10px; border-top: 2px solid var(--color-purple-light); z-index: 1;
}
/* Vertical line connecting the two items in leaves */
.left-half .tree-leaves::after {
    content: ''; position: absolute; right: -10px; top: 25%; bottom: 25%; border-right: 2px solid var(--color-purple-light); z-index: 1;
}

/* Adjust vertical line if bottom match/branch is empty */
.left-half .tree-leaves:has(> .empty-match:last-child)::after,
.left-half .tree-leaves:has(> .tree-branch:last-child > .tree-node > .empty-match)::after {
    bottom: 50%;
}

/* Adjust vertical line if top match/branch is empty */
.left-half .tree-leaves:has(> .empty-match:first-child)::after,
.left-half .tree-leaves:has(> .tree-branch:first-child > .tree-node > .empty-match)::after {
    top: 50%;
}

/* Hide vertical line if both are empty */
.left-half .tree-leaves:has(> .empty-match:first-child):has(> .empty-match:last-child)::after,
.left-half .tree-leaves:has(> .tree-branch:first-child > .tree-node > .empty-match):has(> .tree-branch:last-child > .tree-node > .empty-match)::after {
    display: none;
}
/* Horizontal line entering node from the left */
.left-half .tree-node::before {
    content: ''; position: absolute; left: -10px; top: 50%; width: 10px; border-top: 2px solid var(--color-purple-light); z-index: 1;
}


/* ================= RIGHT HALF LINES ================= */
.right-half .tree-branch { flex-direction: row; } /* Node is already on the left in HTML */

/* Horizontal line leaving match to the left */
.right-half .match::before {
    content: ''; position: absolute; left: -10px; top: 50%; width: 10px; border-top: 2px solid var(--color-purple-light); z-index: 1;
}
/* Vertical line connecting the two items in leaves */
.right-half .tree-leaves::before {
    content: ''; position: absolute; left: -10px; top: 25%; bottom: 25%; border-left: 2px solid var(--color-purple-light); z-index: 1;
}

/* Adjust vertical line if bottom match/branch is empty */
.right-half .tree-leaves:has(> .empty-match:last-child)::before,
.right-half .tree-leaves:has(> .tree-branch:last-child > .tree-node > .empty-match)::before {
    bottom: 50%;
}

/* Adjust vertical line if top match/branch is empty */
.right-half .tree-leaves:has(> .empty-match:first-child)::before,
.right-half .tree-leaves:has(> .tree-branch:first-child > .tree-node > .empty-match)::before {
    top: 50%;
}

/* Hide vertical line if both are empty */
.right-half .tree-leaves:has(> .empty-match:first-child):has(> .empty-match:last-child)::before,
.right-half .tree-leaves:has(> .tree-branch:first-child > .tree-node > .empty-match):has(> .tree-branch:last-child > .tree-node > .empty-match)::before {
    display: none;
}
/* Horizontal line entering node from the right */
.right-half .tree-node::after {
    content: ''; position: absolute; right: -10px; top: 50%; width: 10px; border-top: 2px solid var(--color-purple-light); z-index: 1;
}

/* ================= CHAMPION & FINAL ================= */
.champion-block {
    text-align: center;
    animation: pulse 2s infinite;
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
}

@keyframes pulse {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
    100% { transform: translateX(-50%) scale(1); }
}

.crown {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 10px var(--color-gold));
}

.champion-title {
    font-family: var(--font-heading);
    color: var(--color-gold);
    letter-spacing: 0.2em;
    font-size: 1rem;
    margin-bottom: 5px;
}

.champion-name {
    font-size: 1.4rem; /* Reduced */
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, var(--color-gold) 0%, #fff 50%, var(--color-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(229, 192, 123, 0.3);
}

.final-match-horizontal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px; /* Increased */
    background: rgba(35, 20, 60, 0.9);
    padding: 15px 25px; /* Increased padding */
    border-radius: 12px;
    border: 1px solid var(--color-gold);
    position: relative;
    box-shadow: 0 0 30px rgba(229, 192, 123, 0.2);
    min-width: 250px; /* Make final box larger */
}

/* Connect left/right sides to the final match box */
.final-match-horizontal::before {
    content: ''; position: absolute; left: -10px; top: 50%; width: 10px; border-top: 2px solid var(--color-purple-light); z-index: 1;
}
.final-match-horizontal::after {
    content: ''; position: absolute; right: -10px; top: 50%; width: 10px; border-top: 2px solid var(--color-purple-light); z-index: 1;
}

.team-box {
    text-align: center;
    min-width: 100px;
}

.team-box .name {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 5px;
}

.team-box .score {
    font-size: 1.5rem;
    font-weight: bold;
    font-family: monospace;
    color: var(--color-gold);
}

.vs {
    font-family: var(--font-heading);
    font-style: italic;
    color: var(--color-purple-light);
    font-weight: bold;
    font-size: 1.2rem;
}


.team {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 6px; /* Reduced */
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
    font-size: 0.75rem; /* Reduced */
    line-height: 1.2; /* Prevent text line-height from bloating the box */
}

.team .name {
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 75px; /* Reduced */
}

.team .score {
    color: var(--color-gold);
    font-weight: bold;
    font-family: monospace;
    font-size: 0.9rem; /* Reduced */
}


/* ==========================================================================
   Teams Section
   ========================================================================== */
.teams-section {
    padding: 100px 0;
}

.team-grid {
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.team-card {
    display: flex;
    background: var(--color-bg-panel);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.05);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.team-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-gold-dim);
}

.team-card:nth-child(even) {
    flex-direction: row-reverse;
}

/* 1st Place Styles */
.team-card.rank-1 {
    border: 2px solid var(--color-gold);
    box-shadow: 0 0 30px rgba(229, 192, 123, 0.4), inset 0 0 20px rgba(229, 192, 123, 0.1);
}
.team-card.rank-1 .team-rank {
    background: linear-gradient(135deg, #FFDF73, #D4AF37);
    color: #1A0A2E;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.8);
    transform: scale(1.2);
    border: 2px solid #fff;
}
.team-card.rank-1 .team-name::before {
    content: '👑 ';
}

/* 2nd Place Styles */
.team-card.rank-2 {
    border: 2px solid #C0C0C0;
    box-shadow: 0 0 20px rgba(192, 192, 192, 0.3);
}
.team-card.rank-2 .team-rank {
    background: linear-gradient(135deg, #E0E0E0, #9E9E9E);
    color: #1A0A2E;
    box-shadow: 0 0 10px rgba(192, 192, 192, 0.6);
    transform: scale(1.1);
    border: 2px solid #fff;
}

.team-image-wrapper {
    flex: 1;
    position: relative;
    min-height: 300px;
    background: #fff; /* Ensure logos have a clean background */
}

.team-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Prevent squishing and cropping */
    position: absolute;
    top: 0; left: 0;
    padding: 20px;
    box-sizing: border-box;
}

.team-rank {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--color-gold);
    color: var(--color-bg-dark);
    padding: 5px 15px;
    font-weight: bold;
    font-family: var(--font-heading);
    border-radius: 30px;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.team-card:nth-child(even) .team-rank {
    left: auto;
    right: 20px;
}

.team-content {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.team-name {
    font-size: 2rem;
    color: var(--color-gold);
    margin-bottom: 20px;
}

.team-members h4 {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.member-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.member-tag {
    background: rgba(120, 53, 177, 0.2);
    border: 1px solid var(--color-purple);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* ==========================================================================
   Overview Section
   ========================================================================== */
.overview-section {
    padding: 100px 0;
    background: #11081A;
}

.info-table {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    border-collapse: collapse;
}

.info-table th,
.info-table td {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.info-table th {
    text-align: left;
    width: 30%;
    color: var(--color-gold);
    font-family: var(--font-heading);
    font-size: 1.1rem;
}

.info-table tr:last-child th,
.info-table tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   Video Section
   ========================================================================== */
.video-section {
    padding: 100px 0;
}

.video-container {
    max-width: 900px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
}

.video-container video,
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ==========================================================================
   FAQ Section
   ========================================================================== */
.faq-section {
    padding: 100px 0;
    background: #11081A;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--color-bg-panel);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}

.faq-question {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
}

.faq-question:hover {
    background: rgba(255,255,255,0.05);
}

.faq-icon {
    color: var(--color-gold);
    font-size: 1.5rem;
    line-height: 1;
    transition: transform 0.3s ease;
}

.faq-answer {
    padding: 0 20px;
    height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    color: var(--color-text-muted);
}

.faq-item.active .faq-answer {
    padding: 20px;
    height: auto;
    opacity: 1;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.lp-footer {
    background: var(--color-bg-dark);
    padding: 50px 0 30px;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.lp-footer p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.lp-footer a {
    color: var(--color-text-main);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.lp-footer a:hover {
    color: var(--color-gold);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 950px) {
    .bracket-split {
        transform-origin: top center;
        transform: scale(0.85);
        margin-bottom: -75px;
    }
}

@media (max-width: 768px) {
    .bracket-split {
        transform: scale(0.65);
        margin-bottom: -175px;
    }
    .section-title {
        font-size: 2rem;
    }
    .hero-title-fallback {
        font-size: 2.5rem;
    }
    
    .team-card,
    .team-card:nth-child(even) {
        flex-direction: column;
    }
    
    .team-image-wrapper {
        min-height: 200px;
    }
    
    .team-content {
        padding: 30px 20px;
    }
    
    .team-name {
        font-size: 1.5rem;
    }
    
    .info-table th,
    .info-table td {
        display: block;
        width: 100%;
        padding: 10px 0;
    }
    
    .info-table th {
        padding-bottom: 0;
    }
}

@media (max-width: 480px) {
    .bracket-split {
        transform: scale(0.3);
        margin-bottom: -350px;
    }
}
