* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    font-family: 'Segoe UI', Arial, sans-serif;
    background-image: linear-gradient(rgba(0, 0, 40, 0.75), rgba(0, 0, 40, 0.85)), url(Eurojackpot.webp);
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    color: #fff;
}

.hidden {
    display: none !important;
}

/* ================= HLAVIČKA ================= */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 25px;
    background: rgba(0, 0, 60, 0.6);
    border-bottom: 3px solid gold;
    flex-wrap: wrap;
}

.logo img {
    width: 130px;
    display: block;
}

.jackpot-box {
    text-align: center;
}

.jackpot-title {
    font-size: 18px;
    letter-spacing: 6px;
    color: gold;
}

.jackpot-value {
    font-size: 42px;
    font-weight: bold;
    color: yellow;
    text-shadow: 3px 3px 4px black;
}

.stats-box {
    text-align: right;
    font-size: 16px;
    line-height: 1.6;
}

.stats-box .loss strong {
    color: #ff6666;
    font-size: 20px;
}

#resetStats {
    margin-top: 4px;
    background: transparent;
    color: #aaa;
    border: 1px solid #555;
    border-radius: 6px;
    padding: 2px 10px;
    cursor: pointer;
}

#resetStats:hover {
    color: #fff;
    border-color: #fff;
}

/* ================= SPOLOČNÉ ================= */
main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 25px 20px 60px;
}

h1, h2 {
    text-align: center;
    color: yellow;
    text-shadow: 4px 4px 4px black;
    margin-bottom: 20px;
}

h1 { font-size: 52px; }
h2 { font-size: 34px; }

.draw-date {
    font-size: 18px;
    color: #fff;
    text-shadow: 2px 2px 3px black;
}

button {
    cursor: pointer;
    font-family: inherit;
}

/* lišta s tiketmi čakajúcimi na žrebovanie */
.pending-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin: 0 auto 18px;
    padding: 10px 18px;
    max-width: 700px;
    background: rgba(255, 215, 0, 0.15);
    border: 2px dashed gold;
    border-radius: 12px;
    font-size: 17px;
    color: gold;
}

.pending-bar button {
    background: gold;
    color: #001;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 15px;
    font-weight: bold;
}

.pending-bar button:hover { background: #ffe34d; }

/* ================= TIKET ================= */
.ticket {
    background: rgba(255, 255, 255, 0.95);
    color: #001;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

/* prepínač jednoduchá / systémová stávka */
.mode-switch {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.mode-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 2px solid #0033cc;
    border-radius: 10px;
    font-size: 17px;
    cursor: pointer;
    user-select: none;
}

.mode-option:has(input:checked) {
    background: #0033cc;
    color: #fff;
}

.mode-option input { accent-color: yellow; }

.mode-option small { opacity: 0.75; }

.system-info {
    text-align: center;
    margin-top: 12px;
    font-size: 16px;
    font-weight: bold;
    color: #0033cc;
}

.sys-badge {
    display: inline-block;
    background: #0033cc;
    color: yellow;
    font-size: 12px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 6px;
    margin-left: 6px;
    white-space: nowrap;
}

.pick-area {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.pick-hint {
    margin-bottom: 8px;
    color: #002;
}

.grid {
    display: grid;
    gap: 6px;
}

.main-grid { grid-template-columns: repeat(10, 44px); }
.euro-grid { grid-template-columns: repeat(4, 44px); }

.num {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #003;
    background: #fff;
    font-size: 17px;
    font-weight: bold;
    transition: transform 0.1s, background 0.15s;
}

.num:hover { transform: scale(1.12); }

.num.selected {
    background: #0033cc;
    color: #fff;
}

.euro-num { border-color: #b8860b; }

.euro-num.selected {
    background: gold;
    color: #001;
}

.tip-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 18px 0 10px;
    flex-wrap: wrap;
}

.tip-actions button {
    font-size: 17px;
    padding: 8px 18px;
    border-radius: 10px;
    border: none;
    background: #0033cc;
    color: #fff;
}

.tip-actions button:hover:not(:disabled) { background: #0050ff; }

.tip-actions button:disabled {
    background: #999;
    cursor: not-allowed;
}

/* zoznam tipov na tikete */
.tip-list { margin-top: 10px; }

.tip-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-bottom: 1px dashed #99a;
    flex-wrap: wrap;
}

.tip-letter {
    font-weight: bold;
    font-size: 20px;
    width: 28px;
    color: #0033cc;
}

.mini-ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #003;
    font-weight: bold;
    font-size: 15px;
    color: #001;
}

.mini-ball.euro {
    background: gold;
    border-color: #b8860b;
}

.mini-ball.hit {
    background: #1db954;
    border-color: #0a7a33;
    color: #fff;
}

.mini-ball.euro.hit {
    background: #1db954;
    border-color: #0a7a33;
    color: #fff;
}

.mini-ball.miss {
    opacity: 0.45;
}

.plus {
    font-weight: bold;
    margin: 0 4px;
    color: #444;
}

.remove-tip {
    margin-left: auto;
    background: transparent;
    border: none;
    color: #c00;
    font-size: 18px;
}

.submit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
    flex-wrap: wrap;
    gap: 12px;
}

.price { font-size: 20px; }

.price-note {
    font-size: 14px;
    color: #555;
}

#submitTicket {
    font-size: 26px;
    padding: 12px 35px;
    border-radius: 14px;
    border: none;
    color: yellow;
    background: #0033cc;
    animation: pulse 1s infinite alternate;
}

