@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;600;700&family=Inter:wght@400;500;600&display=swap');

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

:root {
  --blue:    #0A3D91;
  --gold:    #F5C518;
  --gold-dk: #C99B0A;
  --white:   #ffffff;
  --glass-bg:     rgba(255,255,255,0.07);
  --glass-border: rgba(255,255,255,0.15);
  --text-main:    #ffffff;
  --text-muted:   rgba(255,255,255,0.55);
  --correct-bg:   rgba(34,197,94,0.2);
  --correct-brd:  #22c55e;
  --wrong-bg:     rgba(239,68,68,0.2);
  --wrong-brd:    #ef4444;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: url("/bg.png") center center / cover fixed no-repeat;
  background-color: #0d1b2e;
  color: var(--text-main);
  min-height: 100vh;
}

/* Тёмный оверлей поверх фона */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, rgba(5,20,60,0.72) 0%, rgba(10,30,80,0.60) 100%);
  z-index: 0;
  pointer-events: none;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 16px 60px;
}

/* ── Шапка ── */
.header {
  text-align: center;
  margin-bottom: 40px;
  padding-top: 8px;
}

.home-link {
  display: inline-block;
  font-family: 'Oswald', sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
  text-decoration: none;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
  transition: opacity 0.2s;
}
.home-link:hover { opacity: 0.85; }

.subtitle {
  margin-top: 6px;
  font-family: 'Oswald', sans-serif;
  font-size: clamp(0.85rem, 2vw, 1rem);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(245,197,24,0.4);
}

/* ── Карточки выбора игры ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 28px 24px;
  border-radius: 20px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
  position: relative;
  overflow: hidden;
}

.card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--blue));
  opacity: 0;
  transition: opacity 0.25s;
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(245,197,24,0.4);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35), 0 0 0 1px rgba(245,197,24,0.15);
}
.card:hover::after { opacity: 1; }

.card h2 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 8px;
  line-height: 1.3;
}

.card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Экран игры ── */
.game, .result {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}

.hidden { display: none; }

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--glass-border);
}

.game-header h2 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.02em;
}

.progress {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
  background: rgba(245,197,24,0.12);
  border: 1px solid rgba(245,197,24,0.25);
  padding: 5px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ── Вопрос ── */
.question-card {
  display: grid;
  gap: 20px;
}

.question-media {
  width: 100%;
  height: clamp(200px, 38vw, 320px);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: rgba(0,0,0,0.2);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
}

.question-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.5;
  margin-bottom: 4px;
  min-height: 0;
}

/* ── Варианты ответов ── */
.answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

/* На мобильных — 1 колонка */
@media (max-width: 540px) {
  .answers {
    grid-template-columns: 1fr;
  }
}

.answer {
  padding: 16px 18px;
  border: 1.5px solid var(--glass-border);
  background: rgba(255,255,255,0.06);
  border-radius: 14px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--white);
  text-align: center;
  transition: transform 0.18s, border-color 0.18s, background 0.18s, box-shadow 0.18s;
  backdrop-filter: blur(6px);
}

.answer:hover:not(:disabled) {
  border-color: var(--gold);
  background: rgba(245,197,24,0.1);
  box-shadow: 0 0 0 1px rgba(245,197,24,0.2);
  transform: translateY(-2px);
}

.answer.correct {
  background: rgba(245,197,24,0.18);
  border-color: var(--gold);
  box-shadow: 0 4px 20px rgba(245,197,24,0.3);
  color: var(--gold);
}

.answer.incorrect {
  background: rgba(139,30,30,0.35);
  border-color: #7f1d1d;
  box-shadow: 0 4px 16px rgba(127,29,29,0.3);
  color: #fca5a5;
}

.answer:disabled { cursor: not-allowed; }

/* ── Действия ── */
.game-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
  gap: 12px;
}

/* ── Кнопки ── */
button.primary, button.secondary, button.ghost {
  border-radius: 12px;
  padding: 12px 24px;
  border: none;
  cursor: pointer;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.04em;
  transition: transform 0.18s, box-shadow 0.18s, opacity 0.18s;
}

button.primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dk) 100%);
  color: #0d1b2e;
  box-shadow: 0 4px 18px rgba(245,197,24,0.35);
}
button.primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(245,197,24,0.5);
}

button.secondary {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  border: 1px solid var(--glass-border);
}
button.secondary:hover:not(:disabled) {
  background: rgba(255,255,255,0.18);
  transform: translateY(-1px);
}

button.ghost {
  background: transparent;
  color: var(--text-muted);
}
button.ghost:hover:not(:disabled) {
  color: var(--white);
  background: rgba(255,255,255,0.07);
}

button:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

/* ── Результат ── */
.result h2 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 12px;
  letter-spacing: 0.03em;
}

.result p {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

/* ── Адаптив ── */
@media (max-width: 480px) {
  .app { padding: 16px 12px 48px; }
  .game, .result { padding: 20px 16px; }
  .game-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .game-actions { flex-direction: column-reverse; }
  .game-actions button { width: 100%; }
  .card-grid { grid-template-columns: 1fr; }
}

/* ── Админка ── */
.form-row {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.form-row input, .form-row select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: var(--white);
}

.answers-grid { display: grid; gap: 10px; margin-bottom: 16px; }

.answer-row {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 8px;
}

.form-actions { display: flex; gap: 12px; }

.list { display: grid; gap: 16px; }

.list-item {
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
}

.list-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.badge {
  background: rgba(245,197,24,0.15);
  color: var(--gold);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(245,197,24,0.3);
}

.list-item-details { color: var(--text-muted); font-size: 0.88rem; margin-top: 6px; }

.list-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.option {
  padding: 6px 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: 0.88rem;
}

.option.correct {
  border-color: var(--correct-brd);
  background: var(--correct-bg);
  color: #86efac;
}

.list-actions { display: flex; gap: 8px; margin-top: 12px; }
