/* Wormbites. wormbites.js puts classes on <body> for the current mode
   (browse-mode, edit-mode, play-mode, game-over-mode), the block type being
   drawn (drawing-*), the
   music state (music-paused/music-playing), is-index on the main page (and
   players' pages), is-player on a player's page, is-signed-in, and
   series-play while playing a series' levels in order.
   The rules below hide the while-* parts that don't apply. */

body:not(.edit-mode) .while-edit-mode,
body:not(.play-mode):not(.game-over-mode) .while-play-mode,
body:not(.drawing-wall) .while-drawing-wall,
body:not(.drawing-empty) .while-drawing-empty,
body:not(.drawing-food) .while-drawing-food,
body:not(.drawing-worm) .while-drawing-worm,
body:not(.drawing-pill) .while-drawing-pill,
body:not(.drawing-portal) .while-drawing-portal,
body:not(.is-index) .while-is-index,
body:not(.test-mode) .while-test-mode,
body:not(.replay-mode) .while-replay-mode,
body:not(.series-play) .while-series-play,
body:not(.music-paused) .while-music-paused,
body:not(.music-playing) .while-music-playing,
body:not(.is-signed-in) .while-signed-in,
body:not(.music-paused):not(.music-playing) .btn-toggle-music {
  display: none !important;
}

/* The game takes over the screen while editing or playing */
body.edit-mode,
body.play-mode,
body.game-over-mode {
  overflow: hidden;
}

/* ---------- Page ---------- */

.wb-title {
  display: flex;
  align-items: center;
  gap: 0.35em;
}

.canvas-title {
  width: 0.75em;
  height: 0.75em;
}

.wb-top-buttons {
  margin-bottom: 2rem;
}

/* Levels | Series tabs on the main page */
.wb-views {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.wb-views button {
  margin-bottom: -1px;
  padding: 0.5rem 0.1rem 0.65rem;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
}

.wb-views button:hover {
  color: var(--text);
}

.wb-views button[aria-selected="true"] {
  border-bottom-color: var(--accent-text);
  color: var(--text);
}

.wb-section-intro {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.wb-series-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: -0.5rem 0 1.5rem;
  color: var(--muted);
}

.wb-series-summary .wb-badge {
  margin: 0;
}

.wb-search {
  max-width: 420px;
  margin-bottom: 1.5rem;
}

.wb-search input {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-raised);
  color: var(--text);
  font: inherit;
}

.wb-search input:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.wb-empty {
  color: var(--muted);
}

/* The filters, with the sort menu beside them (or under them when there's no room) */
.wb-list-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.wb-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.wb-sort select {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-raised);
  color: var(--text);
  font: inherit;
}

.wb-filters {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-raised);
}

