/* Planet Chicken Studios
   Layout idea: a honeycomb-yellow page. On Home, the featured game is a dark "space" stage in the
   middle with the website boxes on both sides. Every other tab is one sheet in the centre. */

/* ---------- fonts (kept in /fonts, so nothing loads from other websites) ---------- */

@font-face {
  font-family: "Titan One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/titan-one-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Titan One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/titan-one-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url(fonts/nunito-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url(fonts/nunito-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Nunito";
  font-style: italic;
  font-weight: 200 1000;
  font-display: swap;
  src: url(fonts/nunito-latin-wght-italic.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- the look, in one place ---------- */

:root {
  color-scheme: light;
  --yolk: #ffd23f;          /* the page yellow */
  --yolk-pale: #ffe98f;     /* the newsletter's paper */
  --ink: #1c1838;           /* text and outlines: deep space navy */
  --ink-soft: #4b4669;      /* quieter text */
  --egg: #fffaf0;           /* cards */
  --comb: #d62839;          /* the red of a chicken's comb: main buttons, labels */
  --space: #191545;         /* the featured game's stage */
  --display: "Titan One", "Arial Rounded MT Bold", "Nunito", system-ui, sans-serif;
  --body: "Nunito", ui-rounded, "Segoe UI", system-ui, -apple-system, sans-serif;
  --line: 3px solid var(--ink);
  --pop: 5px 5px 0 var(--ink);
  --round: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font: 600 1.0625rem/1.55 var(--body);
  color: var(--ink);
  /* yellow with a faint honeycomb */
  background: var(--yolk) url(hex.svg) center top / 156px 135px;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-synthesis: none; }
a { color: inherit; }
code { font-size: .95em; font-weight: 800; background: rgba(28, 24, 56, .1); padding: .1em .35em; border-radius: 6px; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.wrap {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 60;
  padding: .6em 1em;
  font-weight: 800;
  color: #fff;
  background: var(--ink);
  border-radius: 0 0 12px 12px;
}
.skip:focus { top: 0; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45em;
  min-height: 44px;
  padding: .55em 1.1em;
  font: 800 1rem/1.15 var(--body);
  color: var(--ink);
  text-decoration: none;
  background: var(--egg);
  border: var(--line);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.primary { color: #fff; background: var(--comb); }
.btn.small { min-height: 38px; padding: .4em .85em; font-size: .92rem; }
.btn.plain { background: transparent; border-color: transparent; box-shadow: none; text-decoration: underline; text-underline-offset: 3px; }
.btn.plain:hover, .btn.plain:active { transform: none; box-shadow: none; background: rgba(28, 24, 56, .08); }
.btn.danger { color: #9b1020; }
.btn:disabled { opacity: .55; cursor: default; transform: none; box-shadow: 3px 3px 0 var(--ink); }

.tool {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--ink);
  background: var(--egg);
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
}
.tool:hover { background: var(--yolk); }
.tool:disabled { opacity: .55; cursor: default; }

.linklike {
  padding: 4px 2px;
  font: inherit;
  font-weight: 800;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
  cursor: pointer;
}

.ic { flex: none; width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ic.solid { fill: currentColor; }

.grow { flex: 1; }

/* ---------- top of the page ---------- */

.ownerbar { position: sticky; top: 0; z-index: 30; color: #fff; background: var(--ink); }
.ownerbar-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-block: 8px; }
.ownerbar p { margin: 0; }
.ownerbar strong { color: var(--yolk); }

.masthead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; padding-block: 18px 12px; }

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { flex: none; width: 76px; height: 76px; transition: transform .25s ease; }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-name { display: grid; justify-items: start; gap: 4px; }
.brand-top { font: 400 clamp(1.55rem, 4.6vw, 2.3rem)/1 var(--display); }
.brand-tag {
  padding: .32em .45em .3em .75em;
  font: 400 .92rem/1 var(--display);
  letter-spacing: .28em;
  text-transform: uppercase;
  color: #fff;
  background: var(--comb);
  border: 2.5px solid var(--ink);
  border-radius: 8px;
  transform: rotate(-2deg);
}

.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs a {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  min-height: 44px;
  padding: .45em 1em;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  background: var(--egg);
  border: var(--line);
  border-radius: 999px;
}
.tabs a:hover { background: #fff; }
.tabs a[aria-current="page"] { color: var(--yolk); background: var(--ink); }
.badge { min-width: 1.6em; padding: .05em .45em; font-size: .78rem; font-weight: 900; line-height: 1.5; text-align: center; color: #fff; background: var(--comb); border-radius: 999px; }

main { flex: 1; padding-block: 10px 48px; }
main:focus { outline: none; }

.tab { display: grid; gap: 22px; }
.tab > * { min-width: 0; }
.tab > .btn { justify-self: start; }

.tab-head { display: grid; gap: 6px; justify-items: start; }
.tab-head h1 { margin: 0; font: 400 clamp(2rem, 6vw, 3.2rem)/1.02 var(--display); }
.tab-head p { margin: 0; font-size: 1.1rem; font-weight: 700; }

.sheet {
  padding: clamp(18px, 4vw, 36px);
  background: var(--egg);
  border: var(--line);
  border-radius: 24px;
  box-shadow: var(--pop);
}

.eyebrow { margin: 0; font-size: .8rem; font-weight: 900; line-height: 1.3; letter-spacing: .14em; text-transform: uppercase; }
.empty { margin: 0; padding: 20px 8px; font-weight: 700; text-align: center; }
.faint { opacity: .7; }
.help { margin: 0; font-size: .9rem; font-weight: 600; color: var(--ink-soft); }
.tools { display: flex; flex-wrap: wrap; gap: 8px; }

.loading { margin: 0; padding: 60px 0 10px; font-size: 1.2rem; font-weight: 800; text-align: center; }
/* Only shows up if the page is still stuck after a few seconds (for example, opened without its server). */
.boot-help { justify-self: center; max-width: 620px; visibility: hidden; animation: appear 0s linear 5s forwards; }
.boot-help p { margin: 0; }
@keyframes appear { to { visibility: visible; } }

.trouble { display: grid; gap: 12px; justify-items: start; justify-self: center; max-width: 620px; }
.trouble h1 { margin: 0; font: 400 1.9rem/1.1 var(--display); }
.trouble p { margin: 0; }

/* ---------- Home: welcome line ---------- */

.welcome { display: flex; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.welcome p { margin: 0; max-width: 62ch; font-size: clamp(1.08rem, 2.2vw, 1.3rem); font-weight: 800; text-wrap: balance; }

/* ---------- Home: featured game in the middle, boxes around it ---------- */

.orbit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.3fr) minmax(0, 1fr);
  grid-template-areas: "left stage right" "more more more";
  gap: 22px;
  align-items: start;
}
.orbit.solo { grid-template-columns: minmax(0, 780px); grid-template-areas: "stage"; justify-content: center; }
.side.left { grid-area: left; }
.side.right { grid-area: right; }
.more { grid-area: more; }

.stage {
  grid-area: stage;
  align-self: stretch;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: clamp(410px, 42vw, 500px);
  color: #fff;
  background: var(--space);
  border: var(--line);
  border-radius: 28px;
  box-shadow: 7px 7px 0 var(--ink);
}
.stage :focus-visible { outline-color: var(--yolk); }
.stage-art { position: absolute; inset: 0; z-index: -1; }
.stage-art::after {      /* darkens the bottom so the words stay readable on any picture */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(18, 14, 52, .95) 0%, rgba(18, 14, 52, .74) 30%, rgba(18, 14, 52, 0) 64%);
}
.stage-cover { width: 100%; height: 100%; object-fit: cover; }

.stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 9% 16%, #fff 0 1.6px, transparent 2.6px),
    radial-gradient(circle at 23% 41%, #fff 0 1.2px, transparent 2.2px),
    radial-gradient(circle at 37% 12%, #fff 0 1.8px, transparent 2.8px),
    radial-gradient(circle at 48% 33%, #fff 0 1.1px, transparent 2.1px),
    radial-gradient(circle at 61% 8%, #fff 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 71% 57%, #fff 0 1.3px, transparent 2.3px),
    radial-gradient(circle at 86% 71%, #fff 0 1.7px, transparent 2.7px),
    radial-gradient(circle at 94% 30%, #fff 0 1.2px, transparent 2.2px),
    radial-gradient(circle at 15% 68%, #fff 0 1.4px, transparent 2.4px),
    radial-gradient(circle at 55% 62%, #fff 0 1px, transparent 2px);
}
.stars.far {
  opacity: .6;
  background-image:
    radial-gradient(circle at 5% 48%, #ffd23f 0 1.4px, transparent 2.4px),
    radial-gradient(circle at 18% 27%, #ffd23f 0 1px, transparent 2px),
    radial-gradient(circle at 31% 58%, #ffd23f 0 1.3px, transparent 2.3px),
    radial-gradient(circle at 44% 20%, #ffd23f 0 1px, transparent 2px),
    radial-gradient(circle at 66% 38%, #ffd23f 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 79% 14%, #ffd23f 0 1.1px, transparent 2.1px),
    radial-gradient(circle at 90% 52%, #ffd23f 0 1.3px, transparent 2.3px);
  animation: twinkle 4.5s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .2; } to { opacity: .85; } }

.stage-mascot { position: absolute; top: 9%; right: 6%; width: min(38%, 210px); animation: float 7s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-10px) rotate(3deg); } }

.ribbon {
  position: absolute;
  top: 20px;
  left: 0;
  margin: 0;
  padding: .5em 1.1em .45em 1em;
  font: 400 1rem/1 var(--display);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--comb);
  border: var(--line);
  border-left: 0;
  border-radius: 0 999px 999px 0;
}

.stage-info { display: grid; gap: 12px; justify-items: start; padding: 96px clamp(18px, 3vw, 30px) clamp(18px, 3vw, 30px); }
.stage-title { margin: 0; font: 400 clamp(1.9rem, 4vw, 3rem)/1.05 var(--display); text-shadow: 0 3px 0 rgba(0, 0, 0, .35); text-wrap: balance; overflow-wrap: anywhere; }
.stage-blurb { margin: 0; max-width: 44ch; font-size: 1.08rem; font-weight: 700; }
.stage-go { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.stage-host { font-weight: 800; color: var(--yolk); overflow-wrap: anywhere; }
.btn.play { padding: .65em 1.3em; font-size: 1.2rem; background: var(--yolk); box-shadow: 4px 4px 0 #000; }
.btn.play:hover { box-shadow: 5px 5px 0 #000; }
.btn.play:active { box-shadow: 1px 1px 0 #000; }
.stage-edit { position: absolute; top: 14px; right: 14px; }

/* With a cover picture: the whole picture sits on top, shrunk to fit and never cut off,
   and the game's name and Play button go underneath it instead of over it. */
.stage.has-cover { justify-content: flex-start; }
.stage.has-cover .ribbon { position: static; order: -1; align-self: flex-start; margin: 16px 0 12px; }
.stage.has-cover .stage-art { position: static; z-index: auto; flex: 1; display: grid; place-items: center; }
.stage.has-cover .stage-art::after { content: none; }
.stage.has-cover .stage-cover { width: 100%; height: auto; max-height: 420px; object-fit: contain; }
.stage.has-cover .stage-info { padding-top: 18px; }

.side { display: grid; gap: 12px; align-content: start; }
.boxes { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.more .boxes { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }

.box { position: relative; }
.box-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 118px;
  padding: 14px;
  color: var(--ink);
  text-decoration: none;
  background: var(--egg);
  border: var(--line);
  border-radius: var(--round);
  box-shadow: var(--pop);
  transition: transform .08s ease, box-shadow .08s ease;
}
.box-link:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.box-link:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.box-text { display: grid; gap: 2px; }
.box-title { font-size: 1.08rem; font-weight: 900; line-height: 1.2; overflow-wrap: anywhere; }
.box-note { font-size: .92rem; line-height: 1.3; overflow-wrap: anywhere; }
.box-host { font-size: .85rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.box-tools { position: absolute; top: -12px; right: -8px; }

/* a honeycomb cell: holds a box's picture, or the first letter of its name */
.hex {
  display: grid;
  place-items: center;
  flex: none;
  width: 54px;
  aspect-ratio: 52 / 60;
  overflow: hidden;
  font: 400 1.6rem/1 var(--display);
  color: #fff;
  background: var(--comb);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.hex img { width: 100%; height: 100%; object-fit: cover; }
.tone-0 { background: #d62839; }
.tone-1 { background: #1c1838; }
.tone-2 { background: #0a6f6a; }
.tone-3 { background: #b85c00; }
.tone-4 { background: #6a3fb5; }
.tone-5 { background: #1f6fb2; }

.box-form {
  display: grid;
  gap: 6px;
  align-content: center;
  min-height: 118px;
  padding: 12px 14px;
  background: rgba(255, 250, 240, .5);
  border: 3px dashed rgba(28, 24, 56, .5);
  border-radius: var(--round);
}
.box-form label { font-size: .78rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.box-row { display: flex; gap: 8px; }
.box-row input { flex: 1; min-width: 0; }

/* ---------- forms ---------- */

input[type="text"], input[type="password"], textarea, select {
  width: 100%;
  min-height: 44px;
  padding: .5em .75em;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
}
textarea { display: block; line-height: 1.5; resize: vertical; }
::placeholder { color: #6b6787; opacity: 1; }

.field { display: grid; gap: 6px; }
.field > label, .field > .label { font-weight: 800; }

.form-error { margin: 0; padding: .55em .8em; font-size: .95rem; font-weight: 800; color: #8a0f1c; background: #ffe3e0; border: 2px solid var(--comb); border-radius: 10px; }
.draft-note { margin: 0; padding: .55em .8em; font-weight: 700; background: var(--yolk-pale); border: 2px solid var(--ink); border-radius: 10px; }

.switch { display: inline-flex; align-items: center; gap: 10px; margin-top: 6px; font-weight: 800; cursor: pointer; }
.switch input { flex: none; width: 22px; height: 22px; accent-color: var(--comb); }

.pic-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.pic-preview {
  display: grid;
  place-items: center;
  width: 150px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  font-size: .85rem;
  font-weight: 700;
  text-align: center;
  color: var(--ink-soft);
  background: #fff;
  border: 2.5px dashed rgba(28, 24, 56, .5);
  border-radius: 12px;
}
.pic-preview img { width: 100%; height: 100%; object-fit: cover; }
.pic-preview.wide { width: 190px; aspect-ratio: 16 / 9; }
.pic-preview.tall { width: 110px; aspect-ratio: 2 / 3; }
.pic-preview.hex { width: 84px; font-family: var(--body); color: var(--ink-soft); background: #fff; }
/* "whole": the preview box takes the picture's own shape instead of cutting it to fit */
.pic-preview.whole { width: fit-content; min-width: 150px; max-width: 240px; min-height: 100px; aspect-ratio: auto; }
.pic-preview.whole img { width: auto; height: auto; max-width: 100%; max-height: 220px; object-fit: contain; }
.pic-buttons { display: grid; gap: 8px; justify-items: start; }

/* ---------- pop-ups ---------- */

dialog.dlg {
  width: min(540px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--egg);
  border: var(--line);
  border-radius: 22px;
  box-shadow: 8px 8px 0 var(--ink);
}
dialog.dlg.wide { width: min(780px, calc(100vw - 24px)); }
dialog.dlg.small { width: min(440px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(25, 21, 69, .6); }
.dlg-form { display: flex; flex-direction: column; max-height: calc(100vh - 30px); max-height: calc(100dvh - 30px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 10px; }
.dlg-head h2 { margin: 0; font: 400 1.5rem/1.1 var(--display); text-wrap: balance; }
.dlg-body { display: grid; gap: 14px; min-height: 0; padding: 4px 22px 18px; overflow-y: auto; }
.dlg-body > p { margin: 0; }
.dlg-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 22px 18px; border-top: 2px solid rgba(28, 24, 56, .15); }

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 50;
  display: grid;
  gap: 8px;
  justify-items: center;
  width: min(92vw, 520px);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast { margin: 0; padding: .65em 1.1em; font-weight: 800; color: #fff; background: var(--ink); border: 2.5px solid #fff; border-radius: 14px; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
.toast.error { background: var(--comb); }

/* ---------- Newsletter: its own yellow paper with the faint hexagons ---------- */

.paper {
  display: grid;
  gap: 30px;
  justify-items: center;
  padding: clamp(18px, 4vw, 46px);
  background: var(--yolk-pale) url(hex.svg) 0 0 / 156px 135px;
  border: var(--line);
  border-radius: 24px;
  box-shadow: var(--pop);
}
.paper > * { width: min(100%, 44rem); min-width: 0; }
.paper-head { display: grid; gap: 10px; justify-items: center; padding-bottom: 26px; text-align: center; border-bottom: 5px double var(--ink); }
.title-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.paper-title { margin: 0; font: 400 clamp(2.2rem, 7vw, 4rem)/1 var(--display); text-wrap: balance; overflow-wrap: anywhere; }
.paper-sub { margin: 0; font-weight: 700; color: var(--ink-soft); }

.story { display: grid; gap: 14px; padding-bottom: 30px; border-bottom: 3px dashed rgba(28, 24, 56, .35); }
.story:last-child { padding-bottom: 0; border-bottom: 0; }
.story-head h2 { margin: 0; font: 400 clamp(1.5rem, 3.6vw, 2.1rem)/1.12 var(--display); text-wrap: balance; overflow-wrap: anywhere; }
.story-date { margin: 6px 0 0; font-size: .92rem; font-weight: 800; color: var(--ink-soft); }
/* The frame takes the picture's own shape, so the whole picture always shows (never cut off). */
.story-photo { justify-self: center; width: auto; height: auto; max-width: 100%; max-height: min(90vh, 900px); border: var(--line); border-radius: 16px; }
.story-body, .story-rest { display: grid; gap: 1em; justify-items: start; }
.story-body { font-size: 1.12rem; line-height: 1.7; }
.story-body p, .about p { margin: 0; overflow-wrap: anywhere; }
.story-body h3, .about h3 { margin: .3em 0 0; font: 900 1.3rem/1.25 var(--body); }
.story-body h4, .about h4 { margin: .2em 0 0; font: 900 1.1rem/1.3 var(--body); }
.story-body a, .about a { font-weight: 800; text-decoration-thickness: 2px; text-underline-offset: 3px; overflow-wrap: anywhere; }

/* ---------- Photos ---------- */

.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 24px; margin: 0; padding: 6px 4px; list-style: none; }
.frame {
  position: relative;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 10px 10px 12px;
  background: var(--egg);
  border: var(--line);
  border-radius: 14px;
  box-shadow: var(--pop);
  transition: rotate .15s ease;
}
.frame:nth-child(3n + 1) { rotate: -1.2deg; }
.frame:nth-child(3n + 2) { rotate: .9deg; }
.frame:nth-child(3n) { rotate: -.5deg; }
.frame:hover, .frame:focus-within { rotate: 0deg; }
.frame-open { display: block; width: 100%; padding: 0; overflow: hidden; background: none; border: 0; border-radius: 8px; cursor: zoom-in; }
.frame-open img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.caption { margin: 0; font-weight: 700; line-height: 1.35; text-align: center; overflow-wrap: anywhere; }
.frame-tools { position: absolute; top: -12px; right: -8px; display: flex; gap: 6px; }

.frame.add { padding: 0; rotate: 0deg; background: rgba(255, 250, 240, .5); border-style: dashed; border-color: rgba(28, 24, 56, .5); box-shadow: none; }
.wall.dropping .frame.add { background: var(--egg); border-style: solid; border-color: var(--ink); }
.frame-add {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  width: 100%;
  min-height: 214px;
  padding: 16px;
  font: inherit;
  text-align: center;
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
}
.frame-add:hover:not(:disabled) { background: rgba(255, 250, 240, .8); }
.frame-add .ic { width: 2em; height: 2em; }
.frame-add span { font-size: .9rem; color: var(--ink-soft); }

dialog.viewer {
  width: min(1100px, 100vw);
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
  padding: 12px;
  overflow: visible;
  color: #fff;
  background: transparent;
  border: 0;
}
dialog.viewer[open] { display: grid; gap: 10px; justify-items: center; }
dialog.viewer::backdrop { background: rgba(18, 14, 52, .93); }
.viewer :focus-visible { outline-color: var(--yolk); }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.viewer-count { margin: 0; font-weight: 800; }
.viewer-fig { display: grid; gap: 10px; justify-items: center; margin: 0; }
.viewer-img { max-width: 100%; max-height: calc(100vh - 200px); max-height: calc(100dvh - 200px); background: #fff; border: 3px solid #fff; border-radius: 12px; }
.viewer-cap { max-width: 60ch; font-size: 1.1rem; font-weight: 700; text-align: center; overflow-wrap: anywhere; }
.viewer-nav { display: flex; gap: 12px; }

/* ---------- My Series ---------- */

.series { display: grid; grid-template-columns: minmax(0, 250px) minmax(0, 1fr); gap: clamp(18px, 3vw, 34px); align-items: start; }
.cover { aspect-ratio: 2 / 3; overflow: hidden; background: var(--space); border: var(--line); border-radius: 12px; box-shadow: var(--pop); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover.blank { display: grid; place-content: center; justify-items: center; gap: 12px; padding: 16px; text-align: center; color: #fff; }
.cover-mascot { width: 62%; }
.cover-title { font: 400 1.45rem/1.1 var(--display); overflow-wrap: anywhere; }

.series-info { display: grid; gap: 12px; justify-items: start; min-width: 0; }
.series-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; width: 100%; }
.series-info h2 { margin: 0; font: 400 clamp(1.8rem, 4.4vw, 2.7rem)/1.05 var(--display); text-wrap: balance; overflow-wrap: anywhere; }
.tagline { margin: 0; font-size: 1.2rem; font-weight: 800; line-height: 1.35; }
.about { display: grid; gap: .8em; max-width: 68ch; line-height: 1.65; }
.parts-head { margin: 10px 0 0; font: 400 1.25rem/1 var(--display); }
.parts { display: grid; gap: 10px; width: 100%; margin: 0; padding: 0; list-style: none; }
.part { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 14px; background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; }
.part-num { font: 400 .95rem/1.6 var(--display); white-space: nowrap; color: var(--comb); }
.part-main { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.part-title { margin: 0; font-size: 1.08rem; overflow-wrap: anywhere; }
.part-note { margin: 0; color: var(--ink-soft); white-space: pre-line; overflow-wrap: anywhere; }
.part-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; }

.pill { display: inline-block; padding: .15em .7em; font-size: .8rem; font-weight: 900; letter-spacing: .03em; white-space: nowrap; vertical-align: middle; border: 2px solid var(--ink); border-radius: 999px; }
.pill.writing { background: var(--yolk); }
.pill.planned { background: #e9e4f5; }
.pill.done { background: #c9efc4; }

.invite { display: grid; gap: 10px; justify-items: center; text-align: center; }
.invite-mascot { width: 120px; }
.invite h2 { margin: 0; font: 400 1.8rem/1.1 var(--display); }
.invite p { margin: 0; max-width: 52ch; }

/* ---------- Messages ---------- */

.chat { display: grid; gap: 16px; width: 100%; max-width: 760px; }
.bubbles { display: flex; flex-direction: column; gap: 10px; max-height: min(55vh, 520px); margin: 0; padding: 4px; overflow-y: auto; list-style: none; }
.bubble { max-width: min(85%, 60ch); padding: .5em .9em .4em; overflow-wrap: anywhere; border: 2.5px solid var(--ink); border-radius: 18px; }
.bubble-text { white-space: pre-wrap; }
.bubble time { display: block; margin-top: 2px; font-size: .75rem; font-weight: 700; opacity: .8; }
.bubble.me { align-self: flex-end; color: #fff; background: var(--ink); border-bottom-right-radius: 5px; }
.bubble.them { align-self: flex-start; background: #fff; border-bottom-left-radius: 5px; }

.chat-empty { display: grid; gap: 8px; justify-items: center; align-content: center; padding: 18px 8px; text-align: center; }
.chat-mascot { width: 110px; }
.chat-empty p { margin: 0; max-width: 40ch; font-weight: 700; }
.chat-closed { margin: 0; font-weight: 800; text-align: center; }

.composer { display: grid; gap: 12px; }
.composer-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.composer-foot .help { flex: 1 1 260px; }

.inbox-sheet { padding: 0; overflow: hidden; }
.inbox { display: grid; grid-template-columns: minmax(0, 310px) minmax(0, 1fr); min-height: 470px; }
.inbox-list { max-height: 660px; padding: 12px; overflow-y: auto; border-right: var(--line); }
.thread-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.thread {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  text-align: left;
  color: var(--ink);
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  cursor: pointer;
}
.thread:hover { background: var(--yolk-pale); }
.thread.current { background: var(--yolk); }
.thread-name { overflow: hidden; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.thread-when { font-size: .8rem; font-weight: 700; white-space: nowrap; color: var(--ink-soft); }
.thread-last { grid-column: 1 / -1; overflow: hidden; font-size: .92rem; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); }
.thread.unread .thread-last { font-weight: 800; color: var(--ink); }
.thread-new { grid-column: 1 / -1; justify-self: start; padding: .05em .6em; font-size: .75rem; font-weight: 900; color: #fff; background: var(--comb); border-radius: 999px; }

.pane { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 16px; }
.pane > .chat-empty { flex: 1; }
.pane .bubbles { flex: 1; }
.pane-head { display: flex; align-items: center; gap: 12px; }
.pane-who { flex: 1; min-width: 0; }
.pane-name { margin: 0; font: 400 1.5rem/1.1 var(--display); overflow-wrap: anywhere; }
.pane-name:focus { outline: none; }
.back { display: none; }

/* ---------- bottom of the page ---------- */

.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-block: 20px 28px; font-weight: 800; }
.foot p { margin: 0; }

.noscript { margin: 0; padding: 16px; font-weight: 800; text-align: center; }

.lost { display: grid; gap: 10px; place-content: center; justify-items: center; min-height: 100vh; padding: 24px; text-align: center; }
.lost h1 { margin: 0; font: 400 3rem/1 var(--display); }
.lost p { margin: 0; font-weight: 700; }

/* ---------- smaller screens ---------- */

@media (max-width: 1000px) {
  /* the game on top, the boxes in two columns underneath */
  .orbit { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "stage stage" "left right" "more more"; }
  .orbit.solo { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage"; }
}

@media (max-width: 720px) {
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .inbox-list { max-height: none; border-right: 0; }
  .inbox.reading .inbox-list { display: none; }
  .inbox:not(.reading) .pane { display: none; }
  .back { display: inline-flex; }
  .series { grid-template-columns: minmax(0, 1fr); }
  .cover { max-width: 230px; }
}

@media (max-width: 600px) {
  .orbit { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "left" "right" "more"; }
  .side.right .eyebrow { display: none; }
  .stage-edit { position: static; align-self: flex-start; margin: 0 18px 18px; }   /* under the words: no room beside the ribbon */
  .brand-mark { width: 60px; height: 60px; }
  .tabs a { padding-inline: .8em; }
  .part { grid-template-columns: minmax(0, 1fr) auto; }
  .part-num { grid-column: 1 / -1; }
  .dlg-head { padding-inline: 16px; }
  .dlg-body { padding-inline: 16px; }
  .dlg-foot { padding-inline: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .stage-mascot, .stars.far { animation: none; }
  .btn, .box-link, .brand-mark, .frame { transition: none; }
}
