/* --- YLEISET JA RESET --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --header-height: 64px; /* Mobiili oletus */
    --font-main: 'Archivo', sans-serif;
    --font-heading: 'Bebas Neue', sans-serif;
    --font-logo: 'Tourney', sans-serif;
    --font-mono: 'Space Mono', monospace;
}

@media (min-width: 1240px) {
    :root {
        --header-height: 194px;
    }
}

html {
    font-size: 14px;
    font-family: var(--font-main);
    background-color: #000;
    max-width: 1001vw;
}

body {
    background-color: #000;
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

/* --- SISÄLTÖALUE --- */
main {
    background-color: #161616;
    padding-top: var(--header-height);
    display: flex;
    justify-content: center;
}

.content {
    width: 100vw;
    max-width: 1248px;
    /* Korjattu: calc() tarvitaan laskemiseen */
    min-height: calc(100vh - var(--header-height) - 175px); 
    background-color: #fff;
    color: #000; /* Sisältöalueen teksti mustaksi jos tausta on valkoinen */
    padding: 16px;
}

.content p {
    margin-bottom: 1.5rem;
}

/* --- TYPOGRAFIA --- */
h1, h2, h3, h4, h5, nav a, button, thead th {
    font-family: var(--font-heading);
    font-weight: normal;
    letter-spacing: 1px;
    text-transform: uppercase;
}

h1 { font-weight: bolder; font-size: 3rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.7rem; }
h4 { font-size: 1.4rem; }
h5 { font-size: 1rem; }

nav a, button, thead th { font-size: 1.4rem; }

tbody td {
    font-family: var(--font-mono);
}

.child-page-title {
    margin-top: 24px;
    margin-bottom: 64px;
}

/* --- HEADER & NAVIGAATIO --- */
header {
    background-color: #000;
    width: 100vw;
    height: 64px;
    top: 0;
    left: 0;
    position: fixed;
    z-index: 100;
    display: flex;
    align-items: center;
}

.titlebar {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 0 16px;
}

.title {
    color: #fff;
    font-family: var(--font-logo);
    font-size: 2rem;
    font-weight: 900;
    font-style: italic;
    letter-spacing: 5px;
}

.hamburger {
    cursor: pointer;
    width: 24px;
    height: 24px;
    margin-left: auto;
    z-index: 110;
}

.hamburger img {
    width: 100%;
    height: 100%;
    filter: invert(1);
}

/* Mobiilivalikko */
.menu {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    width: 66vw;
    height: 100vh;
    background-color: #000;
    z-index: 99;
    padding-top: 80px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.menu.open {
    transform: translateX(0);
}

.menu ul {
    display: flex;
    flex-direction: column;
    padding: 0 24px;
    gap: 16px;
}

/* --- HOVER-REUNAVIIVA (Child Page) --- */
.child-page {
    position: relative;
    width: fit-content;
    margin: 20px;
    padding: 8px 4px;
    display: inline-block;
}

.child-page::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #fff;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.child-page:hover::before {
    opacity: 1;
}

.footer-links a {
    position: relative;
    width: fit-content;
    margin: 10px;
    padding: 8px 4px;
    display: inline-block;
}

.footer-links a::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #fff;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.footer-links a:hover::before {
    opacity: 1;
}

/* --- RESPONSIVISUUS (Desktop) --- */
@media (min-width: 992px) {
    
    .content {
        padding: 40px;
    }

    .hamburger { display: none; }

    .menu {
        position: static;
        transform: none;
        width: auto;
        height: auto;
        padding-top: 0;
        flex-direction: row;
        margin-left: auto;
        background-color: transparent;
    }

    .menu ul {
        flex-direction: row;
        gap: 30px;
    }

    .title { font-size: 2.4rem; }
}

/* --- FOOTER --- */
footer {
    max-width: 100vw;
    background-color: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 60px 20px;
    border-top: 1px solid #222;
}

.footer-links {
    display: flex;
    justify-content: space-between;
    gap: 30px;
}

/* .footer-links a:hover {
    text-decoration: underline;
    text-underline-offset: 6px;
} */

.footer-title {
    font-family: var(--font-logo);
    font-style: italic;
    font-weight: 900;
    font-size: 1.5rem;
    opacity: 0.8;
    text-align: center;
}

/* --- KOMPONENTIT JA MUUT --- */
a {
    color: #fff;
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.8;
}

button {
    padding: 10px 20px;
    cursor: pointer;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 20px;
    transition: all 0.3s ease;
}

button:hover {
    background-color: #000;
    color: #fff;
    outline: 2px solid #fff;
}

/* Korjattu valitsin: lisätty pilkku */
.gdpr p, 
.rules p {
    margin-bottom: 24px;
}

.list {
    margin: 20px 0 40px 20px;
}

.list li {
    list-style-type: disc;
    margin-bottom: 10px;
}

.sub-list {
    margin-top: 10px;
    margin-left: 24px;
}

.sub-list li {
    list-style-type: decimal;
}

/* SPECIFIC BUTTONS */
.leaderboard-filter button {
    border: 1px solid #aaa;
    width: 150px !important;
}

#main-filter-btn {
    border: 1px solid #aaa;
    width: 200px !important;
}

#main-filter-panel {
    border-radius: 10px;
    text-align: center;
}

.logo-link {
    margin-right: 16px;
}

@media (max-width: 600px) {
    #main-filter-btn {
        text-align: center;
        font-size: 1.2rem;
        width: 140px !important;
        padding: 10px;
    }
    .leaderboard-filter button  {
        font-size: 1.2rem;
        width: 120px !important;
        padding: 10px;
    }
}
