:root {
  color-scheme: light;
  --ink: #172321;
  --muted: #5d6c67;
  --line: #cad7d0;
  --paper: #f7f4eb;
  --white: #ffffff;
  --river: #217c88;
  --reed: #6f8b43;
  --silt: #b86b45;
  --clay: #815f7c;
  --sun: #efb84a;
  --shadow: 0 18px 44px rgba(22, 38, 35, 0.13);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(18px, 4vw, 54px);
  background: rgba(247, 244, 235, 0.92);
  border-bottom: 1px solid rgba(23, 35, 33, 0.1);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--river);
  border-radius: 8px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav a,
.button,
button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 13px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.nav a:hover,
.nav a[aria-current="page"] {
  background: white;
  border-color: var(--line);
}

.button,
button.primary {
  color: white;
  background: var(--river);
  border-color: var(--river);
}

button.secondary,
.button.secondary {
  color: var(--ink);
  background: white;
  border-color: var(--line);
}

.hero {
  min-height: calc(100vh - 72px);
  display: grid;
  align-items: end;
  padding: clamp(28px, 5vw, 70px);
  color: white;
  background:
    linear-gradient(90deg, rgba(12, 32, 29, 0.82), rgba(12, 32, 29, 0.38)),
    url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=1800&q=82") center/cover;
}

.hero-content {
  width: min(820px, 100%);
  padding-bottom: 8vh;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.06;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(3rem, 8vw, 7.4rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 4rem);
}

h3 {
  font-size: 1.1rem;
}

p {
  line-height: 1.62;
}

.lead {
  max-width: 760px;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
}

.hero-actions,
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.section {
  padding: clamp(48px, 8vw, 96px) clamp(18px, 4vw, 54px);
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 28px;
}

.section-header p {
  max-width: 680px;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 8px 20px rgba(31, 45, 41, 0.06);
}

.service-card {
  min-height: 230px;
  display: grid;
  align-content: space-between;
}

.tag {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--ink);
  background: #eef4f2;
  font-size: 0.78rem;
  font-weight: 800;
}

.portfolio-strip {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  align-items: stretch;
}

.feature-image {
  min-height: 360px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(23, 35, 33, 0), rgba(23, 35, 33, 0.42)),
    url("https://images.unsplash.com/photo-1468546818829-25bb337b6646?auto=format&fit=crop&w=1400&q=82") center/cover;
  box-shadow: var(--shadow);
}

.appointment-panel {
  background: #e9efe9;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.approach-section {
  background: #eef3ed;
}

.approach-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.approach-grid article {
  min-height: 250px;
  display: grid;
  align-content: space-between;
  gap: 18px;
  padding: 22px;
  background: white;
}

.nfm-band {
  background: #172321;
  color: white;
}

.nfm-band .section-header p {
  color: rgba(255, 255, 255, 0.76);
}

.nfm-band .card {
  color: var(--ink);
}

.appointment-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.slot {
  background: white;
  border: 1px solid var(--line);
  text-align: left;
}

.slot:hover,
.slot.selected {
  color: white;
  background: var(--river);
  border-color: var(--river);
}

.subpage-shell {
  min-height: 100vh;
}

.page-title {
  padding: clamp(42px, 7vw, 80px) clamp(18px, 4vw, 54px) 28px;
  background: #eaf0eb;
}

.education-title {
  color: white;
  background:
    linear-gradient(105deg, rgba(8, 22, 28, 0.9), rgba(24, 85, 93, 0.72)),
    url("https://images.unsplash.com/photo-1473448912268-2022ce9509d8?auto=format&fit=crop&w=1600&q=82") center/cover;
}

.education-hub-hero,
.game-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(320px, 1.2fr);
  gap: clamp(18px, 4vw, 54px);
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: clamp(42px, 7vw, 86px) clamp(18px, 4vw, 54px);
  color: white;
  background:
    radial-gradient(circle at 16% 18%, rgba(239, 184, 74, 0.28), transparent 30%),
    linear-gradient(135deg, #07151b, #173a42 48%, #1e2c40);
}

