* {
  box-sizing: border-box;
}
:root {
  color-scheme: dark;
  font:
    16px/1.5 -apple-system,
    BlinkMacSystemFont,
    "Helvetica Neue",
    sans-serif;
  color: #f6f0de;
  --ground: #101412;
  --line: #3a413b;
  --quiet: #a9afa6;
  --gold: #eec599;
  --world: #eec599;
}
body {
  min-height: 100svh;
  margin: 0;
  background-color: var(--ground);
  background-image:
    radial-gradient(ellipse at 50% 0%, #49534236, transparent 70%),
    radial-gradient(circle, #91a28c33 0.6px, transparent 0.9px);
  background-size:
    100% 100%,
    16px 16px;
}
header,
main,
footer {
  width: min(calc(100% - 64px), 1120px);
  margin-inline: auto;
}
header,
footer,
.actions,
.title-row,
nav,
.brand,
.example {
  display: flex;
  align-items: center;
}
header {
  height: 88px;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
button,
nav a,
.back {
  min-width: 44px;
  min-height: 44px;
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
}
button,
nav a,
.back {
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.55;
}
:focus-visible {
  outline: 2px solid #ffe5b8;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.brand {
  gap: 10px;
  font-size: 21px;
  font-weight: 620;
  letter-spacing: -0.045em;
}
.brand b {
  font:
    11px/1 ui-monospace,
    monospace;
  letter-spacing: 0.12em;
  border: 1px solid #696e60;
  border-radius: 4px;
  padding: 4px 5px;
  color: #d6d8c5;
}
nav {
  gap: 4px;
}
nav button,
nav a,
.back {
  display: grid;
  place-items: center;
  color: #c9cfc4;
  border-radius: 50%;
}
nav svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
nav button:hover,
nav a:hover,
.back:hover {
  color: white;
  background: #ffffff0c;
}
#lock[data-active] {
  color: #9ce4ab;
}
#lock .open,
#lock[data-active] .shut {
  display: none;
}
#lock[data-active] .open {
  display: inline;
}
main {
  min-height: calc(100svh - 168px);
  padding-block: 24px;
}
.world-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 16px;
  isolation: isolate;
}
.world-region {
  --foot: 14px;
  position: relative;
  min-width: 0;
  border-top: 1px solid color-mix(in srgb, var(--world) 25%, transparent);
  padding-bottom: 8px;
}
.satellites {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
  max-width: 264px;
  margin: 0 auto;
}
.satellites .power {
  position: static;
  min-height: 44px;
  border: 0;
}
.satellites .power svg {
  width: 21px;
  height: 21px;
}
.world {
  display: grid;
  grid-template-rows: 1fr;
  grid-auto-rows: auto;
  place-items: center;
  position: relative;
  min-height: clamp(144px, 19vh, 180px);
  padding-bottom: var(--foot);
  border-bottom: 1px solid #a6b39e1f;
  -webkit-tap-highlight-color: transparent;
}
.world::before,
.world::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  height: 5px;
  width: 1px;
  background: #adbda246;
}
.world::after {
  width: 5px;
  height: 1px;
  bottom: -1px;
  left: -2px;
}
.medal {
  display: block;
  width: min(100%, 190px);
  transition: transform 0.23s ease;
}
.world:hover .medal,
.world:focus-visible .medal {
  transform: translateY(-4px) scale(1.035);
}
.world:active .medal {
  transform: scale(0.965);
}
.caption {
  max-width: 100%;
  text-align: center;
  text-wrap: balance;
  color: var(--world);
  font:
    600 13px/1.25 ui-monospace,
    monospace;
}
.world .caption {
  color: #f6f0de;
  font:
    500 19px/1.2 Georgia,
    serif;
  letter-spacing: -0.02em;
}
/* One quiet line under each world. It counts the world's powers; ask a glyph beneath it, by pointer or by
   keyboard, and for that moment the same line names the power instead. */
