:root {
  color-scheme: light dark;

  /* Per-game accent colors. Each game has a darker shade for light mode
     and a lighter one for dark mode; the theme blocks below pick one. */
  --game-accent-light: #6f5130;
  --game-accent-dark: #b78a4f;

  --bg: #f3f0e8;
  --card: #fffaf0;
  --text: #1b1812;
  --muted: #746c5f;
  --border: #ddd2c0;
  --accent: var(--game-accent-light);
  --accent-text: #fff7ec;

  --glass-bg: rgb(255 253 248 / 0.36);
  --glass-edge: rgb(255 255 255 / 0.85);
  --glass-shade: rgb(90 70 40 / 0.14);
  --glass-sheen: rgb(255 255 255 / 0.5);
  --glass-lens: rgb(255 255 255 / 0.55);
  --rim-bright: rgb(255 255 255 / 0.95);
  --rim-dim: rgb(255 255 255 / 0.3);
  --surface-sheen: rgb(255 255 255 / 0.75);
  --surface-highlight: rgb(255 255 255 / 0.95);
  --shadow-color: 70 52 28;
}

:root[data-game="gu"],
.dump-option[data-game="gu"] {
  --game-accent-light: #8a2f2a;
  --game-accent-dark: #d4695d;
}

:root[data-game="tri"],
.dump-option[data-game="tri"] {
  --game-accent-light: #245a78;
  --game-accent-dark: #62a6ca;
}

:root[data-game="fu"],
.dump-option[data-game="fu"] {
  --game-accent-light: #5b3a7a;
  --game-accent-dark: #a888cc;
}

/* Rise: Kamura lantern orange (vivid, unlike Wilds' muted tan). */
:root[data-game="rise"],
.dump-option[data-game="rise"] {
  --game-accent-light: #b35412;
  --game-accent-dark: #f0953f;
}

/* World: Iceborne frost cyan. */
:root[data-game="world"],
.dump-option[data-game="world"] {
  --game-accent-light: #0b6f79;
  --game-accent-dark: #52c2cc;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12130f;
    --card: #1d2119;
    --text: #f0eadc;
    --muted: #b5aa96;
    --border: #3a4033;
    --accent: var(--game-accent-dark);
    --accent-text: #151009;

    --glass-bg: rgb(28 32 24 / 0.3);
    --glass-edge: rgb(255 255 255 / 0.2);
    --glass-shade: rgb(0 0 0 / 0.35);
    --glass-sheen: rgb(255 255 255 / 0.12);
    --glass-lens: rgb(255 255 255 / 0.14);
    --rim-bright: rgb(255 255 255 / 0.6);
    --rim-dim: rgb(255 255 255 / 0.07);
    --surface-sheen: rgb(255 255 255 / 0.04);
    --surface-highlight: rgb(255 255 255 / 0.07);
    --shadow-color: 0 0 0;
  }
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg: #f3f0e8;
  --card: #fffaf0;
  --text: #1b1812;
  --muted: #746c5f;
  --border: #ddd2c0;
  --accent: var(--game-accent-light);
  --accent-text: #fff7ec;

  --glass-bg: rgb(255 253 248 / 0.36);
  --glass-edge: rgb(255 255 255 / 0.85);
  --glass-shade: rgb(90 70 40 / 0.14);
  --glass-sheen: rgb(255 255 255 / 0.5);
  --glass-lens: rgb(255 255 255 / 0.55);
  --rim-bright: rgb(255 255 255 / 0.95);
  --rim-dim: rgb(255 255 255 / 0.3);
  --surface-sheen: rgb(255 255 255 / 0.75);
  --surface-highlight: rgb(255 255 255 / 0.95);
  --shadow-color: 70 52 28;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #12130f;
  --card: #1d2119;
  --text: #f0eadc;
  --muted: #b5aa96;
  --border: #3a4033;
  --accent: var(--game-accent-dark);
  --accent-text: #151009;

  --glass-bg: rgb(28 32 24 / 0.3);
  --glass-edge: rgb(255 255 255 / 0.2);
  --glass-shade: rgb(0 0 0 / 0.35);
  --glass-sheen: rgb(255 255 255 / 0.12);
  --glass-lens: rgb(255 255 255 / 0.14);
  --rim-bright: rgb(255 255 255 / 0.6);
  --rim-dim: rgb(255 255 255 / 0.07);
  --surface-sheen: rgb(255 255 255 / 0.04);
  --surface-highlight: rgb(255 255 255 / 0.07);
  --shadow-color: 0 0 0;
}

* {
  box-sizing: border-box;
}

/* Keyboard-focus glow. Uses :focus-visible so mouse/touch taps don't show
   it, only actual keyboard (or assistive-tech) focus. */
button:focus-visible,
input:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent);
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
  /* "clip" also prevents sideways scrolling, but without turning html/body
     into scroll containers, so position: sticky works (pinned headers). */
  overflow-x: clip;
}

body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

header,
main,
footer {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 20px;
}

header {
  padding-top: max(24px, env(safe-area-inset-top));
  text-align: center;
}

.header-row {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 0 64px;
}

h1 {
  margin: 0 0 6px;
  font-size: clamp(34px, 8vw, 56px);
  letter-spacing: -0.05em;
}

#gameTitle {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

#gameTitle:hover {
  color: var(--accent);
}

.game-switch-hint {
  margin-top: 4px;
  font-size: 0.78rem;
  opacity: 0.75;
}

h2,
h3 {
  margin: 0;
}

p {
  margin: 0;
  color: var(--muted);
}

code {
  background: color-mix(in srgb, var(--card), var(--border));
  padding: 2px 6px;
  border-radius: 6px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 800;
  cursor: pointer;
}

button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

/* Clear liquid glass: a light blur that keeps what's behind recognizable,
   brightened and saturated like real glass. Layers, top to bottom: a lens
   brightening toward the edges, a diagonal sheen, a faint tint in the
   game's accent color, and the base glass color. The two-tone rim comes
   from the ::before ring below. Used for everything that floats above the
   page (menu button, search pill, back-to-top, toasts, compare tray). */
.glass,
.menu-toggle,
.floating-search-toggle,
.floating-search.is-expanded,
.back-to-top,
.toast,
.compare-tray,
.dump-menu {
  background:
    radial-gradient(ellipse at 50% 50%, transparent 58%, var(--glass-lens) 100%),
    linear-gradient(145deg, var(--glass-sheen) 0%, transparent 38%),
    linear-gradient(
      color-mix(in srgb, var(--accent) 7%, transparent),
      color-mix(in srgb, var(--accent) 7%, transparent)
    ),
    var(--glass-bg);
  color: var(--text);
  border: 0;
  -webkit-backdrop-filter: blur(8px) saturate(185%) brightness(1.08);
  backdrop-filter: blur(8px) saturate(185%) brightness(1.08);
  box-shadow:
    inset 0 1.5px 1px -0.5px var(--rim-bright),
    inset 0 -1px 1px var(--glass-shade),
    inset 0 0 10px 1px rgb(255 255 255 / 0.06),
    0 10px 28px -8px rgb(var(--shadow-color) / 0.4),
    0 2px 6px rgb(var(--shadow-color) / 0.1);
}

/* Two-tone rim: bright where light hits the top-left edge, fading along
   the sides, catching a little light again at the bottom-right. */
.glass::before,
.menu-toggle::before,
.floating-search-toggle::before,
.floating-search.is-expanded::before,
.back-to-top::before,
.toast::before,
.compare-tray::before,
.dump-menu::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    var(--rim-bright) 0%,
    var(--rim-dim) 38%,
    var(--rim-dim) 62%,
    color-mix(in srgb, var(--rim-bright) 55%, transparent) 100%
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.floating-search-toggle {
  position: relative;
}

.menu-toggle {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 22px;
  z-index: 18;
}

/* Floating search: a round button (matching the menu button) that appears
   once the user has scrolled a bit, and expands in place into a search bar
   on tap. Anchored with `right`, so growing its width expands it leftward
   and keeps the button pinned at the same spot. */
.floating-search {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 17;

  display: flex;
  align-items: center;
  overflow: hidden;

  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid transparent;

  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.92);
  pointer-events: none;

  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s,
    width 0.2s ease,
    height 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.floating-search.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}

.floating-search.is-expanded {
  width: min(420px, calc(100vw - 32px));
  height: 52px;
  /* Less see-through than the round buttons, so typed text stays legible. */
  background:
    radial-gradient(ellipse at 50% 50%, transparent 70%, var(--glass-lens) 100%),
    linear-gradient(145deg, var(--glass-sheen) 0%, transparent 38%),
    linear-gradient(
      color-mix(in srgb, var(--accent) 7%, transparent),
      color-mix(in srgb, var(--accent) 7%, transparent)
    ),
    color-mix(in srgb, var(--card) 72%, transparent);
}

