/* =========================================================================
   playpile - app.css

   A cozy, cute dark dashboard for a small group curating a shared game list.
   Deep blue-violet ink, lilac panels, soft peach / mint / coral pastels,
   generously rounded shapes, and a few kaomoji. The templates carry the
   faces; .kao only makes them sit nicely on the baseline.

   Single dark theme. No build step: served exactly as written, embedded in
   the Go binary. No images, no external fonts, no imports.

   Sections
     1  tokens
     2  base
     3  chrome (header / footer / flash)
     4  buttons, badges and small bits
     5  landing, page heads, cards
     6  summary
     7  toolbar / search
     8  pile / entries (incl. the vetoed row state)
     9  chips (incl. chip--veto)
    10  vote (YES PLEASE / hard no pills)
    11  owners
    12  forms
    13  detail page
    14  members & invites
    15  utilities
    16  responsive
   ========================================================================= */

/* ---------------------------------------------------------------------
   1. Tokens
   Surfaces are a blue-violet ink with a lilac cast, never pure grey.
   Accent is warm peach; mint means yes, coral-pink means no (never
   fire-engine red - a hard no is information, not a fire alarm).
   Text contrast on --surface / --bg: --text 14.6:1, --muted 8.2:1,
   --faint 5.2:1; --accent 11.6:1, --up 12.0:1, --down 8.9:1.
   --------------------------------------------------------------------- */
:root {
  color-scheme: dark;

  --bg: #131122;
  --surface: #1b1830;
  --surface-2: #262140;
  --border: #352f52;
  --text: #efeafb;
  --muted: #b6aed4;
  --faint: #8f88b2;

  --accent: #ffc9a0;
  --accent-contrast: #2a1a0f;
  --up: #96e8bd;
  --up-ink: #0f2419;
  --down: #ff9fb0;
  --down-ink: #2b1016;
  --owned: #86d9a9;
  --warn: #f7d488;

  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1080px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono",
    monospace;

  /* two hover-border tints, kept as literals off the token names */
  --shadow-1: 0 1px 2px rgba(8, 4, 20, 0.35), 0 2px 10px rgba(8, 4, 20, 0.22);
  --shadow-2: 0 14px 34px rgba(8, 4, 20, 0.55);
  --shadow-lift: 0 6px 18px rgba(8, 4, 20, 0.45);
  --header-h: 62px;
}

/* ---------------------------------------------------------------------
   2. Base
   --------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

/* The texture is three cheap paint layers: a peach glow at the top, a
   lilac glow off to the right, and a 1px dot grid. It never sits behind
   a text run that is not already on a panel, and it costs no layout. */
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: radial-gradient(
      60rem 32rem at 50% -14rem,
      rgba(255, 201, 160, 0.08),
      transparent 70%
    ),
    radial-gradient(
      52rem 30rem at 100% -6rem,
      rgba(166, 148, 255, 0.1),
      transparent 70%
    ),
    radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 0);
  background-repeat: no-repeat, no-repeat, repeat;
  background-size: auto, auto, 22px 22px;
  color: var(--text);
  font-family: var(--font);
  font-feature-settings: "tnum" 1;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5em;
  line-height: 1.18;
  font-weight: 760;
  letter-spacing: -0.015em;
}

p {
  margin: 0 0 1em;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--accent);
  color: var(--accent-contrast);
}

/* Kaomoji (the templates' (^_^) style faces). They only look right in a
   monospace run, and they need a little more leading or the brackets clip. */
.kao {
  font-family: var(--mono);
  font-weight: 400;
  letter-spacing: 0;
  opacity: 0.9;
  line-height: 1.5;
  white-space: nowrap;
}

/* Focus rings: visible only for keyboard focus, always in the accent. */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Respect reduced-motion preference everywhere. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

.hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* ---------------------------------------------------------------------
   3. Chrome (header / footer / flash)
   --------------------------------------------------------------------- */
header.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(19, 17, 34, 0.86);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}

