body.numnum {
  --ink: #1d2433;
  --paper: #f6f3ec;
  --tile: #ffffff;
  --accent: #e4572e;
  --hit: #2a9d8f;
  --muted: #8a8577;
  --hard: #7b2cbf;

  > main { padding: 0.75em 1em; }

  [hidden] { display: none !important; }

  .game, .archives {
    max-width: 26rem;
    margin: 0 auto;
    text-align: center;
    color: var(--ink);
  }

  .bar {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.75rem;

    a { color: var(--ink); text-decoration: none; }

    .title {
      min-width: 0;
      font-size: 1.2rem;
      font-weight: 800;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;

      small { color: var(--muted); font-weight: normal; font-size: 0.85rem; }
    }

    .day {
      font-size: 1.6rem;
      line-height: 1;
      padding: 0 0.35rem;
    }

    .difficulty, > span:last-child { margin-left: auto; }
  }

  .difficulty {
    flex-shrink: 0;
    display: flex;
    border: 1px solid var(--ink);
    border-radius: 999px;
    overflow: hidden;
    font-size: 0.8rem;

    a { padding: 0.15rem 0.5rem; }
    a.current { background: var(--ink); color: var(--paper); }
  }

  .target {
    display: inline-block;
    min-width: 7rem;
    padding: 0.1rem 1.25rem;
    margin-bottom: 0.75rem;
    font-size: 2.75rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--paper);
    background: var(--ink);
    border-radius: 0.75rem;
  }

  .game[data-numnum-hard-value="true"] .target { background: var(--hard); }

  .tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.5rem;
  }

  .tile, .operator {
    min-width: 0;
    margin: 0;
    padding: 0;
    font: inherit;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    border: 2px solid var(--ink);
    border-radius: 0.6rem;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 0.1s, background 0.15s;

    &:active:not(:disabled) { transform: scale(0.95); }
  }

  .tile {
    aspect-ratio: 2 / 1;
    font-size: 1.6rem;
    background: var(--tile);
    color: var(--ink);
    box-shadow: 0 3px 0 var(--ink);

    &:hover { background: var(--tile); color: var(--ink); }
    &.selected { background: var(--accent); color: white; }
    &.hit { background: var(--hit); color: white; border-color: var(--hit); }
    &.used { visibility: hidden; }
  }

  .operators {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .operator {
    height: 2.75rem;
    font-size: 1.5rem;
    background: var(--paper);
    color: var(--ink);

    &:hover { background: var(--paper); color: var(--ink); }
    &.selected { background: var(--ink); color: var(--paper); }
    &:disabled { opacity: 0.4; cursor: default; }
  }

  .actions {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.6rem;

    button {
      font: inherit;
      font-size: 0.85rem;
      padding: 0.3rem 0.8rem;
      border: 1px solid var(--muted);
      border-radius: 999px;
      background: transparent;
      color: var(--ink);
      cursor: pointer;
      touch-action: manipulation;
    }
  }

  .message {
    min-height: 1.4rem;
    margin: 0.3rem 0 0;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
  }

  .steps, .solution ol {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.3rem;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;

    li {
      padding: 0.05rem 0.5rem;
      border-radius: 999px;
      background: color-mix(in srgb, var(--ink) 8%, transparent);
    }
  }

  .result {
    margin-top: 0.75rem;
    font-weight: 700;

    p { margin: 0 0 0.4rem; }

    .share {
      font: inherit;
      padding: 0.5rem 1.5rem;
      border: none;
      border-radius: 999px;
      background: var(--hit);
      color: white;
      cursor: pointer;
    }
  }

  .solution {
    margin-top: 0.75rem;

    h2 { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.3rem; }
  }

  .rules { margin-top: 1.25rem; color: var(--muted); font-size: 0.8rem; line-height: 1.4; }

  .game.solved .target { background: var(--hit); }

  .archives {
    ol { list-style: none; padding: 0; margin: 0; text-align: left; }

    li {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.4rem 0;
      border-bottom: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
    }

    .day { flex: 1; font-weight: 700; small { color: var(--muted); font-weight: normal; } }

    li a {
      font-size: 0.85rem;
      padding: 0.15rem 0.6rem;
      border: 1px solid var(--muted);
      border-radius: 999px;
      color: var(--ink);
      text-decoration: none;

      &.started { border-color: var(--accent); }
      &.solved { background: var(--hit); border-color: var(--hit); color: white; &::after { content: " ✓"; } }
      &.gave-up { color: var(--muted); &::after { content: " ✗"; } }
    }
  }
}
