/* Zero's Arcade (was Party Game Fiesta) - shared look for the player page, host page and games */

@font-face {
  font-family: "Lilita One";
  src: url("/fonts/lilita-one-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("/fonts/nunito-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --paper: #fff1d0;
  --paper-deep: #ffe3a6;
  --card: #fffdf6;
  --ink: #2b1340;
  --ink-soft: #6b5580;
  --pink: #ff3d7f;
  --teal: #12a594;
  --orange: #ff7a1a;
  --sun: #ffc530;
  --purple: #7b4dff;
  --green: #2f9e44;
  --red: #e03131;
  --line: 3px solid var(--ink);
  --pop: 5px 5px 0 var(--ink);
  --pop-small: 3px 3px 0 var(--ink);
  --radius: 18px;
  --display: "Lilita One", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --body: "Nunito", "Segoe UI", system-ui, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--body);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12px 14px, rgba(255, 61, 127, .22) 0 4px, transparent 4.5px),
    radial-gradient(circle at 62px 44px, rgba(18, 165, 148, .22) 0 3px, transparent 3.5px),
    radial-gradient(circle at 96px 88px, rgba(123, 77, 255, .18) 0 4px, transparent 4.5px),
    radial-gradient(circle at 30px 104px, rgba(255, 122, 26, .22) 0 3px, transparent 3.5px);
  background-size: 128px 128px;
}

/* ---- paper flags along the top ---- */
.bunting {
  height: 50px;
  background-repeat: repeat-x;
  background-position: center top;
  background-size: 300px 50px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='50' viewBox='0 0 300 50'%3E%3Cpath d='M0 5h300' stroke='%232b1340' stroke-width='2.5'/%3E%3Cg stroke='%232b1340' stroke-width='2' stroke-linejoin='round'%3E%3Cpath fill='%23ff3d7f' d='M3 5h54v28l-9 10-9-10-9 10-9-10-9 10-9-10z'/%3E%3Cpath fill='%23ffc530' d='M63 5h54v28l-9 10-9-10-9 10-9-10-9 10-9-10z'/%3E%3Cpath fill='%2312a594' d='M123 5h54v28l-9 10-9-10-9 10-9-10-9 10-9-10z'/%3E%3Cpath fill='%237b4dff' d='M183 5h54v28l-9 10-9-10-9 10-9-10-9 10-9-10z'/%3E%3Cpath fill='%23ff7a1a' d='M243 5h54v28l-9 10-9-10-9 10-9-10-9 10-9-10z'/%3E%3C/g%3E%3Cg fill='%23fff1d0' stroke='%232b1340' stroke-width='1.5'%3E%3Ccircle cx='30' cy='19' r='6'/%3E%3Cpath d='M90 12l7 7-7 7-7-7z'/%3E%3Ccircle cx='150' cy='19' r='6'/%3E%3Cpath d='M210 12l7 7-7 7-7-7z'/%3E%3Ccircle cx='270' cy='19' r='6'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---- header ---- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 1080px;
  margin: 0 auto;
  padding: 6px 16px 10px;
}
.logo {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(26px, 6vw, 40px);
  line-height: 1;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.logo b {
  font-weight: 400;
  color: var(--pink);
  text-shadow: 2px 2px 0 var(--ink);
  padding-right: 4px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  font-size: 14px;
  font-weight: 800;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 999px;
  white-space: nowrap;
}
.pill::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--ink);
}
.pill.bad::before { background: var(--red); }
.pill.wait::before { background: var(--sun); }

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 4px 16px 40px;
}

/* ---- building blocks ---- */
.card {
  background: var(--card);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--pop);
  padding: 16px;
  margin-bottom: 20px;
}
.card > h2 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: .3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card > h2 small {
  font-family: var(--body);
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-soft);
}
.muted { color: var(--ink-soft); font-size: 15px; }
.center { text-align: center; }

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 18px;
  font: inherit;
  font-weight: 900;
  color: var(--ink);
  background: var(--sun);
  border: var(--line);
  border-radius: 14px;
  box-shadow: var(--pop-small);
  cursor: pointer;
  text-decoration: none;
  transition: transform .06s, box-shadow .06s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn:focus-visible, input:focus-visible, .avatar-pick button:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