/* Higher specificity than the global input[type="search"] rule, so its
   padding/border/flex don't leak into the collapsed button. */
.floating-search input.floating-search-input {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 0 0;
  width: 0;
  min-width: 0;
  height: 100%;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  opacity: 0;
  transition: opacity 0.18s ease 0.05s;
}

.floating-search input.floating-search-input:focus-visible {
  box-shadow: none;
}

.floating-search.is-expanded input.floating-search-input {
  flex: 1 1 auto;
  padding: 0 8px 0 18px;
  opacity: 1;
}

.floating-search-toggle {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
}

/* Once expanded, the whole pill is the glass surface; the button inside
   becomes a plain accent-colored icon. */
.floating-search.is-expanded .floating-search-toggle::before {
  display: none;
}

.floating-search.is-expanded .floating-search-toggle {
  margin-right: 3px;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: var(--accent);
}

.floating-search-toggle svg {
  width: 20px;
  height: 20px;
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .floating-search,
  .floating-search-input {
    transition: none;
  }
}

.menu {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(340px, 86vw);
  background: var(--card);
  border-right: 1px solid var(--border);
  z-index: 20;
  transform: translateX(-100%);
  transition: transform 180ms ease;
  padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
  overflow-y: auto;
  box-shadow: 20px 0 40px rgb(0 0 0 / 0.18);
}

.menu.open {
  transform: translateX(0);
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.35);
  z-index: 19;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.menu-section {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

/* Sections whose entries are all hidden (see updateMenuSectionVisibility). */
.menu-section[hidden] {
  display: none;
}

.menu-section h3,
.filter-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.menu-item,
.npc-item {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}

.menu-item:hover,
.npc-item:hover {
  border-color: var(--accent);
}

#categoryList {
  display: grid;
  gap: 8px;
}

.menu-separator {
  height: 1px;
  background: var(--border);
  margin: 14px 0 6px;
  opacity: 0.7;
}

.card-controls,
.search-filters {
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
}

.filter-group {
  display: grid;
  gap: 6px;
  justify-items: start;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 12px;
  font-size: 0.85rem;
}

.filter-chip.active {
  background: color-mix(in srgb, var(--accent) 85%, black);
  color: var(--accent-text);
  border-color: color-mix(in srgb, var(--accent) 85%, black);
}

.filter-chip:not(.active) {
  opacity: 0.62;
}

.toolbar,
.entry,
.view-header,
.npc-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.06);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  padding: 12px;
  /* Was "sticky", which never took effect (html/body used overflow-x:
     hidden); kept unpinned now that sticky works, so nothing changes. */
  position: relative;
  top: 0;
  z-index: 2;
}

input[type="search"] {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 12px 14px;
  background: transparent;
  color: var(--text);
  font: inherit;
}

#count {
  white-space: nowrap;
  color: var(--muted);
  font-size: 14px;
}

.copy-search-btn {
  width: 100%;
  margin: 0 0 18px;
}

