:root {
  --bg: #f6f2ec;
  --card: #fffdfa;
  --ink: #1f2233;
  --muted: #676a78;
  --line: #e9e3da;
  --soft: #f1ece4;
  --accent: #e8553f;
  --accent-soft: #fde9e4;
  --accent-ink: #ba4432; /* the accent as small text: AA on the light and pink backgrounds */
  --good: #187959;
  --bad: #af3d33;
  --focus: #2f6fde;
  --shadow: 0 1px 2px rgba(31, 34, 51, 0.04), 0 8px 24px rgba(31, 34, 51, 0.06);
  --r: 16px;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  line-height: 1.5;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  -webkit-tap-highlight-color: transparent;
}
button:disabled {
  cursor: default;
}
input {
  font: inherit;
  color: inherit;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
.grow {
  flex: 1;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}
.center {
  text-align: center;
}
.emoji {
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}

/* ---------- frame ---------- */
.top {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 18px 0;
}
.brand {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 15px;
  cursor: default;
}
.net {
  font-size: 12px;
  color: var(--bad);
}
.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 18px 48px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card h2 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
}
.card h2 small {
  color: var(--muted);
  font-weight: 400;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  background: var(--soft);
  font-weight: 600;
  transition: transform 0.08s, background 0.15s, opacity 0.15s;
}
.btn:active:not(:disabled) {
  transform: scale(0.98);
}
.btn.primary {
  background: var(--ink);
  color: #fff;
}
.btn.primary:hover:not(:disabled) {
  background: #33374f;
}
.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
}
.btn.ghost:hover:not(:disabled) {
  background: var(--soft);
}
.btn.small {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 10px;
}
.btn.wide {
  width: 100%;
  margin-top: 14px;
}
.btn:disabled {
  opacity: 0.4;
}
.chip {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.chip.on {
  color: var(--ink);
  background: var(--soft);
  border-color: transparent;
}
.chip.quiet {
  cursor: default;
}
.x {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 18px;
}
.x:hover {
  background: var(--soft);
  color: var(--bad);
}
.tag {
  font-style: normal;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  white-space: nowrap;
}
.tag.host {
  background: #fff4d6;
  color: #8a5f00;
}
.tag.off {
  color: var(--bad);
}
.tag.lie {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.tag.dish {
  background: #e3f5ee;
  color: var(--good);
}

/* ---------- avatars ---------- */
.av {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--av, var(--c));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex: none;
}
.av.lg {
  width: 44px;
  height: 44px;
  font-size: 18px;
}
.who {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.who > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.who em {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
  margin-left: 4px;
}

/* ---------- home ---------- */
.hero {
  text-align: center;
  padding: 28px 0 22px;
}
.hero h1 {
  font-size: 40px;
  letter-spacing: 0.02em;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
.hero .mark {
  font-size: 36px;
}
.tagline {
  font-size: 17px;
  margin-top: 4px;
}
.lead {
  color: var(--muted);
  max-width: 480px;
  margin: 10px auto 0;
  font-size: 14px;
}
.entry {
  max-width: 420px;
  margin: 0 auto;
}
.entry label {
  font-size: 13px;
  color: var(--muted);
}
.entry input {
  width: 100%;
  height: 46px;
  margin-top: 6px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  outline: none;
  font-size: 16px;
}
.entry input:focus {
  border-color: var(--ink);
}
.entry input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}
.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 12px;
  color: var(--muted);
  font-size: 12px;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--line);
}
.joinrow {
  display: flex;
  gap: 8px;
}
.joinrow input {
  margin: 0;
}
.joinrow .btn {
  flex: none;
  height: 46px;
  white-space: nowrap;
}
input.code {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-weight: 700;
  text-align: center;
}
.catalog {
  margin-top: 34px;
}
.cathead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.cathead h2 {
  margin-bottom: 0 !important;
}
.filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.catalog h2 {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.gcard {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px;
  border-radius: var(--r);
  background: var(--card);
  border: 1px solid var(--line);
  transition: transform 0.15s, box-shadow 0.15s;
}
.gcard:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.gcard .emoji {
  font-size: 28px;
}
.gcard b {
  font-size: 16px;
}
.gcard small {
  color: var(--muted);
}
.meta-line {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.foot {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 30px;
}
.foot a {
  color: var(--muted);
}

/* ---------- invite link ---------- */
.hero.mini {
  padding: 18px 0 16px;
}
.hero.mini h1 {
  font-size: 26px;
  gap: 8px;
}
.hero.mini .mark {
  font-size: 24px;
}
.hero.mini .tagline {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}
.inv-head {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.inv-code {
  display: block;
  text-align: center;
  font-size: 46px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0.22em;
  padding-left: 0.22em; /* letter-spacing trails the last letter; keep the code centred */
}
.inv-facts b {
  color: var(--ink);
  font-weight: 600;
}
.inv-facts {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin: 2px 0 16px;
}
.inv-game {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  border-radius: 14px;
  background: var(--soft);
  margin-bottom: 18px;
}
.inv-game .emoji {
  font-size: 34px;
  flex: none;
}
.inv-game > div {
  flex: 1;
  min-width: 0;
}
.inv-game b {
  display: block;
  font-size: 16px;
}
.inv-game small {
  display: block;
  color: #6e7180;
  font-size: 13px;
  line-height: 1.4;
}
.inv-game .meta-line {
  display: block;
  margin-top: 3px;
}
.inv-game .btn {
  flex: none;
  background: var(--card);
}
.btn.big {
  height: 52px;
  font-size: 17px;
  border-radius: 14px;
}
.linkbtn {
  display: block;
  margin: 12px auto -6px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
}
.linkbtn:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}
.note {
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: #a93a28;
  margin-bottom: 14px;
}
.note.info {
  background: #edf2fa;
  color: #3d5a88;
  margin: 12px 0 0;
}
.want {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 12px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--soft);
  font-size: 13px;
  line-height: 1.4;
}
.want .emoji {
  font-size: 22px;
}
.entry input.need {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- lobby ---------- */
.roomcode {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 6px 0 20px;
}
.roomcode > span {
  color: var(--muted);
  font-size: 13px;
}
.roomcode b {
  font-size: 34px;
  letter-spacing: 0.25em;
  font-weight: 800;
}
.share {
  display: flex;
  gap: 8px;
}
.btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}
/* both labels share one cell, so the button keeps its width when it says "Copied" */
.swaplbl {
  display: inline-grid;
}
.swaplbl > span {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.swaplbl > span[hidden] {
  display: inline-flex;
  visibility: hidden;
}
.btn.copy.done {
  color: var(--good);
  border-color: #bfe3d4;
  background: #eaf6f0;
}
.btn.danger {
  background: var(--bad);
  color: #fff;
}
.plist li.asking {
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 10px;
  background: var(--accent-soft);
}
.gamecard .chosen {
  padding: 2px 0 14px;
}
.chosen .meta-line {
  display: block;
  margin-top: 4px;
}
.btn.change {
  margin-top: 0;
}
.btn.change small {
  font-weight: 400;
  color: var(--muted);
  margin-left: 2px;
}
.btn.change small::before {
  content: '· ';
}
.gamecard .settings {
  display: grid;
  grid-template-columns: max-content 1fr;
  align-items: center;
  gap: 10px 12px;
  margin-top: 16px;
}
.settings .timerpick {
  display: contents;
}
.settings .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.startbar .hint.warn {
  margin: 14px 0 -4px;
}
.lobby {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 14px;
  align-items: start;
}
.plist,
.rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.plist li,
.rows li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  min-height: 46px;
}
.plist li:last-child,
.rows li:last-child {
  border-bottom: 0;
}
/* watching: a grey avatar and a grey name (not a faded row, so the text stays readable) */
.plist li.out .av {
  filter: grayscale(1);
}
.plist li.out .who {
  color: var(--muted);
}
.rows.tight li {
  min-height: 38px;
  padding: 5px 0;
}
.rows li.me {
  font-weight: 600;
}
.rows li.now {
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  border-radius: 10px;
  padding-left: 6px;
}
.picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.pick {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fff;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.pick:hover {
  border-color: #cfc7bb;
}
.pickwrap {
  position: relative;
  display: grid;
}
.pickwrap .pick {
  padding-right: 34px;
}
/* the rules of a game in the list, without picking it */
.pinfo {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: var(--soft);
}
.pinfo:hover {
  color: var(--ink);
  background: var(--line);
}
.pick .emoji {
  font-size: 26px;
  flex: none;
}
.pk {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}
.pk b {
  font-size: 14px;
}
.pk small {
  font-size: 12px;
  color: var(--muted);
}
.pk i {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}
.pick.fit .pk i {
  color: var(--good);
}
.pick.nofit {
  background: transparent;
  border-style: dashed;
}
.pick.nofit .emoji {
  opacity: 0.55;
}
.pick.nofit b {
  color: #50546a;
}
.pick.sel {
  border: 1.5px solid var(--ink);
  background: var(--soft);
}
.pick.asking {
  border: 1.5px solid var(--accent);
  background: var(--accent-soft);
}
.pick.sel .pk i {
  color: var(--ink);
  font-weight: 600;
}
.chosen {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}
.chosen .emoji {
  font-size: 34px;
}
.chosen h3 {
  font-size: 17px;
}
.chosen p {
  font-size: 13px;
  color: var(--muted);
}
.chosen > div {
  flex: 1;
}
.timerpick {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}
.timerpick > span:first-child {
  margin-right: 4px;
}
.hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
}
.hint.warn {
  color: var(--accent-ink);
}
.notice {
  max-width: 420px;
  margin: 18vh auto 0;
  text-align: center;
}
.webonly {
  padding: 30px 24px 24px;
}
.webonly img.gicon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  margin-bottom: 8px;
}
.webonly h2 {
  display: block;
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}
.webonly .tag-line {
  margin: 2px 0 14px;
  color: var(--muted);
  font-size: 13px;
}
.hint.center {
  margin-top: 30vh;
}

