:root {
  --sans: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
  --ink: #182038;
  --muted: #57637a;
  --blue: #3449ed;
  --blue-dark: #2338c7;
  --ice: #e3e8ff;
  --lime: #d9f76d;
  --paper: #fff;
  --line: #dadee8;
  --bg: #f5f6fa;
  font: 16px/1.45 var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, a { font: inherit; }
a { color: inherit; }
button { cursor: pointer; color: inherit; border: 0; background: none; }
button:disabled { opacity: .48; cursor: default; }
button:focus-visible, a:focus-visible { outline: 3px solid #e8772d; outline-offset: 3px; }
:where(button, a, i, span) svg { width: 18px; height: 18px; vertical-align: middle; }
i[data-icon] { display: inline-flex; align-items: center; justify-content: center; flex: none; }
[hidden] { display: none !important; }
.wrap { width: min(1184px, calc(100% - 64px)); margin-inline: auto; }
.top { background: #fff; border-bottom: 1px solid var(--line); }
.mast { min-height: 69px; display: flex; align-items: center; gap: clamp(34px, 6vw, 90px); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 29px; font-weight: 800; letter-spacing: -1.9px; line-height: 1; }
.brand img { height: 39px; width: 39px; }
.mast nav { display: flex; gap: 5px; }
.mast nav a, .help { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border-radius: 8px; color: #535e75; text-decoration: none; font-size: 14px; font-weight: 650; }
.mast nav a.on { background: #ecefff; color: var(--blue-dark); }
.mast nav a:hover, .help:hover { background: #f0f2f8; }
.help { margin-left: auto; border: 1px solid var(--line); }
.hero { display: flex; align-items: center; position: relative; isolation: isolate; overflow: hidden; min-height: 180px; margin-block: 21px; padding: 24px 34px; border-radius: 16px; background: #e3e8fe; }
.city { position: absolute; inset: 0 0 0 auto; width: 62%; height: 100%; object-fit: cover; object-position: right 64%; pointer-events: none; z-index: -1; mask-image: linear-gradient(90deg, transparent, #000 19%); }
.hero-copy { max-width: 55%; }
.edition { display: inline-flex; gap: 9px; align-items: center; color: #2d409d; text-transform: uppercase; letter-spacing: 1.6px; font-size: 11px; font-weight: 800; }
.edition::before { content: ""; width: 24px; height: 11px; background: radial-gradient(circle at 5px 50%, var(--blue) 2px, transparent 2.6px), radial-gradient(circle at 19px 50%, var(--blue) 2px, transparent 2.6px), linear-gradient(var(--blue),var(--blue)) center/14px 2px no-repeat; }
.hero h1 { margin: 5px 0 4px; font-size: clamp(40px,4.5vw,66px); line-height: 1.07; font-weight: 790; letter-spacing: -.065em; }
.hero p { margin: 0; font-size: 16px; color: #46516c; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(292px, .49fr); gap: 20px; align-items: start; padding-bottom: 34px; }
.paper { border: 1px solid var(--line); border-radius: 15px; background: var(--paper); box-shadow: 0 3px 12px #1d2c5307; }
.boardcard { padding: 19px 21px 15px; }
.boardhead, .board-heading, .boardfoot, .legend, #saved { display: flex; align-items: center; }
.boardhead, .boardfoot { justify-content: space-between; gap: 10px; }
.boardhead { margin-bottom: 16px; }
.board-heading { gap: 10px; }
.board-heading i { color: var(--blue); }
.board-heading svg { width: 21px; height: 21px; }
.boardhead h2, .sidecard h2, #cluetext, #scoreView h2, dialog h2 { margin: 0; font-weight: 720; line-height: 1.12; letter-spacing: -.048em; }
.boardhead h2 { font-size: 24px; }
.primary, .secondary, .wordtools button { display: inline-flex; gap: 7px; align-items: center; justify-content: center; min-height: 40px; padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 650; }
.primary { color: white; background: var(--blue); }
.primary:hover { background: var(--blue-dark); }
.secondary { border: 1px solid var(--line); background: #f7f8fb; }
.boardwrap { position: relative; container-type: inline-size; }
#typing { position: absolute; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; font-size: 16px; }
#board { --cell-ratio: 1.38; display: grid; grid-template-columns: repeat(var(--cols),minmax(0,1fr)); border: 1px solid #9ba7bb; border-radius: 3px; overflow: hidden; touch-action: manipulation; }
.cell { min-width: 0; min-height: calc(100cqw / var(--cols) / var(--cell-ratio)); position: relative; border-right: 1px solid #9ba7bb; border-bottom: 1px solid #9ba7bb; display: flex; justify-content: center; align-items: center; padding: 0; background: #fff; }
.cell.rightend { border-right: 0; }
.cell.botend { border-bottom: 0; }
.legacy-notice { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.cell.clues { background: #e5ebf5; flex-direction: column; z-index: 1; }
.cell.letter { font: 650 clamp(20px,2.1vw,31px)/1 var(--sans); }
.cell.word { background: #dfe5ff; }
.cell.cursor { background: #c1ccff; box-shadow: inset 0 0 0 3px var(--blue); color: #172c9a; }
.cell.wrong { box-shadow: inset 0 0 0 2.5px #c13f2a; color: #ac3422; }
.cell.hinted::after { content: ""; position: absolute; right: 4px; bottom: 4px; width: 5px; height: 5px; border-radius: 50%; background: #b77b18; }
.cluebtn { position: relative; display: flex; align-items: center; justify-content: center; flex: 1 0 auto; min-height: min-content; width: 100%; padding: 4px 5px; overflow: visible; color: #26334a; font-size: clamp(10px,.94vw,13px); font-weight: 530; line-height: 1.1; hyphens: auto; overflow-wrap: anywhere; text-align: center; }
.cluebtn + .cluebtn { border-top: 1px solid #9ba7bb; }
.cluebtn.dual { padding: 3px 4px; font-size: clamp(8px,.8vw,11px); }
.cluebtn.chosen { background: var(--blue); color: #fff; font-weight: 650; }
.boardfoot { margin-top: 12px; color: var(--muted); font-size: 12px; }
.legend, #saved { gap: 6px; }
.legend b { width: 11px; height: 11px; border: 1px solid #8194e9; border-radius: 3px; background: #dfe5ff; }
#saved svg { width: 16px; }
.mobileclue { display: none; }
aside { display: grid; gap: 14px; }
.cluecard { overflow: hidden; background: #242f51; border-color: #242f51; color: #fff; }
.activehead, .activehead>span, .arrows, .wordmeta, #slots, .wordtools { display: flex; align-items: center; }
.activehead { justify-content: space-between; padding: 12px 18px 0; }
.activehead>span { gap: 8px; color: var(--lime); font-size: 11px; font-weight: 750; letter-spacing: 1.5px; text-transform: uppercase; }
.activehead>span svg { width: 15px; }
.arrows { gap: 3px; }
.arrows button { display: grid; place-items: center; width: 30px; height: 30px; color: #fff; background: #ffffff0d; border: 1px solid #ffffff29; border-radius: 7px; }
.arrows button:hover, .wordtools button:hover { background: #ffffff25; }
.arrows svg { width: 14px; height: 14px; }
.cluebody { padding: 12px 20px 19px; }
.wordmeta { gap: 6px; color: #cbd4ed; font-size: 12px; font-weight: 550; }
.wordmeta svg { width: 16px; height: 16px; }
#cluetext { font-size: clamp(24px,2.2vw,32px); margin: 5px 0 14px; overflow-wrap: anywhere; }
#slots { gap: 4px; flex-wrap: wrap; }
#slots button { position: relative; display: grid; place-items: center; width: 28px; height: 32px; border-radius: 5px; border: 1px solid #7782a0; color: white; background: #36405f; font-weight: 700; }
#slots button:empty::after { content: ""; width: 8px; border-bottom: 2px solid #a5aec6; transform: translateY(4px); }
#slots button.on { color: #283738; background: var(--lime); border-color: var(--lime); }
#slots button.on:empty::after { border-color: #465726; }
.wordtools { gap: 7px; margin-top: 15px; }
.wordtools button { color: #fff; background: #ffffff0a; border: 1px solid #65708e; font-size: 13px; min-height: 35px; padding: 5px 10px; }
.wordtools svg { width: 15px; height: 15px; }
#message { margin: 12px 0 0; font-size: 14px; color: #e5edff; }
#message:empty { display: none; }
.sidecard { padding: 17px 19px; }
.sidecard h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font-size: 21px; }
.sidecard h2 i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #eff1ff; color: var(--blue); }
.progresscard h2 i { background: #ebf4cc; color: #4c6322; }
#levels { display: flex; gap: 6px; margin-bottom: 10px; }
#levels button { flex: 1; min-width: 0; min-height: 37px; display: grid; place-items: center; border: 1px solid #dde2eb; border-radius: 7px; background: #f6f7fb; }
#levels svg { width: 19px; height: 19px; color: #7d88a0; }
#levels .lit { background: #e1e7ff; border-color: #b1bcfd; }
#levels .lit svg { fill: var(--blue); color: var(--blue); }
.levelcaption, .progressline, .scoreline, .scoreline>span { display: flex; align-items: center; justify-content: space-between; gap: 7px; font-size: 14px; }
.levelcaption span, .progressline { color: var(--muted); font-size: 13px; }
.progressline b { color: var(--ink); }
progress { display: block; width: 100%; height: 7px; margin: 8px 0 14px; overflow: hidden; border: 0; border-radius: 10px; background: #e7ebf4; }
progress::-webkit-progress-bar { background: #e7ebf4; }
progress::-webkit-progress-value { background: var(--blue); }
progress::-moz-progress-bar { background: var(--blue); }
.scoreline { border-top: 1px solid var(--line); padding-top: 10px; }
.scoreline svg { color: var(--blue); width: 16px; }
.scoreline strong { font-size: 22px; line-height: 1.2; letter-spacing: -.04em; }
.scoreline small { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
dialog { width: min(450px,calc(100% - 30px)); padding: 26px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: white; box-shadow: 0 16px 64px #13224c36; }
dialog::backdrop { background: #16213f68; }
dialog h2, #scoreView h2 { font-size: 27px; margin-bottom: 14px; }
dialog p, .records { font-size: 15px; line-height: 1.55; }
dialog a, article a { color: var(--blue-dark); }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 22px; }
#scoreView { padding: 25px; margin-bottom: 32px; }
.scorestats { display: flex; gap: 12px; margin-bottom: 24px; }
.scorestats p { min-width: 160px; padding: 16px 20px; margin: 0; border-radius: 10px; background: #eef0ff; font-size: 14px; }
.scorestats p:nth-child(2) { background: #eff5da; }
.scorestats b { display: block; color: var(--ink); font-size: 32px; line-height: 1.1; letter-spacing: -.055em; }
.records { padding: 0; list-style: none; }
.records li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 1020px) {
  .wrap { width: calc(100% - 36px); }
  .layout { gap: 14px; grid-template-columns: minmax(0,1fr) minmax(245px,.51fr); }
  .boardcard, .sidecard { padding: 14px; }
  .hero { min-height: 155px; padding: 20px 24px; margin-block: 16px; }
  #board { --cell-ratio: 1.08; }
  .cluebtn { font-size: clamp(9px,1.15vw,12px); }
  .activehead { padding: 10px 13px 0; }
  .activehead>span { letter-spacing: .8px; }
  .cluebody { padding: 12px 14px 16px; }
  .arrows button { width: 26px; height: 28px; }
}
@media (max-width: 800px) {
  .layout { grid-template-columns: minmax(0,1fr); }
  aside { grid-template-columns: 1.15fr 1fr; }
  .cluecard { grid-row: span 2; }
  #board { --cell-ratio: 1.33; }
  .cluebtn { font-size: clamp(10px,1.8vw,14px); }
  .cluebtn.dual { font-size: clamp(9px,1.5vw,12px); }
  .mobileclue { display: flex; align-items: center; gap: 7px; color: #263c9c; background: #ecf0ff; border-radius: 6px; font-size: 14px; font-weight: 600; margin-bottom: 8px; padding: 7px 10px; }
  .mobileclue svg { width: 16px; height: 16px; }
}
@media (max-width: 580px) {
  .wrap { width: calc(100% - 20px); }
  .mast { gap: 4px; min-height: 59px; }
  .brand { font-size: 22px; gap: 6px; letter-spacing: -1.25px; }
  .brand img { width: 31px; height: 31px; }
  .mast nav { margin-left: auto; gap: 0; }
  .mast nav a { padding: 9px 7px; font-size: 12px; }
  .mast nav i, .help span { display: none; }
  .help { margin-left: 0; padding: 7px; border: 0; }
  .hero { min-height: 126px; padding: 15px; border-radius: 12px; margin-block: 11px; }
  .hero-copy { max-width: 70%; }
  .hero h1 { font-size: clamp(28px,7.7vw,42px); }
  .hero p { font-size: 12px; max-width: 22ch; }
  .edition { font-size: 9px; letter-spacing: 1px; }
  .city { width: 45%; object-position: 62% center; mask-image: linear-gradient(90deg,transparent,#000 34%); }
  .boardcard { padding: 12px 8px 10px; }
  .boardhead { margin-bottom: 10px; }
  .boardhead h2 { font-size: 21px; }
  .board-heading { gap: 5px; }
  .primary { padding-inline: 10px; font-size: 13px; }
  #board { --cell-ratio: .92; }
  .cluebtn { font-size: clamp(8px,2.15vw,11px); padding: 1px 2px 8px; }
  .cluebtn.dual { font-size: clamp(7px,1.9vw,9px); }
  .boardfoot { font-size: 11px; }
  aside { grid-template-columns: 1fr; }
  .scorestats p { min-width: 0; flex: 1; padding: 12px; }
}
@media (pointer: coarse) {
  .arrows button { width: 40px; height: 40px; }
  .wordtools button, #levels button { min-height: 44px; }
}

/* Each marker touches the source border and projects into the first letter. */
.cluearrow {
  position: absolute;
  display: block;
  width: 9px;
  height: 9px;
  pointer-events: none;
  background: #293750;
}
.cluebtn.chosen .cluearrow { background: var(--blue); }
.cluearrow.across { clip-path: polygon(0 0,100% 50%,0 100%); }
.cluearrow.down { clip-path: polygon(0 0,100% 0,50% 100%); }
.exit-right { top: 50%; left: calc(100% + 1px); transform: translateY(-50%); }
.exit-left { top: 50%; right: calc(100% + 1px); transform: translateY(-50%); }
.exit-bottom { top: calc(100% + 1px); left: 50%; transform: translateX(-50%); }
.exit-top { bottom: calc(100% + 1px); left: 50%; transform: translateX(-50%); }
@media (max-width: 580px) { .cluearrow { width: 7px; height: 7px; } }
