* { box-sizing: border-box; }
[hidden] { display: none !important; }
:root {
  color-scheme: light;
  --paper: #f0f7fa;
  --ink: #00192b;
  --muted: #45566b;
  --rule: #b6ccd6;
  --accent-text: #00646d;
  --accent: #03bfcb;
  --serif: Georgia, 'Times New Roman', serif;
  font-family: system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
body { margin: 0; }
.shell { width: min(1100px, calc(100% - 2rem)); margin-inline: auto; }
.masthead { margin-top: 1.4rem; border-block: 4px double var(--ink); text-align: center; }
.edition { display: flex; justify-content: space-between; gap: 1rem; padding: .65rem 0; border-bottom: 1px solid var(--rule); font-size: .85rem; text-align: left; }
.edition strong { color: var(--accent-text); }
.masthead h1 { font: 700 clamp(3.8rem, 12vw, 8.5rem)/1 var(--serif); margin: .15em 0 0; letter-spacing: -.065em; }
.masthead p { margin: .45rem 0 1.3rem; font: italic 1.15rem var(--serif); color: var(--muted); }
h2, h3 { font-family: var(--serif); margin: 0; }
h2 { font-size: clamp(1.6rem, 4vw, 2.25rem); }
p { line-height: 1.5; }
.start, .finish { margin-block: 1.5rem; padding: clamp(1rem, 4vw, 2rem); border: 1px solid var(--rule); background: #ffffff; }
form label { display: block; margin-bottom: .4rem; font-weight: 700; }
.form-line, .rank-head { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }
.form-line input { flex: 1 1 12rem; max-width: 22rem; min-width: 0; padding: .65rem .8rem; border: 1px solid var(--ink); background: white; }
input, button { font: inherit; color: inherit; }
button { cursor: pointer; padding: .65rem .9rem; border: 1px solid var(--accent-text); background: var(--accent-text); color: white; font-weight: 700; }
button.secondary { background: transparent; color: var(--accent-text); }
button:disabled { opacity: .65; cursor: wait; }
button:focus-visible, input:focus-visible { outline: 3px solid #00646d; outline-offset: 2px; }
.note, .rules, #progress, #rank-status { color: var(--muted); }
.active-clue { padding: .55rem .75rem; border-left: 3px solid var(--accent-text); background: #ffffff; }
#start-error { color: var(--accent-text); }
.game-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1.5rem; }
.game-head p { margin: .3rem 0 0; }
.clock { text-align: right; }
.clock span { display: block; font-size: .85rem; color: var(--muted); }
.clock strong, td:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.clock strong { font-size: clamp(1.2rem, 4vw, 1.8rem); }
.puzzle-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; gap: clamp(1rem, 3vw, 2rem); }
.board { background: var(--ink); border: 4px solid var(--ink); display: grid; gap: 1px; padding: 1px; }
.cell { position: relative; min-width: 0; aspect-ratio: 1; background: #ffffff; }
.cell.marked { background: var(--accent); }
.cell input { display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0; text-align: center; background: transparent; font: bold clamp(.75rem, 2vw, 1.25rem) var(--serif); }
.cell input:focus { outline: 3px solid #00646d; outline-offset: -3px; }
.cell small { position: absolute; top: 0; left: 1px; font-size: clamp(.45rem, 1vw, .65rem); line-height: 1; pointer-events: none; }
.cell.solved:not(.marked) { background: #daf4ed; }
.clue-list { border-top: 2px solid var(--ink); padding-top: .5rem; }
.clue-list h3 { font-size: 1.35rem; }
.clue-list ol { margin: .45rem 0 0; padding-left: 1.55rem; }
.clue-list li { border-bottom: 1px solid var(--rule); }
.clue-list button { border: 0; background: transparent; color: var(--ink); text-align: left; display: block; width: 100%; padding: .5rem .35rem; font-weight: 400; line-height: 1.4; }
.clue-list button.active { background: #d7f6f8; }
.clue-list small { color: var(--accent-text); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.finish { border-left: 5px solid var(--accent-text); }
#ranking { margin-block: 1.8rem; border-top: 4px double var(--ink); padding-top: .8rem; }
.rank-head { justify-content: space-between; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .35rem; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
th:last-child, td:last-child { text-align: right; }
footer { border-top: 1px solid var(--rule); padding-block: .8rem 1.5rem; color: var(--muted); font-size: .85rem; }
@media (max-width: 760px) {
  .puzzle-layout { grid-template-columns: 1fr; }
  .cell input { font-size: clamp(.76rem, 3vw, 1.25rem); }
}

/* CodeConnect palette from the public wordmark and website. */
.masthead {
  color: white;
  background: #00192b;
  border: 0;
  border-bottom: 5px solid var(--accent);
  border-radius: 1.25rem;
  padding: .1rem clamp(1rem, 4vw, 2.5rem) 1.35rem;
}
.edition { border-color: #456074; color: #d9e8ee; }
.edition strong { color: var(--accent); }
.masthead p { color: #d9e8ee; margin-bottom: 0; }
.start, .finish { border-radius: 1rem; }
button { border-radius: .5rem; }
.form-line input { border-radius: .5rem; }
.form-line button, #retry { color: var(--ink); background: var(--accent); border-color: var(--accent); }
.clock { background: #00192b; color: white; border-radius: .7rem; padding: .35rem .75rem; }
.clock span { color: #caecf0; }
.board { border-radius: .5rem; }
.active-clue { border-left-color: var(--accent); }
.clue-list button { border-radius: 0; }
