@font-face {
  font-family: Inter;
  src: url("/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  font:
    16px/1.4 Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #1e2b46;
  background: #f6f8fd;
  --blue: #2859c9;
  --navy: #243652;
  --dim: #566681;
  --line: #d5dfed;
  --soft: #eef3fd;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
select {
  font: inherit;
  color: inherit;
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
  font-weight: 620;
}
button:disabled {
  opacity: 0.48;
  cursor: default;
}
button:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid #ffac22;
  outline-offset: 3px;
}
button:not(:disabled):active {
  filter: brightness(0.94);
}
[hidden] {
  display: none !important;
}
svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.sprites {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.mast {
  max-width: 1170px;
  margin: auto;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 54px;
  padding: 0 30px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: #1c2b45;
  font-weight: 800;
  letter-spacing: -0.055em;
  font-size: 1.26rem;
  white-space: nowrap;
}
.brand > span:last-child {
  font-weight: 450;
}
.brandmark {
  margin-right: 5px;
  display: grid;
  grid-template: repeat(2, 9px) / repeat(2, 9px);
  gap: 3px;
  place-content: center;
  background: #295acc;
  width: 35px;
  height: 35px;
  border-radius: 10px;
}
.brandmark i {
  background: white;
  border-radius: 2px;
}
.brandmark i:nth-child(2) {
  background: #ffce70;
  border-radius: 50%;
}
.brandmark i:nth-child(3) {
  opacity: 0.65;
}
nav,
.headtools,
.heading,
.stats,
.timer,
.keyhead,
.progressrow,
.shelfhead {
  display: flex;
  align-items: center;
}
nav {
  gap: 5px;
}
nav button,
.secondary,
.iconbtn,
.primary,
.dailycard button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 9px;
}
nav button {
  color: var(--dim);
  padding: 0 14px;
  font-size: 0.9rem;
}
nav button[aria-current="page"] {
  background: #eaf0ff;
  color: #234fb9;
}
nav svg {
  width: 18px;
}
.headtools {
  margin-left: auto;
  gap: 6px;
}
.iconbtn {
  width: 44px;
  color: #50617b;
}
.iconbtn:hover,
.secondary:hover {
  background: var(--soft);
}
main {
  max-width: 1070px;
  padding: 32px 30px 18px;
  margin: auto;
}
.heading,
.keyhead,
.progressrow,
.shelfhead {
  justify-content: space-between;
}
.heading {
  margin-bottom: 21px;
  gap: 12px;
}
.heading h1 {
  font-size: clamp(2rem, 4.4vw, 3.25rem);
  font-weight: 740;
  line-height: 1.08;
  letter-spacing: -0.063em;
  margin: 0;
}
.primary {
  background: var(--blue);
  color: white;
  padding: 0 18px;
  font-size: 0.91rem;
  box-shadow: 0 3px 8px #2656b71a;
}
.primary:hover {
  background: #204fb7;
}
.primary svg {
  width: 17px;
}
.secondary {
  padding: 0 14px;
  color: var(--blue);
  background: white;
  border: 1px solid var(--line);
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.58fr) minmax(270px, 1fr);
  align-items: start;
  gap: clamp(20px, 3vw, 36px);
}
.stats {
  min-height: 46px;
  gap: 18px;
  padding-bottom: 10px;
}
.difficulty {
  position: relative;
  display: flex;
  align-items: center;
  background: #e7eefc;
  border-radius: 8px;
  color: #234da2;
}
.difficulty:after {
  content: "";
  position: absolute;
  right: 14px;
  top: calc(50% - 4px);
  width: 6px;
  height: 6px;
  border-right: 1.8px solid;
  border-bottom: 1.8px solid;
  transform: rotate(45deg);
  pointer-events: none;
}
.bars {
  position: absolute;
  left: 12px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 13px;
  pointer-events: none;
}
.bars i {
  width: 3px;
  background: currentColor;
  border-radius: 2px;
  height: 6px;
}
.bars i:nth-child(2) {
  height: 10px;
}
.bars i:nth-child(3) {
  height: 13px;
}
select {
  border: 0;
  appearance: none;
  background: transparent;
  font-weight: 670;
  cursor: pointer;
  min-height: 44px;
  padding: 0 34px 0 34px;
  width: 145px;
}
.stats > span {
  font-size: 0.91rem;
  color: var(--dim);
}
#mistakes {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
#mistakes b {
  color: var(--navy);
  margin-left: 2px;
}
#mistakes.has-errors,
#mistakes.has-errors b {
  color: #aa233c;
}
#dailyLabel {
  font-weight: 650;
}
.timer {
  gap: 6px;
  font-variant-numeric: tabular-nums;
}
.timer > svg {
  width: 17px;
}
.timer b {
  font-weight: 600;
}
.timer button {
  display: grid;
  place-items: center;
  min-width: 38px;
  min-height: 44px;
  color: var(--blue);
}
.timer button svg {
  width: 14px;
  height: 14px;
}
#board {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  grid-template: repeat(9, minmax(0, 1fr)) / repeat(9, minmax(0, 1fr));
  background: white;
  border: 2.5px solid #344967;
  border-radius: 5px;
  overflow: hidden;
  isolation: isolate;
}
.cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  border-right: 1px solid #b7c5d8;
  border-bottom: 1px solid #b7c5d8;
  background: white;
  font:
    540 clamp(1.45rem, 2.75vw, 2.32rem) / 1 Inter,
    sans-serif;
  color: #24354f;
  font-variant-numeric: tabular-nums;
}
.cell:nth-child(3n) {
  border-right: 2.3px solid #425975;
}
.cell:nth-child(9n) {
  border-right: 0;
}
.cell:nth-child(n + 19):nth-child(-n + 27),
.cell:nth-child(n + 46):nth-child(-n + 54) {
  border-bottom: 2.3px solid #425975;
}
.cell:nth-child(n + 73) {
  border-bottom: 0;
}
.cell.peer {
  background: #edf3fc;
}
.cell.same {
  background: #d5e5ff;
}
.cell.selected {
  background: #bfd7ff;
  box-shadow: inset 0 0 0 2px #507dd1;
}
.cell.entered {
  color: #2459c5;
}
.cell.error,
.cell.error.same {
  color: #ae193b;
  background: #ffdee5;
  box-shadow: inset 0 0 0 1.5px #d45169;
}
.cell.selected.error {
  box-shadow: inset 0 0 0 3px #ba284b;
}
.cell.error:after {
  content: "×";
  position: absolute;
  right: 2px;
  top: 2px;
  background: #ad2843;
  color: white;
  border-radius: 50%;
  width: 0.88rem;
  height: 0.88rem;
  font:
    700 0.8rem/0.83rem Inter,
    sans-serif;
}
.cell:focus-visible {
  outline-offset: -4px;
}
.mini {
  height: 100%;
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  padding: 2px;
}
.mini i {
  font:
    580 clamp(0.53rem, 1vw, 0.78rem) / 1 Inter,
    sans-serif;
  display: grid;
  place-items: center;
  color: #385986;
}
.tools {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 12px;
  gap: 5px;
}
.tools button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 48px;
  border-radius: 9px;
  color: #425b7d;
  font-size: 0.85rem;
}
.tools button span {
  display: grid;
  place-items: center;
  color: #3e66aa;
}
.tools button:hover:not(:disabled) {
  background: #e7eefb;
}
.tools #hint,
.tools #notes[aria-pressed="true"] {
  background: #e4edff;
  color: #214fab;
}
.tools #hint span {
  color: #2657bc;
}
aside {
  display: grid;
  gap: 14px;
  padding-top: 54px;
}
.keycard,
.dailycard {
  border-radius: 15px;
  border: 1px solid var(--line);
}
.keycard {
  background: white;
  padding: clamp(16px, 2vw, 23px);
}
h2 {
  font-size: 1.35rem;
  letter-spacing: -0.05em;
  line-height: 1.18;
  margin: 0;
}
.keyhead {
  margin-bottom: 14px;
}
.keyhead span,
.shelfhead span {
  font-size: 0.84rem;
  color: var(--dim);
}
#keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.digit {
  position: relative;
  display: grid;
  place-items: center;
  height: clamp(48px, 6.9vh, 70px);
  border-radius: 9px;
  background: #edf2fc;
  color: #2956ab;
  font:
    560 1.9rem/1 Inter,
    sans-serif;
}
.digit small {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font:
    570 0.7rem/1 Inter,
    sans-serif;
  color: #64799f;
}
.digit:hover:not(:disabled) {
  background: #dce8ff;
}
.digit.exhausted {
  opacity: 0.48;
}
.progressrow {
  font-size: 0.81rem;
  color: var(--dim);
  margin: 17px 0 7px;
}
.progressrow b {
  font-weight: 660;
  color: #385071;
}
progress {
  width: 100%;
  height: 5px;
  background: #e7edf8;
  display: block;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  appearance: none;
}
progress::-webkit-progress-bar {
  background: #e7edf8;
}
progress::-webkit-progress-value {
  background: #547fe2;
  border-radius: 10px;
}
progress::-moz-progress-bar {
  background: #547fe2;
}
.dailycard {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  background: #fff4d9;
  border-color: #ebd7a3;
  padding: 19px 20px;
  color: #523e1f;
}
.dailycard:before,
.monthbox:before {
  content: "";
  position: absolute;
  right: -65px;
  top: -30px;
  width: 220px;
  height: 220px;
  z-index: -1;
  background: repeating-radial-gradient(
    circle,
    transparent 0 13px,
    #c4984420 14px 15px
  );
  border-radius: 50%;
}
.dailycard img {
  width: clamp(65px, 7.7vw, 98px);
  height: auto;
  flex: none;
  filter: drop-shadow(0 5px 2px #8f692e15);
}
.dateline {
  display: block;
  font-size: 0.76rem;
  font-weight: 640;
  color: #775d30;
  margin-bottom: 4px;
}
.dailycard h2 {
  font-size: 1.48rem;
}
.dailycard p {
  font-size: 0.83rem;
  margin: 5px 0;
  color: #6f5937;
}
.dailycard button {
  padding: 0 11px;
  background: #fffaf0;
  border: 1px solid #ddc690;
  color: #624921;
  margin-top: 7px;
  font-size: 0.82rem;
}
.dailycard button:hover {
  background: white;
}
#status {
  font-size: 0.9rem;
  color: #405776;
  min-height: 1.4em;
  margin: 7px 0;
}
#status.warn {
  color: #a01e3a;
}
.monthbox {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #fff4d9;
  border: 1px solid #ead6a6;
  border-radius: 16px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.monthbox img {
  width: 88px;
  height: 88px;
}
.monthbox h2 {
  font-size: 1.55rem;
}
.monthbox p {
  margin: 5px 0 10px;
  font-size: 0.93rem;
  color: #685739;
}
.stamps {
  display: flex;
  gap: 5px;
}
.stamps i {
  width: 17px;
  height: 8px;
  border-radius: 5px;
  background: #e3d5b7;
}
.stamps i.earned {
  background: #ab7423;
}
.shelfhead {
  margin: 28px 0 14px;
}
#shelf,
.pastgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}
.medal {
  background: white;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 14px;
  position: relative;
}
.medal img {
  width: 64px;
  height: 64px;
  display: block;
  margin-bottom: 10px;
}
.medal.pending img {
  filter: saturate(0.56);
  opacity: 0.82;
}
.medal h3 {
  font-size: 1.03rem;
  letter-spacing: -0.025em;
  margin: 0;
}
.medal p {
  font-size: 0.85rem;
  color: var(--dim);
  margin: 5px 0 10px;
}
.medal small {
  display: block;
  color: #50668a;
  font-weight: 650;
}
.medal.won {
  border-color: #8baae2;
}
.medal.won small {
  color: #2459a9;
}
.pastgrid span {
  background: #fff4d9;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pastgrid img {
  width: 40px;
  height: 40px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0;
  background: white;
  color: var(--navy);
  width: min(430px, calc(100% - 28px));
  box-shadow: 0 24px 85px #1926413a;
  max-height: 86dvh;
}
dialog::backdrop {
  background: #16264570;
}
.dialog-body {
  padding: 26px;
  position: relative;
}
dialog h2 {
  font-size: 1.72rem;
  padding-right: 22px;
}
dialog p {
  font-size: 1rem;
  line-height: 1.58;
}
.close {
  position: absolute;
  right: 7px;
  top: 7px;
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
}
.dialog-body .primary {
  margin-top: 5px;
}
.dialog-body .secondary {
  margin-right: 8px;
}
.hintcoord {
  display: inline-flex;
  background: #eaf0ff;
  color: #2853a3;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 0.87rem;
}
.wonrow {
  display: flex;
  gap: 9px;
  align-items: center;
  background: #f1f5fd;
  border-radius: 9px;
  margin: 8px 0;
  padding: 8px;
  font-size: 0.9rem;
}
.wonrow img {
  width: 38px;
  height: 38px;
}
@media (min-width: 900px) and (max-height: 850px) {
  main {
    max-width: 960px;
    padding-top: 22px;
  }
  .heading {
    margin-bottom: 12px;
  }
  .heading h1 {
    font-size: 2.65rem;
  }
  .mast {
    height: 60px;
  }
  .layout {
    grid-template-columns: minmax(0, 1.48fr) minmax(250px, 1fr);
  }
  .digit {
    height: 50px;
  }
  .keycard {
    padding: 16px;
  }
  .dailycard {
    padding: 14px 16px;
  }
}
@media (min-width: 701px) and (max-width: 1100px) and (orientation: portrait) {
  main {
    max-width: min(800px, calc(57dvh + 48px));
    padding: 20px 24px;
  }
  .mast {
    gap: 20px;
    height: 62px;
  }
  .heading {
    margin-bottom: 10px;
  }
  .layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .boardcol,
  aside {
    display: contents;
  }
  .stats {
    grid-row: 1;
    padding-bottom: 0;
  }
  #board {
    grid-row: 2;
    justify-self: center;
  }
  .tools {
    grid-row: 4;
    margin: 0;
  }
  .keycard {
    grid-row: 3;
    padding: 3px 0;
    background: none;
    border: none;
  }
  .keyhead,
  .progressrow,
  .keycard progress {
    display: none;
  }
  #keys {
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 6px;
  }
  .digit {
    height: 55px;
    background: #e5edfc;
  }
  .digit small {
    right: 4px;
    bottom: 4px;
  }
  .dailycard {
    grid-row: 5;
    padding: 11px 17px;
    min-height: 75px;
  }
  .dailycard > div {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0 18px;
    align-items: center;
    flex: 1;
  }
  .dailycard img {
    width: 54px;
    order: -1;
    margin-right: 6px;
  }
  .dailycard .dateline {
    grid-column: 1;
  }
  .dailycard h2 {
    font-size: 1.12rem;
  }
  .dailycard p {
    display: none;
  }
  .dailycard button {
    grid-row: 1/3;
    grid-column: 2;
    margin: 0;
  }
}
@media (max-width: 700px) {
  .mast {
    padding: 0 12px;
    height: auto;
    min-height: 51px;
    gap: 5px;
    flex-wrap: wrap;
  }
  .brand {
    font-size: 1.05rem;
  }
  .brandmark {
    width: 29px;
    height: 29px;
  }
  .headtools {
    gap: 0;
  }
  .iconbtn {
    width: 36px;
  }
  nav {
    order: 3;
    width: 100%;
    border-top: 1px solid #e9edf5;
    gap: 6px;
    padding: 3px 0;
  }
  nav button {
    font-size: 0.82rem;
    min-height: 38px;
    padding: 0 10px;
  }
  main {
    padding: 16px 12px max(14px, env(safe-area-inset-bottom));
  }
  .heading {
    margin-bottom: 9px;
  }
  .heading h1 {
    font-size: clamp(1.5rem, 6vw, 2.1rem);
  }
  .primary,
  .secondary {
    font-size: 0.8rem;
    min-height: 42px;
    padding: 0 10px;
  }
  .layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .boardcol,
  aside {
    display: contents;
  }
  .stats {
    grid-row: 1;
    gap: 6px;
    min-height: 39px;
    padding: 0;
  }
  select {
    width: 125px;
    min-height: 42px;
    font-size: 0.85rem;
  }
  .timer {
    gap: 3px;
  }
  .stats > span {
    font-size: 0.8rem;
  }
  .timer button {
    min-width: 28px;
  }
  .cell {
    font-size: clamp(1.22rem, 5.5vw, 2.1rem);
  }
  .mini i {
    font-size: clamp(0.53rem, 1.9vw, 0.77rem);
  }
  .cell.error:after {
    width: 0.65rem;
    height: 0.65rem;
    font-size: 0.64rem;
    line-height: 0.65rem;
  }
  .tools {
    grid-row: 4;
    margin: 0;
  }
  .tools button {
    flex-direction: column;
    gap: 2px;
    font-size: 0.75rem;
    min-height: 46px;
  }
  .tools svg {
    width: 18px;
    height: 18px;
  }
  #board {
    grid-row: 2;
  }
  .keycard {
    grid-row: 3;
    border: 0;
    padding: 0;
    background: none;
  }
  .keyhead,
  .progressrow,
  .keycard progress {
    display: none;
  }
  #keys {
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 3px;
  }
  .digit {
    height: 46px;
    font-size: 1.25rem;
    border-radius: 6px;
    background: #e5edfc;
  }
  .digit small {
    position: static;
    font-size: 0.6rem;
    line-height: 0.8;
  }
  .digit {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
  }
  .dailycard {
    grid-row: 5;
    padding: 10px 12px;
    gap: 6px;
  }
  .dailycard img {
    width: 48px;
    order: -1;
  }
  .dailycard > div {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0 5px;
    align-items: center;
  }
  .dailycard .dateline {
    font-size: 0.65rem;
  }
  .dailycard h2 {
    font-size: 1.03rem;
  }
  .dailycard p {
    display: none;
  }
  .dailycard button {
    grid-column: 2;
    grid-row: 1/3;
    min-height: 40px;
    font-size: 0.72rem;
    margin: 0;
  }
  .monthbox {
    padding: 15px;
    gap: 9px;
  }
  .monthbox img {
    width: 55px;
    height: 55px;
  }
  #shelf,
  .pastgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .medal {
    padding: 11px;
  }
  .medal img {
    width: 50px;
    height: 50px;
  }
  .medal p {
    font-size: 0.79rem;
  }
  .shelfhead h2 {
    font-size: 1.2rem;
  }
}