header.top .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-h);
}

a.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
}

a.brand:hover {
  text-decoration: none;
  color: var(--accent);
}

/* A tiny soft peach bead with a ring around it; it pulses open a little
   on hover, which is the whole brand animation budget. */
.brand-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff4e8, var(--accent) 72%);
  box-shadow: 0 0 0 3px rgba(255, 201, 160, 0.18),
    0 0 12px rgba(255, 201, 160, 0.4);
  flex: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

a.brand:hover .brand-dot {
  transform: scale(1.14);
  box-shadow: 0 0 0 4px rgba(255, 201, 160, 0.24),
    0 0 16px rgba(255, 201, 160, 0.5);
}

nav.top-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
}

nav.top-nav::-webkit-scrollbar {
  display: none;
}

nav.top-nav a {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.14s ease, background-color 0.14s ease,
    border-color 0.14s ease;
}

nav.top-nav a:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border);
  text-decoration: none;
}

.who {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex: none;
  font-size: 0.88rem;
  color: var(--muted);
}

.who img.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  box-shadow: 0 0 0 2px rgba(255, 201, 160, 0.14);
  flex: none;
}

.who-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 22ch;
}

form.logout {
  display: inline;
  margin: 0;
}

main {
  flex: 1 0 auto;
  padding: 30px 0 60px;
}

footer.site {
  border-top: 1px solid var(--border);
  padding: 22px 0;
  flex: none;
}

footer.site .muted {
  font-size: 0.85rem;
}

.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  margin-bottom: 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.92rem;
}

/* The only kaomoji the stylesheet adds, and it stays plain ASCII so any
   font can draw it. */
.flash.flash--ok {
  border-color: rgba(150, 232, 189, 0.4);
  background: rgba(150, 232, 189, 0.09);
  color: #cdf7e2;
}

.flash.flash--ok::before {
  content: "(o^_^o)";
  font-family: var(--mono);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.5;
  opacity: 0.9;
  flex: none;
}

.flash.flash--error {
  border-color: rgba(255, 159, 176, 0.42);
  background: rgba(255, 159, 176, 0.09);
  color: #ffd3da;
}

/* ---------------------------------------------------------------------
   4. Buttons, badges and small bits
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  transition: background-color 0.14s ease, border-color 0.14s ease,
    color 0.14s ease, transform 0.14s ease, box-shadow 0.14s ease;
}

.btn:hover {
  background: #2f2950;
  border-color: #453d69;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lift);
  text-decoration: none;
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn.btn-sm {
  min-height: 30px;
  padding: 0 13px;
  font-size: 0.82rem;
  border-radius: 999px;
}

.btn.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
  font-weight: 720;
}

.btn.btn-primary:hover {
  background: #ffd7b8;
  border-color: #ffd7b8;
  box-shadow: 0 6px 20px rgba(255, 201, 160, 0.22);
}

.btn.btn-ghost {
  background: transparent;
}

.btn.btn-ghost:hover {
  background: var(--surface-2);
  border-color: #453d69;
}

.btn.btn-danger {
  background: transparent;
  border-color: rgba(255, 159, 176, 0.5);
  color: #ffc4cd;
}

.btn.btn-danger:hover {
  background: rgba(255, 159, 176, 0.14);
  border-color: var(--down);
  box-shadow: 0 6px 18px rgba(255, 159, 176, 0.14);
}

/* Steam sign-in: a real, prominent primary action, still in our palette. */
.btn.btn-steam {
  min-height: 46px;
  padding: 0 24px;
  background: #1a1530;
  border: 1px solid #3a3160;
  color: #f3f0ff;
  font-size: 0.98rem;
  font-weight: 720;
  box-shadow: var(--shadow-1);
}

.btn.btn-steam:hover {
  background: #221b3d;
  border-color: #4d4278;
}

button.link,
.link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--accent);
  cursor: pointer;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

button.link:hover,
.link:hover {
  color: #ffd7b8;
}

