:root {
    --bg-color: #0f0f11;
    --surface-color: #16161a;
    --border-color: #24242b;
    --text-main: #e4e4e7;
    --text-muted: #9a9aae;
    --accent: #8b5cf6;
    --accent-hover: #a78bfa;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 16px;
    display: flex;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 440px;
    margin-top: 20px;
}

.card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}

h2 {
    margin: 0 0 20px 0;
    font-size: 22px;
    font-weight: 600;
    text-align: center;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

input, select {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: #1e1e24;
    color: #fff;
    box-sizing: border-box;
    font-size: 16px;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
}

button {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    box-sizing: border-box;
}

button:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: #24242b;
    border: 1px solid #343440;
}

.btn-secondary:hover {
    background: #2d2d38;
}

.btn-link {
    background: transparent;
    color: var(--danger);
    font-weight: 500;
    margin-top: 15px;
}

.btn-link:hover {
    background: rgba(239, 68, 68, 0.05);
}

/* Экстренная большая круглая кнопка */
.btn-emergency {
    background: var(--danger);
    height: 140px;
    width: 140px;
    border-radius: 50%;
    margin: 30px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
}

.btn-emergency.active {
    background: var(--success);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
}

.toggle-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.toggle-link a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.status-msg {
    margin-top: 15px;
    font-size: 14px;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    display: none;
}

.hidden {
    display: none !important;
}

/* Блокирующее окно */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 17, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.attack-card {
    background: rgba(255, 255, 255, 0.03);
    border-left: 5px solid #fff;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    color: #e2e8f0;
}
/* Цветовая индикация интенсивности боли */
.intensity-1 { border-left-color: #2ecc71; } /* Легкая */
.intensity-2 { border-left-color: #f1c40f; } /* Средняя */
.intensity-3 { border-left-color: #e74c3c; } /* Тяжелая */

.attack-meta {
    font-size: 12px;
    color: #a0aec0;
    margin-top: 5px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.badge {
    background: rgba(255,255,255,0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.trigger-chip.selected {
  background: var(--accent, #6246ea) !important;
  border-color: var(--accent, #6246ea) !important;
  color: #fff !important;
}
.trigger-chip:active {
  transform: scale(0.95);
}