.results {
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.entry {
  position: relative;
  padding: 16px;
  overflow: hidden;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Card buttons float at the top-right, and the meta line / title flow
   beside them, instead of the card reserving an empty band at the top. */
.entry-actions {
  float: right;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin: -4px -4px 6px 10px;
  position: relative;
  z-index: 2;
}

.copy-btn,
.tag-badge {
  padding: 6px 10px;
  font-size: 0.74rem;
  line-height: 1;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}

/* Quiet outline style for per-card buttons, so they don't compete with
   the text. They light up in the accent color on hover/press. */
.entry-actions .copy-btn,
.entry-actions .lang-btn {
  padding: 6px 10px;
  font-size: 0.74rem;
  line-height: 1;
  font-weight: 700;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.entry-actions .copy-btn:hover,
.entry-actions .lang-btn:hover,
.entry-actions .copy-btn:active,
.entry-actions .lang-btn:active {
  color: var(--accent);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.tag-badge {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.entry-section {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* Meta line: category chip + lighter details. */
.entry-section:has(.meta-chip) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.meta-chip {
  --chip: var(--accent);
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--chip) 75%, var(--text));
  background: color-mix(in srgb, var(--chip) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--chip) 35%, transparent);
}

.meta-rest {
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.8;
  overflow-wrap: anywhere;
}

/* One color per category, so mixed search results are easy to scan. The
   hues avoid the game accents (Wilds tan, GU crimson, Tri sea blue, 4U
   violet), so a chip never looks like part of the game's theme. */
.meta-chip                        { --chip: #8b8f86; }
.meta-chip[data-cat="Dialogues"]  { --chip: #d8769f; }
.meta-chip[data-cat="NPCs"]       { --chip: #c9b43e; }
.meta-chip[data-cat="Monsters"]   { --chip: #c95fba; }
.meta-chip[data-cat="Quests"]     { --chip: #4fae7a; }
.meta-chip[data-cat="Facilities"] { --chip: #6fae4f; }
.meta-chip[data-cat="Items"]      { --chip: #3fa899; }
.meta-chip[data-cat="Equipment"]  { --chip: #6d86d8; }
.meta-chip[data-cat="Weapons"]    { --chip: #8a7fe0; }
.meta-chip[data-cat="Skills"]     { --chip: #d86a7e; }
.meta-chip[data-cat="Tutorials"]  { --chip: #a3b347; }
.meta-chip[data-cat="UI"]         { --chip: #8a8f98; }
.meta-chip[data-cat="Social"]     { --chip: #b98a9e; }
.meta-chip[data-cat="System"]     { --chip: #7d8a86; }
.meta-chip[data-cat="References"] { --chip: #9a9489; }

.entry-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.entry-name {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text);
}

.entry-name-link {
  padding: 0;
  background: transparent;
  color: var(--accent);
  border: 0;
  border-radius: 0;
  font: inherit;
  font-weight: 900;
  text-align: left;
}

.entry-name-link:hover {
  text-decoration: underline;
}

.entry-id,
.entry-rejected {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 800;
  color: var(--accent);
}

.entry-rejected {
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.entry-text {
  line-height: 1.6;
  color: var(--text);
}

.entry[data-mode="ids"] .entry-text-clean,
.entry[data-mode="ids"] .entry-text-code {
  display: none;
}

.entry[data-mode="clean"] .entry-id,
.entry[data-mode="clean"] .entry-rejected,
.entry[data-mode="clean"] .entry-text-ids,
.entry[data-mode="clean"] .entry-text-code {
  display: none;
}

.entry[data-mode="clean"] .entry-text-clean {
  display: block;
}

.entry[data-mode="code"] .entry-id,
.entry[data-mode="code"] .entry-rejected,
.entry[data-mode="code"] .entry-text-ids,
.entry[data-mode="code"] .entry-text-clean {
  display: none;
}

.entry[data-mode="code"] .entry-text-code {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.entry-text hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 12px 0;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 36px 12px;
}

.view-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  padding: 12px;
}

.view-header h2 {
  flex: 1;
  min-width: 0;
  font-size: 1.3rem;
  text-align: center;
}

.dialogue-view-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
}

.dialogue-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.dialogue-header h2 {
  grid-column: 2;
  text-align: center;
}

.dialogue-mode-btn {
  grid-column: 3;
  justify-self: end;
  white-space: nowrap;
}

.npc-item {
  display: grid;
  gap: 3px;
}

.npc-item span {
  font-weight: 900;
}

.npc-item small {
  color: var(--muted);
  font-weight: 600;
}

.word-index-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  margin: 0.25rem 0.75rem 0.25rem 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.word-index-item span:first-child {
  color: var(--accent);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.word-index-item span:last-child {
  color: var(--muted);
  font-weight: 700;
}

footer {
  color: var(--muted);
  font-size: 14px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  text-align: center;
}

@media (max-width: 560px) {
  header,
  main,
  footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .header-row {
    padding: 0 56px;
  }

  h1 {
    font-size: clamp(36px, 12vw, 52px);
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  #count {
    align-self: flex-end;
  }

  .entry {
  contain: layout paint;
}

.json-panel {
  max-width: 100%;
  min-width: 0;
}

  .view-header {
    align-items: stretch;
    flex-direction: column;
  }

  .dialogue-view-header {
    display: flex;
  }

  .dialogue-header {
    grid-template-columns: 1fr;
  }

  .dialogue-header h2,
  .dialogue-mode-btn {
    grid-column: auto;
    justify-self: stretch;
  }
}



.index-section-title {
  margin: 1.2rem 0 0.5rem;
  opacity: 0.85;
}




.json-meta {
  opacity: 0.8;
  margin-top: 0.35rem;
}



.json-panel {
  margin-top: 1.4rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.03);
}

.json-panel summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--muted);
}

.json-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
}

.json-fact {
  padding: 0.75rem;
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.04);
}

.json-fact span,
.json-block span {
  display: block;
  font-size: 0.75rem;
  opacity: 0.7;
  margin-bottom: 0.25rem;
}

.json-fact strong {
  font-size: 1rem;
}

.json-block {
  margin-top: 1rem;
}

.json-block p {
  margin: 0.25rem 0 0;
  line-height: 1.5;
}







.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.4rem;
}

.data-pill {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: rgba(255, 255, 255, 0.05);
  font-weight: 800;
}

.sharpness-wrap {
  margin-top: 0.45rem;
}

.sharpness-bar {
  display: flex;
  align-items: stretch;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--border);
  padding: 1px;
}

.sharpness-segment {
  flex: var(--sharpness-width) 0 0;
  min-width: 4px;
  height: 100%;
  display: block;
}

.sharpness-segment:last-child {
  border-right: none;
}

.sharpness-values {
  display: flex;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.sharpness-values span {
  flex: var(--sharpness-width) 0 0;
  min-width: 4px;
  text-align: center;
}

.sharpness-red { background: #c74735; }
.sharpness-orange { background: #d9822b; }
.sharpness-yellow { background: #d8c448; }
.sharpness-green { background: #5aa35a; }
.sharpness-blue { background: #4a83c4; }
.sharpness-white { background: #e8e3d8; }
.sharpness-purple { background: #9b6ad6; }

.crafting-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.zenny,
.material-row {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}

.material-row span {
  color: var(--muted);
  min-width: 2.5rem;
}

.tree-flow {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.tree-node {
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  padding: 0.55rem 0.75rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.04);
}

.current-node {
  border-color: var(--accent);
}

.tree-arrow {
  color: var(--muted);
  padding-left: 0.75rem;
}

.tree-flow small {
  color: var(--muted);
}






.json-block .sharpness-values span {
  display: block;
  flex: var(--sharpness-width) 0 0;
  min-width: 4px;
  text-align: center;
}

.json-block .data-pill {
  display: inline-flex;
}

.json-block .material-row span {
  display: inline;
  min-width: auto;
}

.material-row {
  display: flex;
  gap: 0.35rem;
  align-items: baseline;
}

.material-row strong {
  font-size: 1rem;
}






.rarity-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-weight: 900;
}

.rarity-1, .rarity-2 { background: #7f8c8d; color: white; }
.rarity-3, .rarity-4 { background: #4f9d69; color: white; }
.rarity-5, .rarity-6 { background: #4a83c4; color: white; }
.rarity-7, .rarity-8 { background: #b78a4f; color: #151009; }




.weapon-type-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
}





.sharpness-bar .sharpness-segment {
  opacity: 1;
  margin: 0;
  font-size: inherit;
}

.sharpness-values span {
  opacity: 1;
  margin: 0;
}




.monster-index-section {
  margin: 1.35rem 0 2rem;
}

.monster-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.monster-section-header h3 {
  margin: 0;
  font-size: 1.35rem;
}

.monster-section-header span {
  opacity: 0.65;
  font-weight: 700;
  font-size: 1rem;
}

.monster-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: flex-start;
}

.monster-chip-row .monster-chip {
  appearance: none;
  width: auto;
  flex: 0 0 auto;

  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text);

  padding: 0.34rem 0.62rem;
  min-height: 1.8rem;

  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.05;
  white-space: nowrap;
}

.monster-chip-row .monster-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #111;
}

.monster-inline-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  margin-top: 0.9rem;
}

.monster-inline-card .entry,
.monster-inline-card .json-panel,
.monster-inline-card .monster-json-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.monster-inline-card .monster-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}







.monster-json-panel {
  max-width: 100%;
  min-width: 0;
  font-size: 0.9rem;
}

.monster-json-panel * {
  min-width: 0;
}

.monster-json-panel summary {
  font-size: 1rem;
}

.monster-table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  margin-top: 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.monster-parts-table {
  width: max-content;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.monster-parts-table th,
.monster-parts-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.35rem 0.45rem;
  text-align: right;
  white-space: nowrap;
}

.monster-parts-table th:first-child,
.monster-parts-table td:first-child {
  text-align: left;
  font-weight: 700;
}

.monster-parts-table th {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.monster-json-panel .data-pill {
  font-size: 0.78rem;
  padding: 0.3rem 0.55rem;
}

.monster-json-panel[open] {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}





.monster-parts-table th:first-child,
.monster-parts-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--card);
  box-shadow: 8px 0 10px rgb(0 0 0 / 0.12);
}

.monster-parts-table th:first-child {
  z-index: 2;
}

.monster-essence {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.2em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-weight: 900;
  border: 1px solid var(--border);
}

.monster-essence-red {
  color: #fff;
  background: #a93b36;
}

.monster-essence-orange {
  color: #1b1812;
  background: #d1903c;
}

.monster-essence-yellow {
  color: #1b1812;
  background: #d7bd42;
}

.monster-essence-green {
  color: #fff;
  background: #4d8d55;
}

.monster-essence-white {
  color: #1b1812;
  background: #eee7d8;
}

.monster-essence-none {
  color: var(--muted);
  background: transparent;
}

.monster-el-fire {
  color: #ff6b57;
}

.monster-el-water {
  color: #5da9ff;
}

.monster-el-thunder {
  color: #ffd95a;
}

.monster-el-ice {
  color: #9de8ff;
}

.monster-el-dragon {
  color: #c792ea;
}

.monster-hz-high {
  font-weight: 950;
  text-shadow: 0 0 0.45px currentColor;
}

/* =========================================================
   Entity links & search highlighting
   ========================================================= */

.entity-link {
  display: inline;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  cursor: pointer;
  text-align: left;
}

.entity-link:hover {
  text-decoration-color: var(--accent);
}

mark {
  background: color-mix(in srgb, var(--accent) 38%, transparent);
  color: inherit;
  font-weight: 700;
  border-radius: 6px;
  padding: 1px 5px;
  box-shadow: inset 0 -2px 0 var(--accent);
}

.entity-pill {
  gap: 0.4rem;
  align-items: baseline;
}

.entity-pill small {
  color: var(--muted);
  font-weight: 700;
}

.entity-pill .entity-link {
  text-decoration: none;
}

.entity-pill .entity-link:hover {
  text-decoration: underline;
}

/* =========================================================
   Detail pages
   ========================================================= */

.detail-card {
  padding-top: 16px;
}

.detail-section-title {
  margin: 1.4rem 0 0.2rem;
  font-size: 1.05rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 900;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
}

.detail-subtitle {
  color: var(--muted);
  font-weight: 700;
}

.source-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

.source-row:last-child {
  border-bottom: 0;
}

.source-row small {
  color: var(--muted);
}

.rewards-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.rewards-table th,
.rewards-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 0.55rem;
  text-align: left;
  white-space: nowrap;
}

.rewards-table th {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* =========================================================
   Monster size comparison
   ========================================================= */

.size-row {
  display: grid;
  gap: 4px;
  padding: 7px 0;
}

.size-row-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.size-row-label small {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.size-bar-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 45%, transparent);
  overflow: hidden;
}

.size-bar {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.9;
}

.size-bar-gold {
  background: color-mix(in srgb, var(--accent) 40%, transparent);
}

.size-row-current .size-bar {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 60%, transparent);
}

.size-note {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.coverage-bar-track {
  height: 10px;
  margin: 12px 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 45%, transparent);
  overflow: hidden;
}

.coverage-bar {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

.npc-item-unmapped span {
  color: var(--muted);
}

/* =========================================================
   Weapon tree
   ========================================================= */

.wtree {
  list-style: none;
  margin: 0;
  padding: 0 0 0 14px;
  border-left: 2px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.wtree-root {
  padding-left: 0;
  border-left: 0;
}

.wtree li {
  margin: 6px 0;
}

.wtree-node {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.wtree-node small {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wtree-node-current {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

/* =========================================================
   Compare mode
   ========================================================= */

.compare-add-btn.active {
  border-color: var(--accent);
  color: var(--accent);
}

.compare-tray {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 15;
  width: min(720px, calc(100vw - 24px));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 20px;
}

.compare-tray[hidden] {
  display: none;
}

.compare-tray-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.compare-chip {
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
}

.compare-chip-remove {
  padding: 2px 6px;
  font-size: 0.7rem;
  line-height: 1;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.compare-tray-actions {
  display: flex;
  gap: 8px;
}

.compare-tray-actions button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.compare-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.compare-table th,
.compare-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.6rem;
  text-align: left;
  vertical-align: top;
  min-width: 130px;
  max-width: 260px;
}

.compare-table thead th {
  font-size: 0.95rem;
}

.compare-table tbody th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  position: sticky;
  left: 0;
  background: var(--card);
  z-index: 1;
}

/* =========================================================
   Version diff
   ========================================================= */

.diff-added-text {
  color: #4f9d69;
  font-weight: 800;
}

.diff-removed-text {
  color: #c74735;
  font-weight: 800;
}

.diff-change {
  padding-top: 48px;
}

.diff-change-added {
  border-left: 4px solid #4f9d69;
}

.diff-change-removed {
  border-left: 4px solid #c74735;
}

.diff-change-removed .diff-change-text {
  opacity: 0.75;
}

.diff-badge-added {
  color: #4f9d69;
  border-color: #4f9d69;
}

.diff-badge-removed {
  color: #c74735;
  border-color: #c74735;
}

/* =========================================================
   Mobile optimization
   ========================================================= */

main {
  padding-bottom: 90px; /* room for the compare tray */
}

@media (max-width: 700px) {
  /* Filter chips: one horizontally scrollable row instead of tall wrap.
     The scroll container needs a constrained width, otherwise it grows
     to its content and the page just clips it (no scrolling possible). */
  .card-controls,
  .search-filters {
    min-width: 0;
    max-width: 100%;
  }

  .filter-group {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    justify-items: stretch;
  }

  .filter-row,
  .weapon-type-filter {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex-wrap: wrap;
    gap: 6px;
  }

  .filter-chip {
    flex: 0 0 auto;
    min-height: 38px;
  }

  .card-controls,
  .search-filters {
    gap: 8px;
    margin-bottom: 10px;
  }

  /* Compact sticky toolbar */
  .toolbar {
    flex-direction: row;
    align-items: center;
    padding: 8px;
    margin: 10px 0;
  }

  #count {
    align-self: center;
    font-size: 12px;
  }

  /* Was "sticky", which never took effect (html/body used overflow-x:
     hidden); kept unpinned now that sticky works, so nothing changes. */
  .view-header {
    position: relative;
    top: 0;
    z-index: 5;
  }

  .view-header h2 {
    font-size: 1.05rem;
  }

  .view-header .secondary {
    min-height: 42px;
  }

  .json-grid {
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 0.5rem;
  }

  .json-fact {
    padding: 0.55rem;
  }

  .detail-meta {
    padding-top: 4px;
  }

  .wtree {
    padding-left: 10px;
  }

  .compare-table th,
  .compare-table td {
    min-width: 110px;
  }

  .entry {
    padding: 14px;
  }
}

@media (min-width: 701px) {
  .entry-actions .copy-btn,
  .entry-actions .lang-btn {
    min-height: 28px;
  }
}

/* =========================================================
   Jumping between search matches
   ========================================================= */

.match-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.match-nav[hidden] {
  display: none;
}

.match-count {
  min-width: 3.5em;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.match-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 0.7rem;
  line-height: 1;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.match-btn:hover,
.match-btn:active {
  color: var(--accent);
  border-color: var(--accent);
}

/* Inside the floating pill: only while it's expanded. */
.floating-search:not(.is-expanded) .match-nav {
  display: none;
}

.floating-search .match-nav {
  margin-right: 2px;
}

.floating-search .match-btn {
  width: 30px;
  height: 30px;
  border-color: var(--glass-edge);
}

/* The match you jumped to stands out from the other highlights. */
mark.mark-current {
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}

/* =========================================================
   Result counts on the Type filter chips
   ========================================================= */

.chip-count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, currentColor 14%, transparent);
}

.filter-chip.is-empty:not(.active) {
  opacity: 0.3;
}

/* =========================================================
   Help page
   ========================================================= */

.help-content {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.help-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
}

.help-card h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.help-card p {
  margin: 0 0 10px;
  line-height: 1.55;
}

.help-card p:last-child {
  margin-bottom: 0;
}

.help-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 14px;
  margin: 0 0 10px;
  align-items: baseline;
}

.help-list dt {
  font-weight: 800;
  white-space: nowrap;
}

.help-list dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.help-list:last-child {
  margin-bottom: 0;
}

.help-list dd:last-child {
  margin-bottom: 0;
}

.help-note {
  font-size: 0.9rem;
}

kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  font: inherit;
  font-size: 0.85em;
  font-weight: 700;
}

@media (max-width: 480px) {
  .help-list {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .help-list dd {
    margin-bottom: 8px;
  }
}

/* =========================================================
   Liquid glass theme
   The panels themselves stay solid; they just share the glass
   language: soft sheen, bright top edge, deep diffuse shadows,
   glossy accent controls, and an ambient glow behind the page.
   ========================================================= */

/* Ambient glow in the current game's accent color, so glass surfaces
   have some color to pick up. Fixed, so it doesn't scroll away. */
body::before {
  content: "";
  position: fixed;
  inset: -10%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(55% 40% at 12% 0%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 70%),
    radial-gradient(45% 35% at 100% 18%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%),
    radial-gradient(65% 45% at 50% 108%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 70%);
}

::selection {
  background: color-mix(in srgb, var(--accent) 35%, transparent);
}

/* ---------- Panels ---------- */

.toolbar,
.entry,
.view-header,
.npc-item,
.help-card {
  background:
    linear-gradient(180deg, var(--surface-sheen), transparent 110px),
    var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow:
    inset 0 1px 0 var(--surface-highlight),
    0 1px 2px rgb(var(--shadow-color) / 0.06),
    0 14px 34px -14px rgb(var(--shadow-color) / 0.3);
}

@media (hover: hover) {
  .entry,
  .npc-item {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }

  .entry:hover,
  .npc-item:hover {
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
    box-shadow:
      inset 0 1px 0 var(--surface-highlight),
      0 1px 2px rgb(var(--shadow-color) / 0.06),
      0 18px 40px -14px rgb(var(--shadow-color) / 0.38);
  }
}

/* ---------- Glossy accent controls ---------- */

.filter-chip.active,
.segment.active {
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.24), rgb(255 255 255 / 0) 60%),
    var(--accent);
  color: var(--accent-text);
  border-color: transparent;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.35),
    inset 0 -1px 0 rgb(0 0 0 / 0.12),
    0 4px 14px -4px color-mix(in srgb, var(--accent) 70%, transparent);
}

button.secondary {
  background:
    linear-gradient(180deg, var(--surface-sheen), transparent),
    color-mix(in srgb, var(--card) 70%, transparent);
  box-shadow: inset 0 1px 0 var(--surface-highlight);
}

/* ---------- Compact header ---------- */

header {
  padding-bottom: 6px;
}

#gameTitle {
  background: linear-gradient(
    180deg,
    var(--text) 35%,
    color-mix(in srgb, var(--accent) 65%, var(--text))
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: opacity 0.15s ease;
}

#gameTitle:hover {
  color: transparent;
  opacity: 0.85;
}

.header-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.header-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  background:
    linear-gradient(180deg, var(--surface-sheen), transparent),
    color-mix(in srgb, var(--card) 70%, transparent);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--surface-highlight);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.header-chip:hover,
.header-chip.active {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

#appTagline {
  max-width: 560px;
  margin: 12px auto 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

#appTagline[hidden] {
  display: none;
}

@media (max-width: 560px) {
  h1 {
    font-size: clamp(30px, 10vw, 44px);
    margin-bottom: 2px;
  }

  header {
    padding-top: max(20px, env(safe-area-inset-top));
  }
}

/* ---------- Filters: Type chips wrap, Format is a small switch ---------- */

.search-filters {
  display: grid;
  gap: 10px;
  margin: 4px 0 14px;
}

.filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.format-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  background:
    linear-gradient(180deg, var(--surface-sheen), transparent),
    color-mix(in srgb, var(--card) 70%, transparent);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--surface-highlight);
  transition: color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.filter-chip:not(.active) {
  opacity: 1;
  color: var(--muted);
}

.filter-chip:not(.active):hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.filter-chip.is-empty:not(.active) {
  opacity: 0.4;
}

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 65%, transparent);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 3px rgb(var(--shadow-color) / 0.14);
}

.segment {
  padding: 5px 11px;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  transition: color 0.15s ease;
}

.segment:not(.active):hover {
  color: var(--text);
}

@media (max-width: 700px) {
  .filter-chip {
    min-height: 32px;
    padding: 6px 11px;
    font-size: 0.8rem;
  }
}

/* ---------- Search toolbar ---------- */

.toolbar {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 0 0 16px;
  padding: 10px;
}

.toolbar input[type="search"] {
  flex: 1 1 260px;
}

input[type="search"] {
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 3px rgb(var(--shadow-color) / 0.12);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="search"]:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  box-shadow:
    inset 0 1px 3px rgb(var(--shadow-color) / 0.12),
    0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
}

.floating-search input.floating-search-input,
.floating-search input.floating-search-input:focus {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.toolbar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
}

#count {
  align-self: center;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.icon-btn[hidden] {
  display: none;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-btn:hover,
.icon-btn.is-copied,
.entry-actions .copy-btn.is-copied {
  color: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 700px) {
  .toolbar input[type="search"] {
    flex-basis: 100%;
  }

  .toolbar-meta {
    width: 100%;
    margin-left: 0;
    padding: 0 4px;
  }

  #count {
    margin-right: auto;
  }
}

/* ---------- Compact page headers ---------- */

.view-header {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 8px 12px 8px 8px;
}

.view-header > .secondary:first-child {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 14px;
  font-size: 0.85rem;
}

.view-header h2 {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.15rem;
  text-align: left;
  overflow-wrap: anywhere;
}

.dialogue-view-header {
  display: flex;
}

.dialogue-header {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
}

.dialogue-header h2 {
  grid-column: auto;
  flex: 1 1 auto;
  text-align: left;
}

.dialogue-mode-btn {
  grid-column: auto;
  justify-self: auto;
  padding: 7px 12px;
  font-size: 0.8rem;
}

/* ---------- Floating controls ---------- */

.menu-toggle,
.floating-search-toggle,
.back-to-top {
  color: var(--text);
}

.back-to-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 56px);
  z-index: 16;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;

  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 64px);
  z-index: 30;
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.25s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Keep floating controls clear of the compare tray while it's shown. */
body:has(#compareTray:not([hidden])) .floating-search {
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 84px);
}

body:has(#compareTray:not([hidden])) .back-to-top {
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 140px);
}

