/* ----------------------------- */
/* GRUNNLEGGENDE LAYOUT         */
/* ----------------------------- */

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #ffffff;
    color: #000000;
}

/* Skjuler elementer */
.hidden {
    display: none !important;
}

/* Header */
header {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 20px 0;
    background-color: #f3f4f6;
    border-bottom: 1px solid #dddddd;
}

header h1 {
    margin: 0;
}

/* Mørk/lys-knapp */
#theme-toggle {
    position: absolute;
    right: 20px;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background-color: #0055aa;
    color: #ffffff;
}

#theme-toggle:hover {
    background-color: #003f80;
}

/* Tilbake-lenke */
.back-link {
    display: block;
    text-align: center;
    margin-top: 15px;
    font-size: 15px;
    color: #0055aa;
}

/* Seksjoner */
section {
    max-width: 600px;
    margin: 30px auto;
    padding: 20px;
}

/* ----------------------------- */
/* STARTSKJERM                  */
/* ----------------------------- */

#setupBox {
    background: #f7f7f7;
    border-radius: 8px;
    box-shadow: 0 0 6px rgba(0,0,0,0.1);
}

#setupBox label {
    display: block;
    margin-top: 10px;
    font-weight: bold;
}

#setupBox select,
#setupBox input {
    width: 100%;
    padding: 8px 10px;
    margin-top: 5px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
    box-sizing: border-box;
}

/* ----------------------------- */
/* KNAPPER                      */
/* ----------------------------- */

button {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background-color: #2563eb;
    color: #ffffff;
    font-size: 15px;
    margin-top: 10px;
}

button:hover {
    background-color: #1d4ed8;
}

button.secondary {
    background-color: #6b7280;
}

button.secondary:hover {
    background-color: #4b5563;
}

button.finish {
    background-color: #d97706;
}

button.finish:hover {
    background-color: #b45309;
}

/* ----------------------------- */
/* POENGTAVLE                   */
/* ----------------------------- */

#gameBox {
    background: #f7f7f7;
    border-radius: 8px;
    box-shadow: 0 0 6px rgba(0,0,0,0.1);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: #ffffff;
}

th, td {
    padding: 10px;
    border-bottom: 1px solid #dddddd;
    text-align: left;
}

th {
    background: #e5e7eb;
}

tr:nth-child(even) {
    background: #f9fafb;
}

/* ----------------------------- */
/* ANIMASJON VED POENG          */
/* ----------------------------- */

.score-anim {
    animation: pop 0.25s ease-out;
}

@keyframes pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* ----------------------------- */
/* MODAL – SPILL FERDIG         */
/* ----------------------------- */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #ffffff;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    width: 80%;
    max-width: 350px;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

/* ----------------------------- */
/* MØRK MODUS                   */
/* ----------------------------- */

body.dark {
    background-color: #111111;
    color: #eeeeee;
}

body.dark header {
    background-color: #1e1e1e;
    border-bottom-color: #444444;
}

body.dark #setupBox,
body.dark #gameBox {
    background-color: #1e1e1e;
    box-shadow: 0 0 6px rgba(255,255,255,0.05);
}

body.dark select,
body.dark input {
    background-color: #2a2a2a;
    border-color: #444444;
    color: #eeeeee;
}

body.dark table {
    background-color: #111111;
}

body.dark th {
    background-color: #222222;
}

body.dark tr:nth-child(even) {
    background-color: #1a1a1a;
}

body.dark td,
body.dark th {
    border-bottom-color: #444444;
}

body.dark .summary,
body.dark #historyList li,
body.dark .modal-content {
    background-color: #1e1e1e;
    border-color: #444444;
}

body.dark button {
    background-color: #3b82f6;
    color: #000000;
}

body.dark button:hover {
    background-color: #2563eb;
}

body.dark #theme-toggle {
    background-color: #66aaff;
    color: #000000;
}

body.dark #theme-toggle:hover {
    background-color: #3b82f6;
}
