body {
    font-family: 'Roboto', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a1a;
    color: #ffffff;
    margin: 0;
    padding: 0;
    
    /* NYTT: For "sticky footer" layout */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, 
header h1,
.hero-content h2, 
.game-section > h2, 
.game-info h2,
.list-game-info h3,
.highscore-section h2 /* NYTT: La til tittel for toppliste */
{
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
}

header {
    background-color: #0d0d0d;
    padding: 0.5rem 1rem;
    border-bottom: 4px solid #ff4500;
    align-items: center;
    display: flex;
    justify-content: space-between; 
    
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
}

header button {
    background-color: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.logo-button {
    height: fit-content;
    width: fit-content;
    margin-right: 1rem;
}

.logo-button img {
    height: 4rem;
    width: 4rem;
    display: block;
}

h1 {
    font-size: 2.5rem;
    color: #ff4500;
    margin: 0;
}

.nav-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.nav-menu li {
    margin-left: 2rem;
}

.nav-menu a {
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    font-weight: bold;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: #ff4500;
}

/* Stil for aktivt menypunkt */
.hjem-side .nav-menu a[href="/"],
.alle-spill-side .nav-menu a[href="alle-spill.html"],
.kontakt-side .nav-menu a[href="kontakt.html"] {
    color: #ff4500;
}


.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 2rem;
    height: 2rem;
    z-index: 10;
}

.hamburger .bar {
    width: 2rem;
    height: 0.25rem;
    background-color: #fff;
    border-radius: 10px;
    transition: all 0.3s linear;
}


/* -------------------------- */
/* --- HERO SECTION (med video) --- */
/* -------------------------- */
.hero-section {
    height: 50vh; 
    max-height: 450px;
    min-height: 300px;
    position: relative;
    overflow: hidden; 
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 1rem;
    border-bottom: 4px solid #ff4500;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 1;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); 
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
}

.hero-content h2 {
    font-size: 2.5rem; 
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    margin: 0 0 1rem 0;
}

.hero-content p {
    font-size: 1.25rem;
    color: #cccccc;
    margin-bottom: 2rem;
    max-width: 600px;
}

.hero-button {
    background-color: #ff4500;
    color: #ffffff;
    padding: 0.8rem 1.8rem;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.hero-button:hover {
    background-color: #e03c00;
    transform: scale(1.05);
}


/* CONTAINER OG SPILLSEKSJON */

/* NY REGEL: Får <main> til å vokse */
main.container {
    flex-grow: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto; 
    padding: 0 1rem;
}

.game-section {
    margin: 2rem auto;
}

.game-section > h2 {
    font-size: 2.5rem; 
    color: #ff4500;
    margin-bottom: 1.5rem;
    text-align: left;
}

/* FORSIDE-RUTENETT (TOP 9) */
.game-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.game-item {
    background-color: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative; 
    height: 100%; 
    display: flex; 
    flex-direction: column;
}

.game-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.game-item::after {
    content: 'Spill Nå!';
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 188px; /* Matcher .game-item img */
    background-color: rgba(255, 69, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: scale(1.1);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.game-item:hover::after {
    opacity: 1;
    transform: scale(1);
}

.game-item img {
    width: 100%;
    height: 180px; /* Matcher ::after */
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block; /* FIKS: Hindrer et potensielt lite mellomrom under bildet */
}

.game-item:hover img {
    transform: scale(1.05);
}

.game-info {
    padding: 1.5rem;
    text-align: center;
    flex-grow: 1; 
}

.game-info h2 {
    font-size: 1.8rem;
    color: #ff4500;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.game-info p {
    font-size: 1rem;
    line-height: 1.6;
    color: #cccccc;
}

section a {
    text-decoration: none;
}

/* ---------------------------------- */
/* --- STILER FOR "ALLE SPILL" SIDEN --- */
/* ---------------------------------- */
.game-list-alphabetical {
    list-style: none;
    padding: 0;
    max-width: 1000px;
    margin: 2rem auto;
}

.list-game-item {
    background-color: #2a2a2a;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    padding: 1rem;
    transition: background-color 0.3s ease;
}

.list-game-item:hover {
    background-color: #3a3a3a;
}

.list-game-icon {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 1.5rem;
    flex-shrink: 0;
}

.list-game-info {
    flex-grow: 1;
}

.list-game-info h3 {
    color: #ff4500;
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
}

.list-game-info p {
    margin: 0;
    color: #cccccc;
    font-size: 0.9rem;
}

.list-game-button {
    background-color: #ff4500;
    color: #fff;
    padding: 0.6rem 1.2rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    margin-left: 1rem;
    flex-shrink: 0;
    text-align: center;
}

.list-game-button:hover {
    background-color: #e03c00;
}


/* ---------------------------------- */
/* --- NYTT: TOPPLISTE-SEKSJON --- */
/* ---------------------------------- */
.highscore-section {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 2rem;
    margin: 3rem auto; /* Gir litt luft over og under */
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.highscore-section h2 {
    /* Font-familie og vekt er satt globalt */
    font-size: 2.5rem;
    color: #ff4500;
    margin-top: 0;
    margin-bottom: 0.5rem;
    text-align: center;
}

.highscore-section p {
    text-align: center;
    color: #cccccc;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.highscore-list {
    list-style: none; /* Fjerner standard tall */
    padding: 0;
    margin: 0;
    counter-reset: highscore-counter; /* Starter en teller */
}

.highscore-list li {
    background-color: #3a3a3a;
    border-radius: 5px;
    padding: 1rem 1.5rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.1rem;
    transition: background-color 0.3s ease;
}

.highscore-list li:hover {
    background-color: #4a4a4a;
}

/* Legger til egne tall for rangering */
.highscore-list li::before {
    counter-increment: highscore-counter;
    content: counter(highscore-counter) ".";
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #ff4500;
    margin-right: 1.5rem;
    min-width: 2rem; /* Gir lik plassering */
}

.highscore-list .player-name {
    font-weight: bold;
    color: #ffffff;
    flex-grow: 1;
    text-align: left;
}

.highscore-list .game-name {
    color: #cccccc;
    margin: 0 1.5rem;
    font-size: 0.95rem;
    text-align: right;
    flex-shrink: 0; /* Hindrer at den krymper */
}

.highscore-list .score {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: #ff4500;
    font-size: 1.3rem;
    min-width: 80px; /* Gir lik justering for poeng */
    text-align: right;
}

/* ------------------------------------- */
/* --- RESPONSIV DESIGN --- */
/* ------------------------------------- */

/* NETTBRETT (mellom 601px og 900px) */
@media (max-width: 900px) {
    .logo-button img {
        height: 3.5rem; 
        width: 3.5rem;
    }
    h1 { font-size: 2rem; }
    .nav-menu a {
        font-size: 0.9rem;
        margin-left: 1.5rem;
    }
    .hero-content h2 { font-size: 2.2rem; }
    .hero-content p { font-size: 1.1rem; }
    .game-section > h2 { font-size: 2.2rem; }
    
    .game-list {
        grid-template-columns: repeat(2, 1fr);
    }

    /* NYTT: Toppliste nettbrett */
    .highscore-list .game-name {
        margin: 0 1rem;
    }
}


/* MOBIL (600px og mindre) */
@media (max-width: 600px) {
    header { padding: 0.5rem 1rem; }
    .logo-button img { height: 3rem; width: 3rem; }
    h1 { font-size: 1.5rem; }

    .nav-menu {
        display: none; position: absolute; top: 100%; left: 0;
        width: 100%; background-color: #0d0d0d;
        border-bottom: 2px solid #ff4500;
    }
    .nav-menu.open { display: block; }
    .nav-menu ul { 
        flex-direction: column; 
        width: 100%; 
        padding: 0; 
    }
    
    /* --- FIKS FOR MOBILMENY-LINJE --- */
    .nav-menu li { 
        margin: 0; 
        text-align: center; 
        border-top: 1px solid #2a2a2a; /* Flyttet borden hit */
    }
    /* Fjerner kantlinjen over det første elementet */
    .nav-menu li:first-child {
        border-top: none;
    }
    .nav-menu a {
        display: block; 
        padding: 1.5rem;
        /* border-top: 1px solid #2a2a2a; <-- Fjernet herfra */
        font-size: 1.1rem;
        margin: 0;
    }
    /* --- SLUTT PÅ FIKS --- */


    .hamburger { display: flex; }
    .hamburger.open .bar:nth-child(1) { transform: rotate(45deg) translate(0.5rem, 0.6rem); }
    .hamburger.open .bar:nth-child(2) { opacity: 0; }
    .hamburger.open .bar:nth-child(3) { transform: rotate(-45deg) translate(0.5rem, -0.6rem); }

    .hero-content h2 { font-size: 2rem; }
    .hero-content p { font-size: 1rem; }
    .game-section > h2 { font-size: 1.8rem; }
    .game-info h2 { font-size: 1.4rem; }
    .game-info p { font-size: 0.9rem; }
    footer { font-size: 0.9em; padding: 1.5rem; }

    .game-list {
        grid-template-columns: 1fr;
    }

    .list-game-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .list-game-icon {
        width: 100%;
        height: 180px;
        margin-right: 0;
        margin-bottom: 1rem;
    }
    .list-game-button {
        margin-left: 0;
        margin-top: 1rem;
        width: 100%;
        width: fit-content;
    }

    /* NYTT: Responsiv toppliste */
    .highscore-section {
        padding: 1.5rem;
        margin-top: 2rem;
    }
    .highscore-section h2 {
        font-size: 2rem;
    }
    .highscore-list li {
        flex-wrap: wrap; /* Lar elementer bryte */
        padding: 1rem;
        justify-content: flex-start;
    }
    .highscore-list li::before {
        font-size: 1.3rem;
        margin-right: 1rem;
        min-width: 1.5rem;
    }
    .highscore-list .player-name {
        flex-basis: calc(100% - 3rem); /* Tar resten av plassen ved siden av tallet */
        flex-grow: 0;
    }
    .highscore-list .game-name {
        flex-basis: 100%; /* Bryter til ny linje */
        margin: 0.25rem 0 0 2.5rem; /* Indenterer under navnet */
        text-align: left;
        color: #cccccc; 
        font-size: 0.9rem;
    }
    .highscore-list .score {
        flex-basis: 100%; /* Bryter til ny linje */
        text-align: right;
        margin-top: 0.5rem;
        font-size: 1.5rem;
        min-width: auto;
    }
}


/* ---------------------------------- */
/* --- STILER FOR KONTAKT-SIDEN --- */
/* ---------------------------------- */

/* NYTT: Sentrerer innholdet i <main> KUN på kontaktsiden */
.kontakt-side main.container {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Vertikal sentrering */
    align-items: center; /* Horisontal sentrering */
}

.contact-section {
    background-color: #2a2a2a;
    padding: 2rem 3rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    
    /* ENDRET: margin og width for sentrering */
    margin: 0; 
    max-width: 800px;
    width: 100%; /* Respekterer padding i .container */
}

.contact-section h2 {
    font-size: 2.5rem;
    color: #ff4500;
    margin-top: 0;
    margin-bottom: 1rem;
}

.contact-section p {
    font-size: 1.2rem;
    line-height: 1.6;
    color: #cccccc;
    margin-bottom: 1.5rem;
}

.contact-section .contact-email-link {
    font-size: 1.3rem;
    font-weight: bold;
}

.contact-section .contact-email-link a {
    color: #ff4500;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-section .contact-email-link a:hover {
    color: #fff;
    text-decoration: underline;
}

@media (max-width: 600px) {
    .contact-section {
        padding: 1.5rem;
    }
    .contact-section h2 {
        font-size: 2rem;
    }
    .contact-section p {
        font-size: 1rem;
    }
    .contact-section .contact-email-link {
        font-size: 1.1rem;
    }
}


/* ---------------------------------- */
/* --- EGENDESIGNET SCROLLBAR --- */
/* ---------------------------------- */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: #1a1a1a;
}
::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: #ff4500;
}