#submitTicket:disabled {
    background: #999;
    color: #ddd;
    animation: none;
    cursor: not-allowed;
}

#submitTicket:hover:not(:disabled) {
    background: yellow;
    color: #0033cc;
}

/* info panely */
.info-panel {
    margin-top: 18px;
    background: rgba(0, 0, 60, 0.7);
    border: 1px solid #446;
    border-radius: 12px;
    padding: 12px 18px;
}

.info-panel summary {
    cursor: pointer;
    font-size: 18px;
    color: gold;
}

.prize-row {
    display: grid;
    grid-template-columns: 110px 90px 1fr 130px;
    gap: 6px;
    padding: 5px 0;
    border-bottom: 1px solid #334;
    align-items: center;
}

.prize-row strong { text-align: right; }

.prize-head {
    font-weight: bold;
    color: gold;
    border-bottom: 2px solid gold;
}

.sanca { color: #aab; font-size: 14px; }

.prize-note {
    margin-top: 12px;
    font-size: 14px;
    color: #8fda9f;
}

/* reálne výsledky */
.real-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 12px 0;
}

.real-toolbar button {
    background: #0033cc;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 15px;
}

.real-toolbar button:hover { background: #0050ff; }

.real-status { color: #aab; font-size: 14px; }

.real-source {
    margin-top: 10px;
    font-size: 12px;
    color: #778;
}

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.real-listina { color: #fff; }

.real-listina th { background: rgba(0, 51, 204, 0.8); }

.real-listina td { border-bottom: 1px solid #334; }

.mini-ball.small {
    width: 28px;
    height: 28px;
    font-size: 13px;
}

.history-row {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 0;
    border-bottom: 1px solid #334;
    flex-wrap: wrap;
}

.history-date {
    width: 150px;
    font-size: 14px;
    color: #bbc;
}

.history-joker {
    margin-left: 8px;
    color: gold;
    font-weight: bold;
    font-size: 14px;
}

.prize-joker-title {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 2px solid gold;
    color: gold;
    font-weight: bold;
}

.history-money { margin-left: auto; font-weight: bold; }
.history-money.win { color: #4dff88; }
.history-money.lose { color: #ff8080; }

.empty { color: #aab; }

/* ================= ŽREBOVANIE ================= */
.table {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin: 50px 0 40px;
    flex-wrap: wrap;
}

.ball {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    color: black;
    background: rgba(255, 255, 255, 0.25);
    border: 3px dashed rgba(255, 255, 255, 0.5);
    font-size: 68px;
    font-weight: bold;
    transition: transform 0.4s;
}

.ball.euro { border-color: rgba(255, 215, 0, 0.6); }

.ball.revealed {
    background: #fff;
    border: 3px solid black;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7);
}

.ball.euro.revealed { background: gold; }

.ball.pulse { transform: scale(1.25); }

/* animácia losovania — guľa sa "točí v bubne" */
.ball.spinning {
    background: rgba(255, 255, 255, 0.85);
    border: 3px solid #003;
    color: #778;
    animation: drum-spin 0.35s linear infinite;
    filter: blur(0.6px);
}

.ball.euro.spinning {
    background: rgba(255, 223, 70, 0.9);
    border-color: #b8860b;
}

@keyframes drum-spin {
    0%   { transform: rotate(-8deg) translateY(-6px) scale(1.05); }
    25%  { transform: rotate(0deg)  translateY(4px)  scale(0.97); }
    50%  { transform: rotate(8deg)  translateY(-4px) scale(1.03); }
    75%  { transform: rotate(0deg)  translateY(6px)  scale(0.98); }
    100% { transform: rotate(-8deg) translateY(-6px) scale(1.05); }
}

/* ================= JOKER ================= */
.joker-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding: 12px 16px;
    background: #fff4cc;
    border: 2px dashed #b8860b;
    border-radius: 12px;
}

.joker-check {
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.joker-check input {
    width: 22px;
    height: 22px;
    accent-color: #b8860b;
    cursor: pointer;
}

.joker-number {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.joker-digits { display: inline-flex; gap: 4px; }

.jchar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 34px;
    background: #fff;
    border: 2px solid #b8860b;
    border-radius: 6px;
    font-weight: bold;
    font-size: 18px;
    color: #001;
}

.jchar.hit {
    background: #1db954;
    border-color: #0a7a33;
    color: #fff;
}

.jchar.miss { opacity: 0.45; }

#jokerRegen {
    background: #b8860b;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    padding: 5px 12px;
}

#jokerRegen:hover { background: #d4a017; }

/* Joker v žrebovaní */
.joker-draw {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin: 0 0 35px;
}

.joker-title {
    font-size: 34px;
    font-weight: bold;
    color: gold;
    text-shadow: 3px 3px 4px black;
    letter-spacing: 4px;
}

.joker-balls { display: flex; gap: 10px; }

.jdigit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 76px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.25);
    border: 3px dashed rgba(255, 215, 0, 0.6);
    font-size: 44px;
    font-weight: bold;
    color: black;
}

.jdigit.revealed {
    background: gold;
    border: 3px solid black;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}

.jdigit.spinning {
    background: rgba(255, 223, 70, 0.9);
    border: 3px solid #b8860b;
    color: #776;
    animation: reel-spin 0.25s linear infinite;
    filter: blur(0.6px);
}

@keyframes reel-spin {
    0%   { transform: translateY(-5px); }
    50%  { transform: translateY(5px); }
    100% { transform: translateY(-5px); }
}

.podane-info {
    text-align: center;
    font-size: 18px;
    color: gold;
    text-shadow: 2px 2px 3px black;
    margin-top: -8px;
}

.draw-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

#startDraw, #newTicket {
    display: block;
    margin: 0 auto;
    font-size: 32px;
    padding: 12px 40px;
    border-radius: 15px;
    border: none;
    color: yellow;
    background: #0033cc;
    animation: pulse 1s infinite alternate;
}

#startDraw { margin: 0; }

#startDraw:hover, #newTicket:hover {
    background: yellow;
    color: #0033cc;
}

#dalsiTiket {
    font-size: 20px;
    padding: 12px 22px;
    border-radius: 12px;
    border: 2px dashed gold;
    background: transparent;
    color: gold;
}

