:root {
  --color-bg: #f4f6fb;
  --color-card: #ffffff;
  --color-primary: #3b5bdb;
  --color-primary-dark: #2f4bb3;
  --color-text: #1c1f2b;
  --color-muted: #6b7280;
  --color-correct: #2f9e44;
  --color-wrong: #e03131;
  --color-border: #e2e6f0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
}

.app-header h1 {
  font-size: 1.3rem;
  text-align: center;
  margin: 12px 0 20px;
}

.screen {
  background: var(--color-card);
  border-radius: 16px;
  padding: 20px 18px;
  box-shadow: 0 2px 10px rgba(20, 24, 40, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hidden { display: none; }

.lead { color: var(--color-muted); margin: 0 0 4px; }

label { font-size: 0.9rem; color: var(--color-muted); }

input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 1.05rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  outline: none;
}

input:focus {
  border-color: var(--color-primary);
}

button {
  border: none;
  border-radius: 10px;
  padding: 13px 16px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--color-primary-dark); }

.btn-secondary {
  background: #eef0f7;
  color: var(--color-text);
}
.btn-secondary:hover { background: #e2e5f0; }

.game-topbar {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  color: var(--color-muted);
}

.svg-container {
  width: 100%;
  display: flex;
  justify-content: center;
  background: #fbfcff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 8px;
}

.svg-container svg {
  width: 100%;
  height: auto;
  max-width: 420px;
}

.answer-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.answer-label {
  font-weight: 700;
  font-size: 1.1rem;
}

.answer-row input {
  flex: 1;
}

.answer-row button {
  flex-shrink: 0;
}

.feedback {
  min-height: 1.4em;
  font-weight: 700;
  margin: 0;
}

.feedback.correct { color: var(--color-correct); }
.feedback.wrong { color: var(--color-wrong); }

#result-summary {
  font-size: 1.05rem;
  line-height: 1.6;
}

#leaderboard-list {
  padding-left: 1.4em;
  line-height: 1.9;
}

#score-submit-status {
  font-size: 0.9rem;
  color: var(--color-muted);
  min-height: 1.2em;
}
