@font-face { font-family: "Archivo X"; src: url(fonts/ArchivoExpanded-Light.ttf); font-weight: 300; font-display: swap; }
@font-face { font-family: "Archivo X"; src: url(fonts/ArchivoExpanded-Regular.ttf); font-weight: 400; font-display: swap; }
@font-face { font-family: "Archivo X"; src: url(fonts/ArchivoExpanded-SemiBold.ttf); font-weight: 600; font-display: swap; }
@font-face { font-family: "Archivo X"; src: url(fonts/ArchivoExpanded-Bold.ttf); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url(fonts/Inter-Regular.ttf); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url(fonts/Inter-Bold.ttf); font-weight: 700; font-display: swap; }

:root {
  --ink: #111;
  --grey: #8a8a8a;
  --mid: #767676;
  --pale: #ECEAE4;
  --line: #e2e0da;
  --grid: rgba(0,0,0,.045);
  --orange: #F26A1B;
  --paper: #fff;
  --cell: 36px;
  --track-x: 18px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  font: 16px/1.5 Inter, system-ui, sans-serif;
}
a { color: inherit; }
.wrap { max-width: 620px; margin: 0 auto; padding: 0 16px 72px; }

/* Footer style from the book: small, grey, spaced capitals */
.label { font: 400 11px/1.4 Inter, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--grey); }
.label.ink { color: var(--ink); font-weight: 700; }

/* Masthead */
.mast { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  border-bottom: 1px solid var(--grey); padding: 22px 0 8px; }
.mast a { text-decoration: none; }

h1, h2, .display { font-family: "Archivo X", sans-serif; font-weight: 600; letter-spacing: -.01em; margin: 0; }
h1 { font-size: clamp(30px, 8vw, 46px); line-height: 1.05; }
h2 { font-size: 22px; line-height: 1.15; }
.big-num { font-family: "Archivo X"; font-weight: 300; font-size: clamp(90px, 26vw, 150px); line-height: .9; letter-spacing: -.03em; }

.hero { padding: 56px 0 28px; }
.hero p { max-width: 30em; color: #333; margin: 14px 0 0; }
.accent { height: 2px; background: var(--orange); width: calc(var(--cell) * 3); margin: 22px 0 0; }

/* Game list on the home page */
.games { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--line); }
.games li { border-bottom: 1px solid var(--line); }
.games a, .games .soon { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 12px; padding: 18px 0; text-decoration: none; }
.games .soon { opacity: .45; }
.games h2 { font-size: 19px; }
.games p { margin: 2px 0 0; color: #555; font-size: 14px; }
.games a:hover h2 { color: var(--orange); }
.go { font: 700 11px Inter; letter-spacing: .14em; border: 1px solid var(--orange); color: var(--orange); border-radius: 99px; padding: 6px 12px; white-space: nowrap; }

/* Track with laps (clues), like the book */
.track { position: relative; margin: 26px 0 0; padding: 0; list-style: none; }
.track::before { content: ""; position: absolute; left: var(--track-x); top: 6px; bottom: 6px; width: 1px; background: var(--ink); }
.lap { position: relative; display: grid; grid-template-columns: 56px 1fr; gap: 6px; padding: 12px 0; min-height: 58px; }
.lap .dot { position: absolute; left: calc(var(--track-x) - 5px); top: 20px; width: 11px; height: 11px; border-radius: 50%; background: var(--ink); }
.lap .num { grid-column: 1; padding-left: 34px; }
.lap .txt { grid-column: 2; font-size: 17px; line-height: 1.45; padding-left: 14px; }
.lap .n { display: block; font: 700 15px Inter; }
.lap .t { display: block; font: 400 8.5px Inter; letter-spacing: .14em; color: var(--grey); }
.lap.locked .dot { background: var(--paper); border: 1px solid var(--grey); }
.lap.locked .txt { color: var(--grey); }
.lap.locked .n { color: var(--grey); }
.lap.new .txt { animation: fade .5s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Guess box */
.guess { margin: 22px 0 0; position: relative; }
.guess-row { display: flex; gap: 8px; }
.guess input { flex: 1; min-width: 0; font: 16px Inter; padding: 13px 14px; border: 1px solid var(--ink); border-radius: 0; background: var(--paper); }
.guess input:focus { outline: 2px solid var(--orange); outline-offset: -1px; }
.btn { font: 700 12px Inter; letter-spacing: .14em; text-transform: uppercase; padding: 0 18px; border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; border-radius: 0; }
.btn.ghost { background: var(--paper); color: var(--ink); }
.btn:disabled { opacity: .4; cursor: default; }
.skip { margin-top: 10px; background: none; border: 0; padding: 0; cursor: pointer; }
.skip:hover { color: var(--ink); }
.suggest { position: absolute; left: 0; right: 0; top: 49px; z-index: 5; list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--ink); border-top: 0; max-height: 240px; overflow: auto; }
.suggest li { padding: 10px 14px; cursor: pointer; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--pale); }
.msg { min-height: 22px; margin-top: 10px; font-size: 14px; color: var(--mid); }

