:root {
  --pink-50: #fff7fb;
  --pink-100: #fde7f9;
  --pink-200: #f9d4f4;
  --pink-300: #f6b7ea;
  --pink-500: #ee6ccf;
  --purple-500: #9966ff;
  --purple-700: #6c42d9;
  --purple-900: #2c1d56;
  --gold: #ffd767;
  --mint: #8ee7d6;
  --red: #ff6a7a;
  --text: #3b2149;
  --panel: rgba(255, 255, 255, 0.75);
  --shadow: 0 18px 45px rgba(118, 78, 170, 0.18);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Fredoka", "Arial Rounded MT Bold", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.7), transparent 30%),
    linear-gradient(180deg, #fff8fd 0%, #f3ebff 100%);
  color: var(--text);
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 12px;
}

button, input {
  font: inherit;
}

.page-shell {
  width: min(100%, 440px);
  min-height: min(92vh, 760px);
  position: relative;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(4px);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 20px 16px 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffdf5c, #ff8bc4 70%);
  font-weight: 700;
  color: var(--purple-900);
  box-shadow: 0 8px 16px rgba(241, 131, 190, 0.3);
}

.ghost-button,
.primary-button,
.secondary-button {
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ghost-button:hover,
.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.8);
  color: var(--purple-900);
  padding: 10px 12px;
}

.app {
  position: relative;
}

.screen {
  background: var(--panel);
  border: 2px solid rgba(155, 121, 216, 0.1);
  border-radius: 24px;
  padding: 22px 18px 18px;
  min-height: 430px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.screen h1,
.screen h2,
.screen h3 {
  margin: 0 0 12px;
  color: var(--purple-900);
  line-height: 1.2;
}

.screen h1 {
  font-size: clamp(2rem, 6vw, 2.5rem);
}

.screen h2 {
  font-size: clamp(1.5rem, 5vw, 2rem);
}

.question-tip {
  margin: 0 0 14px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: rgba(60, 33, 73, 0.65);
  font-style: italic;
}

.screen p,
.screen li,
.screen label {
  font-size: 1.02rem;
  line-height: 1.5;
}

.muted {
  color: rgba(60, 33, 73, 0.8);
}

.progress {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  color: var(--purple-900);
  margin-bottom: 10px;
  width: fit-content;
}

.step-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  gap: 10px;
}

.step-list li {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(153, 102, 255, 0.15);
}

.form-group {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label,
.choice {
  font-weight: 600;
  color: var(--purple-900);
}

input[type="text"],
input[type="number"] {
  width: 100%;
  border: 2px solid rgba(153, 102, 255, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  padding: 14px 16px;
  font-size: 1.04rem;
  color: var(--text);
}

input[type="text"]:focus,
input[type="number"]:focus {
  outline: 3px solid rgba(153, 102, 255, 0.18);
  border-color: rgba(153, 102, 255, 0.5);
}

.answer-options {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.choice {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(153, 102, 255, 0.12);
}

.choice input {
  width: 20px;
  height: 20px;
  accent-color: var(--purple-500);
}

.primary-button,
.secondary-button {
  width: 100%;
  padding: 16px 18px;
  font-size: 1.06rem;
}

.primary-button {
  background: linear-gradient(135deg, #ff9ed8 0%, #b06eff 100%);
  color: white;
  box-shadow: 0 10px 22px rgba(176, 110, 255, 0.3);
}

.secondary-button {
  background: linear-gradient(135deg, #ffe3a3 0%, #ffcde9 100%);
  color: var(--purple-900);
}

#startButton,
#nextHint,
button[type="submit"],
#restartButton {
  margin-top: 18px;
}

.notice {
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 700;
  min-height: 48px;
  display: none;
  align-items: center;
}

.notice.visible {
  display: flex;
}

.notice.error {
  background: rgba(255, 106, 122, 0.12);
  color: #a83243;
  border: 1px solid rgba(255, 106, 122, 0.3);
}

.notice.success {
  background: rgba(49, 190, 150, 0.12);
  color: #1a6b52;
  border: 1px solid rgba(49, 190, 150, 0.3);
}

.hint-box {
  background: linear-gradient(135deg, rgba(255, 241, 140, 0.8), rgba(255, 214, 112, 0.5));
  border: 2px dashed rgba(125, 90, 24, 0.28);
  border-radius: 18px;
  padding: 18px 16px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #5b3a13;
  text-align: center;
  margin: 16px 0 18px;
}

.icon-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  font-size: 2rem;
  margin: 8px 0 16px;
}

.end-screen {
  text-align: center;
}

.end-screen .icon-row {
  margin-top: 18px;
  margin-bottom: 26px;
}

@media (max-width: 360px) {
  .page-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .screen {
    padding-left: 14px;
    padding-right: 14px;
  }
}