body:has(#compareTray:not([hidden])) .toast {
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 150px);
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top,
  .toast {
    transition: none;
  }
}

/* ---------- Glass menu drawer ---------- */

.menu {
  background:
    linear-gradient(160deg, var(--glass-sheen) 0%, transparent 35%),
    color-mix(in srgb, var(--card) 74%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  border-right: 1px solid var(--glass-edge);
  box-shadow:
    inset -1px 0 0 var(--glass-edge),
    24px 0 60px rgb(var(--shadow-color) / 0.3);
}

.menu-overlay {
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.menu-item {
  background:
    linear-gradient(180deg, var(--surface-sheen), transparent),
    color-mix(in srgb, var(--card) 45%, transparent);
  box-shadow: inset 0 1px 0 var(--surface-highlight);
  transition: border-color 0.15s ease;
}

/* Toasts are read at a glance, so they're a little more solid. */
.toast {
  background:
    radial-gradient(ellipse at 50% 50%, transparent 70%, var(--glass-lens) 100%),
    linear-gradient(145deg, var(--glass-sheen) 0%, transparent 38%),
    linear-gradient(
      color-mix(in srgb, var(--accent) 7%, transparent),
      color-mix(in srgb, var(--accent) 7%, transparent)
    ),
    color-mix(in srgb, var(--card) 80%, transparent);
}

/* =========================================================
   Clear liquid glass: details
   ========================================================= */

/* ---------- Rim light on panels ----------
   A thin line of light along the top edge, tinted with the accent and
   fading out toward the corners, like light catching the rim of glass. */

.toolbar,
.entry,
.view-header,
.npc-item,
.help-card {
  background:
    linear-gradient(
      90deg,
      transparent 12%,
      color-mix(in srgb, var(--accent) 55%, var(--surface-highlight)) 50%,
      transparent 88%
    ) top / 100% 1px no-repeat,
    linear-gradient(180deg, var(--surface-sheen), transparent 110px),
    var(--card);
}

/* ---------- Glass beads ----------
   Small tinted elements on cards share one miniature glass look:
   a soft top highlight over a clear tint. */

.meta-chip,
.chip-count {
  background-image: linear-gradient(180deg, rgb(255 255 255 / 0.16), transparent 70%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.2),
    inset 0 -1px 0 rgb(0 0 0 / 0.06);
}

.meta-chip {
  background-color: color-mix(in srgb, var(--chip) 16%, transparent);
}

.chip-count {
  background-color: color-mix(in srgb, currentColor 14%, transparent);
}

/* ID badge: "0010 + 0011" as a quiet outline pill. It's reference info,
   so it stays in the background: muted text, no fill, no glow. */
.entry-id {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  box-shadow: none;
}

mark {
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.2), transparent 70%),
    color-mix(in srgb, var(--accent) 32%, transparent);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.22),
    inset 0 -1.5px 0 color-mix(in srgb, var(--accent) 85%, transparent);
}

