/**
 * style.css
 * 
 * Egendefinert styling for lotto-simulatoren.
 * Inspirert av norsk lotto sitt visuelle uttrykk med røde farger og kuler.
 */

/* ============================================================
   GENERELT
   ============================================================ */

body {
    background-color: #f0f2f5; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.lotto-tittel {
    color: #fff;
    font-weight: 800;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Hvite kort som inneholder innhold */
.lotto-kort {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* ============================================================
   LOTTO REKKER
   ============================================================ */

.lotto-rekke {
    display: flex;
    align-items: center;
    padding: 8px 4px;
    border-bottom: 1px solid #f0f0f0;
    gap: 6px;
}

.lotto-rekke:last-child {
    border-bottom: none;
}

.lotto-rekke-tom {
    opacity: 0.5;
}

/* Rekke-nummer til venstre */
.rekke-nummer {
    font-size: 0.85rem;
    color: #999;
    min-width: 22px;
    text-align: right;
}

/* Container for kulene i en rekke */
.rekke-baller {
    display: flex;
    gap: 6px;
    flex: 1;
}

/* ============================================================
   LOTTO KULER (BALLER)
   ============================================================ */

.lotto-ball {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: default;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Rød kule – standard spillervalg */
.lotto-ball-roed {
    background: radial-gradient(circle at 35% 35%, #e8001e, #9c0013);
    color: #fff;
    box-shadow: 0 2px 6px rgba(156,0,19,0.4);
}

/* Tom kule – ikke fylt ut */
.lotto-ball-tom {
    background: #e9ecef;
    color: #adb5bd;
    border: 2px dashed #ced4da;
}

/* Gul/gull kule – treff mot trukne tall */
.lotto-ball-treff {
    background: radial-gradient(circle at 35% 35%, #ffd700, #b8860b);
    color: #333;
    box-shadow: 0 2px 8px rgba(255,215,0,0.6);
    transform: scale(1.1);
}

/* Kule med rød ring rundt – treff-markering i sanntid */
.lotto-ball-ring {
    box-shadow: 0 0 0 3px #c0001a, 0 2px 6px rgba(156,0,19,0.4);
}

/* Kule som treffer tilleggstallet – rosa farge */
.lotto-ball-tillegg-treff {
    background: rgba(255, 201, 206, 1);
    color: #333;
    box-shadow: 0 0 0 3px #c0001a, 0 2px 6px rgba(255,201,206,0.6);
    transform: scale(1.1);
}

/* Seiersrekke – grønn bakgrunn ved gevinst */
.lotto-rekke-seier {
    background-color: #d1f5d3;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}
.lotto-ball-tillegg {
    background: radial-gradient(circle at 35% 35%, #ff8c00, #cc6600);
    color: #fff;
    box-shadow: 0 2px 6px rgba(255,140,0,0.4);
}

/* Trukket kule (hvit) – vises i trekningsresultatet */
.lotto-ball-trukket {
    background: radial-gradient(circle at 35% 35%, #e8001e, #9c0013);
    color: #fff;
    box-shadow: 0 2px 6px rgba(156,0,19,0.4);
}

/* ============================================================
   TALL-RUTENETT (VELGER)
   ============================================================ */

.tall-rutenett {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

/* Knapp for hvert tall i rutenettet */
.tall-knapp {
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px solid #dee2e6;
    background: #f8f9fa;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.tall-knapp:hover {
    border-color: #c0001a;
    background: #fff5f5;
    color: #c0001a;
}

/* Valgt tall i rutenettet */
.tall-knapp.valgt {
    background: radial-gradient(circle at 35% 35%, #e8001e, #9c0013);
    border-color: #9c0013;
    color: #fff;
    transform: scale(1.05);
}

/* ============================================================
   HANDLINGSKNAPPER (BUNNEN AV REKKE-PANELET)
   ============================================================ */

.lotto-handlinger {
    color: #c0001a;
}

.btn-lotto-action {
    background: none;
    border: none;
    color: #c0001a;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.15s;
}

.btn-lotto-action:hover {
    background: #fff5f5;
}

/* Pluss-knapp for å legge til rekke */
.btn-legg-til {
    background: none;
    border: 2px solid #dee2e6;
    color: #adb5bd;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 1.1rem;
    line-height: 1;
}

.btn-legg-til:hover {
    border-color: #c0001a;
    color: #c0001a;
}

/* Slett-knapp for å fjerne en rekke */
.btn-slett-rekke {
    background: none;
    border: none;
    color: #adb5bd;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    transition: color 0.15s;
    font-size: 1rem;
    display: flex;
    align-items: center;
}

.btn-slett-rekke:hover {
    color: #c0001a;
}

/* ============================================================
   LABELS OG BADGES
   ============================================================ */

.lotto-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
}

.lotto-uke-badge {
    background: #c0001a;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}

/* ============================================================
   ØKONOMI-BOKSER
   ============================================================ */

.oekonomi-boks {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 10px 6px;
}

/* Rødt for minus, sort for pluss */
.netto-minus {
    color: #c0001a !important;
}

.netto-pluss {
    color: #198754 !important;
}

/* ============================================================
   HISTORIKK-TABELL
   ============================================================ */

#historikk-tabell td {
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Gevinst-rad i tabellen – fremhevet */
.historikk-gevinst-rad {
    background-color: #fff9e6 !important;
}

/* Jackpot-rad – 7 rette */
.historikk-jackpot-rad {
    background-color: #fff3cd !important;
    font-weight: bold;
}

/* ============================================================
   SEIERSMODAL
   ============================================================ */

.seiers-modal {
    border-radius: 20px;
    overflow: hidden;
    border: none;
    background: linear-gradient(135deg, #fff 0%, #fff5f5 100%);
    box-shadow: 0 20px 60px rgba(192,0,26,0.25);
}

.seiers-ikon {
    font-size: 4rem;
    line-height: 1;
}

.seiers-tittel {
    color: #c0001a;
    font-weight: 800;
    font-size: 2rem;
}

.seiers-undertittel {
    color: #666;
    font-size: 1rem;
    margin-bottom: 0;
}

/* Vinnertallene – store og tydelige */
.seiers-tall {
    font-size: 1.6rem;
    font-weight: 800;
    color: #333;
    letter-spacing: 2px;
}

.seiers-statistikk {
    font-size: 0.85rem;
    color: #888;
}

/* Ny rad som legges til i tabellen */
@keyframes fadeInnRad {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.historikk-ny-rad {
    animation: fadeInnRad 0.3s ease forwards;
}

/* Puls-animasjon for treff-markering */
@keyframes pulsRing {
    0%   { box-shadow: 0 0 0 0px rgba(192,0,26,0.6); }
    100% { box-shadow: 0 0 0 6px rgba(192,0,26,0); }
}

.lotto-ball-puls {
    animation: pulsRing 0.6s ease-out;
}

/* ============================================================
   RESPONSIV TILPASNING
   ============================================================ */

@media (max-width: 576px) {
    .lotto-ball {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }

    .tall-rutenett {
        grid-template-columns: repeat(6, 1fr);
    }
}