@font-face {
  font-family: "HN Condensed Black";
  src: local("Helvetica Neue Condensed Black"), local("HelveticaNeue-CondensedBlack");
  font-weight: 900;
  font-display: swap;
}
:root {
  --paper: #f4eee3;
  --ink: #2c2722;
  --muted: #6f655b;
  --line: rgba(44, 39, 34, .16);
  --coral: #d4654e;
  --cream: #fbf6ee;
  --display: "HN Condensed Black", "Helvetica Neue Condensed Black", "Arial Narrow", Helvetica, sans-serif;
  --body: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--body); background: var(--paper); color: var(--ink); min-height: 100vh; }
.nav {
  position: sticky; top: 0; z-index: 40;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 16px 28px; background: rgba(244, 238, 227, .9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--display); font-weight: 900; letter-spacing: -0.03em; font-size: 22px; text-decoration: none; color: inherit; display: inline-flex; align-items: center; gap: 2px; }
.brand .mark { height: 28px; width: 28px; object-fit: cover; border-radius: 4px; flex: 0 0 28px; }
.brand i { font-style: normal; color: var(--coral); margin-right: 0.26em; }
.indicator { justify-self: center; font-family: var(--display); font-weight: 900; font-size: 22px; }
.brand-wrap { position: relative; justify-self: center; }
.brand-btn { background: none; border: none; cursor: pointer; font-family: var(--display); font-weight: 900; letter-spacing: -0.03em; font-size: 22px; color: inherit; padding: 0; }
.brand-drop {
  position: absolute; top: 120%; left: 50%; transform: translateX(-50%); min-width: 180px;
  background: #fbf6ee; border: 1px solid var(--line); border-radius: 14px;
  padding: 8px; display: none; z-index: 50;
  box-shadow: 0 16px 40px rgba(70, 42, 18, 0.12);
}
.brand-wrap.is-open .brand-drop { display: block; }
.brand-drop a { display: block; padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: 15px; }
.brand-drop a:hover { background: rgba(44, 39, 34, 0.06); }
.nav-right { justify-self: end; display: flex; gap: 10px; align-items: center; }
.chip { border: 1px solid var(--line); background: rgba(251, 246, 238, .78); border-radius: 999px; padding: 8px 14px; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); text-decoration: none; cursor: pointer; }
.page-wrap { padding: 28px 28px 40px; }
h1 { font-family: var(--display); font-weight: 900; font-size: clamp(36px, 5vw, 56px); letter-spacing: -0.03em; margin-bottom: 4px; }
.sub { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.dots-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.dot, .dot-skip { width: auto; min-width: 34px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; font-family: var(--mono); font-size: 11px; color: var(--ink); cursor: pointer; }
.dot.on { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.reader { min-height: 62vh; }
.windows { display: flex; gap: 10px; height: 68vh; min-height: 480px; position: relative; overflow: hidden; }
.window { position: relative; flex: 0.18 1 0; min-width: 0; border-radius: 18px; overflow: hidden; cursor: pointer; background: #efe6d6; transition: flex .9s cubic-bezier(.2, .8, .2, 1); height: 100%; }
.window.is-open { flex: 5.2 1 0; cursor: default; }
.book-side { background: #efe6d6; position: absolute; inset: 0; overflow: hidden; }
.window:not(.is-open) .book-side > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center center;
  transition: transform 1.6s ease;
  transform: scale(1);
}
.window:not(.is-open):hover .book-side > img {
  transform: scale(1.08);
  animation: none;
}
.shade { position: absolute; inset: 0; background: rgba(44, 39, 34, .18); pointer-events: none; }
.window.is-open .shade { display: none; }
.strip-name {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--display); font-weight: 900; font-size: 18px; letter-spacing: 0.02em;
  color: #2c2722; pointer-events: none;
}
.window.is-open .split.learn-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr);
  grid-template-rows: auto minmax(0, 1fr);
  position: absolute;
  inset: 0;
}
.panel-kicker {
  font-family: var(--display);
  font-weight: 900;
  font-size: 40px;
  letter-spacing: -0.03em;
  line-height: 1;
  padding: 14px 18px 6px;
  align-self: end;
}
.q-kicker { grid-column: 1; grid-row: 1; }
.a-kicker { grid-column: 2; grid-row: 1; }
.q-head {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: end;
  min-width: 0;
}
.study-head {
  grid-column: 1 / -1;
  grid-row: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr);
  align-items: end;
  min-width: 0;
  padding-top: 6px;
}
.head-aside {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 12px;
  min-width: 0;
  padding-right: 12px;
}
.head-aside .a-kicker { flex: 0 0 auto; grid-column: auto; grid-row: auto; }
.window.is-open .book-side { position: relative; height: 100%; min-width: 0; }
.word-panel, .def-panel { min-width: 0; min-height: 0; grid-row: 2; }
.word-panel { grid-column: 1; }
.def-panel { grid-column: 2; }
.word-panel {
  display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
  gap: 12px; padding: 8px 18px 18px; overflow: auto; background: #efe6d6;
}
.def-panel {
  background: rgba(251, 246, 238, 0.72);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
  padding: 14px; height: 100%; overflow: hidden; text-align: left;
}
.def-body { flex: 1 1 auto; min-height: 0; overflow: auto; }
/* Fixed study frame. Zoom and the bob stay on the picture inside it. */
.learn-figure {
  position: relative;
  flex: 0 1 auto;
  width: 100%;
  height: auto;
  max-height: none;
  min-height: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transform: none;
  scale: 1;
  border-radius: 12px;
}
.learn-figure[hidden] { display: none !important; }
.learn-photo,
.window .book-side .learn-photo {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
  object-fit: contain;
  object-position: center center;
  border-radius: 0;
  background: transparent;
  display: block;
  transform-origin: center center;
  transform: none;
  scale: 1;
  transition: scale 1.6s ease, transform 1.6s ease;
  animation: none;
}
.learn-figure:hover .learn-photo,
.window .book-side .learn-figure:hover .learn-photo {
  scale: 1.08;
  animation: floaterMotion1 3.6s ease-in-out 1.6s infinite;
}
.learn-mark {
  font-family: var(--display); font-weight: 900; font-size: clamp(64px, 7vw, 108px);
  letter-spacing: -0.04em; line-height: 0.85; color: #2c2722;
}
.word-prompt {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(56px, 6vw, 92px); letter-spacing: -0.03em; line-height: 0.92;
  padding: 14px 40px;
  box-sizing: border-box;
}
.group-title {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(44px, 4.6vw, 68px); letter-spacing: -0.03em; line-height: 0.95; margin-bottom: 8px;
  padding: 14px 40px 4px;
  box-sizing: border-box;
}
.learn-progress { font-family: var(--mono); font-size: 16px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); min-height: 20px; margin-bottom: 12px; }
.def-prompt, .welcome-copy {
  font-family: var(--body); font-size: 36px; line-height: 1.35; margin-bottom: 14px; color: #2c2722;
  padding: 14px 40px;
  box-sizing: border-box;
}
.choice-list {
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
  width: 100%; box-sizing: border-box; padding: 12px 8% 18px;
}
.word-panel > #wordChoices[hidden] { display: none !important; }
.capital-choice {
  width: 100%; min-height: 58px; border-radius: 999px;
  border: 1.5px solid rgba(44, 39, 34, 0.45); background: #fff; color: #2c2722;
  font-family: var(--display); font-weight: 900; font-size: clamp(32px, 2.4vw, 44px);
  letter-spacing: -0.02em; line-height: 1.15; padding: 12px 28px; cursor: pointer;
  text-align: center; display: block; overflow: hidden; box-sizing: border-box;
  transform-origin: center center;
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.capital-choice.def-choice {
  font-family: var(--body); font-weight: 500; font-size: 28px; line-height: 1.35;
  text-align: left; height: auto; white-space: normal; padding: 16px 36px;
}
.capital-choice.def-choice .choice-word { display: block; width: 100%; }
.capital-choice .choice-word { display: inline-block; max-width: 100%; }
.capital-choice:hover:not(.is-right):not(.is-wrong),
.capital-choice:focus-visible:not(.is-right):not(.is-wrong) {
  background: #111;
  color: #fbf6ee;
  border-color: #111;
  transform: scale(1.06);
}
.capital-choice.is-wrong { background: #e10600; border-color: #e10600; color: #fff; }
.capital-choice.is-right { background: #1f9d32; border-color: #1f9d32; color: #fff; }
.play-dock { margin-top: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; width: 100%; padding-top: 10px; }
.level-row, .mode-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-start; width: 100%; box-sizing: border-box; padding: 6px 4px; }
.study-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  padding: 16px 18px;
  overflow: visible;
}
.study-nav .chip {
  font-size: 20px;
  letter-spacing: .1em;
  line-height: 1.15;
  padding: 18px 40px;
  min-height: 64px;
  white-space: nowrap;
}
.study-nav #studyBack,
.study-nav #studyNext,
.study-nav #playBack,
.study-nav #moreFacts {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.15;
  padding: 13.5px 30px;
  min-height: 48px;
}
.controls { display: flex; gap: 10px; flex-wrap: wrap; width: 100%; box-sizing: border-box; padding: 6px 4px; }
.learn-split .chip {
  border-radius: 999px;
  transform-origin: center center;
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.learn-split .chip:hover:not(:disabled),
.learn-split .chip:focus-visible:not(:disabled) {
  transform: scale(1.06);
  background: #111;
  color: #fbf6ee;
  border-color: #111;
}
.learn-split .chip:disabled { opacity: 0.4; }
.study-block { display: flex; flex-direction: column; align-items: stretch; gap: 12px; width: 100%; }
.learn-split.is-play .study-block,
.learn-split.is-play .word-search,
.learn-split.is-play .study-nav { display: none; }
.learn-split.is-study #defChoices { display: none; }
.learn-split.is-study .def-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto auto;
  overflow: visible;
}
.learn-split.is-study .def-body {
  grid-row: 1;
  align-self: stretch;
  min-height: 0;
  overflow: auto;
}
.learn-split.is-study .study-nav {
  grid-row: 2;
  align-self: end;
  justify-self: start;
  width: auto;
  max-width: 100%;
  margin: 0;
  position: relative;
  z-index: 3;
  overflow: visible;
}
.learn-split.is-study .play-dock {
  grid-row: 3;
  align-self: end;
  justify-self: stretch;
  min-height: 0;
  margin-top: 0;
  overflow: visible;
}
.study-def {
  font-family: var(--body); font-size: 40px; line-height: 1.35; margin: 0;
  color: #2c2722;
  padding: 14px 40px;
  box-sizing: border-box;
}
.study-fact-gap { height: 48px; flex: 0 0 48px; }
.study-fact-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(32px, 3vw, 48px);
  letter-spacing: -0.03em;
  line-height: 1;
  color: #2c2722;
  padding: 14px 40px;
  box-sizing: border-box;
}
.study-fact {
  margin: 0;
  font-family: var(--body);
  font-size: clamp(28px, 2.2vw, 40px);
  line-height: 1.35;
  color: #2c2722;
  padding: 10px 40px 14px;
  box-sizing: border-box;
}
.geography-page .learn-split.is-study .def-body {
  display: flex;
  flex-direction: column;
}
.geography-page .learn-split.is-study #studyBlock { order: 1; }
.geography-page .learn-split.is-study #defChoices { order: 2; }
.geography-page .learn-split.is-study #highScore { order: 3; margin-top: 16px; }
.geography-page .learn-photo,
.geography-page .learn-figure img {
  object-fit: contain !important;
  object-position: center center !important;
  aspect-ratio: auto !important;
}
.word-search {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 0 1 auto;
  width: min(400px, calc(100% - 190px));
  max-width: 400px;
  margin: 0 0 0 auto;
  box-sizing: border-box;
  padding: 8px 10px 6px 4px;
}
.word-search .chip { flex: 0 0 auto; }
.word-search input {
  flex: 1 1 auto; min-width: 0; width: 100%; min-height: 54px; border-radius: 999px;
  border: 1.5px solid rgba(44, 39, 34, 0.45); background: #fff; color: #2c2722;
  font-family: var(--body); font-size: 28px; line-height: 1.2; padding: 8px 20px;
}
.word-search input:focus { outline: 2px solid #111; outline-offset: 2px; }
.search-note { font-family: var(--body); font-size: 24px; line-height: 1.3; margin: 0; color: #8a8175; min-height: 0; padding: 10px 40px; box-sizing: border-box; }
.search-note:empty { display: none; }
.learn-split.is-study .group-title,
.learn-split.is-study .learn-progress { display: none; }
.word-prompt:empty,
.def-prompt:empty { display: none; }
.learn-split.is-play .word-prompt,
.learn-split.is-play .def-prompt { order: 1; }
.learn-split.is-play .learn-figure { order: 2; }
.learn-split.is-play .group-title {
  order: 3;
  display: block;
  width: 100%;
  margin: 2px 0 0;
  padding: 8px 12px 0;
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-align: center;
}
.learn-split.is-play .learn-progress { order: 4; margin-top: 6px; margin-bottom: 0; }
.learn-split.is-study .word-prompt { order: 1; margin-top: 8px; }
.learn-split.is-study .learn-figure {
  order: 2;
  flex: 0 1 auto;
  width: 100%;
  max-width: 100%;
  max-height: none;
  height: auto;
  overflow: hidden;
  transform: none;
}
.geography-page .windows {
  height: auto;
  min-height: 68vh;
}
.geography-page .window.is-open {
  height: auto;
  min-height: 68vh;
}
.geography-page .window.is-open .split.learn-split {
  position: relative;
  inset: auto;
  height: auto;
  min-height: 68vh;
}
.geography-page .window.is-open .split.learn-split.is-study {
  height: 68vh;
  max-height: 68vh;
}
.geography-page .word-panel { padding-left: 10px; padding-right: 10px; overflow: auto; }
.geography-page .learn-split.is-study .def-panel {
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: visible;
  grid-template-rows: minmax(0, 1fr) auto auto;
}
.geography-page .learn-split.is-study .def-body {
  overflow: auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
}
.geography-page .learn-figure,
.geography-page .learn-split.is-study .learn-figure,
.geography-page .learn-split.is-play .learn-figure {
  width: 100%;
  max-width: 100%;
  max-height: none;
  height: auto;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
  transform: none;
  scale: 1;
}
.geography-page .learn-photo,
.geography-page .learn-figure img {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
  object-fit: contain !important;
  object-position: center center !important;
  aspect-ratio: auto !important;
  transform: none;
  scale: 1;
  transform-origin: center center;
  transition: scale 1.6s ease, transform 1.6s ease;
  animation: none;
}
.geography-page .learn-figure:hover .learn-photo,
.geography-page .learn-figure:hover img {
  scale: 1.08;
  animation: floaterMotion1 3.6s ease-in-out 1.6s infinite;
}
.score-timer { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; width: 100%; margin-top: 4px; }
.play-score { font-family: var(--display); font-size: 30px; font-weight: 900; letter-spacing: -0.03em; text-transform: none; color: var(--ink); text-align: left; line-height: 1.15; }
.play-timer { font-family: var(--body); font-size: 30px; font-weight: 400; letter-spacing: normal; text-transform: none; color: var(--ink); text-align: right; line-height: 1.15; margin-left: auto; }
.high-score { align-self: flex-end; width: 100%; margin: 0 0 8px; text-align: right; font-family: var(--display); font-weight: 900; font-size: 22px; letter-spacing: -0.03em; line-height: 1; }
.play-status { font-family: var(--display); font-weight: 900; font-size: 28px; letter-spacing: -0.03em; color: #e10600; text-align: left; width: 100%; min-height: 0; }
.play-status:empty { display: none; }
.chip.on, #playBtn.on, #restartBtn.on { background: #111; color: #fff; border-color: #111; }
.celebration { position: fixed; inset: 0; pointer-events: none; z-index: 80; display: none; }
.celebration.show { display: block; }
.cheer-msg { position: absolute; top: 30%; left: 50%; transform: translate(-50%, -50%); background: #2c2722; color: #fbf6ee; padding: 16px 28px; border-radius: 999px; font-family: var(--display); font-size: 28px; font-weight: 900; white-space: nowrap; }
@media (max-width: 800px) {
  .window.is-open .split.learn-split { display: flex; flex-direction: column; position: relative; height: auto; }
  .windows { height: auto; min-height: 0; }
  .window.is-open { height: auto; }
  .q-kicker, .a-kicker { align-self: start; }
  .study-head { width: 100%; }
  .study-head .q-kicker, .study-head .a-kicker { align-self: end; }
  .head-aside { flex-wrap: wrap; }
  .head-aside .word-search { flex: 1 1 220px; width: min(400px, 100%); max-width: none; }
  .def-panel { border-left: none; border-top: 1px solid var(--line); height: auto; }
  .learn-split.is-study .def-panel { height: 72vh; min-height: 480px; }
  .word-panel { min-height: 220px; }
  .learn-figure { width: 100%; height: auto; flex: 0 1 auto; max-height: none; overflow: hidden; }
}
/* Closed side strips fill the strip. The open study picture stays contain. */
.dictionary-page .window:not(.is-open) .book-side > img,
.science-page .window:not(.is-open) .book-side > img,
.geography-page .window:not(.is-open) .book-side > img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center center !important;
}