.education-hub-hero img,
.game-hero img {
  width: 100%;
  min-height: 320px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
  transform: rotate(1deg);
  animation: hero-float 4.8s ease-in-out infinite alternate;
}

.hub-copy {
  position: relative;
  z-index: 1;
}

.swim-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.swim-layer span {
  position: absolute;
  width: 58px;
  height: 18px;
  border-radius: 999px 12px 12px 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(115, 214, 238, 0.52));
  opacity: 0.32;
  animation: swim-across 10s linear infinite;
}

.swim-layer span::after {
  content: "";
  position: absolute;
  right: -11px;
  top: 3px;
  border: 6px solid transparent;
  border-left-color: rgba(115, 214, 238, 0.72);
}

.swim-layer span:nth-child(1) { top: 18%; left: -8%; animation-delay: 0s; }
.swim-layer span:nth-child(2) { top: 35%; left: -14%; width: 42px; animation-delay: 2.2s; }
.swim-layer span:nth-child(3) { top: 62%; left: -10%; width: 72px; animation-delay: 4.8s; }
.swim-layer span:nth-child(4) { top: 78%; left: -18%; width: 50px; animation-delay: 6.5s; }

.game-library {
  background: #eef3ed;
}

.game-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
}

.game-promo {
  position: relative;
  overflow: hidden;
  min-height: 290px;
  display: grid;
  align-content: end;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--ink);
  background: white;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(31, 45, 41, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.game-promo:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 44px rgba(31, 45, 41, 0.14);
}

.featured-game {
  grid-column: span 2;
  min-height: 420px;
  color: white;
  background: #07151b;
}

.featured-game img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
  transition: transform 400ms ease;
}

.featured-game:hover img {
  transform: scale(1.04);
}

.featured-game::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 21, 27, 0.05), rgba(7, 21, 27, 0.88));
}

.featured-game > div {
  position: relative;
  z-index: 1;
  max-width: 560px;
}

.mini-scene {
  height: 120px;
  border-radius: 8px;
  background: linear-gradient(135deg, #217c88, #efb84a);
  position: relative;
  overflow: hidden;
}

.mini-scene::before,
.mini-scene::after {
  content: "";
  position: absolute;
  border-radius: 999px;
}

.meander-scene::before {
  inset: 42px -12px auto -12px;
  height: 36px;
  background: #73d6ee;
  transform: rotate(-8deg);
  animation: scene-flow 3.2s ease-in-out infinite alternate;
}

.flood-scene::before {
  left: 16px;
  right: 16px;
  bottom: 18px;
  height: 42px;
  background: rgba(115, 214, 238, 0.85);
  animation: flood-rise 2.6s ease-in-out infinite alternate;
}

.survey-scene::before {
  width: 34px;
  height: 34px;
  left: 28px;
  top: 42px;
  background: #efb84a;
  box-shadow: 52px -18px 0 #2eb3a6, 104px 10px 0 #73d6ee;
  animation: survey-pop 1.8s ease-in-out infinite alternate;
}

.data-scene::before {
  left: 20px;
  right: 20px;
  bottom: 24px;
  height: 8px;
  background: white;
  box-shadow: 0 -22px 0 rgba(255, 255, 255, 0.65), 0 -44px 0 rgba(255, 255, 255, 0.35);
}

.data-scene::after {
  width: 24px;
  height: 58px;
  left: 34px;
  bottom: 24px;
  background: #efb84a;
  box-shadow: 48px -22px 0 #2eb3a6, 96px -8px 0 #73d6ee;
  animation: data-pulse 2.2s ease-in-out infinite alternate;
}

.locked-game::after {
  content: "Future game";
  position: absolute;
  top: 14px;
  right: 14px;
  border-radius: 999px;
  padding: 5px 8px;
  color: white;
  background: rgba(23, 35, 33, 0.74);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(280px, 420px);
  gap: 16px;
  align-items: start;
}

#river-map {
  position: relative;
  min-height: 600px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #cfd8cd;
}

