:root {
  --bg1: #0ea5e9;
  --bg2: #a855f7;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --ring: #0ea5e9;
  --primary: #2563eb;
  --primaryText: #ffffff;
  --border: rgba(15, 23, 42, 0.14);
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
  --goodBg: rgba(34, 197, 94, 0.16);
  --goodText: #065f46;
  --badBg: rgba(239, 68, 68, 0.14);
  --badText: #991b1b;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    radial-gradient(18px 18px at 18% 18%, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 65%),
    radial-gradient(22px 22px at 82% 22%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 65%),
    radial-gradient(28px 28px at 12% 78%, rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0) 65%),
    radial-gradient(18px 18px at 88% 82%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 65%),
    radial-gradient(1000px 700px at 10% 20%, rgba(255, 255, 255, 0.30), rgba(255, 255, 255, 0) 55%),
    linear-gradient(135deg, var(--bg1), var(--bg2));
}

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 18px 34px;
}

.hero {
  color: rgba(255, 255, 255, 0.95);
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.3px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(8px);
}

.hero__title {
  margin: 0;
  font-size: 36px;
  line-height: 1.1;
}

.hero__subtitle {
  margin: 0;
  font-size: 16px;
  opacity: 0.95;
}

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.row {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.row--answer {
  margin-top: 14px;
  align-items: center;
}

.label {
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
}

.select,
.input {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 16px;
  outline: none;
  min-height: 46px;
}

.select {
  min-width: 260px;
}

.input {
  min-width: 280px;
  flex: 1;
}

.select:focus,
.input:focus {
  border-color: rgba(14, 165, 233, 0.7);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.22);
}

.btn {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  min-height: 46px;
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.22);
}

.btn--primary {
  background: var(--primary);
  color: var(--primaryText);
  border-color: rgba(37, 99, 235, 0.6);
}

.meta {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.status {
  font-weight: 700;
  color: var(--muted);
}

.status__right {
  font-weight: 800;
  color: var(--text);
}

.progress {
  display: grid;
  gap: 8px;
}

.progress__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.progress__track {
  height: 16px;
  width: 100%;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  border: 1px solid rgba(148, 163, 184, 0.28);
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #f59e0b, #3b82f6);
  transition: width 220ms ease;
}

.feedback {
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  min-height: 42px;
  display: flex;
  align-items: center;
}

.feedback.is-empty {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.22);
  color: var(--muted);
}

.feedback.is-good {
  background: var(--goodBg);
  border-color: rgba(34, 197, 94, 0.25);
  color: var(--goodText);
}

.feedback.is-error {
  background: var(--badBg);
  border-color: rgba(239, 68, 68, 0.25);
  color: var(--badText);
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
}

.footer {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
}

.celebrate {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.celebrate.is-show {
  display: flex;
}

.celebrate__bubble {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 14px 18px;
  display: grid;
  gap: 6px;
  place-items: center;
  transform-origin: center;
  animation: pop-in 180ms ease-out;
}

.celebrate__animal {
  font-size: 54px;
  line-height: 1;
  animation: dance 620ms ease-in-out infinite;
}

.celebrate__text {
  font-weight: 800;
  color: var(--text);
}

@keyframes pop-in {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes dance {
  0% { transform: translateY(0) rotate(-4deg); }
  25% { transform: translateY(-10px) rotate(6deg); }
  50% { transform: translateY(0) rotate(-6deg); }
  75% { transform: translateY(-8px) rotate(4deg); }
  100% { transform: translateY(0) rotate(-4deg); }
}

.finish {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
}

.finish.is-show {
  display: flex;
}

.finish__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.finish__card {
  position: relative;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: grid;
  gap: 6px;
  text-align: center;
  transform-origin: center;
  animation: finish-pop 220ms ease-out;
}

.finish__title {
  font-weight: 900;
  font-size: 34px;
  line-height: 1.05;
}

.finish__subtitle {
  font-weight: 800;
  color: var(--muted);
}

.finish__score {
  font-weight: 900;
  font-size: 18px;
}

@keyframes finish-pop {
  from { transform: scale(0.88); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