mark.mark-current {
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.28), transparent 65%),
    var(--accent);
  color: var(--accent-text);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.35),
    0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent),
    0 4px 12px -4px color-mix(in srgb, var(--accent) 70%, transparent);
}

/* Outline buttons on cards and in the toolbar get the same top highlight. */
.entry-actions .copy-btn,
.entry-actions .lang-btn,
.icon-btn,
.match-btn {
  background: linear-gradient(180deg, var(--surface-sheen), transparent);
  box-shadow: inset 0 1px 0 var(--surface-highlight);
}

/* ---------- Format switch with a sliding glass thumb ---------- */

.segmented {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
}

.segment {
  position: relative;
  z-index: 1;
}

@supports selector(:has(*)) {
  .segmented::before {
    content: "";
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    width: calc((100% - 10px) / 3);
    border-radius: 999px;
    background:
      linear-gradient(180deg, rgb(255 255 255 / 0.28), rgb(255 255 255 / 0) 60%),
      var(--accent);
    box-shadow:
      inset 0 1px 0 rgb(255 255 255 / 0.4),
      inset 0 -1px 0 rgb(0 0 0 / 0.12),
      0 4px 14px -4px color-mix(in srgb, var(--accent) 70%, transparent);
  }

  .segmented:has(.segment.active:nth-child(2))::before {
    transform: translateX(calc(100% + 2px));
  }

  .segmented:has(.segment.active:nth-child(3))::before {
    transform: translateX(calc(200% + 4px));
  }

  /* The thumb is the highlight now, so the active button itself is clear. */
  .segment.active {
    background: transparent;
    box-shadow: none;
    color: var(--accent-text);
  }

  .motion-ready .segmented::before {
    transition: transform 0.34s cubic-bezier(0.3, 1.3, 0.5, 1);
  }
}

/* ---------- Liquid search pill ----------
   Expands with a slight elastic settle; collapses quickly. The field is
   focused right away, so typing never waits for the animation. */

.motion-ready .floating-search.is-expanded {
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s,
    width 0.42s cubic-bezier(0.3, 1.25, 0.5, 1),
    height 0.42s cubic-bezier(0.3, 1.25, 0.5, 1),
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

/* Give the back-to-top button room while the search pill is open. */
.floating-search.is-expanded ~ .back-to-top.is-visible {
  transform: translateY(-10px);
}

/* ---------- Smooth theme switching ----------
   The browser captures the page and crossfades it (see cycleTheme), so
   no element flickers while colors change. */

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.35s;
  animation-timing-function: ease;
}

/* ---------- Accent details ---------- */

:root {
  accent-color: var(--accent);
}

input,
textarea {
  caret-color: var(--accent);
}

/* ---------- Scrollbars (mouse devices only) ---------- */

@media (hover: hover) and (pointer: fine) {
  html {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--accent) 45%, transparent) transparent;
  }

  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }

  ::-webkit-scrollbar-track {
    background: transparent;
  }

  ::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--accent) 40%, transparent);
    border: 3px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--accent) 65%, transparent);
    background-clip: padding-box;
  }
}