/* ---------- game ---------- */
.game {
  display: flex;
  flex-direction: column;
}
/* one score list: chips under the board on wide screens, a strip under the timer on phones */
.game > .scores {
  order: 1;
}
.ghead {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ghead .emoji {
  font-size: 30px;
}
.gt {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.gt b {
  font-size: 18px;
}
.gt small {
  color: var(--muted);
}
.timer {
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  margin: 12px 0 14px;
  overflow: hidden;
}
.timer i {
  display: block;
  height: 100%;
  background: var(--ink);
  transform-origin: left;
  transform: scaleX(0);
}
.timer.low i {
  background: var(--accent);
}
.timer.idle {
  opacity: 0.4;
}
.banner {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 6px;
  border-radius: 10px;
  margin-bottom: 12px;
  background: var(--soft);
  color: var(--muted);
}
.banner.go {
  background: var(--accent-soft);
  color: var(--accent-ink);
  transition: background 0.2s, color 0.2s;
}
.banner .left b {
  font-variant-numeric: tabular-nums;
}
.banner.go.urgent {
  background: var(--accent);
  color: #fff;
  animation: beat 1s infinite;
}
.board {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.board h4,
.results h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.board > h4 {
  margin-bottom: -6px;
}
.tip {
  font-size: 14px;
  color: #50546a;
}
.tip.strong {
  color: var(--ink);
  font-weight: 600;
}
.headline {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  animation: pop 0.35s ease-out;
}
.headline.good {
  color: var(--good);
}
.lastline {
  font-size: 13px;
  color: var(--muted);
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}
.wait {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}
.dots {
  width: 22px;
  height: 6px;
  background: radial-gradient(circle, var(--muted) 2.4px, transparent 2.6px) 0 0 / 8px 6px repeat-x;
  animation: dots 1.2s infinite linear;
  flex: none;
}
.sub {
  background: var(--soft);
  border-radius: 12px;
  padding: 12px 14px;
}
.sub .rows li {
  border-color: #e2dbd0;
}
.plus {
  color: var(--good);
}
.miss {
  color: var(--bad);
}
.said {
  font-size: 13px;
  color: #50546a;
  white-space: nowrap;
}
.scores {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.scores li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 13px;
  position: relative;
}
.scores li.me {
  border-color: var(--ink);
}
.scores li .nm {
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scores li.pending::after {
  /* a "still thinking" bubble beside the avatar, not on it */
  content: '•••';
  position: absolute;
  top: -7px;
  left: 18px;
  height: 13px;
  padding: 0 4px;
  border-radius: 7px 7px 7px 2px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(31, 34, 51, 0.15);
  color: var(--ink);
  font-size: 7px;
  line-height: 12px;
  letter-spacing: 1px;
  animation: pulse 1.2s infinite;
}
.scores li b small {
  font-weight: 500;
}
.scores li.off {
  color: var(--muted);
  border-style: dashed;
}
.scores li.off .av {
  filter: grayscale(1);
  opacity: 0.45;
}
.offmark {
  font-style: normal;
  font-size: 11px;
  line-height: 16px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  white-space: nowrap;
}
.wait.off {
  font-size: 13px;
}
.offdot {
  width: 8px;
  height: 8px;
  margin: 0 7px;
  border-radius: 50%;
  background: #c9c4bb;
  flex: none;
}

/* choices */
.opts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}
.opts.four {
  grid-template-columns: repeat(4, 1fr);
}
.opts.people {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 8px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.15s, transform 0.08s, background 0.15s;
}
.opt:hover {
  border-color: #cfc7bb;
}
.opt:active {
  transform: scale(0.98);
}
.opt.big {
  min-height: 84px;
}
.opt .emoji {
  font-size: 26px;
}
.opt small {
  font-size: 12px;
  color: var(--muted);
}
.opt.sel {
  border-color: var(--ink);
  background: var(--soft);
}
.opt.lie.sel {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.opt.quiet {
  color: var(--muted);
}
.opts.people .opt {
  flex-direction: row;
}
.nums {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.num {
  flex: 1;
  min-width: 52px;
  height: 56px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 20px;
  font-weight: 700;
}
.num.small {
  flex: 0 0 48px;
  height: 44px;
  font-size: 16px;
}
.num:hover {
  border-color: var(--ink);
}
.num.sel {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #50546a;
  text-align: left;
}
.check .box {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid #cfc7bb;
  flex: none;
}
.check.on .box {
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E") center / 14px no-repeat;
  border-color: var(--ink);
}
.cols3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.cols3 .col h4 {
  display: flex;
  align-items: center;
  gap: 4px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  color: var(--ink);
}
.cols3 .col h4 .emoji {
  font-size: 18px;
}
.cols3 .col h4 small {
  color: var(--muted);
  font-weight: 400;
}

/* hooks */
.tiles {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}
.tile {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
}
.tile .glyph {
  font-size: 14px;
  opacity: 0.6;
}
.tile b {
  font-size: 22px;
}
.tile i {
  position: absolute;
  bottom: 3px;
  font-size: 10px;
  font-style: normal;
  color: var(--muted);
}
.tile:hover:not(:disabled) {
  border-color: var(--ink);
}
.tile.sel {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  transform: translateY(-4px);
}
.tile.used {
  opacity: 0.2;
}
.tile.drying {
  background: repeating-linear-gradient(-45deg, #faf7f2, #faf7f2 6px, #f0ebe2 6px, #f0ebe2 12px);
  opacity: 0.8;
}
.tile.pick {
  border-color: var(--accent);
}
.tile.pick:hover {
  background: var(--accent-soft);
}
.pair {
  display: flex;
  gap: 6px;
}
.pair .tile {
  width: 40px;
}
.pair .tile b {
  font-size: 18px;
}
.pair .tile .glyph {
  display: none;
}
.heat {
  display: flex;
  gap: 4px;
  align-items: stretch;
  flex-wrap: wrap;
}
.heat .cap,
.queue .cap {
  width: 100%;
  font-size: 12px;
  color: var(--muted);
}
.heat .cell {
  flex: 1;
  text-align: center;
  background: var(--soft);
  border-radius: 8px;
  padding: 4px 0;
}
.heat .cell small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.heat .cell.zero b {
  color: var(--good);
}
.water {
  list-style: none;
  padding: 0;
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(#e7f1f7, #b9d3e6);
}
.water li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px;
  min-height: 38px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}
.water .depth {
  width: 44px;
  font-size: 12px;
  color: #4b6378;
}
.water .who-row {
  display: flex;
  gap: 4px;
  align-items: center;
  flex: 1;
}
.water .who-row i {
  font-style: normal;
  font-size: 11px;
  color: var(--bad);
  margin-left: 4px;
}
.water li.tangled .av {
  opacity: 0.45;
}
.water li.win {
  background: rgba(255, 255, 255, 0.55);
}
.water .fish {
  font-size: 22px;
  animation: swim 0.8s ease-out;
}

/* dinner */
.tallies {
  display: flex;
  gap: 14px;
  margin-bottom: 6px;
}
.tally {
  font-weight: 600;
}
.tally .emoji {
  font-size: 20px;
  margin-right: 2px;
}

/* market */
.stall .items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.item {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #fff;
  border: 1.5px solid var(--line);
  font-size: 26px;
  display: grid;
  place-items: center;
  transition: transform 0.12s, border-color 0.12s;
}
.item.rotten {
  background: #eef3e3;
  border-style: dashed;
}
.item.sel {
  border-color: var(--ink);
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(31, 34, 51, 0.12);
}
.item:not(:disabled):hover {
  border-color: var(--ink);
}
.queue ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 4px 0 0;
}
.queue li {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px 3px 3px;
  border-radius: 999px;
  background: var(--soft);
}
.queue li.done {
  opacity: 0.4;
}
.queue li.now {
  background: var(--accent-soft);
  outline: 1.5px solid var(--accent);
}
.basket {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  font-size: 14px;
}
.cnt {
  white-space: nowrap;
}
.cnt.rot,
.rot {
  color: var(--bad);
}
.bidno {
  min-width: 22px;
  text-align: center;
  font-size: 13px;
  border-radius: 6px;
  background: var(--card);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 13px;
  margin-bottom: 10px;
}

/* lamps */
.duel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.duel .side {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  border-radius: 14px;
  position: relative;
}
.duel .side.leads {
  background: var(--soft);
}
.duel .side .tag {
  position: absolute;
  top: 8px;
  right: 8px;
}
.duel .big {
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
}
.duel small {
  color: var(--muted);
  font-size: 12px;
}
.duel .vs {
  font-size: 28px;
  color: var(--muted);
}
.table {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}
.table .vs {
  color: var(--muted);
}
.lanterns {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 6px;
}
.lantern {
  aspect-ratio: 2 / 3;
  border-radius: 14px 14px 10px 10px;
  display: grid;
  place-items: center;
  font-size: 20px;
  border: 1.5px solid transparent;
  transition: transform 0.12s;
}
.lantern.light {
  background: radial-gradient(circle at 50% 40%, #fff6d8, #ffd66b 60%, #f0b43c);
  color: #6a4300;
}
.lantern.shadow {
  background: radial-gradient(circle at 50% 40%, #4a4e66, #262839 70%);
  color: #e9e6f4;
}
.lantern.pick:hover {
  transform: translateY(-4px);
}
.lantern.pick {
  box-shadow: 0 4px 10px rgba(31, 34, 51, 0.15);
}
.lantern.used {
  opacity: 0.15;
}
.lantern.mini {
  display: inline-grid;
  width: 30px;
  font-size: 14px;
  border-radius: 9px 9px 7px 7px;
  vertical-align: middle;
}
.table .lantern.mini,
.table .lantern.hidden {
  width: 56px;
  font-size: 22px;
}
.lantern.hidden b {
  opacity: 0.5;
}
table.hist {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.hist th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  padding: 4px;
}
.hist td {
  padding: 4px;
  border-top: 1px solid #e2dbd0;
}

/* results */
.results {
  text-align: center;
}
.results .over {
  color: var(--muted);
  font-size: 13px;
}
.results h2 {
  font-size: 24px;
  justify-content: center;
  margin: 4px 0 16px;
}
.rank {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  text-align: left;
}
.rank li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
}
.rank li.me {
  background: var(--soft);
  border-radius: 10px;
}
.rank .place {
  width: 34px;
  text-align: center;
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
}
.rank .place.num {
  font-size: 15px;
}
.results .row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}
.results .sub,
.results .lastline {
  text-align: left;
  margin-top: 12px;
}

/* fun titles above the ranking */
.awards {
  list-style: none;
  padding: 0;
  margin: -4px 0 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.awards li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff8e3, #fdeee0);
  border: 1px solid #f1e0c2;
  text-align: left;
  animation: pop 0.35s ease-out backwards;
  min-width: 0;
}
.awards li:nth-child(2) {
  animation-delay: 0.12s;
}
.awards .medal {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(154, 107, 0, 0.18);
  font-size: 20px;
  flex: none;
}
.aw {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  min-width: 0;
}
.aw b {
  font-size: 12px;
  font-weight: 700;
  color: #8a5f00;
  letter-spacing: 0.02em;
}
.aw-who {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  min-width: 0;
}
.aw-who span {
  overflow: hidden;
  text-overflow: ellipsis;
}
/* a title shared by several players: names wrap instead of being cut short */
.awards li.shared .aw-who {
  flex-wrap: wrap;
  row-gap: 2px;
}
.aw-who i {
  font-style: normal;
  color: var(--muted);
}
.aw-who .av {
  width: 18px;
  height: 18px;
  font-size: 10px;
}
.aw small {
  font-size: 12px;
  color: #7d6a4f;
}

/* quick reactions: a row of emoji under the ranking, floating up from whoever sent them */
.reacts {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: -4px 0 6px;
}
.react {
  width: 44px;
  height: 40px;
  border-radius: 12px;
  font-size: 21px;
  background: var(--soft);
  transition: transform 0.1s, opacity 0.2s;
}
.react:hover:not(:disabled) {
  transform: translateY(-2px);
  background: #ebe4d9;
}
.react:active:not(:disabled) {
  transform: scale(0.9);
}
.react:disabled {
  opacity: 0.45;
}
.floater {
  position: absolute;
  z-index: 8;
  font-size: 30px;
  line-height: 1;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: floatup 2s ease-out forwards;
}
@keyframes floatup {
  0% {
    transform: translate(-50%, -30%) scale(0.6);
    opacity: 0;
  }
  12% {
    transform: translate(-50%, -60%) scale(1.15);
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -260%) scale(1);
    opacity: 0;
  }
}

/* "Play again", with how many guests are up for it; a guest's "I'm up for another" */
.btn.again {
  position: relative;
}
.wantn {
  position: absolute;
  top: -11px;
  right: -10px;
  font-size: 11px;
  line-height: 18px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-ink);
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 0 0 2px var(--card);
  animation: pop 0.3s ease-out;
}
.btn.wanted {
  background: #e3f5ee;
  color: var(--good);
}
.btn.wanted svg {
  width: 18px;
  height: 18px;
}

/* the sound switch in the top bar */
.btn.icon {
  width: 32px;
  padding: 0;
}
.btn.icon svg {
  width: 18px;
  height: 18px;
}
.mute[aria-pressed='true'] {
  color: var(--muted);
}

/* a first-game tip, just above the board */
.tipbox {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: -2px 0 12px;
  padding: 8px 6px 8px 12px;
  border-radius: 12px;
  background: #fff8e3;
  border: 1px solid #f1e0c2;
  font-size: 13px;
  line-height: 1.45;
  color: #5b4a2e;
  animation: pop 0.25s ease-out;
}
.tipbox::after {
  content: '';
  position: absolute;
  left: 22px;
  bottom: -6px;
  width: 10px;
  height: 10px;
  background: #fff8e3;
  border: solid #f1e0c2;
  border-width: 0 1px 1px 0;
  transform: rotate(45deg);
}
.tipbox .bulb {
  font-size: 14px;
  line-height: 19px;
}
.tipbox p {
  flex: 1;
  padding-top: 0;
}
.tipoff {
  display: inline;
  white-space: nowrap;
  padding: 0;
  margin-left: 4px;
  font-size: 12px;
  color: #7a6848;
  text-decoration: underline;
  text-decoration-color: #e3d3b4;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.tipoff:hover {
  color: #5b4a2e;
}
.tipbox .x {
  width: 26px;
  height: 22px;
  margin: -2px 0 -2px;
  font-size: 17px;
  line-height: 1;
  flex: none;
}

/* ---------- overlays ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(31, 34, 51, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 10;
}
.modal.open {
  display: flex;
  animation: fade 0.15s;
}
.sheet {
  background: var(--card);
  border-radius: 20px;
  padding: 24px;
  max-width: 520px;
  width: 100%;
  max-height: 88vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(31, 34, 51, 0.25);
}
.sheet-head {
  display: flex;
  gap: 12px;
  align-items: center;
}
.sheet-head .emoji {
  font-size: 40px;
}
.sheet-head p {
  color: var(--muted);
  font-size: 14px;
}
.rules {
  padding-left: 20px;
  margin: 16px 0;
  font-size: 14px;
}
.rules li {
  margin-bottom: 8px;
}
.sheet:focus {
  outline: none;
}
.sheet .btn {
  width: 100%;
  margin-top: 12px;
}
.sheet .row {
  display: flex;
  gap: 10px;
}
.sheet.wide {
  max-width: 660px;
}
.sheet-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.sheet-title > div {
  flex: 1;
}
.sheet-title h3 {
  font-size: 19px;
}
.sheet-title p {
  color: var(--muted);
  font-size: 13px;
}
.sheet-title .x {
  flex: none;
  width: 36px;
  height: 36px;
  margin: -6px -8px 0 0;
  font-size: 22px;
}
.sheet .filters {
  margin-bottom: 14px;
}
.sheet .chip {
  font-size: 13px;
  padding: 4px 12px;
}
/* asking before a game that can't seat everyone: stays in view at the bottom of the sheet */
.confirm {
  position: sticky;
  bottom: -24px;
  margin: 16px -24px -24px;
  padding: 16px 24px 20px;
  background: var(--card);
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 24px rgba(31, 34, 51, 0.08);
  animation: rise 0.18s ease-out;
}
.confirm p {
  font-size: 14px;
  line-height: 1.55;
}
.confirm .btn {
  flex: 1;
}
.qrsheet {
  max-width: 380px;
  text-align: center;
}
.qrsheet .sheet-title {
  text-align: left;
}
.qr {
  width: 232px;
  height: 232px;
  margin: 4px auto 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}
.qr svg {
  display: block;
  width: 100%;
  height: 100%;
}
.qr-code {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 10px;
  margin-top: 14px;
}
.qr-code span {
  color: var(--muted);
  font-size: 13px;
}
.qr-code b {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.22em;
}
.qr-url {
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
  margin-top: 2px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 20;
  max-width: 90vw;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes pop {
  from {
    transform: scale(0.92);
    opacity: 0;
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}
@keyframes dots {
  to {
    background-position: 8px 0;
  }
}
@keyframes beat {
  50% {
    box-shadow: 0 0 0 4px rgba(232, 85, 63, 0.22);
  }
}
@keyframes rise {
  from {
    transform: translateY(16px);
    opacity: 0;
  }
}
@keyframes swim {
  from {
    transform: translateX(-40px);
    opacity: 0;
  }
}

/* the confirm button's bar: nothing on wide screens, a sticky footer on phones */
.actbar {
  display: contents;
}

@media (max-width: 640px) {
  .wrap {
    padding-top: 12px;
  }
  .ghead {
    gap: 10px;
  }
  .ghead .emoji {
    font-size: 26px;
  }
  .gt b {
    font-size: 16px;
    line-height: 1.3;
  }
  .gt small {
    font-size: 12px;
    line-height: 1.35;
  }
  .timer {
    margin: 10px 0;
  }
  .banner {
    padding: 4px;
    margin-bottom: 10px;
  }
  .game > .scores {
    order: 0;
    flex-wrap: nowrap;
    gap: 4px;
    margin: -4px -18px 10px;
    padding: 8px 18px 3px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
  }
  .game > .scores::-webkit-scrollbar {
    display: none;
  }
  .scores li {
    flex: none;
    gap: 4px;
    padding: 2px 8px 2px 2px;
    border-color: transparent;
    font-size: 13px;
    line-height: 1.3;
    white-space: nowrap;
  }
  .scores li .av {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }
  .scores li .nm {
    display: none;
  }
  .scores li.me {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
  }
  .scores li.pending::after {
    top: -6px;
    left: 13px;
  }
  .tipbox {
    margin: -4px 0 8px;
    padding: 6px 4px 6px 10px;
    font-size: 12.5px;
    line-height: 1.4;
  }
  .tipbox .x {
    width: 30px;
    height: 24px;
    margin: -3px 0;
  }
  .awards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .awards li:only-child {
    grid-column: 1 / -1;
    justify-self: center;
  }
  .awards li.shared {
    grid-column: 1 / -1;
  }
  .awards li {
    gap: 7px;
    padding: 7px 8px 7px 6px;
    border-radius: 12px;
  }
  .awards .medal {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
  .aw b,
  .aw small {
    font-size: 11px;
  }
  .aw-who {
    font-size: 13px;
  }
  .react {
    width: 42px;
    height: 38px;
    font-size: 20px;
  }
  .actbar {
    display: block;
    position: sticky;
    bottom: 0;
    z-index: 3;
    margin: -8px -16px 0;
    padding: 18px 16px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(rgba(255, 253, 250, 0), var(--card) 16px);
  }
  .actbar:last-child {
    margin-bottom: -12px;
  }
  .actbar > .btn.wide {
    margin-top: 0;
    box-shadow: 0 6px 16px rgba(31, 34, 51, 0.18);
  }
  /* still waiting for a choice: a soft prompt that says what to do, not a grey button that looks broken (solid, so
     the board doesn't show through it) */
  .actbar > .btn:disabled {
    opacity: 1;
    background: var(--accent-soft);
    color: var(--accent-ink);
    border: 1.5px dashed var(--accent);
    box-shadow: none;
  }
  body:has(.game) .toast {
    bottom: auto;
    top: calc(10px + env(safe-area-inset-top));
    transform: translate(-50%, -20px);
  }
  body:has(.game) .toast.show {
    transform: translate(-50%, 0);
  }
  .lobby {
    grid-template-columns: 1fr;
  }
  /* what's up next comes first; Start stays in reach in a bar along the bottom of the screen */
  .lobby .gamecard {
    order: -1;
  }
  .startbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    padding: 22px 18px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(rgba(246, 242, 236, 0), var(--bg) 20px);
  }
  .startbar .btn.wide {
    margin-top: 0;
    box-shadow: 0 6px 16px rgba(31, 34, 51, 0.18);
  }
  .startbar .btn:disabled {
    opacity: 1;
    background: #a6a8b0;
    box-shadow: none;
  }
  .startbar .hint.warn {
    margin: 0 0 8px;
  }
  body:has(.startbar) .wrap {
    padding-bottom: 130px;
  }
  body:has(.startbar) .toast {
    bottom: calc(96px + env(safe-area-inset-bottom));
  }
  .x {
    margin-right: -8px;
  }
  .plist li .btn.small {
    padding: 0 10px;
  }
  .roomcode {
    gap: 6px 14px;
    padding: 0 0 16px;
  }
  .roomcode .share {
    width: 100%;
    justify-content: center;
  }
  .roomcode .share .btn {
    flex: 1;
    max-width: 200px;
    border-width: 3px 0;
  }
  .inv-code {
    font-size: 42px;
  }
  .offmark {
    font-size: 10px;
    padding: 0 5px;
  }
  .modal {
    align-items: flex-end;
    padding: 0;
  }
  .sheet {
    max-height: 88vh;
    border-radius: 20px 20px 0 0;
    padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
    animation: rise 0.2s ease-out;
  }
  .sheet.qrsheet {
    max-width: none;
  }
  .picker {
    grid-template-columns: 1fr 1fr;
  }
  .pick {
    padding: 9px 8px 9px 10px;
    gap: 8px;
  }
  .pick .emoji {
    font-size: 24px;
  }
  .confirm {
    bottom: calc(-18px - env(safe-area-inset-bottom));
    margin: 16px -18px calc(-18px - env(safe-area-inset-bottom));
    padding: 14px 18px calc(18px + env(safe-area-inset-bottom));
  }
  .hero h1 {
    font-size: 32px;
  }
  .board,
  .card {
    padding: 16px;
  }
  .grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .gcard {
    padding: 14px;
  }
  .tiles {
    grid-template-columns: repeat(4, 1fr);
  }
  .opts.four {
    grid-template-columns: repeat(2, 1fr);
  }
  .cols3 {
    grid-template-columns: 1fr;
  }
  .roomcode {
    flex-wrap: wrap;
  }
  .lanterns {
    gap: 4px;
  }
  .lantern {
    font-size: 16px;
  }
}
/* ---------- accessibility ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
/* a clear ring on whatever the keyboard is on */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
/* touch: small controls keep their look but get a 44px tap area (the extra is a transparent border) */
@media (max-width: 640px), (pointer: coarse) {
  button.chip,
  .btn.small {
    min-height: 44px;
    border-style: solid;
    border-color: transparent;
    /* important: the "on" and hover backgrounds are shorthands that would paint the whole 44px again */
    background-clip: padding-box !important;
  }
  button.chip {
    min-width: 44px;
    border-width: 7px 0;
    box-shadow: inset 0 0 0 1px var(--line);
  }
  button.chip.on {
    border-color: transparent;
    box-shadow: none;
  }
  button.chip:focus-visible {
    outline-offset: -5px;
  }
  .btn.small {
    height: 44px;
    border-width: 6px 0;
  }
  .btn.small.ghost {
    border-color: transparent;
    box-shadow: inset 0 0 0 1px var(--line);
  }
  .btn.small:focus-visible {
    outline-offset: -4px;
  }
  .x {
    width: 44px;
    height: 44px;
  }
  .sheet-title .x {
    width: 44px;
    height: 44px;
    margin: -10px -12px 0 0;
  }
  /* the "?" in the game list: a small round mark inside a 44px tap area */
  .pinfo {
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
    padding: 0 0 6px 6px; /* the mark sits in the corner, as before */
    background: transparent;
    z-index: 0;
  }
  .pinfo::before {
    content: '';
    position: absolute;
    top: 7px;
    right: 7px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--soft);
    z-index: -1;
  }
  .pinfo:hover {
    background: transparent;
  }
  .pinfo:hover::before {
    background: var(--line);
  }
  /* the sound switch: a 32px square inside a 44px tap area */
  .btn.small.icon {
    width: 44px;
    border-width: 6px;
  }
  /* reactions: same look, 44px tall */
  .react {
    width: 44px;
    height: 44px;
    border: solid transparent;
    border-width: 3px 0;
    background-clip: padding-box !important;
  }
  .react:focus-visible {
    outline-offset: -2px;
  }
  /* the tip's close button reaches out of the bubble's padding rather than making it taller */
  .tipbox .x {
    width: 44px;
    height: 44px;
    margin: -12px -4px -12px -8px;
  }
  .pinfo:focus-visible {
    outline: none;
  }
  .pinfo:focus-visible::before {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
  }
  /* the chips' transparent borders already space the rows */
  .filters {
    row-gap: 0;
  }
}

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

/* ---------- the iPhone app ---------- */
/* The app draws edge to edge: pad for the notch / Dynamic Island, and feel like an app rather than a page
   (no text selection or long-press callouts outside the fields you type in, no rubber-band reveal of the page edge). */
.in-app body {
  padding-top: env(safe-area-inset-top);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior-y: none;
}
.in-app * {
  -webkit-tap-highlight-color: transparent;
}
.in-app input,
.in-app textarea {
  -webkit-user-select: text;
  user-select: text;
}
.in-app .wrap {
  padding-bottom: calc(48px + env(safe-area-inset-bottom));
}

.in-app:not(.kbd) :focus-visible:not(input):not(textarea) {
  outline: none;
}

/* home, before the first connection: say why the buttons are waiting */
.entry .wake {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* illustrated game icons and the fox mascot, sized like the emoji they replaced */
img.gicon {
  width: 1.15em;
  height: 1.15em;
  border-radius: 24%;
  vertical-align: -0.2em;
  box-shadow: 0 1px 2px rgba(31, 34, 51, 0.12), 0 3px 8px rgba(31, 34, 51, 0.1);
  flex: none;
}
img.fox {
  height: 1.1em;
  width: auto;
  vertical-align: -0.18em;
}
.brand img.fox {
  height: 22px;
  margin-right: 2px;
}
/* the home grid: the game's icon is the card's picture, so give it room */
.gcard img.gicon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  margin-bottom: 4px;
}

/* results: last place first, the winner last, then the headline pops (--d is each one's place in that order) */
.results .rank li {
  animation: rank-in 0.42s cubic-bezier(0.2, 0.8, 0.3, 1.15) both;
  animation-delay: calc(var(--d, 0) * 160ms + 150ms);
}
.results .awards {
  animation: rank-in 0.42s ease-out both;
  animation-delay: calc(var(--d, 0) * 160ms + 450ms);
}
.results h2 {
  animation: win-pop 0.5s cubic-bezier(0.2, 0.8, 0.3, 1.4) both;
  animation-delay: calc(var(--d, 0) * 160ms + 250ms);
}
@keyframes rank-in {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes win-pop {
  0% { opacity: 0; transform: scale(0.6); }
  70% { opacity: 1; transform: scale(1.08); }
  100% { transform: scale(1); }
}
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 60;
}
.confetti i {
  position: absolute;
  top: -16px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  animation: confetti-fall linear both;
}
@keyframes confetti-fall {
  to { transform: translate(var(--x), 105vh) rotate(var(--r)); }
}
@media (prefers-reduced-motion: reduce) {
  .results .rank li,
  .results .awards,
  .results h2 {
    animation: none;
  }
}
