:root {
  --paper: #f4efe4;
  --paper-bright: #fffdf8;
  --paper-deep: #e9e0d0;
  --ink: #172b26;
  --ink-soft: #52605b;
  --coral: #df5a43;
  --coral-dark: #b9412f;
  --gold: #d5a74a;
  --green: #315b4e;
  --line: rgba(23, 43, 38, 0.16);
  --shadow: 0 24px 70px rgba(50, 42, 25, 0.12);
  --serif: Iowan Old Style, Baskerville, "Times New Roman", Georgia, serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 110px;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 12px 18px;
  color: white;
  background: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1240px, calc(100% - 64px));
  min-height: 88px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
}

.brand-name {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-mark {
  display: grid;
  grid-template-columns: auto 15px auto;
  gap: 3px;
  align-items: end;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.brand-mark i {
  display: block;
  height: 2px;
  margin-bottom: 2px;
  background: var(--coral);
}

.main-nav {
  display: flex;
  gap: 34px;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
}

.main-nav > a {
  position: relative;
  text-decoration: none;
}

.main-nav > a::after {
  position: absolute;
  right: 0;
  bottom: -6px;
  left: 0;
  height: 1px;
  content: "";
  background: var(--coral);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.main-nav > a:hover::after,
.main-nav > a:focus-visible::after {
  transform: scaleX(1);
}

.profile-chip {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
  background: none;
  border: 0;
  cursor: pointer;
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  color: var(--paper-bright);
  background: var(--ink);
  border-radius: 50%;
  place-items: center;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 0.86fr;
  gap: 72px;
  align-items: center;
  width: min(1170px, calc(100% - 64px));
  min-height: 690px;
  padding: 72px 0 92px;
  margin: 0 auto;
}

.hero::before {
  position: absolute;
  top: 60px;
  left: -180px;
  z-index: -1;
  width: 340px;
  height: 340px;
  content: "";
  border: 1px solid rgba(213, 167, 74, 0.28);
  border-radius: 50%;
}

.kicker {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 18px;
  color: var(--coral-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1.4;
  text-transform: uppercase;
}

.kicker > span {
  width: 25px;
  height: 1px;
  background: currentColor;
}

.hero h1 {
  max-width: 700px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(68px, 7.2vw, 105px);
  font-weight: 600;
  line-height: 0.87;
  letter-spacing: -0.065em;
}

.hero h1 em {
  color: var(--coral);
  font-weight: 400;
}

.hero-intro {
  max-width: 590px;
  margin: 36px 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  gap: 28px;
  align-items: center;
  margin-top: 38px;
}

.button {
  display: inline-flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 23px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: #fff;
  background: var(--coral);
  box-shadow: 0 10px 30px rgba(185, 65, 47, 0.2);
}

.button-primary:hover {
  background: var(--coral-dark);
  box-shadow: 0 14px 34px rgba(185, 65, 47, 0.25);
}

.button-primary:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.button-full {
  width: 100%;
}

.text-link {
  padding: 12px 0 7px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
}

.hero-proof {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 36px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-proof span:not(:last-child)::after {
  margin-left: 12px;
  content: "·";
}

.proof-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 4px 1px 0;
  background: #5c8a64;
  border-radius: 50%;
}

.hero-art {
  position: relative;
  min-height: 500px;
  perspective: 1200px;
}

.hero-art::before {
  position: absolute;
  top: 28px;
  right: -14px;
  bottom: 18px;
  left: 55px;
  content: "";
  background: var(--ink);
  transform: rotate(4deg);
}

.sample-page {
  position: absolute;
  inset: 0 10px 0 20px;
  display: flex;
  flex-direction: column;
  padding: 36px 42px 31px;
  background: var(--paper-bright);
  box-shadow: var(--shadow);
  transform: rotate(-2.1deg);
  transition: transform 400ms cubic-bezier(.2,.8,.2,1);
}

.hero-art:hover .sample-page {
  transform: rotate(-0.5deg) translateY(-6px);
}

.sample-topline,
.sample-footer {
  display: flex;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.sample-title {
  margin: 42px 0 4px;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 700;
}

.sample-byline {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.sample-rule {
  width: 100%;
  height: 1px;
  margin: 22px 0 25px;
  background: var(--line);
}

.sample-page blockquote {
  flex: 1;
  margin: 0;
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.7;
}

.sample-blank {
  position: relative;
  display: inline-flex;
  min-width: 79px;
  height: 28px;
  margin: 0 3px;
  vertical-align: text-bottom;
  background: rgba(213, 167, 74, 0.14);
  border-bottom: 2px solid var(--gold);
}

.sample-blank.filled {
  align-items: center;
  justify-content: center;
  color: #2d634c;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 800;
  background: rgba(76, 137, 94, 0.12);
  border-color: #4d8a61;
}

.sample-score {
  align-self: flex-end;
  padding: 8px 12px;
  margin: 3px 0 21px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
  background: #f4efe4;
}

.sample-score span {
  margin-right: 6px;
  color: #387550;
  font-weight: 900;
}

.orbit {
  position: absolute;
  z-index: 3;
  display: grid;
  width: 52px;
  height: 52px;
  color: white;
  font-family: var(--serif);
  font-size: 23px;
  background: var(--coral);
  border-radius: 50%;
  box-shadow: 0 12px 25px rgba(92, 51, 40, 0.2);
  place-items: center;
}

.orbit-one {
  top: -24px;
  right: 50px;
  animation: bob 4s ease-in-out infinite;
}

.orbit-two {
  right: -12px;
  bottom: 75px;
  width: 42px;
  height: 42px;
  color: var(--ink);
  font-size: 18px;
  background: var(--gold);
  animation: bob 4s 1s ease-in-out infinite;
}

.scribble {
  position: absolute;
  right: -15px;
  bottom: 12px;
  z-index: 3;
  color: var(--coral);
  font-family: "Bradley Hand", cursive;
  font-size: 22px;
  transform: rotate(-8deg);
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(4deg); }
  50% { transform: translateY(-9px) rotate(-3deg); }
}

.stat-ribbon {
  display: grid;
  grid-template-columns: repeat(3, 1fr) 1.6fr;
  min-height: 125px;
  padding: 0 max(32px, calc((100% - 1170px) / 2));
  color: white;
  background: var(--ink);
}

.stat-ribbon > div,
.stat-ribbon > p {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 34px;
  margin: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.stat-ribbon strong {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 500;
}

.stat-ribbon span {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stat-ribbon > p {
  align-items: flex-end;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 18px;
  font-style: italic;
  line-height: 1.4;
  text-align: right;
  border: 0;
}

.section {
  width: min(1170px, calc(100% - 64px));
  padding: 112px 0;
  margin: 0 auto;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 44px;
}

.section-heading h2,
.leaderboard-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(42px, 5vw, 62px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
}

.section-heading .kicker {
  margin-bottom: 14px;
}

.section-date {
  margin: 0 0 7px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 15px;
  font-style: italic;
}

.daily-card {
  position: relative;
  display: grid;
  grid-template-columns: 0.5fr 1.2fr 0.36fr;
  gap: 58px;
  align-items: center;
  min-height: 390px;
  padding: 48px 58px;
  overflow: hidden;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 20px 60px rgba(23, 43, 38, 0.16);
}

.daily-card::after {
  position: absolute;
  right: -110px;
  bottom: -180px;
  width: 430px;
  height: 430px;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.daily-number {
  position: absolute;
  top: -28px;
  left: 12px;
  color: rgba(255, 255, 255, 0.035);
  font-family: var(--serif);
  font-size: 260px;
  line-height: 1;
}

.book-glyph {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 190px;
  height: 240px;
  margin: auto;
}

.book-glyph span {
  width: 61px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-bottom: 8px solid var(--coral);
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.03);
}

.book-glyph span:nth-child(1) { height: 180px; transform: rotate(-7deg); }
.book-glyph span:nth-child(2) { height: 218px; margin-left: -4px; }
.book-glyph span:nth-child(3) { height: 160px; margin-left: 2px; transform: rotate(8deg); }

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

.pill-row {
  display: flex;
  gap: 18px;
  align-items: center;
}

.pill {
  padding: 6px 9px;
  color: var(--ink);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--gold);
}

.public-domain-mark {
  color: rgba(255, 255, 255, 0.5);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.public-domain-mark::before {
  margin-right: 7px;
  color: #7da28e;
  content: "●";
}

.daily-copy h3 {
  margin: 21px 0 7px;
  font-family: var(--serif);
  font-size: clamp(34px, 4vw, 51px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

#daily-passage-author {
  margin: 0 0 25px;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 15px;
  font-style: italic;
}

.daily-teaser {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 255, 255, 0.65);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.55;
}

.daily-meta {
  display: flex;
  gap: 36px;
  margin: 28px 0 0;
}

.daily-meta div {
  padding-left: 11px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.daily-meta dt {
  color: rgba(255, 255, 255, 0.42);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.daily-meta dd {
  margin: 5px 0 0;
  font-family: var(--serif);
  font-size: 15px;
}

.round-play {
  position: relative;
  z-index: 2;
  display: grid;
  width: 104px;
  height: 104px;
  color: #fff;
  background: var(--coral);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  place-items: center;
  transition: transform 200ms ease, background 200ms ease;
}

.round-play:hover {
  background: var(--coral-dark);
  transform: rotate(-5deg) scale(1.05);
}

.round-play span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: translateY(10px);
}

.round-play i {
  font-size: 24px;
  font-style: normal;
  transform: translateY(-11px);
}

.how-section {
  width: 100%;
  padding-right: max(32px, calc((100% - 1170px) / 2));
  padding-left: max(32px, calc((100% - 1170px) / 2));
  background: var(--paper-deep);
}

.section-heading.centered {
  align-items: flex-end;
}

.section-heading.centered > p {
  max-width: 260px;
  margin: 0 0 6px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
  line-height: 1.45;
  text-align: right;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 0;
  margin: 68px 0 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.steps li {
  position: relative;
  min-height: 285px;
  padding: 35px 44px 25px 0;
}

.steps li:not(:last-child) {
  margin-right: 44px;
  border-right: 1px solid var(--line);
}

.step-number {
  position: absolute;
  top: -10px;
  left: 0;
  padding-right: 10px;
  color: var(--coral-dark);
  font-size: 10px;
  font-weight: 900;
  background: var(--paper-deep);
}

.step-icon {
  display: flex;
  align-items: center;
  height: 80px;
  color: var(--coral);
  font-family: var(--serif);
  font-size: 40px;
}

.step-icon.pencil {
  font-size: 49px;
}

.steps h3 {
  margin: 12px 0 12px;
  font-family: var(--serif);
  font-size: 24px;
}

.steps p {
  max-width: 290px;
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.6;
}

.library-section {
  padding-bottom: 132px;
}

.library-controls {
  min-width: 285px;
}

.search-field {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--ink);
}

.search-field > span {
  font-size: 20px;
}

.search-field input {
  width: 100%;
  padding: 4px 2px;
  color: var(--ink);
  background: none;
  border: 0;
  outline: none;
}

.search-field input::placeholder {
  color: #8f918a;
  font-family: var(--serif);
  font-style: italic;
}

.filter-row {
  display: flex;
  gap: 8px;
  margin: -14px 0 35px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-row button {
  flex: 0 0 auto;
  padding: 8px 12px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.filter-row button.active,
.filter-row button:hover {
  color: white;
  background: var(--ink);
  border-color: var(--ink);
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.book-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 335px;
  padding: 28px;
  overflow: hidden;
  text-align: left;
  background: var(--paper-bright);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.book-card:hover,
.book-card:focus-visible {
  z-index: 1;
  border-color: rgba(23, 43, 38, 0.35);
  box-shadow: 0 20px 45px rgba(36, 37, 29, 0.1);
  outline: none;
  transform: translateY(-6px) rotate(-0.5deg);
}

.book-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 6px;
  content: "";
  background: var(--card-accent, var(--coral));
}

.book-card[data-accent="gold"] { --card-accent: var(--gold); }
.book-card[data-accent="green"] { --card-accent: #5d8a6c; }
.book-card[data-accent="blue"] { --card-accent: #527c91; }
.book-card[data-accent="navy"] { --card-accent: #29445f; }
.book-card[data-accent="red"] { --card-accent: #9f3a33; }
.book-card[data-accent="rose"] { --card-accent: #c47770; }

.book-card-top {
  display: flex;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.book-card-ornament {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 35px 0 24px;
  color: var(--card-accent);
  font-family: var(--serif);
  font-size: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  place-items: center;
}

.book-card h3 {
  margin: auto 0 8px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -0.025em;
}

.book-card-author {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 13px;
  font-style: italic;
}

.book-card-footer {
  display: flex;
  justify-content: space-between;
  padding-top: 20px;
  margin-top: 22px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  border-top: 1px solid var(--line);
}

.book-card-footer span:last-child {
  color: var(--coral-dark);
}

.empty-state {
  padding: 50px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 19px;
  text-align: center;
  border: 1px dashed var(--line);
}

.leaderboard-section {
  width: 100%;
  padding: 0;
}

.leaderboard-card {
  padding: 95px max(32px, calc((100% - 1170px) / 2)) 105px;
  color: white;
  background: var(--ink);
}

.leaderboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 48px;
}

.kicker.light {
  color: var(--gold);
}

.range-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.07);
}

.range-tabs button {
  padding: 9px 14px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.range-tabs button.active {
  color: var(--ink);
  background: var(--paper);
}

.leaderboard-table {
  min-height: 210px;
}

.leader-row {
  display: grid;
  grid-template-columns: 45px minmax(150px, 1fr) minmax(140px, 0.9fr) 90px 90px;
  gap: 18px;
  align-items: center;
  min-height: 65px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.leader-row:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leader-rank {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 19px;
}

.leader-player {
  display: flex;
  gap: 12px;
  align-items: center;
  font-weight: 800;
}

.mini-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  color: var(--ink);
  font-size: 10px;
  background: var(--paper-deep);
  border-radius: 50%;
  place-items: center;
}

.leader-work,
.leader-difficulty,
.leader-time {
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--serif);
  font-size: 13px;
}

.leader-score {
  font-family: var(--serif);
  font-size: 20px;
  text-align: right;
}

.leaderboard-empty,
.leaderboard-loading {
  display: grid;
  min-height: 210px;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--serif);
  font-size: 17px;
  font-style: italic;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  place-items: center;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 30px;
  align-items: center;
  min-height: 110px;
  padding: 0 max(32px, calc((100% - 1170px) / 2));
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: var(--paper-deep);
}

.site-footer p:last-child {
  text-align: right;
}

.footer-brand {
  color: var(--ink);
}

/* Game */
.game-view {
  min-height: calc(100vh - 88px);
  padding: 42px 32px 90px;
  background: #ede5d7;
}

.game-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.back-button {
  padding: 8px 0;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  background: none;
  border: 0;
  cursor: pointer;
}

.back-button span {
  margin-right: 8px;
  color: var(--coral);
}

.game-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 31px 0 29px;
}

.game-work .kicker {
  margin-bottom: 10px;
}

.game-work h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(35px, 4vw, 52px);
  font-weight: 600;
  letter-spacing: -0.04em;
}

.game-work > p:last-child {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 14px;
  font-style: italic;
}

.timer-block {
  width: 170px;
  text-align: right;
}

.timer-block > span {
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.timer-block strong {
  display: block;
  margin: 3px 0 8px;
  font-family: var(--serif);
  font-size: 32px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.timer-track,
.progress-track {
  height: 4px;
  overflow: hidden;
  background: rgba(23, 43, 38, 0.1);
}

.timer-track i,
.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--coral);
  transition: width 500ms linear;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 25px;
  align-items: start;
}

.passage-paper {
  position: relative;
  min-height: 550px;
  padding: clamp(42px, 6vw, 78px) clamp(34px, 7vw, 88px) 40px;
  background: var(--paper-bright);
  box-shadow: 0 25px 70px rgba(46, 39, 28, 0.12);
}

.passage-paper::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 36px;
  width: 1px;
  content: "";
  background: rgba(223, 90, 67, 0.16);
}

.paper-corner {
  position: absolute;
  top: 19px;
  right: 21px;
  width: 35px;
  height: 35px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.passage-text {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(20px, 2vw, 25px);
  line-height: 2.05;
}

.blank-wrap {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  margin: 0 3px;
  vertical-align: baseline;
}

.blank-number {
  position: absolute;
  top: -11px;
  left: 1px;
  color: var(--coral-dark);
  font-family: var(--sans);
  font-size: 7px;
  font-weight: 900;
}

.word-blank {
  width: var(--blank-width, 95px);
  min-width: 58px;
  height: 32px;
  padding: 2px 3px 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 750;
  line-height: 1;
  text-align: center;
  background: rgba(213, 167, 74, 0.12);
  border: 0;
  border-bottom: 2px solid var(--gold);
  border-radius: 0;
  outline: none;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.word-blank:focus {
  background: rgba(213, 167, 74, 0.23);
  border-color: var(--coral);
}

.word-blank.correct {
  color: #2c6547;
  background: rgba(67, 130, 81, 0.12);
  border-color: #438251;
}

.word-blank.wrong {
  color: #9e352b;
  background: rgba(223, 90, 67, 0.12);
  border-color: var(--coral);
  animation: shake 260ms ease;
}

.word-blank.hinted::placeholder {
  color: #8e6b1d;
  opacity: 1;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  33% { transform: translateX(-3px); }
  66% { transform: translateX(3px); }
}

.paper-colophon {
  display: flex;
  justify-content: space-between;
  padding-top: 30px;
  margin-top: 45px;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  border-top: 1px solid var(--line);
}

.game-sidebar {
  position: sticky;
  top: 22px;
  padding: 28px;
  background: var(--ink);
  box-shadow: 0 18px 45px rgba(23, 43, 38, 0.13);
}

.score-preview > span,
.round-progress span,
.round-stats span {
  color: rgba(255, 255, 255, 0.48);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.score-preview strong {
  display: block;
  margin: 7px 0 2px;
  color: white;
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.score-preview small {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 11px;
  font-style: italic;
}

.round-progress {
  padding: 25px 0;
  margin: 25px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.round-progress > div:first-child,
.round-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.round-progress strong,
.round-stats strong {
  color: white;
  font-family: var(--serif);
  font-size: 17px;
}

.round-progress .progress-track {
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.1);
}

.progress-track i {
  background: var(--gold);
}

.round-stats {
  margin-bottom: 26px;
}

.round-stats div {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.round-stats div:last-child {
  text-align: right;
}

.game-sidebar .button {
  min-height: 50px;
}

.hint-button {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 15px 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 10px;
  font-weight: 800;
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.hint-button span {
  margin-right: 7px;
  color: var(--gold);
}

.hint-button small {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.35);
  font-size: 8px;
}

.keyboard-tip {
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.35);
  font-size: 8px;
  line-height: 1.5;
  text-align: center;
}

kbd {
  padding: 2px 4px;
  font: inherit;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

/* Dialogs */
.modal {
  width: min(580px, calc(100% - 30px));
  max-height: min(760px, calc(100vh - 30px));
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background: var(--paper-bright);
  border: 0;
  box-shadow: 0 30px 100px rgba(17, 28, 25, 0.35);
}

.modal::backdrop {
  background: rgba(23, 43, 38, 0.72);
  backdrop-filter: blur(5px);
}

.modal form,
.result-modal > div {
  position: relative;
  padding: 50px;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 32px;
  height: 32px;
  color: var(--ink-soft);
  font-size: 22px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  place-items: center;
}

.modal h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
}

.modal-intro {
  margin: 15px 0 28px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.5;
}

.difficulty-list {
  display: grid;
  gap: 10px;
}

.difficulty-option {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 20px;
  width: 100%;
  padding: 20px;
  text-align: left;
  background: var(--paper);
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease;
}

.difficulty-option:hover,
.difficulty-option:focus-visible {
  border-color: var(--coral);
  outline: none;
  transform: translateX(3px);
}

.difficulty-option .option-name {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
}

.difficulty-option .option-multiplier {
  color: var(--coral-dark);
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
}

.difficulty-option .option-description {
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.difficulty-option .option-meta {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.name-field {
  display: grid;
  gap: 8px;
  margin-bottom: 17px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.name-field input {
  min-height: 53px;
  padding: 0 15px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  text-transform: none;
  background: var(--paper);
  border: 1px solid var(--line);
  outline: none;
}

.name-field input:focus {
  border-color: var(--coral);
}

.result-modal {
  width: min(640px, calc(100% - 30px));
  text-align: center;
}

.result-flourish {
  color: var(--coral);
  font-family: var(--serif);
  font-size: 40px;
}

.result-kicker {
  margin: 8px 0;
  color: var(--coral-dark);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.result-modal h2 {
  font-size: 48px;
}

.final-score {
  margin: 26px 0;
}

.final-score strong {
  display: block;
  font-family: var(--serif);
  font-size: 74px;
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.05em;
}

.final-score span {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.result-breakdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 30px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.result-breakdown div {
  padding: 15px 5px;
}

.result-breakdown div:not(:last-child) {
  border-right: 1px solid var(--line);
}

.result-breakdown strong,
.result-breakdown span {
  display: block;
}

.result-breakdown strong {
  font-family: var(--serif);
  font-size: 20px;
}

.result-breakdown span {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.button-secondary {
  color: var(--ink);
  background: transparent;
  border-color: var(--ink);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: min(390px, calc(100% - 48px));
  padding: 14px 18px;
  color: white;
  font-size: 12px;
  font-weight: 700;
  background: var(--ink);
  box-shadow: 0 12px 35px rgba(23, 43, 38, 0.25);
  opacity: 0;
  transform: translateY(15px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.confetti {
  position: fixed;
  inset: 0;
  z-index: 90;
  overflow: hidden;
  pointer-events: none;
}

.confetti i {
  position: absolute;
  top: -20px;
  width: 8px;
  height: 15px;
  background: var(--color);
  animation: fall var(--duration) var(--delay) ease-in forwards;
}

@keyframes fall {
  to { transform: translate3d(var(--drift), 105vh, 0) rotate(720deg); }
}

@media (max-width: 1000px) {
  .hero {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 30px;
  }

  .sample-page {
    padding: 30px;
  }

  .sample-page blockquote {
    font-size: 20px;
  }

  .daily-card {
    grid-template-columns: 0.4fr 1fr auto;
    gap: 34px;
    padding: 45px 38px;
  }

  .book-glyph {
    width: 140px;
  }

  .library-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 780px) {
  .site-header {
    width: calc(100% - 36px);
    min-height: 72px;
  }

  .main-nav > a {
    display: none;
  }

  .profile-chip > span:last-child {
    display: none;
  }

  .hero {
    display: block;
    width: calc(100% - 40px);
    min-height: 0;
    padding: 64px 0 75px;
  }

  .hero h1 {
    font-size: clamp(58px, 17vw, 88px);
  }

  .hero-intro {
    font-size: 18px;
  }

  .hero-art {
    min-height: 420px;
    margin-top: 72px;
  }

  .sample-page {
    inset: 0 18px 0 5px;
  }

  .hero-art::before {
    left: 32px;
  }

  .hero-proof {
    flex-wrap: wrap;
  }

  .stat-ribbon {
    grid-template-columns: repeat(3, 1fr);
    padding: 0 15px;
  }

  .stat-ribbon > div {
    align-items: center;
    padding: 22px 7px;
    text-align: center;
  }

  .stat-ribbon strong {
    font-size: 26px;
  }

  .stat-ribbon > p {
    display: none;
  }

  .section {
    width: calc(100% - 40px);
    padding: 80px 0;
  }

  .section-heading,
  .leaderboard-heading {
    align-items: flex-start;
    gap: 25px;
  }

  .daily-card {
    grid-template-columns: 1fr auto;
  }

  .book-glyph {
    display: none;
  }

  .how-section {
    width: 100%;
    padding-right: 20px;
    padding-left: 20px;
  }

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

  .steps li {
    min-height: 0;
    padding-bottom: 45px;
  }

  .steps li:not(:last-child) {
    margin-right: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .step-number {
    background: var(--paper-deep);
  }

  .library-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .leaderboard-section {
    width: 100%;
    padding: 0;
  }

  .leaderboard-card {
    padding-right: 20px;
    padding-left: 20px;
  }

  .leader-row {
    grid-template-columns: 38px minmax(120px, 1fr) 70px;
  }

  .leader-work,
  .leader-difficulty {
    display: none;
  }

  .site-footer {
    grid-template-columns: 1fr 1fr;
    padding: 25px 20px;
  }

  .site-footer > p:first-of-type {
    display: none;
  }

  .game-view {
    padding: 30px 18px 70px;
  }

  .game-layout {
    display: flex;
    flex-direction: column;
  }

  .passage-paper {
    width: 100%;
    min-height: 0;
    padding-right: 30px;
    padding-left: 43px;
  }

  .game-sidebar {
    position: static;
    width: 100%;
  }
}

@media (max-width: 540px) {
  .brand-name {
    font-size: 17px;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .hero-actions .text-link {
    align-self: flex-start;
  }

  .hero-art {
    min-height: 390px;
  }

  .sample-page {
    padding: 25px 23px;
  }

  .sample-title {
    margin-top: 29px;
    font-size: 22px;
  }

  .sample-page blockquote {
    font-size: 17px;
  }

  .orbit-one {
    right: 10px;
  }

  .section-heading,
  .leaderboard-heading {
    display: block;
  }

  .section-date,
  .library-controls,
  .range-tabs {
    margin-top: 25px;
  }

  .section-heading.centered > p {
    margin-top: 20px;
    text-align: left;
  }

  .daily-card {
    display: block;
    min-height: 0;
    padding: 37px 28px 88px;
  }

  .daily-meta {
    gap: 17px;
  }

  .round-play {
    position: absolute;
    right: 22px;
    bottom: 22px;
    width: 66px;
    height: 66px;
  }

  .round-play span {
    display: none;
  }

  .round-play i {
    transform: none;
  }

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

  .book-card {
    min-height: 270px;
  }

  .leaderboard-heading h2,
  .section-heading h2 {
    font-size: 44px;
  }

  .leader-row {
    gap: 10px;
  }

  .leader-time {
    display: none;
  }

  .leader-row {
    grid-template-columns: 30px minmax(120px, 1fr) 70px;
  }

  .site-footer {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .site-footer > p:last-child {
    text-align: center;
  }

  .footer-brand {
    justify-self: center;
  }

  .game-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 25px;
  }

  .timer-block {
    width: 100%;
    text-align: left;
  }

  .passage-paper::before {
    left: 25px;
  }

  .passage-text {
    font-size: 19px;
  }

  .modal form,
  .result-modal > div {
    padding: 43px 25px 30px;
  }

  .modal h2,
  .result-modal h2 {
    font-size: 36px;
  }

  .final-score strong {
    font-size: 62px;
  }

  .result-breakdown {
    grid-template-columns: 1fr 1fr;
  }

  .result-breakdown div:nth-child(2) {
    border-right: 0;
  }

  .result-breakdown div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .result-actions {
    grid-template-columns: 1fr;
  }
}

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