.tries { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tries span { font-size: 13px; padding: 3px 10px; border: 1px solid var(--line); color: var(--mid); text-decoration: line-through; }

/* Scrambled */
.sc-board { margin-top: 30px; }
.sc-slots { display: flex; flex-wrap: wrap; gap: 14px 22px; }
.sc-word { display: flex; gap: 5px; }
.sc-slot, .sc-tile { width: 40px; height: 48px; font: 600 22px "Archivo X", sans-serif; display: inline-flex; align-items: center; justify-content: center; border-radius: 0; padding: 0; color: var(--ink); }
.sc-slot { background: transparent; border: 0; border-bottom: 2px solid var(--ink); cursor: pointer; }
.sc-slot:disabled { cursor: default; color: var(--ink); }
.sc-slot.locked { color: var(--orange); border-bottom-color: var(--orange); }
.sc-tiles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 30px; }
.sc-tile { background: var(--paper); border: 1px solid var(--ink); cursor: pointer; }
.sc-tile:hover { background: var(--pale); }
.sc-tile:disabled { visibility: hidden; }
.sc-clue { margin-top: 8px; padding: 12px 0 12px 16px; border-left: 2px solid var(--orange); font-size: 16px; }
.sc-tools { display: flex; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.sc-tools .btn { padding: 12px 16px; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (max-width: 420px) { .sc-slot, .sc-tile { width: 32px; height: 42px; font-size: 19px; } .sc-slots { gap: 12px 16px; } }

/* Mini Crossword */
.cw-bar { display: flex; justify-content: space-between; margin-top: 30px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.cw-current { min-height: 52px; padding: 12px 0 12px 16px; margin-top: 14px; border-left: 2px solid var(--orange); font-size: 16px; }
.cw-current b { font: 700 11px Inter; letter-spacing: .14em; text-transform: uppercase; margin-right: 8px; }
.cw-grid { --cols: 9; --size: min(44px, calc((100vw - 32px) / var(--cols))); display: grid; grid-template-columns: repeat(var(--cols), var(--size)); margin-top: 18px; }
.cw-cell { position: relative; width: var(--size); height: var(--size); border: 1px solid var(--ink); margin: 0 -1px -1px 0; background: var(--paper); }
.cw-cell.empty { border-color: transparent; background: transparent; }
.cw-cell input { width: 100%; height: 100%; border: 0; background: transparent; text-align: center; padding: 6px 0 0; font: 600 calc(var(--size) * .5) "Archivo X", sans-serif; text-transform: uppercase; color: var(--ink); caret-color: transparent; border-radius: 0; }
.cw-cell input:focus { outline: none; }
.cw-cell.word { background: var(--pale); }
.cw-cell.on { background: #fbd9c4; }
.cw-cell.bad input { color: var(--orange); text-decoration: line-through; }
.cw-num { position: absolute; top: 1px; left: 3px; font: 400 9px Inter; color: var(--mid); pointer-events: none; }
.cw-grid.solved .cw-cell { background: var(--paper); }
.cw-clues { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 36px; }
.cw-clues h2 { margin: 0 0 8px; }
.cw-clues ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.cw-clues li { display: grid; grid-template-columns: 26px 1fr; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.cw-clues li.on { box-shadow: inset 2px 0 0 var(--orange); padding-left: 8px; }
@media (max-width: 520px) { .cw-clues { grid-template-columns: 1fr; } }

/* Grid Order */
.go-grid { position: relative; list-style: none; margin: 18px 0 0; padding: 0; }
.go-grid::before { content: ""; position: absolute; left: var(--track-x); top: 28px; bottom: 28px; width: 1px; background: var(--ink); }
.go-row { position: relative; display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 10px; padding: 6px 0; }
.go-row .dot { position: absolute; left: calc(var(--track-x) - 5px); top: 50%; margin-top: -5px; width: 11px; height: 11px; border-radius: 50%; background: var(--paper); border: 1px solid var(--ink); }
.go-row.locked .dot { background: var(--orange); border-color: var(--orange); }
.go-pos { padding-left: 34px; }
.go-pos .n { font: 700 15px Inter; }
.go-name { border: 1px solid var(--ink); background: var(--paper); padding: 12px 14px; min-height: 50px; display: flex; flex-direction: column; justify-content: center; }
.go-name .nm { font-size: 17px; }
.go-name .val:empty { display: none; }
.go-row.locked .go-name { border-color: var(--orange); }
.go-row.wrong .go-name { border-color: var(--line); color: var(--mid); }
.go-move { display: flex; flex-direction: column; gap: 4px; }
.go-btn { width: 40px; height: 23px; border: 1px solid var(--ink); background: var(--paper); font-size: 10px; cursor: pointer; padding: 0; color: var(--ink); }
.go-btn:hover:not(:disabled) { background: var(--pale); }
.go-btn:disabled { opacity: .25; cursor: default; }

/* Fact or Fiction */
.ff .txt .s { display: block; }
.ff-btns { display: flex; gap: 8px; margin-top: 12px; }
.ff-btns .btn { padding: 11px 18px; }
.ff-btns .btn:hover { background: var(--ink); color: #fff; }
.ff-verdict { display: block; margin-top: 8px; font-size: 14px; color: var(--mid); }
.ff-verdict b { margin-right: 4px; }
.lap.ok .dot { background: var(--orange); }
.lap.ok .ff-verdict b { color: var(--orange); }
.lap.miss .dot { background: var(--paper); border: 1px solid var(--ink); }
.lap.miss .s { color: var(--mid); }

/* Result */
.result { margin-top: 30px; border-top: 1px solid var(--ink); padding-top: 18px; }
.result .pos { font-family: "Archivo X"; font-weight: 600; font-size: 44px; line-height: 1; }
.result .who { font-size: 18px; margin: 10px 0 0; }
.finish { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.flag { width: 18px; height: 12px; background:
  conic-gradient(var(--ink) 25%, transparent 0 50%, var(--ink) 0 75%, transparent 0) 0 0 / 6px 6px;
  border: 1px solid var(--ink); }
.actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.actions .btn { padding: 13px 18px; }
.next { margin-top: 14px; }

/* About us */
.about { margin-top: 52px; }
.about h2 { margin: 8px 0 0; }
.about p { margin: 10px 0 0; max-width: 32em; color: #333; }

/* Book promo */
.book { margin-top: 44px; border: 1px solid var(--ink); padding: 20px; background: var(--paper); position: relative; }
.book::before { content: ""; position: absolute; left: -1px; top: -1px; width: calc(var(--cell) * 3); height: 3px; background: var(--orange); }
.book h2 { font-size: 20px; margin: 8px 0 6px; }
.book p { margin: 0 0 14px; color: #333; font-size: 15px; }
.book .btn { display: inline-block; padding: 13px 18px; text-decoration: none; }

.foot { margin-top: 56px; border-top: 1px solid var(--line); padding-top: 12px; }
.foot p { margin: 4px 0; }
