:root {
  --bg-1: #f7f4ea;
  --bg-2: #d5e6db;
  --ink: #1b2a2f;
  --ink-soft: #4b5f66;
  --accent: #0e7c66;
  --accent-2: #d98d2b;
  --panel: rgba(255, 255, 255, 0.86);
  --ok: #138a36;
  --bad: #ba1b1d;
  --shadow: 0 18px 50px rgba(12, 36, 34, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 10% 20%, var(--bg-2) 0%, transparent 40%),
    linear-gradient(145deg, var(--bg-1), #f3e7d5 65%, #e8ddcc);
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
}

.bg-shape-a {
  width: 340px;
  height: 340px;
  right: -100px;
  top: -90px;
  background: rgba(14, 124, 102, 0.2);
  filter: blur(3px);
}

.bg-shape-b {
  width: 260px;
  height: 260px;
  left: -70px;
  bottom: -60px;
  background: rgba(217, 141, 43, 0.22);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(860px, 100%);
  background: var(--panel);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 22px;
  padding: 26px;
  box-shadow: var(--shadow);
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: 0.02em;
}

.topbar p {
  margin: 8px 0 18px;
  color: var(--ink-soft);
}

.screen {
  display: none;
  animation: fade-in 220ms ease;
}

.screen.active {
  display: block;
}

.difficulty-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.difficulty-btn,
.answer-btn,
.primary-btn {
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.difficulty-btn {
  padding: 14px 16px;
  background: linear-gradient(140deg, #1d8e77, #157965);
  color: #fff;
  box-shadow: 0 10px 24px rgba(17, 91, 75, 0.26);
}

.difficulty-btn:nth-child(2n) {
  background: linear-gradient(140deg, #d28929, #ba7420);
  box-shadow: 0 10px 24px rgba(143, 85, 25, 0.25);
}

.difficulty-btn:hover,
.answer-btn:hover,
.primary-btn:hover {
  transform: translateY(-1px);
}

.game-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 700;
  background: var(--accent);
  color: white;
}

.badge-soft {
  background: #e6f3ee;
  color: #235445;
}

.question-figure {
  margin: 0;
}

#question-image {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 16px;
  border: 2px solid rgba(28, 82, 73, 0.2);
  background: #f4f4f4;
}

#question-prompt {
  margin-top: 10px;
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  font-weight: 700;
}

.answers {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.answer-btn {
  text-align: left;
  padding: 12px 14px;
  background: #f7faf9;
  border: 1px solid #d0ded9;
  color: var(--ink);
}

.answer-btn:disabled {
  cursor: not-allowed;
  opacity: 0.9;
}

.answer-btn.correct {
  background: #dcf3e3;
  border-color: #73c588;
}

.answer-btn.wrong {
  background: #f8dcdd;
  border-color: #d27a7c;
}

.feedback {
  min-height: 34px;
  margin-top: 8px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.feedback.ok {
  color: var(--ok);
}

.feedback.bad {
  color: var(--bad);
}

.result-summary {
  font-size: 1.2rem;
}

.primary-btn {
  background: linear-gradient(140deg, #0e7c66, #136654);
  color: #fff;
  padding: 12px 16px;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 700px) {
  body {
    padding: 14px;
  }

  .app-shell {
    padding: 16px;
  }

  .difficulty-grid {
    grid-template-columns: 1fr;
  }
}