.wb-filters button {
  padding: 0.35rem 0.9rem;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.wb-filters button:hover {
  color: var(--text);
}

.wb-filters button[aria-pressed="true"] {
  background: var(--border);
  color: var(--text);
}

.wb-badge {
  display: inline-block;
  margin: 0 0 0.85rem;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.wb-badge.is-verified {
  border-color: rgb(80 200 120 / 0.4);
  color: var(--success-text);
}

.wb-level-record {
  margin: -0.35rem 0 0.85rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.wb-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.5rem;
}

.wb-badges .wb-badge {
  margin: 0;
}

/* How hard a level is, from how often it's won */
.wb-difficulty.is-easy { border-color: rgb(80 200 120 / 0.4); color: var(--success-text); }
.wb-difficulty.is-medium { border-color: rgb(230 190 60 / 0.5); color: #d9b13b; }
.wb-difficulty.is-hard { border-color: rgb(240 130 60 / 0.5); color: #ec8a4a; }
.wb-difficulty.is-very-hard { border-color: rgb(240 80 80 / 0.5); color: #f06a6a; }

/* On the levels (and series) the player has beaten */
.wb-beaten-tick {
  display: inline-grid;
  place-items: center;
  width: 1.3em;
  height: 1.3em;
  border-radius: 50%;
  background: rgb(80 200 120 / 0.2);
  color: var(--success-text);
  font-size: 0.8em;
  vertical-align: 0.1em;
}

.wb-player-link {
  color: inherit;
}

.wb-series-progress {
  color: var(--success-text);
}

.wb-player-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.wb-player-stats strong {
  color: var(--text);
}

/* Beside each music button while music plays */
.wb-music-volume {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
}

.wb-music-volume input {
  width: 7rem;
  accent-color: var(--accent, #6ea8fe);
}

.wb-menu .wb-music-volume {
  display: flex;
  margin: -0.1rem 0 0.5rem;
  padding: 0 0.75rem;
}

.wb-menu .wb-music-volume input {
  flex: 1;
}

.wb-levels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.wb-level {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
}

/* A series looks like a stack of cards */
.wb-series-card {
  overflow: visible;
  box-shadow:
    5px 5px 0 -1px var(--bg-raised), 5px 5px 0 0 var(--border),
    10px 10px 0 -1px var(--bg-raised), 10px 10px 0 0 var(--border);
}

.wb-series-card .wb-level-map {
  display: block;
  border-radius: var(--radius) var(--radius) 0 0;
}

.wb-level-number {
  margin: 0 0 0.15rem;
  color: var(--accent-text);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.wb-level-map {
  aspect-ratio: 1;
  border-bottom: 1px solid var(--border);
  background: #0b0d12 center / contain no-repeat;
  image-rendering: pixelated;
}

.wb-level-body {
  padding: 1rem 1.1rem 1.15rem;
}

.wb-level-body h2 {
  margin: 0 0 0.2rem;
  font-size: 1.1rem;
  overflow-wrap: anywhere;
}

.wb-level-meta {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.wb-level-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.wormbites .btn {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.wormbites .btn-small {
  font-size: 0.85rem;
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}

.wb-delete {
  color: var(--danger-text);
}

.wb-pages {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 2rem;
}

/* ---------- The game (edit and play modes) ---------- */

#gameModal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 1rem;
  background: rgb(5 6 9 / 0.94);
}

body.edit-mode #gameModal,
body.play-mode #gameModal,
body.game-over-mode #gameModal {
  display: flex;
}

.wb-stage {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.6);
}

body.play-mode .wb-stage,
body.game-over-mode .wb-stage {
  border-color: rgb(247 223 30 / 0.45);
}

/* The menu scrolls inside a column as tall as the map */
.wb-menu {
  position: relative;
  flex: none;
  width: 230px;
  border-right: 1px solid var(--border);
}

.wb-menu-scroll {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 0.75rem;
}

.wb-canvas {
  display: flex;
  flex-direction: column;
  padding: 4px;
}

/* The map, with the game-over buttons over it */
.wb-map-wrap {
  position: relative;
  font-size: 0;
}

/* ---------- Stats above the map while playing ---------- */

.wb-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  padding: 0.45rem 0.6rem 0.55rem;
}

.wb-hud-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.wb-play-series {
  color: var(--accent-text);
  font-size: 0.75rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.wb-play-name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.wb-hud-stats {
  display: flex;
  gap: 1rem;
  margin: 0;
  font-size: 0.8rem;
}

.wb-hud-stats dt {
  color: var(--muted);
}

.wb-hud-stats dd {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.wb-hud-food dd {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.wb-food-bar {
  width: 4rem;
  height: 0.4rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.wb-food-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.15s;
}

/* ---------- What to do next, over the map when a game ends ---------- */

/* Its buttons replace the replay's and test mode's controls */
body.game-over-mode .wb-replay-panel,
body.game-over-mode .wb-test-panel {
  display: none;
}

.wb-game-over {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 52%;
  font-size: 1rem;
}

.wb-game-over[hidden] {
  display: none;
}

.wb-game-over-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  max-width: 90%;
}

canvas.map {
  display: block;
}

.menu-item {
  display: block;
  width: 100%;
  margin: 0 0 0.35rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-sunken);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
}

.menu-item:hover {
  border-color: var(--muted);
}

.menu-item.is-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.menu-item.is-primary:hover {
  background: var(--accent-hover);
}

.wb-menu hr {
  margin: 0.75rem 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.menu-heading {
  margin: 0 0 0.1rem;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.menu-label {
  display: block;
  margin: 0.55rem 0 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.menu-input {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-sunken);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
}

.while-drawing-food .menu-item:first-of-type {
  margin-top: 0.6rem;
}

/* Two buttons side by side */
.menu-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.menu-row .menu-item {
  text-align: center;
}

.menu-item:disabled,
.menu-item:disabled:hover {
  border-color: var(--border);
  opacity: 0.45;
  cursor: default;
}

.menu-item.is-primary:disabled {
  background: var(--accent);
}

/* Save stands out while there's something to save */
.btn-save-level.has-changes {
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}

.wb-edit-status {
  margin: 0.15rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.wb-edit-status.is-warning {
  color: var(--warning-text);
}

.wb-menu .menu-heading {
  margin-top: 0.85rem;
}

/* Block tools: icons drawn in the level's colors, with their number keys */
.wb-tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.25rem;
  margin: 0.35rem 0 0.5rem;
}

.wb-tools button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.3rem 0.1rem 0.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-sunken);
  color: var(--muted);
  font: inherit;
  font-size: 0.68rem;
  cursor: pointer;
}

.wb-tools button:hover {
  border-color: var(--muted);
}

.wb-tools button[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.wb-tools canvas {
  width: 28px;
  height: 28px;
  border-radius: 4px;
}

.wb-tools kbd {
  position: absolute;
  top: 1px;
  right: 2px;
  padding: 0 0.2em;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.6rem;
}

/* Shape and mirror choices */
.wb-segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 0 0.35rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.wb-segmented button {
  padding: 0.35rem 0;
  border: 0;
  border-left: 1px solid var(--border);
  background: var(--bg-sunken);
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.wb-segmented button:first-child {
  border-left: 0;
}

.wb-segmented button:hover {
  color: var(--text);
}

.wb-segmented button[aria-pressed="true"] {
  background: var(--border);
  color: var(--text);
}

/* Shift the map: arrows around a rotate button */
.wb-shift {
  display: grid;
  grid-template-areas: ". up ." "left rotate right" ". down .";
  grid-template-columns: repeat(3, 2.25rem);
  grid-template-rows: repeat(3, 2.25rem);
  gap: 0.2rem;
  margin: 0.35rem 0 0.25rem;
}

.wb-shift button {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-sunken);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.wb-shift button:hover {
  border-color: var(--muted);
}

.wb-shift-up { grid-area: up; }
.wb-shift-left { grid-area: left; }
.wb-shift-rotate { grid-area: rotate; }
.wb-shift-right { grid-area: right; }
.wb-shift-down { grid-area: down; }

/* Level settings fold away */
.wb-settings {
  margin-top: 0.5rem;
}

.wb-settings summary {
  cursor: pointer;
}

.wb-settings summary::marker {
  color: var(--muted);
}

/* "Grows on [2] of every [3] food" */
.wb-growth {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 2.1;
}

.wb-growth .menu-input {
  display: inline-block;
  width: 4.2em;
  padding: 0.15rem 0.3rem;
}

.menu-hint {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.wb-replay-panel {
  margin-bottom: 0.75rem;
  padding: 0.6rem;
  border: 1px solid rgb(130 170 255 / 0.4);
  border-radius: 8px;
  background: rgb(130 170 255 / 0.08);
}

/* Arrow pad for touch screens */
.wb-dpad {
  display: none;
  grid-template-areas: ". up ." "left . right" ". down .";
  grid-template-columns: repeat(3, 3.25rem);
  grid-template-rows: repeat(3, 3.25rem);
  gap: 0.3rem;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.wb-dpad button {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-sunken);
  color: var(--text);
  font-size: 1.1rem;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.wb-dpad button:active {
  background: var(--border);
}

.wb-dpad-up { grid-area: up; }
.wb-dpad-left { grid-area: left; }
.wb-dpad-right { grid-area: right; }
.wb-dpad-down { grid-area: down; }

@media (pointer: coarse) {
  body:not(.replay-mode) .wb-dpad {
    display: grid;
  }
}

.wb-test-panel {
  margin-bottom: 0.75rem;
  padding: 0.6rem;
  border: 1px solid rgb(247 223 30 / 0.35);
  border-radius: 8px;
  background: rgb(247 223 30 / 0.06);
}

.wb-test-badge {
  margin: 0 0 0.25rem;
  color: var(--accent-text);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.wb-test-status {
  margin: 0 0 0.6rem;
  font-size: 0.82rem;
  line-height: 1.45;
}

body.worm-dead .wb-test-status {
  color: var(--danger-text);
}

body.worm-dead .wb-stage {
  border-color: rgb(255 110 100 / 0.6);
}

.wb-play-note {
  margin: 0 0 1rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid rgb(80 200 120 / 0.4);
  border-radius: 8px;
  color: var(--success-text);
  font-size: 0.85rem;
}

kbd {
  padding: 0.05em 0.35em;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-sunken);
  font: 0.85em var(--mono);
}

/* On narrow screens the menu goes under the map */
/* On phones the game fills the screen: stats and map at the top, then the
   arrows (on touch screens) and the menu under them, scrolling on their own.
   (constants.js sizes the map by checking .wb-stage's flex-direction, so this
   is the only place the breakpoint is set.) */
@media (max-width: 760px) {
  #gameModal {
    padding: 0;
  }

  .wb-stage {
    flex-direction: column-reverse;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .wb-canvas {
    flex: none;
    align-items: center;
  }

  .wb-hud {
    align-self: stretch;
    padding: 0.35rem 0.4rem 0.4rem;
  }

  .wb-menu {
    flex: 1;
    width: auto;
    min-height: 0;
    border-top: 1px solid var(--border);
    border-right: 0;
  }

  .wb-hud-stats {
    gap: 0.75rem;
  }

  .wb-food-bar {
    width: 2.5rem;
  }
}

/* ---------- Song title (shown for a few seconds when a song starts) ---------- */

.wb-song-title {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  max-width: min(480px, 100% - 2rem);
  padding: 0.6rem 1.1rem 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgb(23 26 35 / 0.94);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.45);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0.75rem);
  transition: opacity 0.3s, transform 0.3s;
}

.wb-song-title.is-shown {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  .wb-song-title,
  .wb-song-title.is-shown {
    transform: translate(-50%, 0);
  }
}

.wb-song-icon {
  color: var(--accent-text);
  font-size: 1.3rem;
}

.wb-song-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.wb-song-name,
.wb-song-author {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-song-name {
  font-weight: 700;
}

.wb-song-author {
  color: var(--muted);
  font-size: 0.82rem;
}

.wb-song-author:empty {
  display: none;
}

/* ---------- Dialogs ---------- */

.wb-dialog {
  width: min(560px, 100% - 2rem);
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--text);
}

.wb-dialog::backdrop {
  background: rgb(0 0 0 / 0.6);
}

.wb-dialog-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.wb-dialog-text p,
p.wb-dialog-text {
  margin: 0 0 0.75rem;
  color: var(--muted);
}

.wb-dialog-text a {
  overflow-wrap: anywhere;
}

.wb-qr-button {
  display: block;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  cursor: pointer;
}

.wb-qr-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wb-qr-code {
  display: block;
  width: 180px;
  height: 180px;
  border-radius: 8px;
  image-rendering: pixelated;
}

.wb-dialog-text p.wb-qr-hint {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  text-align: center;
}

.txt-level-code {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-sunken);
  color: var(--text);
  font: 0.8rem/1.5 var(--mono);
  resize: vertical;
}

.wb-dialog-error {
  margin: 0.5rem 0 0;
  color: var(--danger-text);
  font-size: 0.9rem;
}

.wb-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

/* ---------- Series editor ---------- */

.wb-series-dialog {
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.wb-field-label {
  display: block;
  margin: 1rem 0 0.35rem;
  padding: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.wb-field {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-sunken);
  color: var(--text);
  font: inherit;
}

textarea.wb-field {
  font: 0.85rem/1.5 var(--mono);
  resize: vertical;
}

.wb-field:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.wb-stub-field {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-sunken);
}

.wb-stub-field span {
  padding-left: 0.65rem;
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.wb-stub-field .wb-field {
  min-width: 0;
  padding-left: 0.1rem;
  border: 0;
}

.wb-field-hint {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.wb-series-levels-field {
  margin: 0;
  padding: 0;
  border: 0;
}

.wb-series-levels {
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
  counter-reset: series-level;
}

.wb-series-levels li {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
  counter-increment: series-level;
}

.wb-series-levels li::before {
  content: counter(series-level) ".";
  min-width: 1.75em;
  color: var(--muted);
  font-size: 0.85rem;
}

.wb-series-level-name {
  flex: 1;
  overflow-wrap: anywhere;
}

.wb-series-levels .btn-small {
  min-width: 2.2em;
  padding-inline: 0.5em;
}

.cursor-pointer {
  cursor: pointer;
}
