:root {
  --leaf: #2f9f81;
  --deep: #163344;
  --sun: #f6c756;
  --sky: #d9f1fb;
  --clay: #c96f45;
  --paper: #fffaf0;
  --line: #d9dfd6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(#d8f2fb, #fff8df 36%, #f7f1dd);
  color: var(--deep);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select {
  font: inherit;
}

.app {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 14px 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 12px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--clay);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(1.6rem, 8vw, 3rem);
  line-height: 0.95;
}

h2 {
  margin: 0;
  font-size: clamp(1.45rem, 7vw, 2.2rem);
}

.streak {
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 2px solid #986e0d;
  border-radius: 999px;
  background: var(--sun);
  font-weight: 950;
}

.hero {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 36px rgba(22, 51, 68, 0.12);
}

.hero img {
  width: 100%;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.hero img {
  height: 150px;
  object-fit: cover;
  object-position: top;
}

.hero p {
  margin: 4px 0 14px;
  font-size: 1.05rem;
  line-height: 1.35;
  font-weight: 720;
}

.primary {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  padding: 0 16px;
  color: #fff;
  background: var(--leaf);
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.member-note {
  padding: 10px;
  border-radius: 9px;
  background: #fff3bd;
  color: #4a3510;
  font-size: 0.9rem;
  line-height: 1.35;
}

.activity-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding: 2px 0 14px;
  scroll-snap-type: x mandatory;
}

.nav-card {
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 4px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  color: var(--deep);
  box-shadow: 0 8px 20px rgba(22, 51, 68, 0.08);
  scroll-snap-align: start;
}

.nav-card span {
  font-weight: 950;
}

.nav-card small {
  color: #546674;
  font-weight: 750;
}

.nav-card.active {
  color: #fff;
  background: var(--deep);
  border-color: var(--deep);
}

.nav-card.active small {
  color: #d8edf5;
}

.screen {
  display: none;
  gap: 14px;
}

.screen.active {
  display: grid;
}

.screen-head {
  padding: 4px 2px 0;
}

.game-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 34px rgba(22, 51, 68, 0.11);
}

.game-card {
  padding: 16px;
}

.game-card > p {
  margin-top: 0;
  color: #3d5260;
  font-weight: 720;
  line-height: 1.45;
}

.word-card {
  width: min(100%, 330px);
  margin: 2px auto 14px;
  padding: 24px 20px;
  border: 4px solid #81562f;
  border-radius: 22px;
  background: #f3d09b;
  color: #2f2119;
  text-align: center;
  font-size: clamp(3rem, 22vw, 6rem);
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0;
}

.vowel-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.vowel-grid button,
.letter-choices button {
  min-height: 58px;
  border: 0;
  border-radius: 12px;
  background: var(--sun);
  color: #3b2c10;
  font-size: 1.2rem;
  font-weight: 950;
  cursor: pointer;
}

.vowel-grid.compact {
  margin-top: 12px;
}

.feedback {
  min-height: 28px;
  margin: 12px 0 0;
  color: var(--leaf);
  font-weight: 900;
}

.dig-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.fossil {
  min-height: 82px;
  display: grid;
  place-items: center;
  border: 2px dashed #9b7d4c;
  border-radius: 18px;
  background: #ead8ad;
  color: #432e19;
  font-size: 1.15rem;
  font-weight: 950;
}

.chain-word {
  display: grid;
  grid-template-columns: repeat(3, minmax(64px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.chain-word span {
  display: grid;
  place-items: center;
  min-height: 84px;
  border-radius: 14px;
  background: #fff;
  border: 2px solid var(--line);
  font-size: 2.7rem;
  font-weight: 950;
}

.chain-word span.change {
  border-color: var(--clay);
  background: #ffe2d5;
}

.letter-choices {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

label {
  display: grid;
  gap: 7px;
  color: #405564;
  font-weight: 900;
}

select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  color: var(--deep);
  font-weight: 800;
}

@media (max-width: 430px) {
  .hero {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .hero img {
    height: 128px;
  }

  .vowel-grid {
    grid-template-columns: repeat(5, minmax(52px, 1fr));
  }

}