.map-data-legend {
  position: absolute;
  z-index: 460;
  left: 14px;
  bottom: 14px;
  max-width: min(320px, calc(100% - 28px));
  padding: 10px 12px;
  border: 1px solid rgba(23, 35, 33, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 32px rgba(21, 45, 39, 0.18);
  backdrop-filter: blur(10px);
}

.map-data-legend h3 {
  margin-bottom: 6px;
  font-size: 0.82rem;
}

.map-data-legend ul {
  display: grid;
  gap: 4px;
  padding: 0;
  list-style: none;
}

.map-data-legend li {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 800;
}

.map-data-legend li span {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 999px;
}

.map-data-legend strong {
  margin-left: auto;
  color: var(--river);
}

.timeline-photo {
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  background-position: center;
  background-size: cover;
  border: 1px solid var(--line);
}

.meta-list {
  display: grid;
  gap: 9px;
  padding: 0;
  list-style: none;
}

.meta-list a,
.meta-list button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
  text-decoration: none;
}

.meta-list button {
  width: 100%;
  cursor: pointer;
}

.meta-list button:hover,
.meta-list a:hover {
  border-color: rgba(35, 118, 105, 0.45);
  box-shadow: 0 10px 22px rgba(21, 45, 39, 0.1);
}

.meta-list strong {
  color: var(--river);
  white-space: nowrap;
}

.source-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.source-toolbar p {
  flex: 1 1 280px;
  margin: 0;
  color: var(--muted);
}

.source-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.source-list li > a {
  min-width: 76px;
  justify-content: center;
  font-weight: 900;
}

.source-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.source-results article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.source-results h3 {
  margin-bottom: 6px;
}

.source-results ol {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-left: 20px;
}

.source-results li span,
.source-results li small,
.source-results li a {
  display: block;
}

.source-results li small {
  color: var(--muted);
}

.dash-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
}

.rail {
  position: sticky;
  top: 82px;
  display: grid;
  gap: 8px;
  align-self: start;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: white;
  font: inherit;
}

