* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #eef2f7 0%, #e0e9f3 100%);
    color: #2c3e50;
    min-height: 100vh;
}

/* ---------- Экраны ---------- */
.screen { display: none; }
.screen.active { display: block; animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.quiz-app {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* ---------- Старт ---------- */
.hero {
    text-align: center;
    padding: 70px 30px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    margin-top: 60px;
}
.hero h1 { font-size: 36px; margin: 0 0 16px; }
.hero .lead { font-size: 18px; color: #6a7d8c; margin-bottom: 12px; }
.hero .hero-sub { font-size: 15px; color: #8a9ba8; margin-bottom: 32px; }

/* ---------- Кнопки ---------- */
.btn-primary {
    background: linear-gradient(135deg, #4a90d9, #357abd);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(74, 144, 217, 0.3);
    transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(74, 144, 217, 0.4); }
.btn-primary.btn-large { padding: 16px 40px; font-size: 18px; }

.btn-secondary {
    background: #fff;
    color: #4a90d9;
    border: 2px solid #4a90d9;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-secondary:hover { background: #eef5fb; }

/* ---------- Прогресс ---------- */
.quiz-progress-wrap { margin: 20px 0 30px; }
.quiz-progress-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: #6a7d8c;
}
.quiz-progress-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    overflow: hidden;
}
#quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a90d9, #64b5f6);
    border-radius: 4px;
    transition: width 0.4s ease;
    width: 0%;
}

/* ---------- Карточка вопроса ---------- */
.card-scene {
    perspective: 1400px;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.question-card {
    width: 100%;
    max-width: 700px;
    min-height: 340px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    backface-visibility: hidden;
    transform: rotateY(0deg);
}

.question-number {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #4a90d9;
    font-weight: 700;
    margin-bottom: 16px;
}

.question-text {
    font-size: 22px;
    line-height: 1.5;
    font-weight: 500;
    color: #2c3e50;
    flex: 1;
    display: flex;
    align-items: center;
}

.answer-buttons {
    display: flex;
    gap: 16px;
    margin-top: 30px;
}

.btn-answer {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.btn-yes {
    background: linear-gradient(135deg, #4caf50, #388e3c);
    color: #fff;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}
.btn-no {
    background: linear-gradient(135deg, #e0e0e0, #bdbdbd);
    color: #2c3e50;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.btn-answer:hover { transform: translateY(-2px); }
.btn-answer:active { transform: scale(0.98); }

/* ---------- Результат ---------- */
.result-wrap {
    background: #fff;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    margin-top: 40px;
}
.result-wrap h2 {
    text-align: center;
    margin: 0 0 24px;
    font-size: 28px;
}
.result-subtitle {
    font-size: 15px;
    color: #6a7d8c;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 24px 0 12px;
}

.prediction-result {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border-radius: 16px;
    border: 1px solid #c8e6c9;
}
.winner-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #558b2f;
    margin-bottom: 8px;
}
.winner-name {
    font-size: 24px;
    font-weight: 700;
    color: #33691e;
    margin-bottom: 8px;
}
.winner-confidence {
    font-size: 15px;
    color: #558b2f;
}

/* ---------- Полоски классов ---------- */
#classes-list { margin-bottom: 24px; }
.class-item {
    background: #f9fafb;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
}
.class-item .class-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}
.progress-bg {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a90d9, #64b5f6);
    transition: width 0.6s ease;
}

/* ---------- Сохранение ---------- */
.save-row {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 12px;
}
.save-row select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #d0d7de;
    font-size: 14px;
    background: #fff;
    max-width: 320px;
}

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

/* ---------- Админка ---------- */
.admin-panel {
    max-width: 1200px;
    margin: 60px auto 40px;
    padding: 0 20px;
}
.admin-panel summary {
    cursor: pointer;
    padding: 14px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    font-size: 16px;
    font-weight: 600;
    user-select: none;
}

.card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    margin: 16px 0;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.card-header h3 { margin: 0; font-size: 17px; }
.card-header button {
    background: #4a90d9;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}

.feature-top {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}
.name-input {
    padding: 6px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    background: #fafafa;
}
.name-input:focus { outline: none; border-color: #4a90d9; background: #fff; }

.btn-del {
    background: transparent;
    border: none;
    color: #c0392b;
    cursor: pointer;
    font-size: 18px;
    padding: 0 6px;
    border-radius: 4px;
}
.btn-del:hover { background: #fdeaea; }

.class-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #eef2f7;
}
table { border-collapse: collapse; width: 100%; font-size: 13px; }
table th, table td {
    padding: 6px 8px;
    border-bottom: 1px solid #eef2f7;
    text-align: left;
    white-space: nowrap;
}
table th { background: #f9fafb; font-weight: 600; color: #6a7d8c; }
table input[type="number"] {
    width: 60px;
    padding: 4px 6px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 13px;
}
table select {
    padding: 4px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 13px;
    max-width: 260px;
}

.formula {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    font-size: 13px;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
}
