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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 30px;
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 10px;
    font-size: 2.5em;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    min-width: 220px;
    border: 2px solid #dbe3ff;
    border-radius: 10px;
    background: #f8faff;
    color: #3f4a7a;
    font-size: 1em;
    font-weight: 700;
    padding: 11px 14px;
    cursor: pointer;
    transition: all 0.25s;
}

.tab-btn:hover {
    border-color: #aebdff;
    transform: translateY(-1px);
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: #fff;
    box-shadow: 0 6px 14px rgba(102, 126, 234, 0.28);
}

.enemy-summary {
    margin-bottom: 16px;
}

.enemy-rally-card {
    border-left-color: #ef4444;
}

.my-march-summary {
    margin-top: 20px;
    border-left-color: #16a34a;
}

.enemy-rally-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.enemy-rally-card-header h3 {
    margin-bottom: 0;
}

.enemy-remove-btn {
    white-space: nowrap;
}

.enemy-time-label {
    font-size: 0.9em;
}

.enemy-result-grid {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.enemy-result-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(33, 150, 243, 0.18);
    border-radius: 10px;
    padding: 16px;
}

.enemy-my-march-card {
    background: rgba(22, 163, 74, 0.08);
    border: 1px solid rgba(22, 163, 74, 0.2);
    border-radius: 10px;
    padding: 16px;
    margin-top: 16px;
}

.enemy-my-march-card h3 {
    color: #166534;
    margin-bottom: 10px;
}

.enemy-my-march-card p:last-child {
    margin-bottom: 0;
}

.enemy-target-highlight {
    display: inline-block;
    background: rgba(220, 38, 38, 0.12);
    color: #991b1b;
    border: 1px solid rgba(220, 38, 38, 0.28);
    border-radius: 999px;
    padding: 2px 10px;
    font-weight: 700;
}

.send-time-highlight {
    display: inline-block;
    background: rgba(37, 99, 235, 0.14);
    color: #1d4ed8;
    border: 1px solid rgba(37, 99, 235, 0.3);
    border-radius: 999px;
    padding: 2px 10px;
    font-weight: 700;
}

.enemy-result-card h3 {
    color: #1d4ed8;
    margin-bottom: 10px;
}

.enemy-result-card p:last-child {
    margin-bottom: 0;
}

.section {
    margin-bottom: 30px;
}

.hidden {
    display: none;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 600;
    color: #444;
    margin-bottom: 8px;
    font-size: 1.1em;
}

input[type="number"],
input[type="text"],
input[type="time"],
select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="number"]:focus,
input[type="text"]:focus,
input[type="time"]:focus,
select:focus {
    outline: none;
    border-color: #667eea;
}

.utc-option-group {
    margin-top: 4px;
}

.utc-option-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.utc-option-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.utc-checkbox-label {
    margin-bottom: 0;
    font-size: 1em;
    cursor: pointer;
}

.utc-help {
    display: block;
    margin-top: 6px;
    color: #6b7280;
    font-size: 0.9em;
}

.utc-results-panel {
    margin-bottom: 16px;
}

.utc-time-row {
    margin-bottom: 8px;
}

.utc-apply-btn {
    margin-top: 0;
}

.time-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.time-inputs input {
    width: 100%;
}

.leader-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.leader-card h3 {
    color: #667eea;
    margin-bottom: 15px;
}


.result-card {
    background: linear-gradient(135deg, #42a5f5 0%, #1e88e5 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.result-card.first {
    background: linear-gradient(135deg, #fb7185 0%, #e11d48 100%);
}

.result-card h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.result-card p {
    font-size: 1.1em;
    margin: 5px 0;
}

.result-card .badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.3);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    margin-top: 10px;
}


.result-card .inline-edit-grid {
    margin-top: 10px;
}

.result-card .inline-edit-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.result-card .inline-edit-grid label {
    font-size: 0.95em;
    color: rgba(255, 255, 255, 0.9);
}

.result-card .inline-edit-grid input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.result-card .inline-edit-grid input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.result-card .inline-edit-actions {
    margin-top: 8px;
    display: flex;
    gap: 10px;
}


.summary {
    background: #e7f3ff;
    border-left: 4px solid #2196F3;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

@media (max-width: 576px) {
    .enemy-rally-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .enemy-remove-btn {
        width: 100%;
    }
}

.summary h3 {
    color: #2196F3;
    margin-bottom: 10px;
}

.summary p {
    color: #333;
    font-size: 1.1em;
    margin: 5px 0;
}

.summary .leader-highlight {
    display: inline-block;
    margin-left: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #2196F3;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.summary .timeline-leader {
    margin: 0 6px;
}

.summary .leader-highlight.first-leader,
.summary .timeline-leader.first-leader {
    background: #e11d48;
    box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.25);
}

/* Countdown Timer Panel */
.countdown-panel {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
    border-left: 4px solid #764ba2;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.countdown-panel h3 {
    color: #c084fc;
    margin-bottom: 8px;
    font-size: 1.3em;
}

.countdown-hint {
    font-size: 1em;
    margin-bottom: 15px;
    color: #b0b0c0;
}

.timer-controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}


.leader-alert {
    margin: 14px 0 6px;
    padding: 12px 20px;
    background: rgba(239, 68, 68, 0.15);
    border: 2px solid #ef4444;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: 700;
    color: #fca5a5;
    transition: opacity 1s ease;
}

.leader-alert.hidden {
    display: none;
.btn-next {
    padding: 12px 34px;
    font-size: 1.05rem;
}
}

.leader-alert.alert-visible {
    display: block;
    opacity: 1;
}

.leader-alert.fade-out {
    opacity: 0;
}

.countdown-next {
    font-size: 1.05em;
    color: #94a3b8;
    margin: 14px 0 4px;
}

.countdown-timer {
    font-size: 3.5em;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 4px;
    margin: 4px 0 14px;
    font-variant-numeric: tabular-nums;
    font-family: 'Courier New', monospace;
}

.countdown-timer.target-hit {
    font-size: 1.6em;
    color: #4ade80;
    letter-spacing: 1px;
    font-family: inherit;
}

.leader-status-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 6px;
}

.leader-status-item {
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 0.95em;
    font-weight: 600;
    border: 2px solid transparent;
}

.leader-status-item.waiting {
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    border-color: #374151;
}

.leader-status-item.started {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border-color: #22c55e;
}

.footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
    text-align: center;
    color: #666;
}

.footer p {
    margin: 5px 0;
    font-size: 0.95em;
}

.footer strong {
    color: #667eea;
    font-size: 1.1em;
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .time-inputs {
        grid-template-columns: 1fr;
    }

    .tab-btn {
        min-width: 100%;
    }
}
