/* Home. Everything is scoped under .hm-root and coloured with the custom
   properties from styles.css, so both themes work. Mobile first: one column;
   from 1000px the page widens and splits into a main and a side column. */

.hm-root { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.hm-root [hidden] { display: none !important; }
.hm-root > [data-sec], .hm-col > [data-sec] { min-width: 0; }
.hm-root [data-sec="setup"] { display: grid; gap: 16px; }
.hm-cols, .hm-col { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-content: start; }
.hm-root h2 { margin: 0; font-size: 1.3rem; }
.hm-root h3 { margin: 0; }
.hm-root ul { list-style: none; margin: 0; padding: 0; }
.hm-root p { margin: 0; }

@media (min-width: 720px) {
  .hm-root, .hm-cols, .hm-col, .hm-root [data-sec="setup"] { gap: 20px; }
}
@media (min-width: 1000px) {
  .app-main[data-route="home"] { max-width: 1120px; }
  .hm-cols { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
  .hm-cols.is-single { grid-template-columns: minmax(0, 1fr); max-width: 760px; width: 100%; margin: 0 auto; }
}

.hm-eyebrow {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.hm-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.hm-more {
  display: inline-flex; align-items: center; gap: 4px; min-height: 32px;
  font-size: 0.9rem; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.hm-more:hover { text-decoration: underline; }
.hm-arrow {
  width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round; transition: transform 180ms var(--ease);
}
.hm-more:hover .hm-arrow { transform: translateX(3px); }
.hm-when { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.hm-quiet { padding: 4px 0 2px; }

/* Avatars and game monograms */
.hm-av {
  flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--c); color: var(--on);
  font-size: 0.8rem; font-weight: 700; line-height: 1; letter-spacing: 0.02em; user-select: none;
}
.hm-av.is-small { width: 30px; height: 30px; font-size: 0.72rem; }
.hm-av.is-tiny { width: 22px; height: 22px; font-size: 0.6rem; }
.hm-av.is-big { width: 56px; height: 56px; font-size: 1.15rem; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--c); }
.hm-mono {
  flex: none; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 11px;
  background: hsl(var(--hue, 160) 42% 34%); color: #fff;
  font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; line-height: 1;
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / 0.18); user-select: none;
}
.hm-mono.is-big { width: 64px; height: 64px; border-radius: 16px; font-size: 1.9rem; box-shadow: inset 0 -5px 0 rgb(0 0 0 / 0.18), var(--shadow); }

/* ---- Hero ---- */
.hm-hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px;
  padding: 18px 18px 20px;
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 60%),
    linear-gradient(125deg, var(--accent-soft), var(--surface) 72%);
  border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow);
}
.hm-hero-art {
  order: -1; justify-self: center; display: block;
  width: min(100%, 340px); height: auto;
  filter: drop-shadow(0 10px 14px rgb(0 0 0 / 0.2));
}
.hm-hero-text { min-width: 0; display: grid; gap: 8px; align-content: center; }
.hm-root .hm-hello {
  font-size: clamp(1.75rem, 1.2rem + 2.6vw, 2.7rem); line-height: 1.08; letter-spacing: -0.02em;
}
.hm-hello-line { font-size: 1.08rem; color: var(--text); max-width: 46ch; text-wrap: pretty; }
.hm-hero-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hm-hero-chips li {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--border);
  font-size: 0.88rem; color: var(--muted); font-variant-numeric: tabular-nums;
}
.hm-hero-chips b { color: var(--text); }
.hm-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
@media (min-width: 640px) {
  .hm-hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: 24px; padding: 26px 30px; }
  .hm-hero-art { order: 0; width: 100%; max-width: 460px; justify-self: end; }
}
@media (min-width: 1000px) { .hm-hero { padding: 34px 40px; } }

/* ---- First run ---- */
.hm-welcome { display: grid; gap: 12px; }
.hm-promises { display: grid; gap: 8px; }
.hm-promises li { display: flex; gap: 10px; align-items: baseline; }
@media (min-width: 720px) { .hm-promises { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .hm-promises li { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); } }