textarea {
  min-height: 160px;
  resize: vertical;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.day {
  min-height: 150px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.event {
  border-left: 4px solid var(--river);
  padding: 8px;
  background: #eef6f6;
  border-radius: 6px;
  font-size: 0.9rem;
}

.game-zone {
  color: white;
  background:
    radial-gradient(circle at 20% 10%, rgba(239, 184, 74, 0.22), transparent 28%),
    linear-gradient(135deg, #08161c, #17352e 48%, #26313d);
}

.game-shell {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(520px, 1fr);
  gap: clamp(18px, 3vw, 36px);
  align-items: center;
}

.game-panel {
  display: grid;
  gap: 16px;
}

.game-panel h2 {
  font-size: clamp(2.1rem, 4.8vw, 4.8rem);
}

.score-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 8px;
}

.score-row div,
.event-card {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
}

.rival-row div {
  background: rgba(239, 184, 74, 0.12);
}

.score-row span {
  display: block;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.score-row strong {
  display: block;
  margin-top: 6px;
  font-size: 1.25rem;
}

.player-name-field {
  display: grid;
  gap: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.player-name-field input {
  color: white;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}

.player-name-field input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.health-meter {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.health-meter span {
  display: block;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, #efb84a, #7ecf74);
  transition: width 260ms ease, background 260ms ease;
}

.health-meter span[data-mood="danger"] {
  background: linear-gradient(90deg, #b94646, #efb84a);
}

.health-meter span[data-mood="good"] {
  background: linear-gradient(90deg, #2eb3a6, #b8e86f);
}

.dice-stage {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.dice {
  width: 74px;
  min-height: 74px;
  display: grid;
  place-items: center;
  color: #101b20;
  background: var(--sun);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.dice span {
  font-size: 2.2rem;
  line-height: 1;
}

.dice.rolling {
  animation: dice-shake 520ms ease both;
}

.event-card {
  min-height: 168px;
}

.event-card.pulse {
  animation: card-pop 420ms ease both;
}

.npc-taunt {
  position: relative;
  max-width: 100%;
  padding: 12px 14px 12px 46px;
  border: 2px solid rgba(16, 27, 32, 0.88);
  border-radius: 8px;
  color: #101b20;
  background: #efb84a;
  font-weight: 900;
  line-height: 1.25;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
}

.npc-taunt::before {
  content: "TIM";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: #101b20;
  font-size: 0.58rem;
  transform: translateY(-50%);
}

.npc-taunt::after {
  content: "";
  position: absolute;
  left: 28px;
  bottom: -10px;
  border-width: 10px 9px 0 9px;
  border-style: solid;
  border-color: #efb84a transparent transparent transparent;
}

.npc-taunt[data-mood="behind"] {
  background: #ff8a65;
}

.npc-taunt[data-mood="behind"]::after {
  border-top-color: #ff8a65;
}

.npc-taunt[data-mood="close"] {
  background: #b8e86f;
}

.npc-taunt[data-mood="close"]::after {
  border-top-color: #b8e86f;
}

.npc-taunt[data-mood="win"] {
  color: white;
  background: #2b4d8f;
  border-color: rgba(255, 255, 255, 0.7);
}

.npc-taunt[data-mood="win"]::after {
  border-top-color: #2b4d8f;
}

.npc-taunt[hidden] {
  display: none;
}

.npc-taunt.pop {
  animation: taunt-pop 360ms cubic-bezier(0.2, 1.4, 0.35, 1) both;
}

.choice-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.choice-list[hidden] {
  display: none;
}

.choice-button {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 10px 12px;
  color: white;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  text-align: left;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.choice-button:hover {
  transform: translateX(4px);
  background: rgba(239, 184, 74, 0.22);
  border-color: rgba(239, 184, 74, 0.72);
}

.choice-button span {
  line-height: 1.25;
}

.choice-button strong {
  white-space: nowrap;
  color: #f7df8a;
  font-size: 0.82rem;
}

.event-type {
  display: inline-flex;
  margin-bottom: 8px;
  border-radius: 999px;
  padding: 5px 8px;
  color: #08161c;
  background: white;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
  font-size: 0.88rem;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-chip {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 5px;
}

.leaderboard {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
}

.leaderboard-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.leaderboard ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaderboard li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.leaderboard li span {
  font-weight: 900;
}

.leaderboard li strong {
  color: #f7df8a;
}

.leaderboard li small {
  grid-column: 1 / -1;
  color: rgba(255, 255, 255, 0.7);
}

.leaderboard .empty-board {
  grid-template-columns: 1fr;
  color: rgba(255, 255, 255, 0.72);
}

.small-button {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 0.8rem;
}

.board-wrap {
  position: relative;
  min-width: 0;
}

.river-ribbon {
  position: absolute;
  inset: 4% 6%;
  border-radius: 48% 42% 56% 38%;
  background: linear-gradient(120deg, rgba(33, 172, 194, 0.35), rgba(111, 139, 67, 0.2));
  filter: blur(18px);
  animation: river-drift 7s ease-in-out infinite alternate;
}

.game-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(10, minmax(40px, 1fr));
  gap: 6px;
  max-width: 920px;
  margin-inline: auto;
}

.square {
  aspect-ratio: 1;
  display: grid;
  align-content: space-between;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 8px;
  color: white;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  font-weight: 800;
}

.square::after {
  content: "";
  position: absolute;
  inset: auto -20% -35% -20%;
  height: 56%;
  background: rgba(56, 184, 198, 0.18);
  border-radius: 50% 50% 0 0;
  animation: tile-water 3.4s ease-in-out infinite;
}

.square.boost::before,
.square.slide::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, rgba(5, 17, 22, 0.42), rgba(5, 17, 22, 0.1) 44%, rgba(5, 17, 22, 0.5));
}

.square.boost,
.legend-chip.boost {
  background:
    linear-gradient(145deg, rgba(46, 179, 166, 0.42), rgba(126, 207, 116, 0.36)),
    url("/assets/images/baffle-boost-tile.webp") center/cover;
}

.square.slide,
.legend-chip.slide {
  background:
    linear-gradient(145deg, rgba(157, 77, 134, 0.42), rgba(228, 109, 77, 0.36)),
    url("/assets/images/eel-setback-tile.webp") center/cover;
}

.square.challenge,
.legend-chip.challenge {
  background: linear-gradient(145deg, #efb84a, #d7813f);
}

.square.finish,
.legend-chip.finish {
  background: linear-gradient(145deg, #73d6ee, #f0e08a);
  color: #0d1d23;
}

.square.source {
  background: linear-gradient(145deg, #415f76, #2eb3a6);
}

.square.riffle {
  background: linear-gradient(145deg, rgba(100, 188, 202, 0.38), rgba(255, 255, 255, 0.08));
}

.square.pool {
  background: linear-gradient(145deg, rgba(48, 75, 132, 0.55), rgba(255, 255, 255, 0.08));
}

.cell-number {
  position: relative;
  z-index: 1;
  font-size: clamp(0.72rem, 1vw, 0.95rem);
}

.cell-label {
  position: relative;
  z-index: 1;
  max-width: 100%;
  font-size: clamp(0.56rem, 0.8vw, 0.72rem);
  line-height: 1.15;
  text-transform: uppercase;
}

.player {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 3;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 3px solid white;
  border-radius: 999px;
  color: white;
  background: #181d28;
  font-size: 0.68rem;
  transform: translate(-50%, -50%);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35), 0 0 0 8px rgba(239, 184, 74, 0.28);
  animation: player-bob 900ms ease-in-out infinite alternate;
}

.npc-player {
  background: #efb84a;
  color: #101b20;
  border-color: #101b20;
  transform: translate(-15%, -18%);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3), 0 0 0 7px rgba(46, 179, 166, 0.28);
  animation-name: npc-bob;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

@keyframes player-bob {
  from { transform: translate(-50%, -54%) scale(1); }
  to { transform: translate(-50%, -46%) scale(1.05); }
}

@keyframes npc-bob {
  from { transform: translate(-18%, -22%) scale(1); }
  to { transform: translate(-12%, -14%) scale(1.05); }
}

@keyframes tile-water {
  from { transform: translateX(-8%); }
  to { transform: translateX(8%); }
}

@keyframes river-drift {
  from { transform: rotate(-2deg) scale(0.98); }
  to { transform: rotate(3deg) scale(1.03); }
}

@keyframes dice-shake {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-12deg) scale(1.08); }
  50% { transform: rotate(14deg) scale(0.96); }
  75% { transform: rotate(-8deg) scale(1.04); }
}

@keyframes card-pop {
  0% { transform: translateY(8px); opacity: 0.5; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes taunt-pop {
  0% { transform: translateY(12px) rotate(-2deg) scale(0.86); opacity: 0; }
  70% { transform: translateY(-3px) rotate(1deg) scale(1.04); opacity: 1; }
  100% { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
}

@keyframes hero-float {
  from { transform: rotate(1deg) translateY(0); }
  to { transform: rotate(-1deg) translateY(-12px); }
}

@keyframes swim-across {
  from { transform: translateX(0) translateY(0); }
  to { transform: translateX(118vw) translateY(-24px); }
}

@keyframes scene-flow {
  from { transform: rotate(-8deg) translateX(-16px); }
  to { transform: rotate(8deg) translateX(16px); }
}

@keyframes flood-rise {
  from { transform: translateY(18px); opacity: 0.55; }
  to { transform: translateY(-8px); opacity: 0.95; }
}

@keyframes survey-pop {
  from { transform: scale(0.92); }
  to { transform: scale(1.08); }
}

@keyframes data-pulse {
  from { transform: scaleY(0.72); transform-origin: bottom; }
  to { transform: scaleY(1); transform-origin: bottom; }
}

.resource-list {
  display: grid;
  gap: 14px;
}

.media-thumb {
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(33, 124, 136, 0.8), rgba(239, 184, 74, 0.7)),
    url("https://images.unsplash.com/photo-1518837695005-2083093ee35b?auto=format&fit=crop&w=1000&q=80") center/cover;
}

.footer {
  padding: 30px clamp(18px, 4vw, 54px);
  color: white;
  background: #172321;
}

@media (max-width: 820px) {
  .site-header,
  .section-header,
  .portfolio-strip,
  .map-layout,
  .dash-grid,
  .approach-grid,
  .appointment-grid {
    grid-template-columns: 1fr;
  }

  .site-header,
  .section-header {
    align-items: start;
  }

  .nav {
    width: 100%;
  }

  .nav a {
    flex: 1 1 auto;
    text-align: center;
  }

  .calendar {
    grid-template-columns: 1fr;
  }

  .workdash-page .section {
    padding-inline: 10px;
  }

  .workdash-page .page-title {
    padding-inline: 16px;
  }

  .workdash-page .toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .workdash-page .toolbar button,
  .workdash-page .toolbar input,
  .workdash-page .toolbar select {
    min-height: 48px;
  }

  #river-map {
    height: 68vh;
    min-height: 460px;
    border-radius: 0;
    margin-inline: -10px;
    border-left: 0;
    border-right: 0;
  }

  .workdash-page .leaflet-touch .leaflet-bar a,
  .workdash-page .leaflet-touch .leaflet-control-layers-toggle {
    width: 46px;
    height: 46px;
    line-height: 46px;
  }

  .workdash-page .leaflet-control-layers {
    max-width: calc(100vw - 24px);
    border-radius: 8px;
    font-size: 0.92rem;
  }

  .workdash-page .leaflet-control-layers-expanded {
    max-height: 46vh;
    overflow: auto;
  }

  .workdash-page .leaflet-control-layers label {
    min-height: 36px;
    display: flex;
    align-items: center;
  }

  .workdash-page .leaflet-popup-content {
    max-width: min(72vw, 280px);
    font-size: 0.95rem;
  }

  .map-data-legend {
    left: 10px;
    bottom: 22px;
    max-width: min(260px, calc(100% - 20px));
    max-height: 30vh;
    overflow: auto;
    padding: 8px 10px;
  }

  .map-data-legend li {
    font-size: 0.72rem;
  }

  .source-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }

  .source-toolbar p {
    grid-column: 1 / -1;
    font-size: 0.92rem;
  }

  .source-toolbar button,
  .meta-list a,
  .meta-list button {
    min-height: 50px;
  }

  .source-list li {
    grid-template-columns: minmax(0, 1fr) minmax(62px, 74px);
  }

  .source-list li > a {
    min-width: 0;
    padding-inline: 8px;
  }

  .meta-list a,
  .meta-list button {
    padding: 10px;
    font-size: 0.93rem;
  }

  .meta-list strong {
    font-size: 0.82rem;
  }

  .source-results {
    grid-template-columns: 1fr;
  }

  [data-project-panel] {
    padding: 14px;
  }

  .game-shell {
    grid-template-columns: 1fr;
  }

  .education-hub-hero,
  .game-hero,
  .game-card-grid {
    grid-template-columns: 1fr;
  }

  .education-hub-hero,
  .game-hero {
    min-height: auto;
  }

  .featured-game {
    grid-column: span 1;
  }

  .game-board {
    grid-template-columns: repeat(10, minmax(25px, 1fr));
    gap: 4px;
  }

  .square {
    padding: 5px;
  }

  .cell-label {
    display: none;
  }

  .player {
    width: 28px;
    height: 28px;
    font-size: 0.5rem;
  }

  .score-row,
  .legend {
    grid-template-columns: 1fr;
  }

  .choice-button {
    grid-template-columns: 1fr;
  }

  .choice-button strong {
    white-space: normal;
  }
}
