/* General Styles */
body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(to bottom, #1e1e2f, #2c2c3e); /* Dark subtle gradient */
    color: #f0f0f0; /* Light text */
    margin: 0;
    padding: 0;
    /* Removed overflow: hidden; - can cause issues with scrolling */
    min-height: 100vh; /* Ensure body takes at least viewport height */
    position: relative; /* Needed for the pseudo-element */
}

/* Animated Background (Original Version Restored) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 223, 86, 0.3), transparent),
    radial-gradient(circle at top right, rgba(255, 69, 58, 0.3), transparent),
    radial-gradient(circle at bottom left, rgba(54, 92, 243, 0.3), transparent),
    radial-gradient(circle at bottom right, rgba(136, 216, 104, 0.3), transparent);
    animation: animateBackground 10s infinite alternate;
    z-index: -1; /* Ensures it stays behind content */
}

@keyframes animateBackground {
    0% {
        transform: scale(1) rotate(0);
    }
    50% {
        transform: scale(1.1) rotate(180deg);
    }
    100% {
        transform: scale(1) rotate(360deg);
    }
}


h2, h3, h4 {
    margin: 0;
    padding: 10px 0;
    color: #ffffff; /* Default heading color - can be overridden */
}

/* Centered content container */
.center-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    max-width: 1200px;
    padding: 20px;
    position: relative; /* Still good practice with z-index -1 background */
    /* Removed z-index: 1; as it's not needed with background z-index -1 */
}

/* Tournament Title Styling */
.tournament-title {
    color: #ffcc00; /* Brawl Stars Gold */
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8);
    font-size: 2.5em; /* Slightly larger */
    text-align: center;
    border-bottom: 3px solid #ffcc00; /* Thicker border */
    margin-bottom: 25px; /* More space below */
    padding-bottom: 15px;
    position: relative;
    /* Softened glow animation */
    animation: softGlow 3s infinite alternate ease-in-out, fadeIn 1.5s ease-out;
}

@keyframes softGlow {
    0% {
        text-shadow: 2px 2px 6px rgba(255, 204, 0, 0.4);
    }
    100% {
        text-shadow: 2px 2px 12px rgba(255, 204, 0, 0.8);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px); /* Added slight translation */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Styling */
section.tournament {
    background: rgba(40, 60, 80, 0.95); /* Dark blue-grey with less transparency */
    border: 2px solid #54a3f3; /* Blue border accent */
    border-radius: 12px; /* More rounded corners */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.7); /* Stronger shadow */
    margin: 20px 0;
    padding: 25px; /* More padding */
    width: 100%;
    max-width: 850px; /* Slightly wider */
    animation: slideIn 1s ease-out;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out; /* Add transitions for hover */
}

section.tournament:hover {
    transform: translateY(-5px); /* Lift slightly on hover */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.8); /* Enhance shadow on hover */
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tournament Details, Rules, Notes, Results Containers */
.tournament-details, .rules, .notes, .results {
    margin-top: 20px;
    background: rgba(58, 75, 92, 0.9); /* Slightly lighter dark blue-grey background */
    padding: 20px; /* More padding */
    border-radius: 8px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6); /* Deeper inset shadow */
}

/* Text color inside these containers */
.tournament-details p,
.rules ol li,
.notes ol li,
.results ol li,
.results p, /* Style for the note added to the new tournament */
.tournament-details ul li { /* Add styling for list items in details */
    color: #e0e0e0; /* Lighter text for readability */
    line-height: 1.7; /* Improved line spacing */
    font-size: 1.1em;
}

.tournament-details strong {
    color: #ff8c00; /* Slightly different orange */
}

/* Links inside containers */
.tournament-details a,
.results a {
    color: #54a3f3; /* Blue link color */
    text-decoration: none;
    transition: color 0.3s ease;
}

.tournament-details a:hover,
.results a:hover {
    color: #ffcc00; /* Gold on hover */
    text-decoration: underline;
}


/* Points System */
.points-system ul {
    list-style-type: none;
    padding: 0;
    margin-top: 10px;
}

.points-system ul li {
    background: rgba(136, 216, 104, 0.2); /* Greenish background with transparency */
    color: #aaffaa; /* Lighter green text */
    padding: 8px 15px; /* More padding */
    margin: 8px 0; /* More margin */
    border-left: 4px solid #88d868; /* Solid green border */
    border-radius: 4px;
    font-weight: bold;
}