/* ---- Next game night ---- */
.hm-night {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px 16px; align-items: start;
}
.hm-night.hm-skeleton { min-height: 150px; }
.hm-chat.hm-skeleton { min-height: 180px; }
.hm-skeleton {
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 300% 100%;
}
.hm-night-date {
  display: grid; justify-items: center; align-content: center; width: 68px; padding: 8px 0 9px;
  border-radius: 14px; background: var(--accent); color: var(--accent-text); line-height: 1.1;
  box-shadow: inset 0 -4px 0 rgb(0 0 0 / 0.14);
}
.hm-night-month { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.hm-night-day { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.hm-night-weekday { font-size: 0.78rem; font-weight: 600; opacity: 0.9; }
.hm-night-main { min-width: 0; display: grid; gap: 5px; }
.hm-night-when { color: var(--text); }
.hm-night-when.is-soon { color: var(--gold); }
.hm-night-facts { display: flex; flex-wrap: wrap; gap: 2px 0; color: var(--muted); font-size: 0.95rem; }
.hm-night-facts span:not(:last-child)::after { content: "·"; margin: 0 8px; }
.hm-night-going { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 4px; font-size: 0.92rem; color: var(--muted); }
.hm-night-going b { color: var(--text); font-variant-numeric: tabular-nums; }
.hm-faces { display: inline-flex; padding-left: 6px; }
.hm-faces .hm-av { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.hm-night-rsvp { grid-column: 1 / -1; display: grid; gap: 8px; }
.hm-rsvp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hm-rsvp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 8px 10px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 650; white-space: nowrap;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), transform 120ms var(--ease), box-shadow 160ms var(--ease);
}
.hm-rsvp-btn > span { font-weight: 800; }
.hm-rsvp-btn:hover { border-color: var(--text); background: var(--surface-2); }
.hm-rsvp-btn:active { transform: scale(0.97); }
.hm-rsvp-btn[aria-pressed="true"] { box-shadow: inset 0 -3px 0 rgb(0 0 0 / 0.14); }
.hm-rsvp-btn.is-in[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.hm-rsvp-btn.is-maybe[aria-pressed="true"] { background: var(--winner); border-color: var(--gold); color: var(--text); }
.hm-rsvp-btn.is-out[aria-pressed="true"] { background: var(--surface-2); border-color: var(--text); color: var(--text); }
.hm-rsvp[aria-busy="true"] .hm-rsvp-btn { cursor: progress; }
.hm-rsvp-note { font-size: 0.9rem; color: var(--muted); min-height: 1.4em; }
.hm-rsvp-note.is-error { color: var(--danger); font-weight: 600; }
.hm-night.is-empty { grid-template-columns: minmax(0, 1fr); align-items: center; }
.hm-night-none { display: flex; gap: 14px; align-items: center; }
.hm-night-none h2 { font-size: 1.15rem; }
.hm-night-emoji { font-size: 2rem; line-height: 1; }
.hm-night.is-empty .btn { justify-self: start; }
@media (min-width: 720px) {
  .hm-night { grid-template-columns: auto minmax(0, 1fr) minmax(260px, auto); align-items: center; gap: 20px 24px; }
  .hm-night-date { width: 78px; padding: 10px 0 12px; }
  .hm-night-rsvp { grid-column: auto; }
  .hm-night.is-empty { grid-template-columns: minmax(0, 1fr) auto; }
  .hm-night.is-empty .btn { justify-self: end; }
}

/* ---- Headlines ---- */
.hm-news { position: relative; }
.hm-lead {
  display: flex; gap: 12px; align-items: flex-start;
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em;
  font-size: clamp(1.3rem, 1.05rem + 1.1vw, 1.7rem); line-height: 1.22; text-wrap: balance;
}
.hm-lead-icon {
  flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--winner); font-size: 1.4rem; font-family: var(--font-body);
}
.hm-news-list { display: grid; margin-top: 14px; }
.hm-news-list li {
  display: flex; gap: 12px; align-items: baseline; padding: 11px 0; border-top: 1px solid var(--border);
  text-wrap: pretty;
}
.hm-news-icon { flex: none; width: 44px; text-align: center; font-size: 1.05rem; }
.hm-recap {
  margin-top: 6px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2);
  display: grid; gap: 3px;
}
.hm-news-list + .hm-recap { margin-top: 4px; }
.hm-lead + .hm-recap { margin-top: 16px; }
.hm-recap h3 { font-family: var(--font-body); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.hm-recap p { font-size: 0.97rem; }

/* ---- Latest plays ---- */
.hm-play { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--border); }
.hm-play:first-child { border-top: 0; padding-top: 0; }
.hm-play:last-child { padding-bottom: 0; }
.hm-play-body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.hm-play-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.hm-play-top strong { font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-results { display: flex; flex-wrap: wrap; gap: 6px; }
.hm-res {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); font-size: 0.88rem; max-width: 100%;
}
.hm-res > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-res b { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.hm-res.is-winner { background: var(--winner); border-color: var(--gold); font-weight: 650; }
.hm-res.is-winner b { color: var(--text); }
.hm-res.is-winner::after { content: "🏆"; font-size: 0.8rem; margin-left: -1px; }
.hm-res.is-me { box-shadow: 0 0 0 2px var(--accent); border-color: transparent; }
.hm-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.hm-tag {
  padding: 1px 9px; border-radius: 999px; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.02em;
  background: var(--accent-soft); color: var(--text);
}
.hm-tag.is-record, .hm-tag.is-first-win, .hm-tag.is-streak { background: var(--winner); }
.hm-tag.is-plain, .hm-tag.is-snapped { background: var(--surface-2); }

/* ---- Awards wall ---- */
.hm-awards-head { align-items: center; flex-wrap: nowrap; }
.hm-awards-head p { font-size: 0.92rem; margin-top: 2px; }
.hm-awards-art { flex: none; width: 92px; height: auto; margin: -8px -4px -6px 0; filter: drop-shadow(0 4px 6px rgb(0 0 0 / 0.16)); }
.hm-award-grid { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .hm-award-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hm-award {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid transparent;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease);
}
.hm-award:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.hm-award.is-mine { background: var(--accent-soft); border-color: var(--accent); }
.hm-award-emoji {
  flex: none; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface); font-size: 1.35rem; box-shadow: 0 1px 2px rgb(0 0 0 / 0.1);
}
.hm-award-body { min-width: 0; display: grid; gap: 3px; }
.hm-award-title {
  font-size: 0.76rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.hm-you {
  padding: 0 7px; border-radius: 999px; background: var(--accent); color: var(--accent-text);
  font-size: 0.68rem; letter-spacing: 0.06em;
}
.hm-award-who { display: flex; flex-wrap: wrap; gap: 4px 12px; font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; line-height: 1.25; }
.hm-holder { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.hm-holder .hm-av { font-family: var(--font-body); }
.hm-award-detail { font-size: 0.88rem; color: var(--muted); text-wrap: pretty; }

/* ---- Your card ---- */
.hm-me { display: grid; gap: 14px; }
.hm-me.is-anon { justify-items: start; gap: 10px; }
.hm-me-head { display: flex; align-items: center; gap: 14px; }
.hm-me-head > div { flex: 1; min-width: 0; }
.hm-me-head h2 { font-size: 1.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-rank {
  flex: none; font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.hm-me-line { font-size: 1.02rem; text-wrap: pretty; }
.hm-stats { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.hm-stat { display: grid; justify-items: center; gap: 1px; padding: 10px 4px; border-radius: 12px; background: var(--surface-2); text-align: center; }
.hm-stat dd { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hm-stat dd span { font-size: 0.95rem; font-family: var(--font-body); margin-right: 2px; }
.hm-stat dt { font-size: 0.72rem; color: var(--muted); line-height: 1.2; }
.hm-titles { display: flex; flex-wrap: wrap; gap: 6px; }
.hm-titles li {
  padding: 4px 11px; border-radius: 999px; background: var(--winner); border: 1px solid var(--gold);
  font-size: 0.86rem; font-weight: 650;
}
.hm-no-titles { font-size: 0.92rem; }
.hm-no-titles:empty { display: none; }
.hm-rows li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); }
.hm-rows li:last-child { padding-bottom: 0; }
.hm-row-label { color: var(--muted); font-size: 0.88rem; flex: none; }
.hm-row-value { display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px 6px; font-weight: 650; text-align: right; min-width: 0; }
.hm-row-value small { font-weight: 400; color: var(--muted); font-size: 0.84rem; font-variant-numeric: tabular-nums; }

/* ---- What should we play? ---- */
.hm-picker { display: grid; gap: 14px; }
.hm-picker .hm-head { margin-bottom: 0; }
.hm-count { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.hm-count-label { font-weight: 600; font-size: 0.9rem; color: var(--muted); }
.hm-stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); }
.hm-step {
  width: 44px; height: 44px; border: 0; background: none; cursor: pointer; border-radius: 11px;
  font-size: 1.35rem; font-weight: 600; line-height: 1; color: var(--text);
}
.hm-step:hover:not([aria-disabled="true"]) { background: var(--surface-2); }
.hm-step[aria-disabled="true"] { opacity: 0.35; cursor: not-allowed; }
.hm-count-value { min-width: 2.2ch; text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.hm-count-hint { font-size: 0.86rem; color: var(--muted); }
.hm-pick-stage {
  display: flex; align-items: center; gap: 14px; min-height: 104px; padding: 14px; border-radius: 14px;
  background: var(--surface-2); overflow: hidden;
}
.hm-pick-stage > div { min-width: 0; display: grid; gap: 2px; }
.hm-pick-stage.is-idle p { font-size: 0.95rem; }
.hm-pick-art { flex: none; width: 66px; height: auto; filter: drop-shadow(0 4px 6px rgb(0 0 0 / 0.16)); }
.hm-pick-name { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; line-height: 1.15; overflow-wrap: anywhere; }
.hm-pick-meta { font-size: 0.85rem; color: var(--muted); }
.hm-pick-reason { font-size: 0.95rem; margin-top: 4px; text-wrap: pretty; }
.hm-pick-stage.is-landed { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.hm-pick-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- Table talk ---- */
.hm-msgs { display: grid; gap: 12px; }
.hm-msg { display: flex; gap: 10px; align-items: flex-start; }
.hm-msg-body { flex: 1; min-width: 0; padding: 8px 12px; border-radius: 4px 14px 14px 14px; background: var(--surface-2); }
.hm-msg.is-me .hm-msg-body { background: var(--accent-soft); }
.hm-msg-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 0.88rem; }
.hm-msg-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-msg-text {
  white-space: pre-line; overflow-wrap: anywhere; font-size: 0.97rem;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.hm-chat-cta { margin-top: 14px; width: 100%; justify-content: center; text-align: center; }

/* ---- Motion ---- */
@media (prefers-reduced-motion: no-preference) {
  .hm-skeleton { animation: hm-shimmer 1.4s linear infinite; }
  @keyframes hm-shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
  .hm-pick-stage.is-landed { animation: hm-land 420ms var(--ease); }
  .hm-pick-stage.is-landed .hm-mono { animation: hm-pop 520ms var(--ease); }
  @keyframes hm-land { from { transform: scale(0.97); } 55% { transform: scale(1.015); } }
  @keyframes hm-pop { from { transform: rotate(-14deg) scale(0.7); } 60% { transform: rotate(5deg) scale(1.08); } }
  .hm-pick-name.is-tick { animation: hm-tick 130ms var(--ease); }
  @keyframes hm-tick { from { opacity: 0.2; transform: translateY(-10px); } }
  .hm-pick-stage.is-rolling .hm-mono { animation: hm-wobble 360ms ease-in-out infinite alternate; }
  @keyframes hm-wobble { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
  .hm-rsvp-btn[aria-pressed="true"] { animation: hm-press 260ms var(--ease); }
  @keyframes hm-press { 40% { transform: scale(1.05); } }
}

@media (max-width: 380px) {
  .hm-stats { gap: 6px; }
  .hm-stat dd { font-size: 1.15rem; }
  .hm-night-date { width: 60px; }
}
