:root {
  color-scheme: light;
  --ink: #17221b;
  --muted: #667169;
  --cream: #f6f2e8;
  --paper: #fffdf7;
  --green: #2d6a4f;
  --green-dark: #1f4d39;
  --lime: #d9f26a;
  --peach: #ff9f7a;
  --line: #dcded5;
  --shadow: 0 18px 55px rgba(41, 57, 46, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 10%, rgba(217, 242, 106, 0.35), transparent 24rem),
    var(--cream);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
}

button {
  font: inherit;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.screen {
  display: none;
  min-height: 100vh;
  padding: 32px 24px;
  animation: arrive 0.35s ease both;
}

.screen.is-active {
  display: flex;
  flex-direction: column;
}

.welcome-screen,
.complete-screen,
.journey-screen {
  justify-content: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 2px solid var(--ink);
  border-radius: 15px;
  margin-bottom: 36px;
  background: var(--lime);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: "Space Grotesk", sans-serif;
  font-size: 26px;
  font-weight: 700;
  transform: rotate(-3deg);
}

.eyebrow,
.speech-label,
.scene-label {
  margin: 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 10px 0 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.045em;
  line-height: 1.03;
}

h1 {
  font-size: clamp(39px, 11vw, 56px);
}

h2 {
  max-width: 430px;
  font-size: clamp(31px, 8vw, 42px);
}

.intro,
.situation-copy {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.intro {
  max-width: 420px;
  margin: 20px 0 28px;
}

.character-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  margin-bottom: 24px;
  background: #eff4e5;
}

.welcome-quote {
  margin: 5px 0 0;
  font-weight: 600;
  line-height: 1.4;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 58px;
  padding: 0 20px;
  border: 0;
  border-radius: 15px;
  background: var(--green);
  color: white;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 5px 0 var(--green-dark);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.primary-button[hidden] {
  display: none;
}

.primary-button:hover {
  background: var(--green-dark);
}

.primary-button:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--green-dark);
}

.time-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.game-screen {
  padding: 0;
}

.game-header {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 14px;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
}

.day-progress {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.day-pill {
  padding: 7px 9px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: #9aa19b;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.day-pill:disabled {
  opacity: 0.65;
}

.day-pill.is-current {
  background: var(--ink);
  color: white;
}

.day-pill.is-done {
  color: var(--green);
}

.xp-badge {
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.progress-track {
  height: 4px;
  background: #e9e9e1;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--lime);
  transition: width 0.4s ease;
}

.game-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 30px 24px 28px;
}

.scene-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quest-theme {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.location-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
}

.situation-copy {
  margin: 12px 0 8px;
}

.brooz-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 145px;
  margin: 8px 0 18px;
  border-radius: 22px;
  background:
    linear-gradient(150deg, rgba(217, 242, 106, 0.56), rgba(255, 159, 122, 0.18));
  overflow: hidden;
}

.brooz {
  position: relative;
  width: 88px;
  height: 102px;
  border: 3px solid var(--ink);
  border-radius: 45% 45% 42% 42%;
  background: var(--peach);
  box-shadow: inset -8px -9px 0 rgba(108, 47, 27, 0.08);
  transition: transform 0.25s ease;
}

.brooz-large {
  flex: 0 0 auto;
  width: 66px;
  height: 76px;
  border-width: 2px;
}

.hair {
  position: absolute;
  width: 45px;
  height: 21px;
  top: -8px;
  left: 19px;
  border-radius: 60% 10% 60% 10%;
  background: var(--ink);
  transform: rotate(-8deg);
}

.eye {
  position: absolute;
  width: 7px;
  height: 9px;
  top: 39px;
  border-radius: 50%;
  background: var(--ink);
}

.eye-left { left: 25px; }
.eye-right { right: 25px; }

.nose {
  position: absolute;
  width: 8px;
  height: 11px;
  top: 48px;
  left: 40px;
  border: solid var(--ink);
  border-width: 0 0 2px 2px;
  transform: skew(-10deg);
}

.mouth {
  position: absolute;
  width: 22px;
  height: 8px;
  top: 68px;
  left: 31px;
  border-bottom: 3px solid var(--ink);
  border-radius: 50%;
}