@media (prefers-reduced-motion: reduce) {
  .motion-ready .segmented::before,
  .motion-ready .floating-search.is-expanded {
    transition: none;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

/* =========================================================
   Menu
   ========================================================= */

.menu-header {
  margin-bottom: 14px;
}

.menu-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Compact round buttons in the menu header: Help and Close. */
.menu-icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  background:
    linear-gradient(180deg, var(--surface-sheen), transparent),
    color-mix(in srgb, var(--card) 60%, transparent);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--surface-highlight);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.menu-icon-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

/* Help stands out a little through its accent-colored "?". */
.menu-help-btn {
  color: var(--accent);
  font-size: 1.05rem;
}

.menu-section {
  gap: 6px;
  margin: 14px 0;
}

.menu-item {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.95rem;
}

/* The page you're on: accent-tinted, with a small bar on the left. */
.menu-item.is-current,
.menu-icon-btn.is-current {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  background:
    linear-gradient(180deg, var(--surface-sheen), transparent),
    color-mix(in srgb, var(--accent) 16%, var(--card));
}

.menu-item.is-current {
  position: relative;
  color: var(--text);
  font-weight: 800;
}

.menu-item.is-current::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
}

/* =========================================================
   One-line meta line (tap to see it in full)
   ========================================================= */

.entry-section:has(.meta-chip) {
  flex-wrap: nowrap;
}

.meta-chip {
  flex: 0 0 auto;
}

.meta-rest {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.meta-rest.is-expanded {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* =========================================================
   Dump dropdown ("⇄ Switch dump" under the title)
   ========================================================= */

/* The menu is centered under the whole button row, so it always fits on
   narrow screens. */
.header-actions {
  position: relative;
}

.dump-picker {
  display: inline-flex;
}

.dump-chevron {
  width: 14px;
  height: 14px;
  margin-left: -2px;
  transition: transform 0.2s ease;
}

#switchGameBtn[aria-expanded="true"] .dump-chevron {
  transform: rotate(180deg);
}

.dump-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  z-index: 19;
  display: grid;
  gap: 2px;
  width: min(320px, calc(100vw - 32px));
  padding: 6px;
  border-radius: 24px;
  text-align: left;

  /* Slightly more solid than the round buttons, so the list reads easily. */
  background:
    radial-gradient(ellipse at 50% 50%, transparent 70%, var(--glass-lens) 100%),
    linear-gradient(145deg, var(--glass-sheen) 0%, transparent 38%),
    linear-gradient(
      color-mix(in srgb, var(--accent) 7%, transparent),
      color-mix(in srgb, var(--accent) 7%, transparent)
    ),
    color-mix(in srgb, var(--card) 82%, transparent);

  opacity: 0;
  transform: translate(-50%, -6px) scale(0.97);
  transform-origin: 50% 0;
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.3, 1.2, 0.5, 1);
}

.dump-menu.is-open {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.dump-menu[hidden] {
  display: none;
}

/* Wilds is the default game, so its dot color is set here explicitly. */
.dump-option[data-game="wilds"] {
  --game-accent-light: #6f5130;
  --game-accent-dark: #b78a4f;
}

.dump-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 8px 12px;
  border-radius: 18px;
  text-align: left;
  font-weight: 400;
  color: var(--text);
  background: transparent;
  border: 0;
  box-shadow: none;
  transition: background-color 0.15s ease;
}

.dump-option:hover {
  background: color-mix(in srgb, var(--text) 7%, transparent);
}

.dump-option.is-current {
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.1), transparent 70%),
    color-mix(in srgb, var(--accent) 16%, transparent);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.12);
}

.dump-option-text {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
}

.dump-option-text strong {
  font-size: 0.98rem;
  font-weight: 800;
}

.dump-option-text small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Each game's own accent color, as a small glass bead. */
.dump-dot {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.4), transparent 60%),
    var(--game-accent-light);
  box-shadow:
    inset 0 -1px 0 rgb(0 0 0 / 0.15),
    0 0 0 3px color-mix(in srgb, var(--game-accent-light) 18%, transparent);
}

:root[data-theme="dark"] .dump-dot {
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.4), transparent 60%),
    var(--game-accent-dark);
  box-shadow:
    inset 0 -1px 0 rgb(0 0 0 / 0.15),
    0 0 0 3px color-mix(in srgb, var(--game-accent-dark) 22%, transparent);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .dump-dot {
    background:
      linear-gradient(180deg, rgb(255 255 255 / 0.4), transparent 60%),
      var(--game-accent-dark);
    box-shadow:
      inset 0 -1px 0 rgb(0 0 0 / 0.15),
      0 0 0 3px color-mix(in srgb, var(--game-accent-dark) 22%, transparent);
  }
}

.dump-check {
  flex: 0 0 auto;
  color: var(--accent);
  font-weight: 900;
}

@media (prefers-reduced-motion: reduce) {
  .dump-menu,
  .dump-chevron {
    transition: none;
  }
}


/* =========================================================
   Combined mode: MonsterHunterDump
   ========================================================= */

/* Each game's colors, available on any element marked with its game. */
:is(.entry, .game-badge, .game-section, .game-chip, .game-tile, .load-row, .across-card)[data-game="wilds"] {
  --game-accent-light: #6f5130;
  --game-accent-dark: #b78a4f;
}

:is(.entry, .game-badge, .game-section, .game-chip, .game-tile, .load-row, .across-card)[data-game="rise"] {
  --game-accent-light: #b35412;
  --game-accent-dark: #f0953f;
}

:is(.entry, .game-badge, .game-section, .game-chip, .game-tile, .load-row, .across-card)[data-game="world"] {
  --game-accent-light: #0b6f79;
  --game-accent-dark: #52c2cc;
}

:is(.entry, .game-badge, .game-section, .game-chip, .game-tile, .load-row, .across-card)[data-game="gu"] {
  --game-accent-light: #8a2f2a;
  --game-accent-dark: #d4695d;
}

:is(.entry, .game-badge, .game-section, .game-chip, .game-tile, .load-row, .across-card)[data-game="fu"] {
  --game-accent-light: #5b3a7a;
  --game-accent-dark: #a888cc;
}

:is(.entry, .game-badge, .game-section, .game-chip, .game-tile, .load-row, .across-card)[data-game="tri"] {
  --game-accent-light: #245a78;
  --game-accent-dark: #62a6ca;
}

/* --gc: the element's game color for the current theme. */
:is(.entry[data-game], .game-badge, .game-section, .game-chip, .game-tile, .load-row, .across-card) {
  --gc: var(--game-accent-light);
}

:root[data-theme="dark"] :is(.entry[data-game], .game-badge, .game-section, .game-chip, .game-tile, .load-row, .across-card) {
  --gc: var(--game-accent-dark);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.entry[data-game], .game-badge, .game-section, .game-chip, .game-tile, .load-row, .across-card) {
    --gc: var(--game-accent-dark);
  }
}

/* A neutral pearl accent, so the game colors carry the design. */
:root[data-game="all"] {
  --game-accent-light: #56596a;
  --game-accent-dark: #c9ccd8;
}

/* Title: a gradient through all six game colors. */
:root[data-game="all"] #gameTitle {
  /* A longer name: scale down on narrow screens so it clears the menu button. */
  font-size: clamp(22px, 6.2vw, 56px);
  letter-spacing: -0.04em;
  background: linear-gradient(90deg, #6f5130, #b35412, #0b6f79, #8a2f2a, #5b3a7a, #245a78);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

:root[data-game="all"][data-theme="dark"] #gameTitle {
  background-image: linear-gradient(90deg, #d9b27a, #f0953f, #52c2cc, #d4695d, #a888cc, #62a6ca);
}

@media (prefers-color-scheme: dark) {
  :root[data-game="all"]:not([data-theme="light"]) #gameTitle {
    background-image: linear-gradient(90deg, #d9b27a, #f0953f, #52c2cc, #d4695d, #a888cc, #62a6ca);
  }
}

/* Background: a soft aurora of all six colors. */
:root[data-game="all"] body::before {
  background:
    radial-gradient(40% 30% at 8% 0%, rgb(183 138 79 / 0.2), transparent 70%),
    radial-gradient(35% 28% at 50% -4%, rgb(240 149 63 / 0.16), transparent 70%),
    radial-gradient(40% 30% at 96% 6%, rgb(82 194 204 / 0.16), transparent 70%),
    radial-gradient(45% 35% at 0% 70%, rgb(212 105 93 / 0.1), transparent 70%),
    radial-gradient(45% 35% at 100% 64%, rgb(168 136 204 / 0.12), transparent 70%),
    radial-gradient(60% 40% at 50% 108%, rgb(98 166 202 / 0.12), transparent 70%);
}

/* ---------- Game badge and card outline ---------- */

.game-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--gc) 78%, var(--text));
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.16), transparent 70%),
    color-mix(in srgb, var(--gc) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--gc) 45%, transparent);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.18);
}