.muted {
  color: var(--muted);
}

.faint {
  color: var(--faint);
}

.mono {
  font-family: var(--mono);
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.69rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  flex: none;
}

.badge--owner {
  border-color: rgba(255, 201, 160, 0.5);
  color: var(--accent);
  background: rgba(255, 201, 160, 0.1);
}

.badge--admin {
  border-color: rgba(207, 198, 240, 0.45);
  color: #cfc6f0;
  background: rgba(207, 198, 240, 0.1);
}

.badge--member {
  color: var(--muted);
}

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

.empty {
  text-align: center;
  padding: 44px 20px 48px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(27, 24, 48, 0.55);
  color: var(--muted);
}

/* Reserved slot, no content: a template may drop a kaomoji in here and it
   will never shove the text below it around. */
.empty::before {
  content: "";
  display: block;
  min-height: 14px;
}

.empty-title {
  color: var(--text);
  font-size: 1.12rem;
  font-weight: 760;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.empty-body {
  max-width: 46ch;
  margin: 0 auto 1em;
  font-size: 0.92rem;
}

/* ---------------------------------------------------------------------
   5. Landing, page heads, cards
   --------------------------------------------------------------------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 4px 0 20px;
}

.page-head h1 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
  overflow-wrap: break-word;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
  margin-bottom: 4px;
}

.page-head p {
  margin: 0;
  font-size: 0.9rem;
}

.page-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.hero {
  padding: 60px 0 44px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  max-width: 20ch;
  margin: 0 auto 0.35em;
}

/* One small ASCII face under the landing title. ASCII only, mono stack,
   so it renders in every font. */
.hero h1::after {
  content: "(^_^)";
  display: block;
  margin-top: 0.25em;
  font-family: var(--mono);
  font-size: 0.38em;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.6;
  color: var(--accent);
  opacity: 0.85;
}

.hero p.lede {
  color: var(--muted);
  font-size: clamp(1rem, 0.92rem + 0.3vw, 1.15rem);
  max-width: 56ch;
  margin: 0 auto 28px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 44px;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 26px;
  max-width: 760px;
  margin: 0 auto;
}

.hero-points li {
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: left;
  background-image: radial-gradient(
    circle,
    var(--accent) 0 2.5px,
    rgba(255, 201, 160, 0.28) 2.9px,
    transparent 3.6px
  );
  background-repeat: no-repeat;
  background-position: 0 0.6em;
  background-size: 10px 10px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px dashed var(--border);
}

.card-head h2,
.card-head h3 {
  margin: 0;
  font-size: 1.02rem;
}

.card-body {
  padding: 20px;
}

.card-title {
  overflow-wrap: break-word;
}

.card--danger {
  border-color: rgba(255, 159, 176, 0.35);
}

.card--danger .card-head {
  border-bottom-color: rgba(255, 159, 176, 0.25);
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  margin-bottom: 16px;
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

a.crew-card {
  display: block;
  color: var(--text);
  transition: transform 0.16s ease, border-color 0.16s ease,
    box-shadow 0.16s ease;
}

a.crew-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: rgba(255, 201, 160, 0.35);
  box-shadow: var(--shadow-2);
}

a.crew-card .card-body p {
  margin: 0;
  font-size: 0.88rem;
}

/* ---------------------------------------------------------------------
   6. Summary
   --------------------------------------------------------------------- */
.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: var(--shadow-1);
}

.stat {
  background: var(--surface);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--faint);
  font-weight: 600;
}

.stat-value {
  font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.72rem);
  font-weight: 780;
  letter-spacing: -0.02em;
  color: var(--text);
}

.stat-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

.stat--total .stat-value {
  color: var(--text);
}

.stat--me .stat-value {
  color: var(--accent);
}

.stat--group .stat-value {
  color: var(--text);
}

.stat--ready .stat-value {
  color: var(--up);
}

/* The note is rendered inside .summary, so it has to own a row of its own;
   without the span and a surface it shows the grid's border colour as a
   solid lavender bar. */
