* {
    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;
}

.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;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 10px;
    margin-top: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-add {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: #fff;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(22, 163, 74, 0.35);
}

.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;
}

.btn-edit {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 8px 16px;
    font-size: 0.95em;
    margin-left: 10px;
}

.btn-edit:hover {
    background: rgba(255, 255, 255, 0.32);
    transform: translateY(-1px);
}

.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;
}

.btn-save-edit {
    background: rgba(16, 185, 129, 0.22);
    color: #fff;
    border: 1px solid rgba(16, 185, 129, 0.7);
    padding: 9px 18px;
}

.btn-save-edit:hover {
    background: rgba(16, 185, 129, 0.34);
}

.btn-cancel-edit {
    background: rgba(239, 68, 68, 0.2);
    color: #fff;
    border: 1px solid rgba(239, 68, 68, 0.7);
    padding: 9px 18px;
}

.btn-cancel-edit:hover {
    background: rgba(239, 68, 68, 0.34);
}

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

.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;
}

.btn-start {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    font-size: 1.1em;
    padding: 14px 36px;
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(34, 197, 94, 0.4);
}

.btn-start:disabled {
    background: #4b5563;
    transform: none;
    box-shadow: none;
    cursor: default;
}

.btn-cancel {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: #fff;
    font-size: 1em;
    padding: 14px 22px;
}

.btn-cancel:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.35);
}

.btn-cancel:disabled {
    background: #4b5563;
    transform: none;
    box-shadow: none;
    cursor: default;
}

.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;
}

.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%;
    }
}