/* Headers inside sections */
section h3 {
    color: #ff8c00; /* Orange */
    font-size: 1.6em; /* Slightly larger */
    border-bottom: 2px solid #ff8c00;
    padding-bottom: 8px;
    margin-bottom: 15px; /* More space below */
}
section h4 {
    color: #ffffff; /* White heading for sub-sections like "Results:" */
    font-size: 1.3em;
    margin-bottom: 10px;
}


/* Results List Styling */
.results ol {
    list-style: none;
    padding: 0;
    counter-reset: tournament-rank; /* Reset counter for numbered list */
}

.results ol li {
    counter-increment: tournament-rank; /* Increment counter for each list item */
    background: rgba(76, 93, 110, 0.9); /* Slightly darker dark blue-grey */
    margin: 12px 0; /* More margin */
    padding: 15px 20px; /* More padding */
    border-radius: 8px;
    color: #ffffff; /* White text */
    font-weight: bold;
    font-size: 1.2em;
    border-left: 5px solid #ffcc00; /* Gold accent border */
    transition: background-color 0.3s ease, border-left-color 0.3s ease; /* Smooth transition */
    position: relative; /* Needed for custom numbering */
    padding-left: 50px; /* Make space for custom number */
}

/* Custom numbered list before each list item */
.results ol li::before {
    content: counter(tournament-rank) "."; /* Use the counter */
    position: absolute;
    left: 15px; /* Position the number */
    top: 50%; /* Center vertically */
    transform: translateY(-50%);
    font-size: 1.1em;
    font-weight: bold;
    color: #ffcc00; /* Gold color for numbers */
    width: 25px; /* Fixed width for alignment */
    text-align: right;
}


/* Specific styles for top ranks (optional but nice) */
.results ol li:nth-child(1) {
    border-left-color: #ffcc00; /* Gold for 1st place */
    background: rgba(255, 204, 0, 0.1); /* Subtle gold background */
}
.results ol li:nth-child(2) {
    border-left-color: #c0c0c0; /* Silver for 2nd place */
    background: rgba(192, 192, 192, 0.1); /* Subtle silver background */
}
.results ol li:nth-child(3) {
    border-left-color: #cd7f32; /* Bronze for 3rd place */
    background: rgba(205, 127, 50, 0.1); /* Subtle bronze background */
}

/* Hover effect for result list items */
.results ol li:hover {
    background-color: rgba(90, 110, 130, 0.9); /* Darker background on hover */
    border-left-color: #ffffff; /* White border on hover */
}


/* Rules and Notes List Styling */
.rules ol, .notes ol {
    padding-left: 25px; /* Increased indentation */
    margin-top: 10px;
}

.rules ol li, .notes ol li {
    margin: 8px 0; /* Adjusted margin */
    position: relative; /* Needed for potential custom bullets later if desired */
}


/* Responsive Design */
@media (max-width: 768px) {
    .tournament-title {
        font-size: 2em; /* Adjusted size for mobile */
        padding-bottom: 10px;
        margin-bottom: 20px;
    }

    section.tournament {
        padding: 20px; /* Adjusted padding */
        margin: 15px 0;
    }

    .tournament-details, .rules, .notes, .results {
        padding: 15px; /* Adjusted padding */
        margin-top: 15px;
    }

    .results ol li {
        font-size: 1.1em; /* Adjusted font size */
        padding: 12px 15px;
        padding-left: 45px; /* Adjust padding for custom number */
    }

    .results ol li::before {
        left: 10px; /* Adjust position for custom number */
        width: 20px;
    }

    section h3 {
        font-size: 1.4em;
    }

    section h4 {
        font-size: 1.2em;
    }
}

@media (max-width: 480px) {
    .tournament-title {
        font-size: 1.6em; /* Further adjust for very small screens */
    }

    section.tournament {
        padding: 15px;
    }

    .tournament-details, .rules, .notes, .results {
        padding: 10px;
    }

    .results ol li {
        font-size: 1em;
        padding: 10px 10px;
        padding-left: 40px;
    }

    .results ol li::before {
        left: 8px;
        font-size: 1em;
    }

    section h3 {
        font-size: 1.2em;
    }

    section h4 {
        font-size: 1.1em;
    }
}