.summary-note {
  grid-column: 1 / -1;
  background: var(--surface);
  color: var(--faint);
  font-size: 0.8rem;
  margin: 0;
  padding: 10px 18px;
}

/* ---------------------------------------------------------------------
   7. Toolbar / search
   --------------------------------------------------------------------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.search {
  position: relative;
  flex: 1 1 280px;
  min-width: 200px;
  max-width: 440px;
}

.search-input {
  width: 100%;
}

/* Heavier than the generic input rules in section 12 so the pill wins. */
.search .search-input {
  border-radius: 999px;
  padding: 0 16px;
}

.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 360px;
  overflow-y: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2);
  padding: 6px;
}

.search-results.is-open {
  display: block;
}

button.result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  color: var(--text);
}

button.result:hover,
button.result:focus-visible {
  background: var(--surface);
}

.result-cover {
  width: 38px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  flex: none;
  background: var(--border);
}

.result-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex: none;
  font-size: 0.78rem;
}

.result-price {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.result-score {
  color: var(--muted);
}

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

a.filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  transition: color 0.14s ease, border-color 0.14s ease,
    background-color 0.14s ease, transform 0.14s ease, box-shadow 0.14s ease;
}

a.filter:hover {
  text-decoration: none;
  color: var(--text);
  border-color: #453d69;
  background: var(--surface-2);
  transform: translateY(-1px);
}

a.filter.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(255, 201, 160, 0.18);
}

.sorts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 0.82rem;
}

/* ---------------------------------------------------------------------
   8. Pile / entries
   --------------------------------------------------------------------- */
.pile {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

article.entry {
  display: grid;
  grid-template-columns: 132px 1fr auto;
  gap: 16px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color 0.14s ease, box-shadow 0.14s ease,
    opacity 0.14s ease;
}

article.entry:hover {
  border-color: rgba(255, 201, 160, 0.32);
  box-shadow: var(--shadow-1);
}

article.entry.is-played {
  opacity: 0.66;
}

article.entry.is-played:hover {
  opacity: 0.86;
}

article.entry.is-busy {
  opacity: 0.55;
  pointer-events: none;
}

/* A hard no is a veto: a quiet coral edge and a slightly quieter cover,
   never a banner. */
article.entry.is-vetoed {
  border-left: 3px solid rgba(255, 159, 176, 0.6);
  padding-left: 14px;
}

/* One divider marks where the disqualified games begin, so a long list does
   not read as "these are all fine" down to the last row. */
.veto-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 2px 4px;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.veto-divider::before,
.veto-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255, 159, 176, 0.45),
    transparent
  );
}

.veto-divider .kao {
  color: var(--down);
}

article.entry.is-vetoed a.entry-cover img {
  filter: saturate(0.85);
}

a.entry-cover {
  grid-row: 1 / span 2;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex: none;
}

a.entry-cover img {
  width: 132px;
  height: 62px;
  object-fit: cover;
  display: block;
  transition: transform 0.18s ease;
}

a.entry-cover:hover img {
  transform: scale(1.03);
}

.entry-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.entry-title {
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  overflow-wrap: break-word;
}

.entry-title:hover {
  color: var(--accent);
  text-decoration: none;
}

