/* ================================================
   Timing Gara — admin + public risultati
   ================================================ */

/* ---- Admin ---- */
.crr-timing-wrap h1 { margin-bottom: 24px; }
.crr-timing-wrap h2 { font-size: 16px; font-weight: 600; margin: 0 0 12px; }

.crr-timing-controls {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 24px;
    margin-bottom: 24px;
}
.crr-btn-start {
    font-size: 22px !important;
    padding: 16px 48px !important;
    height: auto !important;
    background: #2e7d32 !important;
    border-color: #1b5e20 !important;
    border-radius: 6px !important;
    letter-spacing: .04em;
    display: block;
    margin-bottom: 12px;
}
.crr-btn-start:hover { background: #1b5e20 !important; }
.crr-btn-reset { color: #c62828 !important; border-color: #c62828 !important; margin-top: 12px; }
.crr-timing-hint { color: #666; font-size: 13px; margin-top: 8px; }
.crr-timing-status {
    font-size: 16px;
    font-weight: 600;
    padding: 14px 18px;
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2e7d32;
}
.crr-status-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #2e7d32;
    animation: crr-blink 1.2s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes crr-blink {
    0%,100%{opacity:1} 50%{opacity:.3}
}
.crr-elapsed-live { font-family: monospace; font-size: 14px; color: #555; }

/* Scanner */
.crr-scanner-panel {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 24px;
    margin-bottom: 24px;
}
#crr-scan-area {
    width: 100%;
    max-width: 380px;
    margin: 0 auto 16px;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}
#crr-qr-video { width: 100%; display: block; }
.crr-manual-input {
    display: flex;
    gap: 10px;
    align-items: center;
    max-width: 380px;
    margin: 0 auto;
}
.crr-manual-input input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}
.crr-scan-result {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    display: none;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}
.crr-scan-result.ok  { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.crr-scan-result.err { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }

/* Risultati admin */
.crr-results-panel {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 24px;
}
.crr-results-table td:first-child { font-weight: 700; }

/* ---- Risultati pubblici ---- */
.crr-risultati-wrap {
    font-family: 'Roboto', sans-serif;
    max-width: 700px;
    margin: 32px auto;
}
.crr-risultati-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.crr-risultati-title {
    font-size: 22px;
    font-weight: 600;
    color: #1a1713;
    margin: 0;
}
.crr-ris-start {
    font-size: 13px;
    color: #888;
}
.crr-ris-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    overflow: hidden;
    font-size: 15px;
}
.crr-ris-table thead tr { background: #1a1713; }
.crr-ris-table th {
    padding: 11px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: rgba(255,255,255,.7);
}
.crr-ris-table td {
    padding: 11px 16px;
    border-bottom: 1px solid #f0ece4;
    color: #312D27;
}
.crr-ris-table tr:last-child td { border-bottom: none; }
.crr-ris-table tr:hover td { background: #faf8f4; }
.crr-ris-primo td  { background: #fff8e1; }
.crr-ris-podio td  { background: #fafaf6; }
.crr-ris-pos  { width: 52px; text-align: center; font-size: 20px; }
.crr-ris-cat  { color: #888; font-size: 13px; }
.crr-ris-tempo {
    font-family: 'Courier New', monospace;
    font-size: 17px;
    font-weight: 700;
    color: #1a1713;
    letter-spacing: .03em;
}
.crr-ris-primo .crr-ris-tempo { color: #CC2D2D; }
.crr-ris-empty { color: #999; font-style: italic; text-align: center; padding: 32px 0; }
.crr-ris-footer { font-size: 12px; color: #bbb; text-align: right; margin-top: 10px; }
@media (max-width: 480px) {
    .crr-ris-cat { display: none; }
    .crr-ris-tempo { font-size: 15px; }
}

/* ---- Tab tappe ---- */
.crr-stage-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    width: fit-content;
}
.crr-tab-link {
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    text-decoration: none;
    background: #f9f9f9;
    border-right: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background .15s, color .15s;
}
.crr-tab-link:last-child { border-right: none; }
.crr-tab-link:hover { background: #f0f0f0; color: #222; }
.crr-tab-link.active { background: #1a1713; color: #fff; }
.crr-tab-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #2e7d32;
    display: inline-block;
}

/* ---- Split times nella classifica generale ---- */
.crr-ris-split {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #888;
    padding: 11px 16px;
}

/* Tappa terminata */
.crr-finished {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    color: #1565c0;
}
.crr-finished .crr-status-dot { background: #1565c0; animation: none; }
.crr-btn-finish { transition: background .15s; }

/* ---- Nascondi Categoria nella tabella timing su mobile ---- */
@media screen and (max-width: 782px) {
    table.crr-results-table th.col-cat,
    table.crr-results-table td.col-cat { display: none !important; }
}