.count,
.satellites .caption {
  font:
    11px/1.4 ui-monospace,
    monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: opacity 0.14s;
}
.count {
  margin-top: 4px;
  color: color-mix(in srgb, var(--world) 72%, var(--quiet));
}
.satellites .caption {
  position: absolute;
  inset: auto 0 calc(100% + var(--foot) + 1px);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
}
.satellites .power:is(:hover, :focus-visible) .caption {
  opacity: 1;
}
.world-region:has(.satellites .power:is(:hover, :focus-visible)) .count {
  opacity: 0;
}
footer {
  height: 64px;
  justify-content: flex-end;
}
.offline {
  width: min(calc(100% - 32px), 1120px);
  margin: 12px auto 0;
  color: var(--gold);
  font-size: 14px;
}
.build-stamp,
small {
  color: var(--quiet);
  font:
    11px/1.6 ui-monospace,
    monospace;
}
.title-row {
  gap: 12px;
  margin: 0 0 24px;
}
.title-row .back {
  font: 26px/1 system-ui;
  border: 1px solid var(--line);
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font:
    500 clamp(30px, 5vw, 58px) / 1.12 Georgia,
    serif;
  letter-spacing: -0.05em;
  overflow-wrap: anywhere;
}
h2 {
  font:
    500 24px/1.2 Georgia,
    serif;
}
.world-head {
  display: flex;
  align-items: center;
  gap: 16px;
}
.world-head .medal {
  width: 112px;
  flex-shrink: 0;
}
.power-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  border-block: 1px solid var(--line);
}
/* A world of one or two powers looks marked up, not sparse: it owns a row and each power owns a half. */
.power-grid[data-count="1"],
.power-grid[data-count="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.power-grid[data-count="1"] .power {
  grid-column: span 2;
}
.power {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 112px;
  -webkit-tap-highlight-color: transparent;
}
.power svg {
  color: var(--world);
  width: 36px;
  height: 36px;
  transition: transform 0.18s;
}
.power:is(:hover, :focus-visible) svg {
  transform: translateY(-4px);
}
.power:active svg {
  transform: scale(0.9);
}
/* Each row rules itself off; the last row's rule lands on the grid's own, which runs the whole width. */
.power-grid .power {
  align-content: start;
  row-gap: 12px;
  margin-bottom: -1px;
  border-bottom: 1px solid var(--line);
  padding: 24px 8px 18px;
}
.power-grid .caption {
  color: #f6f0de;
  font:
    15px/1.25 Georgia,
    serif;
  letter-spacing: -0.01em;
}
.sheet,
.search-view {
  max-width: 720px;
  margin: 0 auto;
}
.sheet .tool-symbol {
  width: 48px;
  height: 48px;
  color: var(--world);
  flex-shrink: 0;
}
.sheet .title-row {
  margin-bottom: 16px;
}
.description {
  color: #c1c6ba;
  margin: 0 0 24px;
}
.details {
  font-size: 14px;
  color: #c1c6ba;
  margin-block: 12px 20px;
  overflow-wrap: anywhere;
}
summary {
  cursor: pointer;
  padding-block: 8px;
}
.examples {
  margin: 20px 0 24px;
  border-top: 1px solid var(--line);
}
.example {
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-block: 8px;
}
.example.current {
  border-bottom-color: var(--world);
}
.example a {
  flex: 1;
  padding-block: 10px;
}
.example button,
.actions button,
#copy-link {
  padding: 8px 16px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 22px;
  font-size: 14px;
}
.example button {
  color: var(--world);
}
.actions {
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0;
}
.actions .primary {
  background: var(--world);
  color: #141813;
  font-weight: 650;
  border-color: transparent;
}
label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}
input,
textarea,
pre {
  background: #101713;
  border: 1px solid #586052;
  border-radius: 8px;
  padding: 12px 16px;
}
input,
textarea {
  display: block;
  width: 100%;
}
.fields {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 12px;
}
.fields input {
  margin-top: 4px;
  font-weight: 400;
}
.fields input[type="checkbox"] {
  width: 24px;
  height: 24px;
}
textarea,
pre {
  font:
    14px/1.55 ui-monospace,
    monospace;
  overflow-wrap: anywhere;
}
textarea {
  min-height: 104px;
  resize: vertical;
}
pre {
  white-space: pre-wrap;
  max-height: 45vh;
  overflow: auto;
}
.output {
  margin-block: 24px;
}
.output p {
  margin-block: 8px;
  color: var(--world);
}
.output .error {
  color: #ffb89c;
}
dialog {
  background: #1c221e;
  border: 1px solid #60695c;
  border-radius: 16px;
  color: inherit;
  width: min(396px, calc(100vw - 32px));
  padding: 28px;
}
dialog::backdrop {
  background: #050807be;
}
dialog h2 {
  margin-bottom: 20px;
}
dialog small {
  display: block;
  margin: 8px 0 24px;
}
dialog .actions {
  margin: 0;
}
#kept p {
  margin: -4px 0 24px;
  color: #c1c6ba;
}
.search-results {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 16px;
  margin-block: 16px;
}
.search-results a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
}
.search-results svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--world);
}
@media (max-width: 900px) {
  .world-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 600px) {
  header,
  main,
  footer {
    width: calc(100% - 32px);
  }
  header {
    height: 64px;
  }
  main {
    padding-block: 16px;
  }
  .brand {
    gap: 7px;
    font-size: 18px;
  }
  .brand img {
    width: 26px;
    height: 26px;
  }
  nav {
    gap: 0;
  }
  .world-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .world {
    min-height: 150px;
  }
  .search-results {
    grid-template-columns: 1fr;
  }
  .world-head {
    gap: 0;
  }
  .world-head .medal {
    width: 72px;
  }
  .power-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .power {
    min-height: 94px;
  }
  .power-grid .power {
    row-gap: 10px;
    padding: 18px 4px 14px;
  }
  .title-row {
    gap: 8px;
  }
}
/* The narrowest phones: two powers to a row, so a name never crowds its neighbor. */
@media (max-width: 350px) {
  .power-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* Nothing to hover with: a touch screen, or a narrow one, keeps the worlds by name and each world's powers, named,
   one tap inside it. */
@media (hover: none), (pointer: coarse), (max-width: 600px) {
  .satellites,
  .world::before,
  .world::after {
    display: none;
  }
  .world-region {
    padding-bottom: 0;
  }
  .world {
    border-bottom: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