.entry-sub {
  color: var(--muted);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.entry-note {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
  overflow-wrap: break-word;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.entry-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 132px;
}

.entry-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.entry-actions form {
  display: inline-flex;
  margin: 0;
}

.entry-actions > form:first-child {
  flex: 1 1 220px;
  min-width: 0;
}

/* The note field is the input itself in the current markup, wrapped in a
   plain div in older markup: style both, the wrapper via its child. */
.entry-actions .note-input {
  flex: 1 1 200px;
  min-width: 0;
  min-height: 32px;
  padding: 0 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
}

.entry-actions .note-input::placeholder {
  color: var(--faint);
}

.entry-actions .note-input:hover {
  border-color: #453d69;
}

.entry-actions .note-input:focus-visible {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.note-input input {
  flex: 1 1 auto;
  min-width: 0;
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
  padding: 4px 0;
}

.note-input input:focus-visible {
  outline: none;
}

.stale {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -4px 0 18px;
}

.refresh {
  margin: 0;
}

.refresh-age {
  font-size: 0.8rem;
}

/* ---------------------------------------------------------------------
   9. Chips
   Pills, 1px tinted borders, pastel text. Everything pastel is light on
   a dark tint so it stays legible (>= 7:1 in practice).
   --------------------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1;
  gap: 4px;
  white-space: nowrap;
}

.chip.chip--meta.is-good {
  color: #b7f2d3;
  border-color: rgba(150, 232, 189, 0.45);
  background: rgba(150, 232, 189, 0.1);
}

.chip.chip--meta.is-mixed {
  color: #ffe3ae;
  border-color: rgba(247, 212, 136, 0.45);
  background: rgba(247, 212, 136, 0.1);
}

.chip.chip--meta.is-bad {
  color: #ffc4cd;
  border-color: rgba(255, 159, 176, 0.45);
  background: rgba(255, 159, 176, 0.1);
}

.chip.chip--review.is-positive {
  color: #b7f2d3;
  border-color: rgba(150, 232, 189, 0.4);
}

.chip.chip--review.is-mixed {
  color: #ffe3ae;
  border-color: rgba(247, 212, 136, 0.4);
}

.chip.chip--review.is-negative {
  color: #ffc4cd;
  border-color: rgba(255, 159, 176, 0.4);
}

.chip.chip--price {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.chip.chip--discount {
  color: var(--accent-contrast);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 750;
}

.chip.chip--free {
  color: #b7f2d3;
  border-color: rgba(150, 232, 189, 0.4);
  background: rgba(150, 232, 189, 0.08);
}

.chip.chip--owned {
  color: #b7f2d3;
  border-color: rgba(134, 217, 169, 0.5);
  background: rgba(134, 217, 169, 0.12);
}

.chip.chip--missing {
  color: var(--muted);
  border-style: dashed;
  background: transparent;
}

.chip.chip--soon {
  color: var(--warn);
  border-color: rgba(247, 212, 136, 0.4);
  background: rgba(247, 212, 136, 0.07);
}

.chip.chip--voted {
  color: var(--accent);
  border-color: rgba(255, 201, 160, 0.4);
  background: rgba(255, 201, 160, 0.08);
}

/* Veto count: coral-tinted, informative, deliberately calm. */
.chip.chip--veto {
  color: #ffc4cd;
  border-color: rgba(255, 159, 176, 0.38);
  background: rgba(255, 159, 176, 0.12);
  font-weight: 650;
}

/* ---------------------------------------------------------------------
   10. Vote
   Two labelled pills with the score between them. Unpressed pills are
   quiet ghosts; pressed ones are filled mint / coral. Hover only tints
   the border, so a stray hover never looks like a vote.
   --------------------------------------------------------------------- */
.vote {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vote form {
  margin: 0;
  display: inline-flex;
}

.vote-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.14s ease, border-color 0.14s ease,
    color 0.14s ease, transform 0.14s ease, box-shadow 0.14s ease;
}

.vote-btn:hover {
  color: var(--text);
  background: var(--surface-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-1);
}

.vote-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.vote-btn.up:hover {
  border-color: rgba(150, 232, 189, 0.55);
  color: #cdf7e2;
}

.vote-btn.down:hover {
  border-color: rgba(255, 159, 176, 0.55);
  color: #ffd3da;
}

.vote-btn.up[aria-pressed="true"] {
  background: var(--up);
  border-color: var(--up);
  color: var(--up-ink);
  box-shadow: 0 4px 14px rgba(150, 232, 189, 0.22);
}

.vote-btn.down[aria-pressed="true"] {
  background: var(--down);
  border-color: var(--down);
  color: var(--down-ink);
  box-shadow: 0 4px 14px rgba(255, 159, 176, 0.2);
}

.vote-btn .vote-label {
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
}

.vote-btn .kao {
  font-size: 0.82em;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.5;
  text-transform: none;
  opacity: 0.9;
}

.vote-score {
  min-width: 2.5ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 780;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--muted);
}

.vote-score[data-sign="pos"] {
  color: var(--up);
}

.vote-score[data-sign="neg"] {
  color: var(--down);
}

.vote-score[data-sign="zero"] {
  color: var(--muted);
}

/* ---------------------------------------------------------------------
   11. Owners
   --------------------------------------------------------------------- */
.owners {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.owners-row {
  display: flex;
  align-items: center;
}

.owner {
  position: relative;
  overflow: hidden;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--surface);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: -9px;
}

.owner:first-child {
  margin-left: 0;
}

.owner.owner--me {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--surface);
  box-shadow: 0 0 0 2px rgba(255, 201, 160, 0.22);
}

