/* Star Seed pages, shown inside the bordered frame */

:root { --ink: #141218; --sea: #2c7a76; --soft: #625e69; --gold: #9a7420; --line: rgba(20, 18, 24, 0.18); }

* { box-sizing: border-box; }
body {
  margin: 0;
  padding: 18px 22px 12px;
  background: #fff;
  color: var(--ink);
  font-family: Verdana, Tahoma, Geneva, sans-serif;
  font-size: 13px;
  line-height: 1.65;
  scrollbar-width: thin;
  scrollbar-color: var(--ink) transparent;
}

a { color: var(--sea); text-decoration: none; border-bottom: 1px dotted var(--sea); }
a:hover { border-bottom-style: solid; }
a:focus-visible { outline: 1px solid var(--sea); outline-offset: 2px; }
::selection { background: var(--ink); color: #fff; }

h2 {
  margin: 0 0 8px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-style: italic;
  font-size: 24px;
  line-height: 1.2;
  color: var(--ink);
  text-wrap: balance;
}
h2::before { content: "\2727  "; font-style: normal; font-size: 13px; color: var(--sea); }
h3 {
  margin: 18px 0 8px;
  padding-bottom: 2px;
  font-size: 10.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--soft);
  border-bottom: 1px solid var(--line);
}
p, li { text-wrap: pretty; }
p { margin: 0 0 9px; }
.box { margin: 0 0 16px; }

.count { padding: 6px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; color: var(--soft); }
.count b { color: var(--sea); }

.updates { list-style: none; margin: 0; padding: 0; }
.updates li { margin: 0 0 6px; }
.updates .date { color: var(--sea); font-weight: bold; margin-right: 6px; }

.rules { margin: 0; padding-left: 20px; }
.rules li { margin: 0 0 7px; }
.rules li::marker { color: var(--sea); font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; }

.toc { margin: 0 0 6px; text-align: center; }
.toc a { margin: 0 3px; }

/* the sprite shelves */
.sprites {
  list-style: none;
  margin: 0 0 6px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
}
.sprites li > a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-height: 108px;
  padding: 8px 4px 6px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: center;
}
.sprites li > a:hover,
.sprites li > a:focus-visible { border-color: var(--sea); outline: none; background: rgba(44, 122, 118, 0.06); }
.sprites img { image-rendering: pixelated; margin-bottom: 5px; }
.sprites .name { max-width: 100%; font-size: 10px; line-height: 1.3; letter-spacing: -0.1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.members { margin: 0; padding-left: 20px; }
.members li { margin: 0 0 5px; }
.members li::marker { color: var(--sea); }
.members .adopted { color: var(--soft); }

/* join form and code boxes */
.join { display: grid; gap: 10px; margin: 6px 0 10px; }
.join label, .pick { display: grid; gap: 3px; font-size: 11px; letter-spacing: 1px; color: var(--soft); }
.join small { letter-spacing: 0; }
input, select, textarea {
  width: 100%;
  padding: 6px 7px;
  font: 13px Verdana, Tahoma, sans-serif;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--ink);
  border-radius: 0;
}
input:focus, select:focus, textarea:focus { outline: 1px solid var(--sea); outline-offset: 1px; }
button {
  justify-self: start;
  padding: 6px 22px;
  font: 12px Verdana, Tahoma, sans-serif;
  letter-spacing: 2px;
  color: #fff;
  background: var(--ink);
  border: 1px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: 2px;
  cursor: pointer;
}
button:hover { background: var(--sea); border-color: var(--sea); outline-color: var(--sea); }
.note { font-size: 11.5px; color: var(--soft); }

.preview { margin: 10px 0; text-align: center; }
.preview img { image-rendering: pixelated; }
textarea.code {
  height: 70px;
  font: 11.5px/1.4 "Courier New", monospace;
  border-color: var(--line);
  resize: none;
}

.credit { margin-top: 20px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--soft); text-align: center; }
.credit p { margin: 0 0 2px; }

.sparkle {
  position: fixed;
  pointer-events: none;
  z-index: 50;
  font-size: 11px;
  color: var(--gold);
  animation: twinkle 0.8s ease-out forwards;
}
@keyframes twinkle {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(14px) scale(0.4); }
}
@media (prefers-reduced-motion: reduce) { .sparkle { display: none; } }
@media (max-width: 420px) { body { padding: 14px 12px 10px; } }

/* a thin ink rule between characters, with a small star in the middle */
.sprites li.divider {
  grid-column: 1 / -1;
  background: linear-gradient(var(--line), var(--line)) left center / calc(50% - 12px) 1px no-repeat,
              linear-gradient(var(--line), var(--line)) right center / calc(50% - 12px) 1px no-repeat;
  justify-content: center;
  display: flex;
  align-items: center;
  height: 14px;
  margin: 8px 0;
  color: var(--sea);
  font-size: 11px;
  line-height: 1;
}
.sprites li.divider::before { content: "\2727"; }

/* quick nav at the top of the sprites page */
/* three labeled rows of small ink-ruled buttons, between double rules */
.quick {
  margin: 0 0 16px;
  padding: 10px 0 12px;
  border-top: 3px double var(--ink);
  border-bottom: 3px double var(--ink);
}
.quick .row { display: grid; grid-template-columns: 62px 1fr; gap: 10px; align-items: baseline; }
.quick .row + .row { margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line); }
.quick .label {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--sea);
  text-align: right;
}
.quick .chips { display: flex; flex-wrap: wrap; gap: 6px 5px; }
.quick a {
  padding: 4px 8px 3px;
  font-size: 11px;
  letter-spacing: 1px;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--ink);
}
.quick a:hover,
.quick a:focus-visible { color: #fff; background: var(--ink); outline: none; }
@media (max-width: 420px) {
  .quick .row { grid-template-columns: 1fr; gap: 4px; }
  .quick .label { text-align: center; }
  .quick .chips { justify-content: center; }
}
.sprites li[id] { scroll-margin-top: 14px; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }


/* the sprite pop-up */
#pop {
  width: min(360px, calc(100vw - 32px));
  padding: 18px 20px 16px;
  border: 1px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: -6px;
  color: var(--ink);
  background: #fff;
  text-align: center;
}
#pop::backdrop { background: rgba(20, 18, 24, 0.35); }
#pop h3 { margin: 4px 0 8px; border: 0; padding: 0; font: italic 600 20px/1.2 "Cormorant Garamond", Georgia, serif; letter-spacing: 0; text-transform: none; color: var(--ink); }
#pop p { font-size: 12px; }
#pop .pop-sprite { margin: 6px 0 0; }
#pop .pop-sprite { min-height: 80px; display: flex; align-items: flex-end; justify-content: center; }
#pop .pop-sprite img { image-rendering: pixelated; }
#pop textarea.code { height: 84px; text-align: left; }
#pop .pop-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 14px; margin: 10px 0 0; }
#pop .pop-actions button { justify-self: auto; }
#pop .close { position: absolute; top: 8px; right: 10px; padding: 0 6px; font-size: 18px; line-height: 1; letter-spacing: 0; color: var(--ink); background: none; border: 0; outline: 0; }
#pop .close:hover { color: var(--sea); background: none; }
#pop .close:focus-visible { outline: 1px solid var(--sea); }
