:root {
  --ink: #30251d;
  --teal: #23adc0;
  --paper: #fff5df;
  --specimen-paper: #fff1d0;
  --gold: #f2c34f;
  --red: #a13a27;
  --olive: #dce9a6;
  --line: #c4a880;
  --display: Georgia, 'Times New Roman', serif;
  --sans: 'Trebuchet MS', Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--teal);
  background-image: radial-gradient(rgba(48, 37, 29, .17) .7px, transparent .7px);
  background-size: 5px 5px;
  font: 18px/1.35 var(--sans);
}

button, input { font: inherit; }
button { color: inherit; }
figure, p, h1, ul { margin: 0; }

.book {
  width: 91%;
  max-width: 1500px;
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.masthead,
.controls {
  display: flex;
  align-items: center;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .05em;
}

.masthead {
  justify-content: space-between;
  border-bottom: 2px solid var(--ink);
  min-height: 52px;
  text-transform: uppercase;
}

#location { margin-left: 14px; text-align: right; }

#screen {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 0;
}

.controls {
  border-top: 2px solid var(--ink);
  justify-content: center;
  flex-wrap: wrap;
  padding: 11px 0;
}
.controls span { margin: 4px 12px; white-space: nowrap; }
kbd {
  font: inherit;
  letter-spacing: 0;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 4px;
  padding: 1px 6px;
}

.cover {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cover-copy { width: 51%; }
.game-title {
  font: bold 8.5vw/.81 var(--display);
  letter-spacing: -.08em;
}
.game-title em { font-weight: inherit; }
.game-title span { color: var(--red); }
.subtitle {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 17px 0 15px;
}

.cabinet {
  position: relative;
  width: 42%;
  max-width: 530px;
  padding: 8px;
  border: 3px solid var(--ink);
  border-radius: 48% 48% 9px 9px / 14% 14% 9px 9px;
  background: var(--specimen-paper);
  box-shadow: 7px 8px 0 var(--ink);
  transform: rotate(1.6deg);
}
.cabinet img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 60vh;
  object-fit: contain;
  border-radius: inherit;
}
.category-prompt {
  margin-bottom: 8px;
  font-size: .93rem;
  font-weight: 700;
}

.paper {
  width: 100%;
  max-width: 980px;
  padding: 24px 34px 30px;
  border: 2px solid var(--ink);
  border-radius: 5px 9px 5px 7px;
  background: var(--paper);
  box-shadow: 8px 8px 0 var(--ink);
  position: relative;
}