.owner.owner--more {
  background: var(--surface-2);
  border: 2px solid var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--muted);
}

/* The initial sits under the avatar and is never removed, so a bubble whose
   image fails to load just shows the letter again: no inline error handler,
   no extra JavaScript, nothing a strict CSP has to allow. The image carries
   no background of its own, so nothing paints over that fallback. */
.owner-initial {
  line-height: 1;
}

.owner img.owner-avatar {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.owners-label {
  font-size: 0.74rem;
  color: var(--faint);
}

.entry-mine {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  row-gap: 6px;
  text-align: right;
  justify-content: flex-end;
}

.entry-mine form {
  margin: 0;
}

.entry-mine.is-owned,
.entry-mine .is-owned {
  color: var(--owned);
  font-weight: 700;
}

/* ---------------------------------------------------------------------
   12. Forms
   --------------------------------------------------------------------- */
label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}

input[type="text"],
input[type="url"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 0 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font: inherit;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

textarea {
  min-height: 84px;
  padding: 10px 14px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

input:hover,
select:hover,
textarea:hover {
  border-color: #453d69;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) center, calc(100% - 14px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}

.field {
  flex: 1 1 200px;
  min-width: 0;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

/* ---------------------------------------------------------------------
   13. Detail page
   --------------------------------------------------------------------- */
.gamedetail {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: start;
  margin: 12px 0 30px;
}

img.detail-cover {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  box-shadow: var(--shadow-1);
}

.detail-body {
  min-width: 0;
}

.detail-title {
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2.05rem);
  font-weight: 780;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.detail-desc {
  max-width: 68ch;
  color: var(--muted);
  margin-bottom: 24px;
}

.detail-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 20px;
  margin: 0;
}

.detail-facts dt {
  color: var(--faint);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 650;
  white-space: nowrap;
}

.detail-facts dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: break-word;
}

.detail-side {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px 20px;
  margin: 18px 0 22px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.detail-side .owners,
.detail-side .entry-mine {
  align-items: flex-start;
  text-align: left;
}

.detail-side .owners-label {
  text-align: left;
}

.detail-side > .summary {
  flex: 1 1 320px;
  margin: 0;
}

/* ---------------------------------------------------------------------
   14. Members & invites
   --------------------------------------------------------------------- */
.members {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.member {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.member img.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  flex: none;
}

.member-name {
  font-weight: 650;
  margin-right: 4px;
  overflow-wrap: break-word;
  min-width: 0;
}

.member-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.member-actions form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.member-actions select {
  width: auto;
  min-width: 120px;
  min-height: 32px;
}

.invite-box {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
  border: 1px dashed rgba(255, 201, 160, 0.4);
  border-radius: var(--radius-sm);
  background: rgba(255, 201, 160, 0.06);
}

.invite-box p {
  margin: 0;
}

.invite-box .form-row {
  margin-bottom: 0;
}

.invite-box .invite-link {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.82rem;
}

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

.table th,
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.table th {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--faint);
  font-weight: 650;
}

.table tbody tr:hover {
  background: var(--surface-2);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* ---------------------------------------------------------------------
   15. Utilities
   --------------------------------------------------------------------- */
.flex {
  display: flex;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-sm {
  gap: 8px;
}

.gap-md {
  gap: 16px;
}

.center {
  text-align: center;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mt-0 {
  margin-top: 0;
}

.mb-0 {
  margin-bottom: 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------
   16. Responsive
   --------------------------------------------------------------------- */
@media (max-width: 900px) {
  .gamedetail {
    grid-template-columns: 1fr;
  }

  img.detail-cover {
    max-width: 220px;
  }

  /* The vote column would eat the title column here; the label carries
     the meaning, so the face goes. */
  .vote-btn .kao {
    display: none;
  }
}

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

  .grid--3 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 640px) {
  article.entry {
    grid-template-columns: 96px 1fr;
  }

  .entry-side {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px 14px;
    min-width: 0;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }

  .entry-side > * {
    flex: 0 1 auto;
  }

  .entry-mine {
    text-align: left;
    justify-content: flex-start;
  }

  .owners {
    align-items: flex-start;
  }

  .owners-label {
    white-space: normal;
  }

  a.entry-cover img {
    width: 96px;
    height: 45px;
  }

  .entry-actions > form:first-child {
    flex-basis: 100%;
  }

  .detail-side {
    padding: 14px;
  }
}

@media (max-width: 520px) {
  /* The header nav and the account line are the widest thing on a phone
     and were expanding the whole document. Let them collapse instead. */
  header.top .wrap {
    flex-wrap: wrap;
    gap: 10px;
  }

  header.top .top-nav {
    display: none;
  }

  header.top .who {
    margin-left: auto;
    min-width: 0;
  }

  .brand {
    font-size: 1rem;
  }

  /* Six columns of invite table do not fit a phone: give the table a fixed
     layout so it can never widen the page, and let cells wrap inside it. */
  .table {
    table-layout: fixed;
  }

  .table th,
  .table td {
    padding: 8px 6px;
    font-size: 0.82rem;
    overflow-wrap: anywhere;
  }

  .table th:first-child,
  .table td:first-child {
    width: 40%;
  }

  .table th:last-child,
  .table td:last-child {
    width: 26%;
  }
}

@media (max-width: 480px) {
  .wrap {
    padding: 0 14px;
  }

  header.top .wrap {
    gap: 14px;
  }

  .who span.who-name {
    display: none;
  }

  .hero {
    padding: 36px 0 28px;
  }

  .search {
    max-width: none;
    flex-basis: 100%;
  }

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

  .filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .stale {
    flex-wrap: wrap;
  }

  /* Keep the vote row on one line: the label stays, the face goes. */
  .vote {
    gap: 6px;
  }

  .vote-btn {
    padding: 0 11px;
  }

  .vote-btn .kao {
    display: none;
  }

  .entry-side {
    gap: 8px 12px;
  }

  .page-head {
    align-items: flex-start;
  }

  .member-name {
    font-size: 0.9rem;
  }
}

@media (max-width: 360px) {
  .summary {
    grid-template-columns: 1fr 1fr;
  }

  .stat {
    padding: 12px 14px;
  }

  article.entry {
    padding: 12px;
    gap: 12px;
  }

  .vote-btn {
    padding: 0 10px;
  }

  .vote-btn .vote-label {
    letter-spacing: 0.03em;
  }
}

/* Crew-maintained non-Steam game form. */
.manual-game { max-width: 760px; margin-inline:auto; padding:clamp(18px,4vw,32px); }
.manual-game-form { display:grid; gap:18px; }
.manual-game-form label { display:grid; gap:8px; }
.manual-game-form input, .manual-game-form textarea { width:100%; min-width:0; }
.manual-game-form textarea { resize:vertical; }
.manual-game-numbers { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
@media(max-width:560px) { .manual-game-numbers { grid-template-columns:1fr; } }
