:root {
  --ink: #17233b;
  --muted: #667085;
  --paper: #fbf7ef;
  --surface: #ffffff;
  --line: #d8dde8;
  --blue: #194f90;
  --orange: #f47b20;
  --green: #21855b;
  --shadow: 0 18px 40px rgba(23, 35, 59, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.88), rgba(251,247,239,0.98)),
    repeating-linear-gradient(0deg, rgba(25,79,144,0.045) 0, rgba(25,79,144,0.045) 1px, transparent 1px, transparent 32px),
    var(--paper);
}

.shell {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 46px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 900;
}

.brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a,
.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 15px;
  border-radius: 8px;
  border: 0;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.nav a {
  color: var(--blue);
}

.button-primary {
  background: var(--orange);
  color: white;
}

.button-secondary {
  background: #e9f1fb;
  color: var(--blue);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 18px;
}

.panel {
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 28px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--orange);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: 1;
  letter-spacing: 0;
}

.copy {
  color: var(--muted);
  line-height: 1.55;
  font-size: 1.02rem;
}

.play-surface {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fffdf8;
}

.status-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.status-pill {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: white;
  font-weight: 800;
  font-size: 0.9rem;
}

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

.letter-tile,
.word-tile {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-weight: 900;
  font-size: 1.1rem;
  cursor: pointer;
}

.word-tile.selected {
  background: #e9f1fb;
  border-color: var(--blue);
}

.word-tile.solved {
  background: #dff4e9;
  border-color: var(--green);
  color: var(--green);
}

.answer-input {
  width: 100%;
  min-height: 50px;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: uppercase;
}

.guess-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(38px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.guess-cell {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  font-weight: 900;
}

.guess-cell.correct {
  background: #dff4e9;
  color: var(--green);
}

.guess-cell.present {
  background: #fff0cf;
  color: #9a5a00;
}

.guess-cell.absent {
  background: #eef1f5;
  color: var(--muted);
}

.quote-board {
  padding: 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.book-list {
  display: grid;
  gap: 12px;
}

.book-card {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  text-decoration: none;
  color: var(--ink);
}

.book-card img {
  width: 70px;
  height: 88px;
  object-fit: contain;
  border-radius: 5px;
}

.book-card strong {
  display: block;
  margin-bottom: 4px;
}

.book-card span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

@media (max-width: 820px) {
  .topbar,
  .layout {
    display: block;
  }

  .nav {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .panel {
    margin-bottom: 16px;
  }
}