.game-badge-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.45), transparent 60%),
    var(--gc);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--gc) 22%, transparent);
}

/* Cards get an outline and rim light in their game's color. */
.entry[data-game] {
  border-color: color-mix(in srgb, var(--gc) 55%, var(--border));
  background:
    linear-gradient(
      90deg,
      transparent 12%,
      color-mix(in srgb, var(--gc) 70%, var(--surface-highlight)) 50%,
      transparent 88%
    ) top / 100% 1px no-repeat,
    linear-gradient(180deg, color-mix(in srgb, var(--gc) 6%, var(--surface-sheen)), transparent 110px),
    var(--card);
}

@media (hover: hover) {
  .entry[data-game]:hover {
    border-color: color-mix(in srgb, var(--gc) 80%, var(--border));
  }
}

/* ---------- Game sections (collapsible) ---------- */

.game-section {
  margin: 0 0 12px;
}

.game-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 10px 16px;
  border-radius: 20px;
  text-align: left;
  font-weight: 400;
  color: var(--text);
  background:
    linear-gradient(180deg, var(--surface-sheen), transparent),
    linear-gradient(90deg, color-mix(in srgb, var(--gc) 16%, transparent), transparent 70%),
    var(--card);
  border: 1px solid color-mix(in srgb, var(--gc) 45%, var(--border));
  box-shadow:
    inset 0 1px 0 var(--surface-highlight),
    0 10px 26px -14px rgb(var(--shadow-color) / 0.3);
  transition: border-color 0.2s ease;
}

.game-section-header .game-badge-dot {
  width: 12px;
  height: 12px;
}

.game-section-title {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
}

.game-section-title strong {
  font-size: 1.02rem;
  font-weight: 800;
}

.game-section-title small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-section-count {
  flex: 0 0 auto;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--gc) 75%, var(--text));
  background: color-mix(in srgb, var(--gc) 14%, transparent);
}

.game-section-chevron {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: transform 0.25s ease;
}

.game-section.is-open .game-section-chevron {
  transform: rotate(180deg);
}

.game-section.is-open .game-section-header {
  border-color: color-mix(in srgb, var(--gc) 70%, var(--border));
}

.game-section-body {
  display: grid;
  gap: 12px;
  padding-top: 12px;
}

.game-section:not(.is-open) .game-section-body {
  display: none;
}

.game-show-more {
  justify-self: center;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text);
  background:
    linear-gradient(180deg, var(--surface-sheen), transparent),
    color-mix(in srgb, var(--card) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--gc) 50%, var(--border));
  box-shadow: inset 0 1px 0 var(--surface-highlight);
}

.game-show-more small {
  color: var(--muted);
  font-weight: 600;
}

/* ---------- Games filter row ---------- */

.game-filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 6px;
}

.game-filter-row[hidden] {
  display: none;
}

.game-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  background:
    linear-gradient(180deg, var(--surface-sheen), transparent),
    color-mix(in srgb, var(--card) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--gc) 35%, var(--border));
  box-shadow: inset 0 1px 0 var(--surface-highlight);
  transition: color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.game-chip.active {
  color: var(--text);
  border-color: var(--gc);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.14), transparent 70%),
    color-mix(in srgb, var(--gc) 22%, var(--card));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.2),
    0 4px 14px -6px color-mix(in srgb, var(--gc) 70%, transparent);
}

.game-chip.is-empty:not(.active) {
  opacity: 0.4;
}

/* ---------- Start screen ---------- */

.combined-start {
  padding: 22px 18px;
  border-radius: 24px;
  text-align: center;
  background:
    linear-gradient(180deg, var(--surface-sheen), transparent 120px),
    var(--card);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--surface-highlight), 0 14px 34px -14px rgb(var(--shadow-color) / 0.3);
}

.combined-start h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.combined-start p {
  margin: 0 0 16px;
}

.game-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  text-align: left;
}

.game-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--gc) 14%, transparent), transparent 70%),
    color-mix(in srgb, var(--bg) 40%, transparent);
  border: 1px solid color-mix(in srgb, var(--gc) 40%, var(--border));
}

.game-tile .game-badge-dot {
  width: 12px;
  height: 12px;
}

.game-tile-text {
  display: grid;
  min-width: 0;
}

.game-tile-text strong {
  font-size: 0.9rem;
}

.game-tile-text small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
}

/* ---------- Loading progress (liquid glass) ---------- */

.load-progress {
  position: relative;
  margin: 0 0 14px;
  padding: 16px;
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 70%, var(--glass-lens) 100%),
    linear-gradient(145deg, var(--glass-sheen) 0%, transparent 40%),
    color-mix(in srgb, var(--card) 78%, transparent);
  -webkit-backdrop-filter: blur(10px) saturate(180%);
  backdrop-filter: blur(10px) saturate(180%);
  border: 1px solid var(--glass-edge);
  box-shadow:
    inset 0 1.5px 1px -0.5px var(--rim-bright),
    0 14px 34px -14px rgb(var(--shadow-color) / 0.35);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.load-progress[hidden] {
  display: none;
}

.load-progress.is-finished {
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
}

.load-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  font-size: 0.92rem;
}

.load-progress-head span {
  color: var(--muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* The bar fills with a gradient of all six game colors, with a light
   sheen gliding across it while loading. */
.load-progress-bar {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  box-shadow: inset 0 1px 2px rgb(var(--shadow-color) / 0.2);
}

.load-progress-bar span {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #b78a4f, #f0953f, #52c2cc, #d4695d, #a888cc, #62a6ca);
  background-size: 360px 100%;
  transition: width 0.5s cubic-bezier(0.3, 1.1, 0.5, 1);
}

.load-progress-bar span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.55), transparent);
  transform: translateX(-100%);
  animation: load-sheen 1.6s ease-in-out infinite;
}

.load-progress.is-finished .load-progress-bar span::after {
  animation: none;
}

@keyframes load-sheen {
  to { transform: translateX(100%); }
}

.load-rows {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.load-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--bg) 45%, transparent);
  border: 1px solid color-mix(in srgb, var(--gc) 30%, transparent);
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.load-row-name {
  flex: 1 1 auto;
}

.load-row.is-waiting {
  opacity: 0.55;
}

/* Loading: the dot pulses. */
.load-row.is-loading .game-badge-dot {
  animation: load-pulse 1.1s ease-in-out infinite;
}

@keyframes load-pulse {
  0%, 100% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--gc) 22%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--gc) 0%, transparent), 0 0 12px var(--gc); }
}

.load-row.is-done {
  border-color: color-mix(in srgb, var(--gc) 60%, transparent);
  background: color-mix(in srgb, var(--gc) 12%, transparent);
}

.load-row-state::before {
  font-weight: 900;
}

.load-row.is-done .load-row-state::before {
  content: "✓";
  color: var(--gc);
  animation: load-pop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
  display: inline-block;
}

.load-row.is-error .load-row-state::before {
  content: "!";
  color: #d4695d;
}

