/* Základní reset a globální styly */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0f1a0e;
    color: #f0f0f0;
    padding: 20px;
}

.app {
    max-width: 1400px;
    margin: 0 auto;
}

/* Třísloupcový layout (frontend) – viz index.php */
.three-columns {
    display: flex;
    gap: 20px;
    min-height: 80vh;
}

.chat-col {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
}

.broadcast-col {
    flex: 1;
}

.right-col {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Chat panel */
.chat-panel {
    background: #1e2a1c;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.chat-header {
    background: #2c3e2b;
    padding: 12px;
    font-weight: bold;
    border-bottom: 1px solid #3e5a3c;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #1a2818;
    font-size: 0.9rem;
}

.chat-messages div {
    margin-bottom: 8px;
    word-break: break-word;
}

.chat-input {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #2c3e2b;
    border-top: 1px solid #3e5a3c;
}

.chat-input input {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 20px;
    background: #3a5538;
    color: white;
}

.chat-input button {
    padding: 8px 16px;
    background: #4caf50;
    border: none;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-input button:hover {
    background: #66bb6a;
}

/* Hlavička zápasu (frontend) */
.match-header {
    background: #1a2818;
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.team-info {
    flex: 1;
    text-align: center;
}

.team-info img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    background: white;
    border-radius: 50%;
    padding: 4px;
}

.score-clock {
    text-align: center;
    min-width: 180px;
}

.score {
    font-size: 2rem;
    font-weight: bold;
}

.penalty-count {
    font-size: 0.9rem;
    opacity: 0.8;
}

.clock {
    font-size: 1.2rem;
    font-family: monospace;
    font-weight: bold;
}

.period {
    font-size: 0.8rem;
    text-transform: uppercase;
}

.status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-left: 5px;
}

.blink {
    animation: blink-animation 1s step-start infinite;
}

@keyframes blink-animation {
    50% { opacity: 0; }
}

/* Hřiště */
#courtCanvas {
    width: 100%;
    height: auto;
    background: #2e7d32;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Tabulka událostí (frontend) */
.events-table {
    max-height: 300px;
    overflow-y: auto;
    background: #1a2818;
    border-radius: 12px;
    padding: 10px;
}

.events-table table {
    width: 100%;
    border-collapse: collapse;
}

.events-table th, .events-table td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid #2c3e2b;
}

.events-table th {
    background: #2c3e2b;
    position: sticky;
    top: 0;
}

/* Pravý sloupec (frontend) */
.upcoming-matches, .roster {
    background: #1a2818;
    border-radius: 12px;
    padding: 10px;
}

.upcoming-matches h3, .roster h3 {
    margin-top: 0;
    font-size: 1.1rem;
    border-bottom: 1px solid #2c3e2b;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.upcoming-match {
    background: #1e2a1c;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.upcoming-match:hover {
    background: #2c3e2b;
}

.roster ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.roster li {
    padding: 4px 0;
    border-bottom: 1px solid #2c3e2b;
    font-size: 0.9rem;
}

/* Nastavení (frontend) */
.settings-bar {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.settings-bar button, .settings-bar select {
    padding: 8px 16px;
    background: #2c3e2b;
    border: none;
    border-radius: 30px;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
}

.settings-bar button:hover {
    background: #3e5a3c;
}

/* MODAL (frontend) */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #2c3e2b;
    padding: 30px;
    border-radius: 24px;
    text-align: center;
    font-size: 2rem;
    animation: fadeIn 0.3s;
    color: #ffd966;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ============================ */
/* ADMIN STYLY (moderní) */
/* ============================ */

.admin-container {
    max-width: 1200px;
    margin: 20px auto;
    background: #1a2818;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.admin-nav {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    border-bottom: 1px solid #3e5a3c;
    padding-bottom: 12px;
}

.admin-nav a {
    background: #2c3e2b;
    padding: 8px 16px;
    border-radius: 30px;
    color: #e0e0e0;
    text-decoration: none;
    transition: all 0.2s;
}

.admin-nav a:hover {
    background: #4caf50;
    color: white;
    transform: translateY(-2px);
}

/* Tabulky */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #1a2818;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.data-table th, .data-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #2c3e2b;
}

.data-table th {
    background: #2c3e2b;
    font-weight: 600;
    color: #f0f0f0;
}

.data-table td {
    color: #d0d0d0;
}

/* Akční odkazy */
.actions a {
    display: inline-block;
    margin-right: 8px;
    padding: 4px 8px;
    background: #2c3e2b;
    color: #aaffaa;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.actions a:hover {
    background: #4caf50;
    color: white;
}

/* Formuláře */
.admin-form {
    background: #1a2818;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    border: 1px solid #2c3e2b;
}

.form-group {
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.form-group label {
    width: 150px;
    font-weight: 500;
}

.form-group input, .form-group select {
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #3e5a3c;
    background: #2c3e2b;
    color: white;
    flex: 1;
    min-width: 200px;
}

.btn {
    background: #4caf50;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
    margin-top: 8px;
}

.btn:hover {
    background: #66bb6a;
    transform: translateY(-1px);
}

.btn-red {
    background-color: #aa2e2e;
}
.btn-red:hover {
    background-color: #cc3c3c;
}

/* Chybové a úspěšné zprávy */
.error {
    background: #ffdddd;
    color: #d00;
    padding: 10px;
    margin: 10px 0;
    border-radius: 8px;
    border-left: 4px solid #d00;
}

.success {
    background: #ddffdd;
    color: #0a0;
    padding: 10px;
    margin: 10px 0;
    border-radius: 8px;
    border-left: 4px solid #0a0;
}

/* Inline formuláře (v events.php) */
.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Ovládací panel útoku (mobilní) */
.attack-pad {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.attack-left, .attack-right {
    flex: 1;
    text-align: center;
    background: #2c7a2c;
    padding: 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.attack-left:hover, .attack-right:hover {
    background: #3e9a3e;
}

/* Ovládací panel časovače */
.clock-controls {
    background: #2c3e2b;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
}

.clock-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
}

/* Modální okna v adminu */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #2c3e2b;
    padding: 20px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    color: white;
}

.modal-content h3 {
    margin-top: 0;
}

.modal-content select, .modal-content input {
    width: 100%;
    padding: 8px;
    margin: 8px 0;
    border-radius: 6px;
    border: none;
    background: #1a2818;
    color: white;
}

.modal-content button {
    margin-top: 10px;
}

.penalty-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.penalty-buttons button {
    background: #3e5a3c;
    padding: 8px;
}

.custom-penalty {
    margin-top: 10px;
}

/* Responzivita */
@media (max-width: 768px) {
    .three-columns {
        flex-direction: column;
    }
    .chat-col, .right-col {
        flex: auto;
    }
    .team-info img {
        width: 32px;
        height: 32px;
    }
    .score {
        font-size: 1.5rem;
    }
    .form-group {
        flex-direction: column;
        align-items: flex-start;
    }
    .form-group label {
        width: auto;
        margin-bottom: 4px;
    }
    .form-group input, .form-group select {
        width: 100%;
    }
}
/* Zvětšení tlačítek útoku na mobilu */
@media (max-width: 768px) {
    .attack-btn {
        font-size: 1.2rem;
        padding: 12px !important;
    }
    .btn-group .btn {
        padding: 8px 12px;
    }
}
.hidden {
    display: none !important;
}

#attackIndicator {
    font-size: 60px;
    text-align: center;
    margin: 10px 0;
}

#attackIndicator {
    font-size: 80px;
    font-weight: bold; /* podle chuti */
}