.brooz-large .hair { width: 34px; height: 16px; top: -6px; left: 14px; }
.brooz-large .eye { width: 5px; height: 7px; top: 29px; }
.brooz-large .eye-left { left: 18px; }
.brooz-large .eye-right { right: 18px; }
.brooz-large .nose { width: 6px; height: 8px; top: 36px; left: 29px; }
.brooz-large .mouth { width: 16px; height: 6px; top: 50px; left: 23px; border-width: 2px; }

.brooz.is-happy {
  transform: rotate(4deg) scale(1.05);
}

.brooz.is-worried {
  transform: rotate(-5deg);
}

.brooz.is-happy .mouth {
  height: 13px;
  border-radius: 0 0 50% 50%;
}

.brooz.is-worried .mouth {
  top: 72px;
  transform: rotate(180deg);
}

.thought-bubble {
  position: absolute;
  top: 13px;
  right: 18px;
  max-width: 126px;
  padding: 10px 12px;
  border: 1px solid var(--ink);
  border-radius: 14px 14px 14px 3px;
  margin: 0;
  background: var(--paper);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.answers {
  display: grid;
  gap: 10px;
}

.answer-button {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.answer-button:hover {
  border-color: var(--green);
  transform: translateY(-1px);
}

.answer-letter {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #eff0ea;
  font-size: 12px;
  font-weight: 700;
}

.answer-button.is-correct {
  border-color: var(--green);
  background: #edf8e8;
}

.answer-button.is-wrong {
  border-color: #c95d45;
  background: #fff0eb;
}

.answer-button:disabled {
  cursor: default;
  transform: none;
}

.reaction-panel {
  padding-top: 18px;
  animation: rise 0.3s ease both;
}

.reaction-result {
  margin: 0 0 4px;
  color: var(--green);
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  font-weight: 700;
}

.result-count {
  display: flex;
  gap: 16px;
  padding-top: 22px;
  margin-top: auto;
  color: var(--muted);
  font-size: 13px;
}

.result-count span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.result-count strong {
  font-size: 15px;
}

.reaction-copy {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.45;
}

.complete-mark {
  background: var(--peach);
}

.complete-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  margin: 2px 0 28px;
  background: #eff4e5;
  font-size: 18px;
  font-weight: 600;
}

.completion-title {
  margin: 0 0 16px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
}

.complete-card .speech-label {
  margin-top: 0;
}

.complete-card p {
  margin: 8px 0 0;
}

.results-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 4px 0 22px;
}

.results-card div {
  display: grid;
  gap: 4px;
  padding: 13px 8px;
  border-radius: 14px;
  background: #eff4e5;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.results-card strong {
  font-size: 18px;
}

.results-card b {
  color: var(--ink);
}

.complete-card p:last-child {
  margin: 6px 0 0;
}

.journey-screen {
  justify-content: flex-start;
}

.journey-screen .brand-mark {
  margin-bottom: 28px;
}

.journey-days {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.journey-day-card,
.journey-total {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #eff4e5;
}

.journey-day-card h2 {
  margin-top: 5px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.journey-day-xp {
  margin: 14px 0 8px;
  color: var(--green);
}

.journey-day-xp strong,
.journey-total > p strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
}

.journey-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  color: var(--muted);
  font-size: 12px;
}

.journey-counts b {
  color: var(--ink);
}

.replay-button {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--green);
  border-radius: 12px;
  margin-top: 14px;
  background: transparent;
  color: var(--green);
  cursor: pointer;
  font-weight: 700;
}

.replay-button:hover {
  background: var(--paper);
}

.journey-total {
  margin-bottom: 20px;
  background: var(--paper);
}

.journey-total > p {
  margin: 0 0 10px;
}

@keyframes arrive {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 521px) {
  body {
    padding: 26px 0;
  }

  .app-shell,
  .screen {
    min-height: calc(100vh - 52px);
  }

  .app-shell {
    border: 1px solid rgba(23, 34, 27, 0.12);
    border-radius: 26px;
  }
}

@media (max-width: 370px) {
  .screen { padding: 24px 18px; }
  .game-content { padding: 24px 18px; }
  .day-pill { padding-inline: 6px; }
  .thought-bubble { right: 9px; max-width: 105px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}