:root {
  --primary: #d9a441;
  --primary-dark: #c28f34;
  --accent: #2f6a54;
  --accent-dark: #1f4a3d;
  --ink-on-gold: #4a3413;
  --success: #16a34a;
  --danger: #dc2626;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Karla', sans-serif;
  background: radial-gradient(circle at top, var(--accent) 0%, var(--accent-dark) 70%);
  color: #eef0ea;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.wrap {
  width: 100%;
  max-width: 520px;
  position: relative;
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: #eef0ea;
  text-decoration: none;
  font-size: 14px;
  opacity: 0.8;
}
.back-link:hover { opacity: 1; }

.header-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.header-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(217, 164, 65, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.title {
  font-family: 'Bitter', serif;
  font-size: 21px;
  margin: 0 0 2px;
  color: #fff;
}
.subtitle {
  font-size: 13px;
  opacity: 0.8;
  margin: 0;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(217, 164, 65, 0.3);
  border-radius: 14px;
  padding: 12px 18px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.time-selector,
.topic-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.time-label,
.topic-label { font-size: 13px; opacity: 0.8; margin-right: 4px; }
.time-pill,
.topic-pill {
  border: 1px solid rgba(217, 164, 65, 0.4);
  background: transparent;
  color: #eef0ea;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.time-pill.selected,
.time-pill:hover,
.topic-pill.selected,
.topic-pill:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--ink-on-gold);
}

.time-remaining { text-align: right; }
.time-remaining-label { display: block; font-size: 11px; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.05em; }
.time-remaining-value { font-family: 'JetBrains Mono', monospace; font-size: 26px; font-weight: 800; color: var(--primary); }

.problem-card {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
}

.problem {
  font-family: 'JetBrains Mono', monospace;
  font-size: 40px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #fff;
}

.answer-input {
  width: 100%;
  font-size: 22px;
  text-align: center;
  padding: 12px;
  border-radius: 10px;
  border: 2px solid var(--primary);
  background: rgba(255, 255, 255, 0.95);
  color: #1f2a24;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}
.answer-input:focus { outline: none; box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.4); }
.answer-input:disabled { opacity: 0.6; }

.submit-hint {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.65;
}

.counts-row {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 700;
}
.count-correct { color: #7be3a0; }
.count-wrong { color: #ff9b9b; }

.footer-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.restart-btn {
  border: 1px solid rgba(217, 164, 65, 0.4);
  background: transparent;
  color: #eef0ea;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.restart-btn:hover { background: var(--primary); border-color: var(--primary); color: var(--ink-on-gold); }
.shortcut-hint { font-size: 12px; opacity: 0.6; text-align: center; }
