/* --- BOOTSTRAP BARVY --- */
.text-warning { color: #ffc107 !important; }
.text-light { color: #f8f9fa !important; }
.text-dark { color: #212529 !important; }
.bg-dark { background-color: #212529 !important; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #212529; /* Bootstrap Dark */
    color: #f8f9fa; /* Bootstrap Light */
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 15px;
    box-sizing: border-box;
}
h1 { margin: 0 0 10px 0; color: #f8f9fa; text-align: center; }

/* Obálka pro plátno a šipky */
.canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 800px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

/* Tlačítka pro přepínání pozadí */
.slider-arrow {
    background-color: rgba(33, 37, 41, 0.8);
    color: #ffc107;
    border: 2px solid #ffc107;
    font-size: 1.5em;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: absolute;
    z-index: 10;
    transition: 0.3s;
    padding: 0;
    line-height: 1;
}
.slider-arrow:hover {
    background-color: #ffc107;
    color: #212529;
}
#bg-prev { left: -70px; }
#bg-next { right: -70px; }

canvas {
    background-color: #343a40; 
    border: 3px solid #343a40; /* Temnější okraj */
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    cursor: crosshair;
    max-width: 100%;
    height: auto;
    touch-action: none;
    /* Pozadí se nyní kompletně řídí přes JavaScript */
}

.stats-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 800px;
    margin-bottom: 15px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}
.time-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.stat-box {
    background-color: #343a40; /* Bootstrap panel dark */
    padding: 8px 12px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    color: #f8f9fa;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
.time-box {
    justify-content: center;
    gap: 10px;
    border: 1px solid #ffc107;
}

.stat-box .val {
    font-weight: bold;
    font-family: 'Courier New', Courier, monospace; 
    font-size: 1.2em;
}

span.green { color: #4cd137; }
span.blue { color: #00a8ff; }
span.orange { color: #f39c12; }
span.red { color: #e74c3c; }
span.brown { color: #8d6e63; }

.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
    background-color: #343a40;
    padding: 10px 15px;
    border-radius: 8px;
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
}

/* Nástroje v liště */
.tool {
    background-color: #212529;
    color: #adb5bd;
    border: 2px solid transparent;
    opacity: 0.7;
    padding: 8px 12px;
}
.tool:hover {
    background-color: #2b3035;
    opacity: 1;
}
.tool.active {
    opacity: 1;
    border-color: #ffc107; /* Warning border */
    color: #f8f9fa;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.4);
}

.dashboard {
    display: flex;
    gap: 20px;
    background-color: #343a40;
    padding: 15px;
    border-radius: 8px;
    color: #f8f9fa;
    align-items: center;
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
    justify-content: space-between;
}
.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Tlačítka Bootstrap stylu */
button {
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}
.btn-warning {
    background-color: #ffc107;
    color: #212529;
}
.btn-warning:hover {
    background-color: #e0a800;
}
.btn-light {
    background-color: #f8f9fa;
    color: #212529;
}
.btn-light:hover {
    background-color: #e2e6ea;
}

/* --- STYLY PRO MODALY --- */
.modal-overlay {
    display: none; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px); 
}

.modal-content {
    background-color: #343a40;
    border: 2px solid #ffc107;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 25px;
    position: relative;
    color: #f8f9fa;
    box-shadow: 0 0 30px rgba(0,0,0,0.9);
}

.modal-content h2, .modal-content h3 {
    margin-top: 0;
    border-bottom: 1px solid rgba(255, 193, 7, 0.3);
    padding-bottom: 10px;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    color: #dc3545; /* Bootstrap danger */
    font-size: 1.5em;
    padding: 0;
}
.close-btn:hover {
    color: #bd2130;
    background: transparent;
    transform: scale(1.1);
}

/* Akordeon manuálu */
details {
    background-color: #212529;
    margin-bottom: 10px;
    border-radius: 6px;
    border: 1px solid #495057;
}
summary {
    padding: 12px 15px;
    font-weight: bold;
    cursor: pointer;
    list-style: none;
    user-select: none;
    font-size: 1.1em;
    color: #ffc107;
}
summary::-webkit-details-marker { display: none; }
summary:hover { background-color: #2b3035; }

.details-body {
    padding: 10px 15px 15px 15px;
    border-top: 1px solid #495057;
    font-size: 0.95em;
    line-height: 1.5;
}
.details-body ul { margin: 10px 0 0 0; padding-left: 20px; }
.details-body li { margin-bottom: 8px; }

/* Stylování žebříčku */
#leaderboardList li {
    background-color: #212529;
    margin-bottom: 8px;
    padding: 12px 15px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    font-size: 1.1em;
    border-left: 4px solid #ffc107;
}
#leaderboardList li:nth-child(1) { font-weight: bold; background-color: rgba(255, 193, 7, 0.15); }
#leaderboardList li:nth-child(2) { border-left-color: #c0c0c0; background-color: rgba(192, 192, 192, 0.1); }
#leaderboardList li:nth-child(3) { border-left-color: #cd7f32; background-color: rgba(205, 127, 50, 0.1); }

/* --- RESPONZIVITA --- */
@media (max-width: 950px) {
    /* Na menších monitorech vtáhneme šipky přes plátno dovnitř */
    #bg-prev { left: 10px; }
    #bg-next { right: 10px; }
}

@media (max-width: 768px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .toolbar { flex-wrap: wrap; justify-content: center; }
    .dashboard { flex-direction: column; gap: 15px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .time-grid { grid-template-columns: 1fr; }
}