#dalsiTiket:hover {
    background: gold;
    color: #001;
}

@keyframes pulse {
    0%   { transform: scale(1); }
    100% { transform: scale(1.07); }
}

/* výsledky */
.results {
    background: rgba(255, 255, 255, 0.95);
    color: #001;
    border-radius: 16px;
    padding: 20px;
    margin: 25px 0;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

/* výsledná listina */
.listina-title {
    text-align: center;
    font-size: 24px;
    letter-spacing: 2px;
    color: #0033cc;
    margin-bottom: 14px;
}

.listina-drawn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    font-size: 17px;
}

.listina-joker {
    margin-left: 15px;
    font-size: 18px;
    color: #b8860b;
    letter-spacing: 2px;
}

.listina {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

.listina th {
    background: #0033cc;
    color: #fff;
    padding: 8px 10px;
    text-align: left;
}

.listina td {
    padding: 8px 10px;
    border-bottom: 1px solid #ccd;
    vertical-align: middle;
}

.listina td .mini-ball { margin: 1px; }

.listina .center { text-align: center; }

.listina .money {
    text-align: right;
    font-weight: bold;
    white-space: nowrap;
}

.listina tr.winner { background: rgba(29, 185, 84, 0.15); }

.listina tr.ticket-head td {
    background: #dfe7ff;
    color: #0033cc;
    font-weight: bold;
    font-size: 15px;
    letter-spacing: 1px;
    border-top: 3px solid #0033cc;
}

.listina tr.winner .money { color: #0a7a33; }

.joker-mini {
    font-weight: bold;
    color: #b8860b;
    letter-spacing: 1px;
    margin-right: 6px;
}

.listina-summary {
    display: flex;
    justify-content: space-around;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding: 12px;
    background: #eef2ff;
    border-radius: 10px;
    font-size: 18px;
}

.listina-summary .plus-b strong { color: #0a7a33; }
.listina-summary .minus-b strong { color: #b00020; }

.total {
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    margin-top: 18px;
}

.total.win { color: #0a7a33; }
.total.lose { color: #b00020; }

.total.jackpot-win {
    font-size: 36px;
    color: #b8860b;
    animation: pulse 0.6s infinite alternate;
}

/* ================= RESPONZIVITA ================= */

/* tablety a menšie notebooky */
@media (max-width: 900px) {
    h1 { font-size: 40px; }
    h2 { font-size: 28px; }
    .jackpot-value { font-size: 32px; }
    .ball { width: 100px; height: 100px; font-size: 52px; }
    .main-grid { grid-template-columns: repeat(10, 38px); }
    .euro-grid { grid-template-columns: repeat(6, 38px); }
    .num { width: 38px; height: 38px; font-size: 15px; }
}

/* mobily */
@media (max-width: 600px) {
    header {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 10px;
        text-align: center;
    }

    .logo img { width: 100px; }

    .jackpot-title { font-size: 14px; letter-spacing: 4px; }
    .jackpot-value { font-size: 26px; }

    .stats-box {
        text-align: center;
        font-size: 14px;
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        line-height: 1.4;
    }

    .stats-box .loss strong { font-size: 16px; }

    main { padding: 15px 8px 40px; }

    h1 { font-size: 26px; }
    h2 { font-size: 22px; }
    .draw-date { display: block; font-size: 14px; margin-top: 4px; }

    .ticket { padding: 12px 8px; border-radius: 12px; }

    .mode-option { font-size: 14px; padding: 7px 10px; }
    .mode-option small { display: none; }

    .pick-area { gap: 16px; }

    /* mriežka sa prispôsobí šírke displeja */
    .main-grid {
        grid-template-columns: repeat(10, minmax(0, 1fr));
        gap: 4px;
        width: 100%;
    }
    .euro-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 4px;
        width: 100%;
        max-width: 220px;
    }
    .pick-block { width: 100%; }
    .num {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        font-size: clamp(11px, 3.4vw, 15px);
    }

    .tip-actions { gap: 8px; }
    .tip-actions button { font-size: 15px; padding: 10px 12px; flex: 1 1 40%; }

    .mini-ball { width: 28px; height: 28px; font-size: 13px; }
    .mini-ball.small { width: 24px; height: 24px; font-size: 11px; }
    .tip-letter { font-size: 17px; width: 22px; }

    .joker-box { padding: 10px; justify-content: center; }
    .joker-check { font-size: 15px; }
    .jchar { width: 22px; height: 28px; font-size: 15px; }

    .submit-row { justify-content: center; text-align: center; }
    .price { font-size: 17px; width: 100%; }
    #submitTicket { font-size: 22px; padding: 12px 28px; width: 100%; }

    .info-panel { padding: 10px 12px; }
    .info-panel summary { font-size: 16px; }

    .prize-row {
        grid-template-columns: 78px 60px 1fr 90px;
        font-size: 13px;
    }
    .sanca { font-size: 12px; }

    /* žrebovanie */
    .table { gap: 8px; margin: 25px 0 20px; }
    .ball {
        width: 62px;
        height: 62px;
        font-size: 32px;
        border-width: 2px;
    }

    .joker-draw { gap: 10px; flex-wrap: wrap; }
    .joker-title { font-size: 22px; letter-spacing: 2px; }
    .joker-balls { gap: 5px; }
    .jdigit { width: 40px; height: 52px; font-size: 28px; }

    #startDraw, #newTicket { font-size: 22px; padding: 12px 24px; width: 90%; }
    #startDraw { width: 100%; }
    .draw-actions { gap: 12px; }
    #dalsiTiket { font-size: 16px; width: 100%; }
    .podane-info { font-size: 15px; }
    .pending-bar { font-size: 15px; padding: 8px 10px; }

    .results { padding: 12px 8px; }
    .listina-title { font-size: 18px; }
    .listina { font-size: 13px; }
    .listina th, .listina td { padding: 6px 5px; }
    .listina-drawn { font-size: 14px; }
    .listina-summary { font-size: 15px; gap: 8px; }
    .total { font-size: 20px; }
    .total.jackpot-win { font-size: 24px; }

    .history-date { width: 100%; }
}