.paper::after {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 19px;
  height: 19px;
  content: '';
  background: linear-gradient(135deg, #e5c892 48%, var(--ink) 49%, var(--ink) 53%, var(--teal) 54%);
  border-radius: 2px 0 0;
  pointer-events: none;
}

.eyebrow {
  color: var(--red);
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  margin-bottom: 8px;
  overflow-wrap: break-word;
}

.paper h1 {
  font: bold 2.9rem/1.02 var(--display);
  letter-spacing: -.04em;
  margin-bottom: 14px;
  overflow-wrap: break-word;
}

.slip-stack { display: flex; flex-direction: column; align-items: stretch; }
.slip-stack > * + * { margin-top: 7px; }
.cover-actions { max-width: 500px; }
.cover-ranking { margin-top: 11px; }

.slip {
  display: flex;
  align-items: center;
  text-align: left;
  width: 100%;
  min-height: 54px;
  padding: 8px 14px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 3px 5px 4px 3px;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  font-size: 1.21rem;
  font-weight: 700;
  outline-offset: 3px;
}

.slip-label { min-width: 0; overflow-wrap: break-word; }
.slip-note {
  margin-left: auto;
  padding-left: 14px;
  color: #5f412a;
  font-size: .9rem;
  text-align: right;
  font-weight: 700;
}
.slip.secondary { background: #f6e7c8; }
.cover .slip.secondary {
  width: auto;
  min-height: 40px;
  padding: 6px 13px;
  font-size: 1rem;
}
.slip.drawer {
  justify-content: space-between;
  min-height: 44px;
  padding: 7px 12px;
}
.slip.drawer::after {
  content: '';
  flex: 0 0 27px;
  height: 10px;
  margin-left: 10px;
  border: 2px solid var(--ink);
  border-radius: 2px 2px 8px 8px;
  background: #d6a36a;
}
.slip.drawer:focus::after { background: var(--ink); }
.slip.wager { background: #fae5ab; border-style: dashed; }
.slip.wager[aria-pressed="true"] { background: #f5c363; border-style: solid; }

.slip:focus {
  background: var(--gold);
  outline: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}
.slip:focus .choice-letter { background: var(--ink); color: var(--paper); }

.choice-letter {
  display: inline-flex;
  height: 30px;
  width: 30px;
  flex: 0 0 30px;
  align-items: center;
  justify-content: center;
  background: #ead6a9;
  border-radius: 50%;
  margin-right: 12px;
  font-size: 1rem;
}

.intro { margin-bottom: 16px; font-size: 1.16rem; }
.question-note { font-size: .95rem; margin-top: 13px; }

.scoreboard {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0 -4px 14px;
}
.scoreboard li {
  display: flex;
  align-items: center;
  min-width: 120px;
  max-width: calc(100% - 8px);
  margin: 3px 4px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  font-size: .93rem;
  font-weight: 700;
  border-radius: 4px;
}
.scoreboard li span { overflow-wrap: break-word; min-width: 0; }
.scoreboard li strong { margin-left: auto; padding-left: 12px; font-size: 1.15rem; }
.scoreboard .active-score { background: #f6de9d; border-color: var(--ink); }

.reveal-layout {
  display: flex;
  align-items: center;
}
.reveal-copy { flex: 1 1 53%; min-width: 0; }
.specimen {
  flex: 0 0 41%;
  margin-right: 5%;
  background: var(--specimen-paper);
  border: 2px solid var(--ink);
  border-radius: 4px 8px 4px 7px;
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-2deg);
}
.specimen img {
  width: 100%;
  display: block;
  transform-origin: top center;
  animation: solapa .26s ease-out;
}
@keyframes solapa {
  from { transform: perspective(600px) rotateX(-45deg); opacity: .5; }
  to { transform: perspective(600px) rotateX(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .specimen img { animation: none; }
}
.reveal-copy h1 { margin-top: 10px; }
.fact { margin-bottom: 21px; font-size: 1.18rem; }
.verdict {
  display: inline-block;
  padding: 4px 9px;
  background: #f4d9bb;
  border: 1px solid var(--ink);
  border-radius: 3px;
  font-size: .92rem;
  font-weight: 700;
}
.verdict.correct { background: var(--olive); }

.ranking { border-collapse: collapse; width: 100%; margin-bottom: 22px; }
.ranking th, .ranking td {
  border-bottom: 1px solid var(--line);
  padding: 9px 8px;
  text-align: center;
}
.ranking th[scope="row"], .ranking th:nth-child(2) {
  text-align: left;
  max-width: 240px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.ranking thead { background: #f2dfad; }
.name-fields { display: flex; flex-wrap: wrap; margin: 0 -5px 9px; }
.name-fields label { flex: 1 1 180px; padding: 0 5px 7px; font-weight: 700; }
.name-fields input {
  display: block;
  padding: 8px;
  width: 100%;
  margin-top: 3px;
  background: #fffbf0;
  color: var(--ink);
  border: 2px solid var(--ink);
}
.name-fields input:focus { outline: 3px solid var(--gold); outline-offset: 2px; }
#name-error { margin-bottom: 8px; color: var(--red); font-weight: 700; }

@media (min-width: 1650px) {
  .game-title { font-size: 144px; }
}

@media (max-height: 650px) and (min-width: 761px) {
  #screen { padding: 20px 0; }
  .paper { padding: 17px 24px 22px; }
  .paper h1 { font-size: 2.45rem; }
  .slip { min-height: 45px; }
  .masthead { min-height: 42px; }
  .controls { padding: 6px 0; }
}

@media (max-width: 760px) {
  .game-title { font-size: 12vw; }
  .subtitle { font-size: 1.16rem; margin: 14px 0 18px; }
  .cabinet img { max-height: 46vh; }
  .paper { padding: 18px 15px 25px; }
  .paper h1 { font-size: 2.15rem; }
  .reveal-layout { flex-direction: column; align-items: stretch; }
  .specimen { flex-basis: auto; width: 68%; margin: 0 auto 20px; }
  .specimen img { max-height: 235px; object-fit: contain; }
  .masthead, .controls { font-size: .76rem; }
  .controls span { margin-right: 5px; margin-left: 5px; }
  .ranking { font-size: .94rem; }
  .ranking th, .ranking td { padding: 8px 4px; }
}

@media (max-width: 520px) {
  .cover { flex-direction: column; align-items: stretch; }
  .cover-copy { width: 100%; }
  .game-title { font-size: 16vw; }
  .cabinet { width: 82%; margin: 25px auto 0; }
  .cabinet img { max-height: 37vh; }
}
