﻿:root {
  --bg-top: #5ec2ff;
  --bg-bottom: #7cffa8;
  --panel: #ffffff;
  --ink: #17365d;
  --accent: #ff8b3d;
  --accent-dark: #e86e1b;
  --good: #1f9b51;
  --warn: #b82020;
  --button-blue: #3287ff;
  --button-yellow: #ffd84d;
  --button-pink: #ff6ca8;
  --shadow: 0 12px 25px rgba(23, 54, 93, 0.18);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Comic Sans MS", "Verdana", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 14px;
}

.app {
  width: min(980px, 100%);
  display: grid;
  gap: 14px;
}

.hero {
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 12px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 1.1;
  color: #0f4ea8;
}

.tagline {
  margin: 8px 0 0;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 700;
}

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

.setup-panel h2,
.question-panel h2 {
  margin-top: 0;
}

.setup-panel h2 {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
}

.player-field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.player-field label {
  font-size: 1rem;
  font-weight: 900;
}

.player-field input {
  width: 100%;
  border: 3px solid #cfe0ff;
  border-radius: 14px;
  color: var(--ink);
  font: inherit;
  font-size: clamp(1rem, 2.8vw, 1.2rem);
  font-weight: 800;
  outline: none;
  padding: 12px 14px;
}

.player-field input:focus {
  border-color: var(--button-blue);
  box-shadow: 0 0 0 4px rgba(50, 135, 255, 0.16);
}

.player-field input.input-error {
  border-color: var(--warn);
}

.player-field input:disabled {
  background: #edf4ff;
  cursor: not-allowed;
  opacity: 0.85;
}

.input-help {
  margin: 0;
  min-height: 20px;
  color: #5b6b83;
  font-size: 0.9rem;
  font-weight: 700;
}

.input-help.warn {
  color: var(--warn);
}

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

.difficulty-btn,
.answer-btn,
.control-btn {
  border: none;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.difficulty-btn {
  background: #dce9ff;
  color: #134a95;
  padding: 12px;
  font-size: clamp(1rem, 2.7vw, 1.2rem);
}

.difficulty-btn.active {
  background: var(--button-yellow);
  color: #513700;
}

.difficulty-btn:hover,
.answer-btn:hover,
.control-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.stats-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  text-align: center;
}

.stat {
  border-radius: 14px;
  padding: 10px;
  background: #f2f8ff;
}

.label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat span:last-child {
  font-size: clamp(1.3rem, 4vw, 2rem);
  font-weight: 900;
  color: #10438d;
}

.question-label {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #5b6b83;
  text-transform: uppercase;
}

#question {
  margin: 8px 0 14px;
  font-size: clamp(1.8rem, 6vw, 3.1rem);
  text-align: center;
}

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

.answer-btn {
  min-height: 72px;
  font-size: clamp(1.3rem, 4.5vw, 2rem);
  color: #08356d;
  background: #deecff;
}

.answer-btn:nth-child(4n + 1) {
  background: #d7f9ff;
}

.answer-btn:nth-child(4n + 2) {
  background: #ffe6f2;
}

.answer-btn:nth-child(4n + 3) {
  background: #fff6d0;
}

.answer-btn:nth-child(4n + 4) {
  background: #ddffd8;
}

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

.feedback {
  margin: 14px 0 0;
  min-height: 28px;
  text-align: center;
  font-size: clamp(1rem, 2.8vw, 1.3rem);
  font-weight: 800;
  color: #215eb1;
}

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

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

.controls-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.control-btn {
  min-height: 56px;
  font-size: clamp(1rem, 3vw, 1.2rem);
}

.control-btn.primary {
  background: var(--accent);
  color: #fff;
}

.control-btn.primary:hover {
  background: var(--accent-dark);
}

.control-btn.secondary {
  background: var(--button-blue);
  color: #fff;
}

.control-btn:disabled {
  cursor: not-allowed;
  filter: grayscale(0.35);
  opacity: 0.65;
  transform: none;
}

#restartBtn {
  background: var(--button-pink);
}

.safety-note {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f4f96;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 14px;
  padding: 10px;
}

.game-footer {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: #0b3f83;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px;
}

.game-footer p {
  margin: 0;
}

@media (max-width: 720px) {
  body {
    padding: 8px;
  }

  .app {
    gap: 10px;
  }

  .answers-grid,
  .controls-panel,
  .difficulty-buttons,
  .stats-panel {
    grid-template-columns: 1fr;
  }

  .answer-btn {
    min-height: 64px;
  }
}