.btn.pink { background: var(--pink); color: #fff; }
.btn.teal { background: var(--teal); color: #fff; }
.btn.plain { background: var(--card); }
.btn.danger { background: var(--red); color: #fff; }
.btn.big { min-height: 56px; font-size: 20px; padding: 10px 26px; width: 100%; }
.btn.small { min-height: 34px; padding: 2px 12px; font-size: 14px; border-width: 2px; border-radius: 10px; box-shadow: 2px 2px 0 var(--ink); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

input[type="text"] {
  width: 100%;
  min-height: 48px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 800;
  color: var(--ink);
  background: #fff;
  border: var(--line);
  border-radius: 14px;
}
input[type="text"]::placeholder { color: #a797b5; font-weight: 600; }
label.field { display: block; font-weight: 900; margin-bottom: 6px; }

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

/* ---- avatars ---- */
.face {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  font-size: 22px;
  line-height: 1;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  background: var(--sun);
}
.face.big { width: 64px; height: 64px; font-size: 34px; border-width: 3px; }
.face.small { width: 28px; height: 28px; font-size: 15px; border-width: 2px; }

.avatar-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 8px;
  margin: 0 0 18px;
}
.avatar-pick button {
  aspect-ratio: 1;
  font-size: 24px;
  line-height: 1;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  cursor: pointer;
  padding: 0;
}
.avatar-pick button[aria-pressed="true"] {
  background: var(--sun);
  box-shadow: var(--pop-small);
  transform: translate(-2px, -2px);
}

/* ---- join screen ---- */
.join { max-width: 460px; margin: 16px auto 0; }
.join h2 { font-size: 30px; }
.join .field + input { margin-bottom: 16px; }

/* ---- lobby ---- */
.lobby {
  display: grid;
  gap: 0 20px;
  grid-template-columns: minmax(0, 1fr);
}
/* On a phone the cards are one list: you, games, players, chat, invite. */
.lobby > div { display: contents; }
.lobby .o1 { order: 1; }
.lobby .o2 { order: 2; }
.lobby .o3 { order: 3; }
.lobby .o4 { order: 4; }
.lobby .o5 { order: 5; }
@media (min-width: 860px) {
  .lobby { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
  .lobby > div { display: block; }
}

.me-strip { display: flex; align-items: center; gap: 12px; }
.me-strip .name { font-family: var(--display); font-size: 24px; line-height: 1.1; overflow-wrap: anywhere; }

.result {
  background: var(--sun);
  text-align: center;
}
.result .trophy { font-size: 40px; line-height: 1; }
.result .who { font-family: var(--display); font-size: 26px; line-height: 1.15; margin: 4px 0; overflow-wrap: anywhere; }

.players { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.players li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  min-width: 0;
}
.players li.off { opacity: .45; }
.players li.me { background: var(--paper-deep); }
.players .pname { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 900; }
.players .tag { flex: none; font-size: 13px; font-weight: 900; color: var(--ink-soft); white-space: nowrap; }
.players .wins { flex: none; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }
.players .acts { flex: none; display: flex; gap: 6px; }

.games { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.games li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 14px;
}
.games .gicon {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  font-size: 30px;
  background: var(--teal);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
}
.games li:nth-child(4n+2) .gicon { background: var(--pink); }
.games li:nth-child(4n+3) .gicon { background: var(--purple); }
.games li:nth-child(4n+4) .gicon { background: var(--orange); }
.games .gname { font-family: var(--display); font-size: 20px; line-height: 1.15; }
.games .gdesc { font-size: 14px; color: var(--ink-soft); }
.empty {
  padding: 18px 14px;
  text-align: center;
  color: var(--ink-soft);
  border: 2px dashed var(--ink-soft);
  border-radius: 14px;
}

.invite-link {
  display: block;
  padding: 10px 12px;
  font-weight: 900;
  font-size: 18px;
  background: #fff;
  border: 2px dashed var(--ink);
  border-radius: 12px;
  overflow-wrap: anywhere;
  user-select: all;
}
.qr {
  display: block;
  width: 180px;
  max-width: 100%;
  aspect-ratio: 1;
  background: #fff;
  border: var(--line);
  border-radius: 12px;
}

/* ---- chat ---- */
.chat-log {
  height: 220px;
  overflow-y: auto;
  padding: 8px 10px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 12px;
  margin-bottom: 10px;
  overscroll-behavior: contain;
}
.chat-log p { margin: 0 0 6px; overflow-wrap: anywhere; font-size: 16px; }
.chat-log p b { font-weight: 900; }
.chat-log p.sys { color: var(--ink-soft); font-size: 14px; font-style: italic; }

/* ---- game screen ---- */
.gamebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.gamebar .title { font-family: var(--display); font-size: 22px; line-height: 1.1; }
#game-root { min-height: 50vh; }

/* ---- full screen notices ---- */
.notice { max-width: 460px; margin: 40px auto; text-align: center; }
.notice .emoji { font-size: 56px; line-height: 1; }
.notice h2 { justify-content: center; font-size: 30px; margin-top: 8px; }

/* ---- toast ---- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 20px);
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  font-weight: 900;
  color: #fff;
  background: var(--ink);
  border-radius: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 50;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- host page ---- */
.host-grid { display: grid; gap: 0 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .host-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.power { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.linkbox { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.linkbox .grow { min-width: 220px; }
.linkbox .invite-link { font-size: 22px; margin-bottom: 10px; }
.step { margin: 0 0 12px; }
details { margin-top: 12px; font-size: 15px; }
details summary { cursor: pointer; font-weight: 900; }
details ul { margin: 8px 0 0; padding-left: 20px; }
details li { margin-bottom: 4px; overflow-wrap: anywhere; }
hr { border: 0; border-top: 2px dashed var(--ink-soft); margin: 16px 0; opacity: .5; }
code {
  font-family: Consolas, "Courier New", monospace;
  font-size: .9em;
  background: var(--paper-deep);
  padding: 1px 6px;
  border-radius: 6px;
  overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ================================================================
   Game site: top bar, game tiles, game page, pop-up windows
   ================================================================ */
a { color: inherit; }
a.logo { text-decoration: none; }

.site-top { flex-wrap: wrap; row-gap: 10px; }
.site-top .search {
  order: 3;
  flex: 1 1 100%;
  min-height: 44px;
  padding: 6px 16px;
  font: inherit;
  font-weight: 800;
  color: var(--ink);
  background: #fff;
  border: var(--line);
  border-radius: 999px;
}
.site-top .search::placeholder { color: #a797b5; font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 10px; }
@media (min-width: 760px) {
  .site-top { flex-wrap: nowrap; }
  .site-top .search { order: 0; flex: 1 1 auto; max-width: 360px; margin: 0 auto; }
}
.profile-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  font: inherit;
  font-weight: 900;
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.profile-chip .pc-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) { .profile-chip .pc-name { display: none; } }
.profile-chip:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }

/* category buttons */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 18px; }
.chip {
  appearance: none;
  min-height: 38px;
  padding: 4px 16px;
  font: inherit;
  font-weight: 900;
  font-size: 15px;
  color: var(--ink);
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; }
.chip:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }

/* game tiles */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px;
}
@media (min-width: 700px) { .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 22px; } }
.tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
  background: var(--card);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--pop);
  overflow: hidden;
  transition: transform .08s, box-shadow .08s;
}
.tile:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.tile:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.tile:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }
.thumb {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border-bottom: var(--line);
  overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-emoji { font-size: clamp(52px, 12vw, 76px); line-height: 1; filter: drop-shadow(3px 3px 0 rgba(43, 19, 64, .35)); }
.ribbon {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 1px 9px;
  font-size: 12px;
  font-weight: 900;
  color: var(--ink);
  background: var(--sun);
  border: 2px solid var(--ink);
  border-radius: 999px;
}
.tile-body { padding: 10px 12px 12px; }
.tile-name { font-family: var(--display); font-size: 19px; line-height: 1.15; overflow-wrap: anywhere; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.tagc {
  padding: 0 8px;
  font-size: 12px;
  font-weight: 900;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  white-space: nowrap;
}
.tagc.party { background: var(--pink); color: #fff; }
.tagc.idle { background: var(--teal); color: #fff; }
.tagc.mine { background: var(--sun); }
.tagc.pc { background: var(--ink); color: #fff; }
.ribbon.hid { background: var(--ink); color: #fff; }
.tile:has(.ribbon.hid) .thumb { filter: grayscale(.55); }

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--sun);
  text-decoration: none;
  font-weight: 900;
}

/* game page */
.gamebar { flex-wrap: wrap; }
.gamebar .title { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
#game-stage { margin-bottom: 20px; }
#game-stage:fullscreen { background: var(--paper); padding: 12px; overflow: auto; }
#game-root { min-height: 0; }
.frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100dvh - 150px);
  background: #111;
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--pop);
  overflow: hidden;
}
.frame iframe { display: block; width: 100%; height: 100%; border: 0; }
#game-stage:fullscreen .frame { height: 100%; max-height: none; aspect-ratio: auto; border: 0; border-radius: 0; box-shadow: none; }
.frame.fill { aspect-ratio: auto; height: calc(100dvh - 190px); min-height: 300px; max-height: none; }
@media (max-width: 759px) { body.in-game .frame.fill { height: calc(100dvh - 128px); border-width: 2px; border-radius: 12px; } }
.table { text-align: center; }
.table .big-emoji { font-size: 72px; line-height: 1; }
.table h2 { justify-content: center; font-size: 30px; margin: 6px 0; }
.table .faces { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 14px 0; }
.table .btn.big { max-width: 340px; }
.about h2 { font-size: 20px; }
.about p { margin: 0 0 10px; }
.about .howto { display: grid; gap: 10px; margin: 6px 0 4px; }
.about .howto section { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.10); border-radius: 12px; padding: 8px 12px; }
.about .howto h3 { font-family: var(--display); font-size: 16px; margin: 0 0 4px; }
.about .howto ul { margin: 0; padding-left: 20px; }
.about .howto li { margin: 2px 0; line-height: 1.4; }
.about .howto p { margin: 0; }
@media (min-width: 900px) { .about .howto { grid-template-columns: 1fr 1fr; } .about .howto .wide { grid-column: 1 / -1; } }

/* pop-up windows */
dialog.sheet {
  width: min(460px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 20px;
  color: var(--ink);
  background: var(--card);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--pop);
  overflow-y: auto;
}
dialog.sheet::backdrop { background: rgba(43, 19, 64, .6); }
.sheet h2 { margin: 0 0 10px; font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.1; }
.sheet h3 { margin: 18px 0 8px; font-family: var(--display); font-weight: 400; font-size: 20px; display: flex; justify-content: space-between; align-items: baseline; }
.sheet h3 small { font-family: var(--body); font-size: 14px; font-weight: 800; color: var(--ink-soft); }
.sheet-close { position: sticky; top: 0; float: right; margin: -4px -4px 0 8px; z-index: 2; }
.or { display: flex; align-items: center; gap: 12px; margin: 18px 0 12px; font-weight: 900; color: var(--ink-soft); }
.or::before, .or::after { content: ""; flex: 1; border-top: 2px dashed var(--ink-soft); opacity: .5; }
.party-code {
  margin: 4px 0 2px;
  font-family: var(--display);
  font-size: 68px;
  line-height: 1;
  letter-spacing: 8px;
  text-align: center;
  color: var(--pink);
  text-shadow: 3px 3px 0 var(--ink);
}
input.code-input { text-align: center; font-size: 24px; letter-spacing: 6px; font-family: var(--display); }
input.code-input::placeholder { font-family: var(--body); font-size: 16px; letter-spacing: 0; }
.sheet .chat-log { height: 150px; }
.sheet .me-strip { margin: 14px 0; padding: 8px 10px; background: var(--paper); border: 2px solid var(--ink); border-radius: 14px; }
.sheet .me-strip .name { font-size: 20px; }

/* While a game is open on a phone: small header, so the game gets the screen */
@media (max-width: 759px) {
  body.in-game .bunting { height: 20px; background-size: 120px 20px; }
  body.in-game .site-top { flex-wrap: nowrap; padding-top: 4px; padding-bottom: 6px; }
  body.in-game .site-top .search { display: none; }
  body.in-game .logo { font-size: 22px; }
  body.in-game #logo-first { display: none; }
  body.in-game .top-actions .btn { min-height: 38px; padding: 4px 12px; font-size: 15px; }
  body.in-game .top-actions .face { width: 36px; height: 36px; font-size: 19px; }
  body.in-game main { padding-top: 0; }
  body.in-game .gamebar { flex-wrap: nowrap; margin-bottom: 8px; gap: 8px; }
  body.in-game .gamebar .title { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
  body.in-game .gamebar .btn { flex: none; }
  body.in-game .gamebar a.btn { text-transform: capitalize; }
  body.in-game .lbl-long { display: none; }
  /* a running party game gets the whole screen: no About card, no extra space below */
  body.in-game.playing-party #game-about { display: none; }
  body.in-game.playing-party main { padding-bottom: 8px; }
  body.in-game.playing-party #game-stage { margin-bottom: 0; }
}

/* ---- host page: games on the site ---- */
.games-admin { margin-top: 0; }
.admin-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 4px 0 14px; }
.admin-bar .search { flex: 1 1 220px; min-height: 42px; padding: 6px 16px; font: inherit; font-weight: 800; color: var(--ink); background: #fff; border: var(--line); border-radius: 999px; }
.admin-bar .chips { margin: 0; }
.games.admin { grid-template-columns: repeat(auto-fill, minmax(min(100%, 430px), 1fr)); }
.games.admin li { gap: 10px; }
.games.admin li.is-hidden { background: #efe8f2; border-style: dashed; }
.games.admin li.is-hidden .gicon { filter: grayscale(.7); opacity: .75; }
.switch {
  appearance: none;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 112px;
  min-height: 40px;
  padding: 4px 12px 4px 6px;
  font: inherit;
  font-weight: 900;
  font-size: 14px;
  color: #fff;
  background: var(--teal);
  border: var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.switch .knob { width: 26px; height: 26px; background: #fff; border: 2.5px solid var(--ink); border-radius: 50%; }
.switch[aria-checked="false"] { flex-direction: row-reverse; padding: 4px 6px 4px 12px; color: var(--ink); background: #d9d2e0; }
.switch:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
.admin-foot { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .admin-foot { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; } }
.admin-foot .check { display: flex; align-items: center; gap: 10px; font-weight: 900; cursor: pointer; }
.admin-foot .check input { width: 20px; height: 20px; accent-color: var(--teal); }
.testers b { font-family: var(--display); font-weight: 400; font-size: 20px; }
.testers p { margin: 4px 0 8px; }
.testers .invite-link { font-size: 15px; }

/* ---- who's playing? ---- */
.who-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.who-pick { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; font: inherit; font-weight: 900; color: var(--ink); background: var(--card); border: var(--line); border-radius: var(--radius); box-shadow: var(--pop-small); cursor: pointer; }
.who-pick:hover { background: var(--paper-deep); }
.who-pick:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
.who-pick .face { width: 56px; height: 56px; font-size: 30px; }
.who-pick span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#who-new { width: 100%; }


/* ================================================================
   Zero's Arcade: cozy, dark, blues and purples (October 2026).
   Everything above stays as the layout; this part sets the look.
   Games keep their own light look inside #game-root.
   ================================================================ */
@font-face {
  font-family: "Fredoka";
  /* from the internet; Nunito (on this PC) is used when there is no internet */
  src: url("/fonts/fredoka-latin-wght-normal.woff2") format("woff2"),
       url("https://fonts.gstatic.com/s/fredoka/v17/X7n64b87HvSqjb_WIi2yDCRwoQ_k7367_DWu89U.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
:root {
  --paper: #0d1226;          /* the room: nearly black blue */
  --paper-deep: #1c2446;     /* raised and hover */
  --card: #151c36;           /* panels: dark blue */
  --field: #0a0f20;          /* inputs and lists */
  --ink: #e8ecfa;            /* text */
  --ink-soft: #9ba5c7;
  --pink: #8fbfff;           /* main accent: soft moonlight blue */
  --teal: #a993ff;           /* second accent: lavender */
  --orange: #ff9f6b;
  --sun: #2e2558;            /* plain buttons and highlights: dusky purple */
  --purple: #8fbfff;         /* focus rings */
  --green: #6fdba8;
  --red: #ff6b81;
  --on-accent: #0d1226;      /* text on the accent colors */
  --edge: rgba(156, 190, 255, .14);
  --line: 1px solid var(--edge);
  --pop: 0 14px 34px -16px rgba(0, 0, 0, .75);
  --pop-small: 0 6px 16px -8px rgba(0, 0, 0, .7);
  --radius: 18px;
  --display: "Fredoka", "Nunito", "Arial Rounded MT Bold", sans-serif;
  color-scheme: dark;
}
body {
  font-weight: 500;
  background-color: var(--paper);
  background-image:
    radial-gradient(900px 420px at 85% -140px, rgba(143, 191, 255, .13), transparent 70%),
    radial-gradient(700px 520px at -10% 35%, rgba(124, 88, 214, .14), transparent 70%);
  background-size: auto;
  background-attachment: fixed;
}
.bunting { display: none; }
.top { padding-top: 18px; }
.logo { text-transform: none; font-weight: 600; letter-spacing: .2px; }
.logo b { font-weight: 600; color: var(--pink); text-shadow: none; }
.card > h2, .sheet h2, .sheet h3, .tile-name, .gamebar .title, .games .gname, .me-strip .name, .result .who, .testers b, .table h2 { font-weight: 600; }

.btn { font-weight: 700; border: var(--line); box-shadow: none; transition: background .15s, transform .15s, filter .15s; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn.pink, .btn.teal { color: var(--on-accent); border-color: transparent; }
.btn.plain { background: var(--card); }
.btn.danger { color: var(--on-accent); }
.btn.small { border-width: 1px; box-shadow: none; }

input[type="text"], .site-top .search, .admin-bar .search { color: var(--ink); background: var(--field); border: var(--line); font-weight: 600; }
input[type="text"]::placeholder, .site-top .search::placeholder { color: var(--ink-soft); }
input[type="text"]:focus, .site-top .search:focus { border-color: var(--pink); outline: none; }

.face { border: 2px solid rgba(255, 255, 255, .14); }
.avatar-pick button { background: var(--field); border: var(--line); }
.avatar-pick button[aria-pressed="true"] { background: var(--paper-deep); border-color: var(--pink); box-shadow: 0 0 0 2px var(--pink); transform: none; }

.card { box-shadow: var(--pop); }
.players li, .games li { background: var(--field); border: var(--line); }
.players li.me { background: var(--paper-deep); }
.chat-log, .invite-link { background: var(--field); border: 1px solid var(--edge); }
.invite-link { border-style: dashed; }
.qr { background: #fff; }
.empty { border-color: var(--edge); }
code { background: var(--paper-deep); }
hr { border-top-color: var(--edge); opacity: 1; }

.chip { font-weight: 700; color: var(--ink-soft); background: transparent; border: var(--line); }
.chip[aria-pressed="true"] { color: var(--ink); background: var(--paper-deep); border-color: rgba(143, 191, 255, .4); }

.tile { box-shadow: var(--pop-small); transition: transform .18s, border-color .18s, box-shadow .18s; }
.tile:hover { transform: translateY(-3px); border-color: rgba(143, 191, 255, .4); box-shadow: var(--pop); }
.tile:active { transform: translateY(0); box-shadow: var(--pop-small); }
.thumb { border-bottom: var(--line); }
.thumb-emoji { filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .45)); }
.ribbon { font-weight: 700; color: var(--ink); background: rgba(13, 18, 38, .72); border: 1px solid var(--edge); backdrop-filter: blur(4px); }
.ribbon.hid { background: var(--teal); color: var(--on-accent); }
.tagc { font-weight: 700; color: var(--ink-soft); background: transparent; border: 1px solid var(--edge); }
.tagc.party { color: var(--pink); background: rgba(143, 191, 255, .12); border-color: transparent; }
.tagc.idle { color: var(--teal); background: rgba(169, 147, 255, .14); border-color: transparent; }
.tagc.mine { color: var(--ink); background: var(--sun); border-color: transparent; }
.tagc.pc { color: var(--ink); background: var(--paper-deep); border-color: transparent; }
.banner { background: linear-gradient(110deg, var(--sun), var(--card)); }
.result { background: var(--sun); }

dialog.sheet { box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8); }
dialog.sheet::backdrop { background: rgba(5, 8, 20, .72); backdrop-filter: blur(3px); }
.or::before, .or::after { border-top: 1px solid var(--edge); opacity: 1; }
.party-code { color: var(--pink); text-shadow: 0 0 28px rgba(143, 191, 255, .35); }
.sheet .me-strip { background: var(--field); border: var(--line); }

#toast { color: var(--on-accent); background: var(--ink); font-weight: 700; }

.games .gicon { border: 0; }
.games.admin li.is-hidden { background: var(--card); }
.switch { color: var(--on-accent); border: var(--line); }
.switch .knob { border: 0; }
.switch[aria-checked="false"] { color: var(--ink); background: var(--paper-deep); }
.who-pick { background: var(--field); box-shadow: none; }
.who-pick:hover { background: var(--paper-deep); border-color: rgba(143, 191, 255, .4); }

/* Each game keeps its own look: a calm, light stage with the colors the games were made with. */
#game-root {
  --paper: #eef0fa;
  --paper-deep: #dfe3f5;
  --card: #ffffff;
  --field: #ffffff;
  --ink: #1b1f3a;
  --ink-soft: #5a6280;
  --pink: #ff3d7f;
  --teal: #12a594;
  --orange: #ff7a1a;
  --sun: #ffc530;
  --purple: #7b4dff;
  --green: #2f9e44;
  --red: #e03131;
  --on-accent: #ffffff;
  --edge: rgba(27, 31, 58, .18);
  --line: 3px solid var(--ink);
  --pop: 5px 5px 0 var(--ink);
  --pop-small: 3px 3px 0 var(--ink);
  color-scheme: light;
  color: var(--ink);
  background: var(--paper);
  border-radius: var(--radius);
  padding: 12px;
}
#game-root:has(> .frame) { background: transparent; padding: 0; }
#game-root .btn { border: var(--line); box-shadow: var(--pop-small); }
#game-root .btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
#game-root .card { box-shadow: var(--pop); }
#game-root .players li, #game-root .games li, #game-root .chat-log { border: 2px solid var(--ink); }
#game-root .face { border: 2.5px solid var(--ink); }
#game-stage:fullscreen { background: var(--paper); }
@media (max-width: 759px) { body.in-game #game-root { padding: 6px; border-radius: 12px; } }

/* ---- PINs ---- */
.pin-strip { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 10px 12px; border: var(--line); border-radius: var(--radius); background: var(--field, var(--card)); font-weight: 900; }
.pin-face { display: flex; justify-content: center; margin-bottom: 6px; }
.pin-face .face { width: 64px; height: 64px; font-size: 36px; }
#pin-dialog h2 { justify-content: center; text-align: center; }
#pin-text { text-align: center; }
.pin-error { margin: 0 0 10px; text-align: center; font-weight: 900; color: #ff8fa3; }
.who-list .who-pick small { font-size: 12px; color: var(--ink-soft); font-weight: 900; }
.note { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--paper-deep); font-weight: 900; }
#notice-button { margin-top: 12px; }

/* tags: a row of tag buttons under the categories, and tappable tags on each tile */
.chips:has(+ .tag-chips:not([hidden])) { margin-bottom: 10px; }
.tag-chips { align-items: center; gap: 6px; }
.tag-label { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-right: 2px; }
.chip.tag-chip { min-height: 32px; padding: 2px 12px; font-size: 13.5px; }
.tag-chips.shut { max-height: 36px; overflow: hidden; }
.chip.tag-chip[aria-pressed="true"] { color: var(--on-accent, #0d1226); background: var(--pink); border-color: transparent; }
.tag-chips:has(+ .tags-more:not([hidden])) { margin-bottom: 6px; }
.tags-more { appearance: none; display: block; margin: 0 0 14px; padding: 4px 0; font: inherit; font-size: 13px; font-weight: 700; color: var(--pink); background: none; border: 0; cursor: pointer; }
.tags-more[hidden] { display: none; }
.tags-more:hover { text-decoration: underline; }
.tags-more:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
.tagc.tagx { cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.tagc.tagx:hover { color: var(--ink); border-color: rgba(143, 191, 255, .5); }
.tagc.tagx[aria-pressed="true"] { color: var(--on-accent, #0d1226); background: var(--pink); border-color: transparent; }
.tagc.tagx:focus-visible { outline: 2px solid var(--purple); outline-offset: 1px; }
/* phones: the tag row scrolls sideways instead of taking half the screen */
@media (max-width: 700px) {
  .tag-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 2px 16px; scroll-padding: 0 16px; }
  .tag-chips::-webkit-scrollbar { display: none; }
  .tag-chips > * { flex: none; }
}

/* host page: blocked words */
.word-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 260px; overflow-y: auto; }

/* Coins: chip in the header + the coins window */
.coin-chip {
  appearance: none; position: relative; display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 4px 14px; border-radius: 999px; cursor: pointer;
  font: inherit; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap;
  color: #ffd76b; background: rgba(255, 199, 66, .1); border: 1px solid rgba(255, 199, 66, .35);
}
.coin-chip:hover { background: rgba(255, 199, 66, .18); }
.coin-chip:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
.coin-chip.bump { animation: coin-bump .5s ease; }
.coin-pop { position: absolute; right: 6px; top: -4px; color: #ffd76b; font-weight: 900; pointer-events: none; animation: coin-pop 1.3s ease-out forwards; }
@keyframes coin-bump { 30% { transform: scale(1.12); } }
@keyframes coin-pop { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-26px); } }
@media (max-width: 759px) { body.in-game .coin-chip { min-height: 38px; padding: 4px 10px; font-size: 15px; } }
.coin-big { font-family: var(--display); font-size: 44px; font-weight: 600; color: #ffd76b; margin: 0 0 6px; font-variant-numeric: tabular-nums; }
.coin-meter { height: 10px; border-radius: 999px; background: var(--field); border: var(--line); overflow: hidden; }
.coin-meter > div { height: 100%; width: 0; background: linear-gradient(90deg, #ffb84d, #ffd76b); border-radius: 999px; transition: width .4s; }
.coin-top li .rank { flex: none; width: 22px; text-align: center; font-weight: 900; color: var(--ink-soft); }
@media (prefers-reduced-motion: reduce) { .coin-chip.bump, .coin-pop { animation: none; } }
@media (max-width: 520px) {
  .site-top .top-actions { gap: 8px; }
  #whats-new .lbl-long { display: none; }     /* room for the coins on small phones */
  .coin-chip { padding: 4px 10px; }
}