@media (min-width: 701px) and (orientation: landscape) and (max-height: 770px) {
  main {
    max-width: min(960px, calc(100vh * 1.37));
    padding-top: 12px;
  }
  .mast {
    height: 52px;
  }
  .heading {
    margin-bottom: 5px;
  }
  .heading h1 {
    font-size: 2.1rem;
  }
  .stats {
    padding-bottom: 4px;
    min-height: 44px;
  }
  .tools {
    margin-top: 3px;
  }
  .dailycard {
    padding: 11px 14px;
  }
  .digit {
    height: 44px;
  }
  aside {
    padding-top: 48px;
  }
}

.stage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0;
}
.level-option {
  text-align: left;
  background: #f5f7fc;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
}
.level-option[aria-pressed="true"] {
  color: #214fab;
  background: #e8efff;
  border: 2px solid #4973cd;
  padding: 11px;
}
.level-option small {
  display: block;
  font-size: 0.76rem;
  font-weight: 450;
  margin-top: 3px;
  color: #516582;
}
.replace-note {
  font-size: 0.86rem;
}
@media (min-width: 701px) and (max-width: 1100px) and (orientation: portrait) {
  .cell {
    font-size: clamp(1.85rem, 4.1vw, 2.6rem);
  }
  .mini i {
    font-size: clamp(0.69rem, 1.45vw, 0.91rem);
  }
}