@keyframes load-pop {
  from { transform: scale(0.3); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.load-progress-note {
  margin: 10px 0 0;
  font-size: 0.76rem;
}

@media (max-width: 380px) {
  .load-rows {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Dropdown: the special "all games" entry ---------- */

.dump-menu-divider {
  height: 1px;
  margin: 6px 10px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.dump-dot-all {
  background: conic-gradient(#b78a4f, #f0953f, #52c2cc, #d4695d, #a888cc, #62a6ca, #b78a4f);
  box-shadow: 0 0 0 3px rgb(255 255 255 / 0.08), 0 0 10px rgb(183 138 79 / 0.35);
}

:root[data-theme="dark"] .dump-dot-all,
:root:not([data-theme="light"]) .dump-dot-all {
  background: conic-gradient(#b78a4f, #f0953f, #52c2cc, #d4695d, #a888cc, #62a6ca, #b78a4f);
}

.dump-option-all {
  background:
    linear-gradient(120deg,
      rgb(183 138 79 / 0.12), rgb(82 194 204 / 0.1), rgb(168 136 204 / 0.12));
  border: 1px solid transparent;
}

.dump-option-all strong {
  background: linear-gradient(90deg, #b78a4f, #f0953f, #52c2cc, #d4695d, #a888cc, #62a6ca);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dump-option-all.is-current {
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.12);
}

/* ---------- Menu switch ---------- */

.all-games-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 14px;
  text-align: left;
  font-weight: 400;
  color: var(--text);
  background:
    linear-gradient(120deg, rgb(183 138 79 / 0.1), rgb(82 194 204 / 0.08), rgb(168 136 204 / 0.1)),
    color-mix(in srgb, var(--card) 45%, transparent);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--surface-highlight);
}

.all-games-switch-text {
  display: grid;
}

.all-games-switch-text strong {
  font-size: 0.95rem;
}

.all-games-switch-text small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.switch-track {
  position: relative;
  flex: 0 0 auto;
  width: 50px;
  height: 30px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 30%, transparent);
  box-shadow: inset 0 1px 3px rgb(var(--shadow-color) / 0.25);
  transition: background 0.25s ease;
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background:
    radial-gradient(ellipse at 50% 30%, rgb(255 255 255 / 0.95), rgb(255 255 255 / 0.75));
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.25), inset 0 -1px 1px rgb(0 0 0 / 0.08);
  transition: transform 0.28s cubic-bezier(0.3, 1.3, 0.5, 1);
}

.all-games-switch[aria-checked="true"] .switch-track {
  background: linear-gradient(90deg, #b78a4f, #f0953f, #52c2cc, #d4695d, #a888cc, #62a6ca);
}

.all-games-switch[aria-checked="true"] .switch-thumb {
  transform: translateX(20px);
}

@media (prefers-reduced-motion: reduce) {
  .load-progress-bar span::after,
  .load-row.is-loading .game-badge-dot,
  .load-row.is-done .load-row-state::before {
    animation: none;
  }

  .switch-thumb,
  .game-section-chevron,
  .load-progress {
    transition: none;
  }
}

/* ---------- Combined mode: Open all / Close all ---------- */

.combined-bar {
  display: flex;
  justify-content: flex-end;
  margin: -2px 2px 10px;
}

.sections-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.sections-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform 0.3s cubic-bezier(0.3, 1.3, 0.5, 1);
}

.sections-toggle[data-action="close"] svg {
  transform: rotate(180deg) scaleX(-1);
}

.sections-toggle:hover,
.sections-toggle:focus-visible {
  color: var(--text);
  background: color-mix(in srgb, var(--card) 70%, transparent);
  border-color: var(--border);
}

/* ---------- Combined mode: pinned section headers ---------- */

.game-section.is-open .game-section-header {
  position: sticky;
  top: calc(max(16px, env(safe-area-inset-top)) - 6px);
  z-index: 6;
  transition:
    border-color 0.2s ease,
    padding 0.25s ease,
    min-height 0.25s ease,
    background-color 0.25s ease;
}

/* While pinned: compact liquid glass, lined up beside the menu button. */
.game-section-header.is-stuck {
  min-height: 56px;
  padding: 6px 14px 6px 70px;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 70%, var(--glass-lens) 100%),
    linear-gradient(145deg, var(--glass-sheen) 0%, transparent 40%),
    linear-gradient(90deg, color-mix(in srgb, var(--gc) 18%, transparent), transparent 75%),
    color-mix(in srgb, var(--card) 80%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  backdrop-filter: blur(12px) saturate(180%);
  box-shadow:
    inset 0 1.5px 1px -0.5px var(--rim-bright),
    0 12px 28px -12px rgb(var(--shadow-color) / 0.45);
}

.game-section-header.is-stuck .game-section-title small {
  display: none;
}

.game-section-header.is-stuck .game-section-title strong {
  font-size: 0.96rem;
}

/* ---------- Combined mode: long press on Games chips ---------- */

.game-chip {
  position: relative;
  overflow: hidden;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

/* While holding: a fill in the game's color sweeps across the chip. */
.game-chip::after {
  content: "";
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--gc) 28%, transparent);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

.game-chip.is-pressing::after {
  transform: scaleX(1);
  transition: transform 0.48s linear;
}

/* ---------- Across games ---------- */

/* "Compare across games": a quiet line at the bottom of name cards. */
.across-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 7px 12px 7px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  background:
    linear-gradient(120deg, rgb(183 138 79 / 0.1), rgb(82 194 204 / 0.08), rgb(168 136 204 / 0.1)),
    color-mix(in srgb, var(--card) 60%, transparent);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--surface-highlight);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.across-link:hover,
.across-link:focus-visible {
  color: var(--text);
  border-color: color-mix(in srgb, var(--gc, var(--accent)) 60%, var(--border));
}

.across-link svg {
  width: 13px;
  height: 13px;
}

/* Six tiny dots in the game colors. */
.across-link-dots {
  flex: 0 0 auto;
  width: 37px;
  height: 6px;
  background:
    radial-gradient(circle at 3px 3px, #b78a4f 2.6px, transparent 3px),
    radial-gradient(circle at 9px 3px, #f0953f 2.6px, transparent 3px),
    radial-gradient(circle at 15px 3px, #52c2cc 2.6px, transparent 3px),
    radial-gradient(circle at 21px 3px, #d4695d 2.6px, transparent 3px),
    radial-gradient(circle at 27px 3px, #a888cc 2.6px, transparent 3px),
    radial-gradient(circle at 33px 3px, #62a6ca 2.6px, transparent 3px);
}

.across-hero {
  margin: 0 4px 14px;
}

.across-eyebrow {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #b78a4f, #f0953f, #52c2cc, #d4695d, #a888cc, #62a6ca);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.across-hero p {
  margin: 4px 0 0;
}

.across-list {
  display: grid;
  gap: 12px;
}

.across-card {
  padding: 14px 16px;
  border-radius: 22px;
  background:
    linear-gradient(90deg, transparent 12%, color-mix(in srgb, var(--gc) 70%, var(--surface-highlight)) 50%, transparent 88%) top / 100% 1px no-repeat,
    linear-gradient(180deg, color-mix(in srgb, var(--gc) 8%, var(--surface-sheen)), transparent 120px),
    var(--card);
  border: 1px solid color-mix(in srgb, var(--gc) 55%, var(--border));
  box-shadow: 0 14px 34px -16px rgb(var(--shadow-color) / 0.35);
}

.across-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.across-card-head .game-badge-dot {
  width: 12px;
  height: 12px;
}

.across-card-title {
  display: grid;
  min-width: 0;
  text-align: left;
}

.across-card-title strong {
  font-size: 1rem;
}

.across-card-title small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
}

.across-match {
  padding: 10px 0 2px;
  border-top: 1px solid color-mix(in srgb, var(--gc) 22%, var(--border));
}

.across-name {
  font-weight: 800;
  font-size: 1.02rem;
}

.across-text {
  margin-top: 4px;
  line-height: 1.5;
}

.across-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.across-jp {
  margin: 8px 0 4px;
}

.across-jp summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.across-jp[open] summary {
  margin-bottom: 6px;
}

.across-missing {
  margin: 14px 4px 0;
  font-size: 0.82rem;
}

@media (prefers-reduced-motion: reduce) {
  .game-chip.is-pressing::after,
  .sections-toggle svg,
  .game-section.is-open .game-section-header {
    transition: none;
  }
}


/* =========================================================
   Card links (tap the ID badge) and Across differences
   ========================================================= */

/* The ID badge copies a link to its card. */
.entry-id[data-copy-entry-link] {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

@media (hover: hover) {
  .entry-id[data-copy-entry-link]:hover {
    color: var(--text);
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  }
}

.entry-id[data-copy-entry-link]:focus-visible {
  outline: none;
  border-color: var(--accent);
}

.entry-id[data-copy-entry-link].is-copied {
  color: var(--accent);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

/* A card opened from a link glows softly, then settles. */
.entry.is-linked {
  animation: linked-glow 4.2s ease-out forwards;
}

@keyframes linked-glow {
  0%, 55% {
    box-shadow:
      0 0 0 2px color-mix(in srgb, var(--gc, var(--accent)) 85%, transparent),
      0 0 26px 2px color-mix(in srgb, var(--gc, var(--accent)) 45%, transparent);
  }
  100% {
    box-shadow:
      0 0 0 0 transparent,
      0 0 0 0 transparent;
  }
}

/* Words that differ from the newer game above. */
.diff-mark {
  color: inherit;
  font-weight: inherit;
  padding: 0 2px;
  margin: 0 -1px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--gc, var(--accent)) 24%, transparent);
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--gc, var(--accent)) 70%, transparent);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.diff-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.diff-note.is-same {
  opacity: 0.8;
}

.diff-swatch {
  width: 14px;
  height: 9px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--gc, var(--accent)) 24%, transparent);
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--gc, var(--accent)) 70%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .entry.is-linked {
    animation: none;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--gc, var(--accent)) 85%, transparent);
  }
}
