:root {
  color-scheme: dark;
  --background: #10171a;
  --surface: #1a2529;
  --border: #304044;
  --text: #f4f7f6;
  --muted: #b3c2c2;
  --accent: #c7f67f;
  --accent-ink: #c7f67f;
  --on-accent: #15202b;
  --backdrop: #0b1114;
  --gallery: #233438;
  font: 16px/1.45 "Segoe UI", system-ui, sans-serif;
}
html[data-theme="night"] {
  --background: #171727;
  --surface: #222339;
  --border: #373951;
  --text: #f7f5ff;
  --muted: #bdbbd5;
  --backdrop: #101120;
  --gallery: #282b47;
}
html[data-theme="day"] {
  color-scheme: light;
  --background: #f7f8f3;
  --surface: #fff;
  --border: #dadfd2;
  --text: #202920;
  --muted: #536052;
  --backdrop: #eaece4;
  --gallery: #ebeee5;
  --accent-ink: #3c5b1a;
}
html[data-accent="mint"] { --accent: #84edc7; --accent-ink: #84edc7; }
html[data-accent="blue"] { --accent: #a3cdff; --accent-ink: #a3cdff; }
html[data-accent="violet"] { --accent: #cfb9ff; --accent-ink: #cfb9ff; }
html[data-accent="rose"] { --accent: #ffb8cd; --accent-ink: #ffb8cd; }
html[data-theme="day"][data-accent="mint"] { --accent-ink: #176648; }
html[data-theme="day"][data-accent="blue"] { --accent-ink: #225780; }
html[data-theme="day"][data-accent="violet"] { --accent-ink: #604292; }
html[data-theme="day"][data-accent="rose"] { --accent-ink: #823b60; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--text); background: var(--backdrop); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: var(--text); }
button:disabled { opacity: .6; cursor: wait; }
button:focus-visible, a:focus-visible, select:focus-visible, textarea:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 3px;
}
.shell {
  width: min(100%, 31rem);
  min-height: 100dvh;
  margin: auto;
  padding: 0 1rem calc(6rem + env(safe-area-inset-bottom));
  background: var(--background);
}
.icon-button, .secondary, .menu-item {
  border: 1px solid var(--border);
  background: var(--surface);
}
.icon-button { border-radius: .8rem; min-width: 2.5rem; min-height: 2.5rem; font-weight: 700; }
main { padding: max(1.2rem, env(safe-area-inset-top)) 0 .8rem; outline: none; }
h1 { margin: 0 0 1rem; font-size: 1.65rem; line-height: 1.15; letter-spacing: -.035em; }
h2 { margin: 0 0 .6rem; font-size: 1.45rem; line-height: 1.2; overflow-wrap: anywhere; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.card, .panel {
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: var(--surface);
}
.card { overflow: hidden; }
.panel, .details { padding: 1rem; }
.launch-panel { margin-top: .5rem; }
.launch-panel progress { display: block; width: 100%; margin: .45rem 0 1rem; accent-color: var(--accent-ink); }
.launch-panel .hint { margin-bottom: 0; }
.feed-filters { margin-bottom: .75rem; }
.urgent-games { display: grid; gap: .35rem; max-height: 13rem; overflow-y: auto; margin: .55rem 0 1rem; }
.details p { margin-bottom: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }
.card-reason { margin: 0 0 .75rem; color: var(--muted); font-size: .85rem; }
#sandbox-label { padding-top: .75rem; }
#tabs button[data-page="matches"] { position: relative; }
[data-incoming-count] { position: absolute; top: .15rem; right: .3rem; font-weight: 700; }
.gallery { position: relative; background: var(--gallery); }
.gallery img {
  display: block;
  width: 100%;
  height: clamp(12rem, 46vh, 24rem);
  object-fit: contain;
}
.slide {
  position: absolute;
  right: .75rem;
  bottom: .75rem;
  display: flex;
  align-items: center;
  border: 1px solid #627477;
  border-radius: 2rem;
  background: #111a1bee;
  color: #f4f7f6;
  font-variant-numeric: tabular-nums;
}
.slide button { width: 2.35rem; height: 2.35rem; background: transparent; border: 0; font-size: 1.6rem; color: inherit; }
.slide span { min-width: 2rem; text-align: center; font-size: .8rem; }
.actions { display: flex; gap: .5rem; margin-top: .8rem; }
.primary, .secondary, .menu-item {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.75rem;
  border-radius: .8rem;
  padding: .55rem .8rem;
  font-weight: 690;
  text-decoration: none;
}
.primary { background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); }
.actions .primary, .actions .secondary { flex: 1; }
.menu { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .55rem; }
.menu-item { min-height: 2.5rem; }
form { display: grid; gap: .85rem; }
label { display: grid; gap: .32rem; color: var(--muted); font-size: .9rem; }
select, textarea, input[type="search"] {
  width: 100%;
  color: var(--text);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: .65rem;
  padding: .65rem;
}
textarea { min-height: 4.25rem; resize: vertical; }
.switch { display: flex; align-items: center; gap: .65rem; margin: 1rem 0 0; font-size: .95rem; }
.switch input { width: 1rem; height: 1rem; accent-color: var(--accent); }
#status { min-height: 1.5rem; margin: .65rem 0 0; color: var(--accent-ink); font-size: .9rem; overflow-wrap: anywhere; }
nav {
  position: fixed;
  z-index: 2;
  bottom: 0;
  left: 50%;
  width: min(100%, 31rem);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(var(--tab-count, 4), minmax(0, 1fr));
  padding: .35rem .75rem calc(.35rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--background);
}
nav button {
  min-height: 3rem;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: .1rem;
  border: 0;
  border-radius: .75rem;
  background: transparent;
  color: var(--muted);
  font-size: clamp(.65rem, 2.7vw, .76rem);
  padding: 0 .125rem;
}
nav button span { font-size: 1.2rem; line-height: 1; }
nav button[aria-current] { color: var(--accent-ink); background: var(--surface); }

.section-stack { display: grid; gap: .9rem; }
.category { color: var(--muted); font-size: .88rem; font-weight: 650; margin: .95rem 0 .45rem; }
.choice-grid { display: flex; flex-wrap: wrap; gap: .45rem; }
.choice {
  border: 1px solid var(--border);
  background: var(--background);
  border-radius: .7rem;
  min-height: 2.4rem;
  padding: .4rem .6rem;
  font-size: .88rem;
}
.choice[aria-pressed="true"] { border-color: var(--accent-ink); color: var(--accent-ink); font-weight: 700; }
.swatch { display: inline-block; width: .75rem; height: .75rem; border-radius: 50%; margin-right: .35rem; background: var(--sample); }
.swatch[data-option="lime"] { --sample: #a5db55; }
.swatch[data-option="mint"] { --sample: #55cba1; }
.swatch[data-option="blue"] { --sample: #6bafff; }
.swatch[data-option="violet"] { --sample: #b291f8; }
.swatch[data-option="rose"] { --sample: #ee92b1; }
.games-list { max-height: 12rem; overflow: auto; padding: .15rem; display: grid; gap: .5rem; }
.games-list .switch { margin: 0; }
.readable { white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-tabs { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .8rem; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.metric { padding: .75rem; background: var(--background); border-radius: .7rem; border: 1px solid var(--border); }
.metric span, .hint { display: block; color: var(--muted); font-size: .82rem; }
.metric strong { display: block; font-size: 1.2rem; font-weight: 700; }
.admin-row { display: grid; gap: .3rem; padding: .75rem 0; border-bottom: 1px solid var(--border); }
.admin-row:last-child { border-bottom: 0; }
.admin-row p { margin: 0; }
.small-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.admin-search { display: flex; gap: .45rem; margin-bottom: .6rem; }
.admin-search input { min-width: 0; }
.participant-header { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.participant-header > div { min-width: 0; }
.participant-header h2 { margin: 0; }
.participant-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 2.75rem;
  border-radius: 50%;
  background: var(--gallery);
  border: 1px solid var(--border);
  font-size: .9rem;
  font-weight: 700;
}
.participant-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.activity-channels { color: var(--accent-ink); font-weight: 650; }
.activity-daily summary { cursor: pointer; font-weight: 650; }
.activity-daily table { width: 100%; margin-top: .6rem; border-collapse: collapse; font-size: .85rem; }
.activity-daily th, .activity-daily td { text-align: left; border-bottom: 1px solid var(--border); padding: .35rem; }
.like-sections { margin-bottom: .85rem; }
.game-notification { padding-left: .75rem; margin-top: .65rem; }
.onboarding-funnel { border-top: 1px solid var(--border); padding-top: .8rem; }
.onboarding-funnel h2 { font-size: 1.2rem; }
.onboarding-funnel > .hint { margin-top: .6rem; }
.funnel-step { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .25rem .55rem; margin: .5rem 0; font-size: .88rem; }
.funnel-step progress { grid-column: 1 / -1; width: 100%; height: .55rem; accent-color: var(--accent-ink); }
@media (max-width: 360px) {
  nav { padding-inline: .25rem; }
  nav button { letter-spacing: -.015em; }
}
