/* Mahj Local */
/* Colors: Repose light and Repose dark (from monkeytype). Repose only defines
   neutrals, an accent and an error red; the other hues are muted to match. */
:root {
  --bg: #efead0;
  --surface: #f6f2de;
  --surface-2: #e4dfc9;
  --text: #333538;
  --muted: #6b6a63;
  --border: #d6d0ba;
  --accent: #5f605e;
  --accent-hover: #474846;
  --accent-ink: #efead0;
  --accent-soft: #e1decc;
  --good: #557352;
  --good-soft: #e1e2cc;
  --warn: #93622a;
  --warn-soft: #e8dec5;
  --danger: #c43c53;
  --danger-ink: #efead0;
  --danger-soft: #efd9cb;
  --social: #a35a3c;
  --social-soft: #eaddc7;
  --serious: #4f6385;
  --serious-soft: #dfded2;
  --friend: #8c6c1c;
  --host: #7a4f9a;
  --shadow: 0 1px 2px rgba(51, 53, 56, .07), 0 2px 8px rgba(51, 53, 56, .05);
  --icon-ink: #333538;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #2f3338;
    --surface: #383b3f;
    --surface-2: #43464a;
    --text: #d6d2bc;
    --muted: #a09f95;
    --border: #4a4d51;
    --accent: #d6d2bc;
    --accent-hover: #e2e0d0;
    --accent-ink: #2f3338;
    --accent-soft: #515353;
    --good: #a3bf96;
    --good-soft: #49504d;
    --warn: #d9a86a;
    --warn-soft: #524c46;
    --danger: #ff4a59;
    --danger-ink: #2f3338;
    --danger-soft: #583d43;
    --social: #e0a084;
    --social-soft: #534b4a;
    --serious: #a3b3d1;
    --serious-soft: #494e56;
    --friend: #dcc07a;
    --host: #c3a3e0;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35);
    --icon-ink: #d6d2bc;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #2f3338;
  --surface: #383b3f;
  --surface-2: #43464a;
  --text: #d6d2bc;
  --muted: #a09f95;
  --border: #4a4d51;
  --accent: #d6d2bc;
  --accent-hover: #e2e0d0;
  --accent-ink: #2f3338;
  --accent-soft: #515353;
  --good: #a3bf96;
  --good-soft: #49504d;
  --warn: #d9a86a;
  --warn-soft: #524c46;
  --danger: #ff4a59;
  --danger-ink: #2f3338;
  --danger-soft: #583d43;
  --social: #e0a084;
  --social-soft: #534b4a;
  --serious: #a3b3d1;
  --serious-soft: #494e56;
  --friend: #dcc07a;
  --host: #c3a3e0;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  --icon-ink: #d6d2bc;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: .5rem 0 1rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 .5rem; }
p { margin: 0 0 .75rem; }
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
main.container { padding-top: 16px; padding-bottom: 48px; }
.narrow { max-width: 560px; margin: 0 auto; }
.narrow.wide { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.strong { font-weight: 600; }
.good-text { color: var(--good); font-weight: 600; }
.bad-text { color: var(--danger); font-weight: 600; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.error { background: var(--danger-soft); color: var(--danger); padding: 10px 14px; border-radius: 8px; }
.banner { background: var(--warn-soft); color: var(--warn); padding: 10px 14px; border-radius: 8px; }
.banner.danger { background: var(--danger-soft); color: var(--danger); font-weight: 600; }

/* ---------------------------------------------------------------- header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1000;
}
.header-inner {
  max-width: 1240px; margin: 0 auto; padding: 8px 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.1rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-tile {
  width: 34px; height: 34px; background: var(--icon-ink);
  -webkit-mask: var(--tile-icon) center / contain no-repeat;
  mask: var(--tile-icon) center / contain no-repeat;
}
.main-nav {
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
  order: 3; width: 100%; margin: 0 -8px;
}
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  white-space: nowrap; color: var(--muted); padding: 6px 10px; border-radius: 8px; font-weight: 500; font-size: .95rem;
  display: inline-flex; align-items: center; gap: 6px;
}
.main-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.main-nav a.active { color: var(--accent); background: var(--accent-soft); }
#theme-toggle { margin-left: auto; }
@media (min-width: 860px) {
  .main-nav { order: 0; width: auto; margin: 0 0 0 16px; }
}
.badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--danger); color: var(--danger-ink); font-size: .75rem; font-weight: 700;
}
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 1.15rem; cursor: pointer; line-height: 1;
}
.icon-btn:hover { background: var(--surface-2); text-decoration: none; }
#theme-toggle {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
}
#theme-toggle:hover { background: var(--surface-2); }
/* Logged out: Log in / Sign up at the right end of the header, where the account menu goes. */
.auth-links { display: flex; align-items: center; gap: 6px; }
.auth-links .btn.ghost { border-color: transparent; }
/* Very narrow phones: keep the logo but visually hide the name so the header fits on one row. */
@media (max-width: 359px) {
  .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
#theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Account menu: initials circle that opens a dropdown (<details>, so no JS needed). */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; position: relative; user-select: none; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover, .user-menu[open] > summary { box-shadow: 0 0 0 2px var(--accent); }
.user-menu > summary.active { background: var(--accent); color: var(--accent-ink); }
.user-menu > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.badge.dot { position: absolute; top: -7px; right: -11px; min-width: 18px; height: 18px; padding: 0 5px; font-size: .7rem; border: 2px solid var(--surface); box-sizing: content-box; }
.user-menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; z-index: 1100;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18); padding: 6px;
}
.user-menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; overflow-wrap: anywhere; }
.user-menu-links { display: flex; flex-direction: column; }
.user-menu-links a, .user-menu-logout {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 8px; color: var(--text); font-weight: 500; font-size: .95rem;
}
.user-menu-links a:hover, .user-menu-logout:hover { background: var(--surface-2); text-decoration: none; }
.user-menu-links a.active { color: var(--accent); background: var(--accent-soft); }
.user-menu form { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
.user-menu-logout { width: 100%; border: 0; background: transparent; font: inherit; cursor: pointer; color: var(--muted); text-align: left; }
/* Icon PNGs are masks, so one image draws black on light and white on dark. */
.theme-icon {
  width: 28px; height: 28px; background: var(--icon-ink);
  -webkit-mask: var(--theme-icon) center / contain no-repeat;
  mask: var(--theme-icon) center / contain no-repeat;
}
.flash { background: var(--accent-soft); color: var(--text); border-bottom: 1px solid var(--border); padding: 10px 0; font-weight: 500; }
.site-footer { color: var(--muted); font-size: .85rem; padding: 24px 0; border-top: 1px solid var(--border); }

/* ---------------------------------------------------------------- controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.small { padding: 5px 10px; font-size: .85rem; border-radius: 8px; }
.btn.active { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .6; cursor: wait; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; min-height: 42px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
input:disabled { opacity: .7; }
form.stack { display: flex; flex-direction: column; gap: 14px; }
form.stack label, .field { display: flex; flex-direction: column; gap: 4px; font-weight: 500; }
.label { font-weight: 500; }
form.stack small { font-weight: 400; }
label.check { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 400 !important; cursor: pointer; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px 16px; margin: 0; display: flex; flex-direction: column; gap: 12px; }
legend { font-weight: 700; padding: 0 6px; }
.grid2, .grid3 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) {
  .grid2 { grid-template-columns: 1fr 1fr; }
  .grid3 { grid-template-columns: 1.3fr 1fr 1fr; }
}
.radio-row { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.inline-form.grow { display: flex; width: 100%; }
.inline-form.grow input { flex: 1; min-width: 180px; }
.loc-field { display: flex; gap: 8px; flex-wrap: wrap; }
.loc-field input[type=text] { flex: 1 1 200px; }
.geo-btn { font-weight: 500; }

/* ---------------------------------------------------------------- cards & tags */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.tag.good { background: var(--good-soft); color: var(--good); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.danger { background: var(--danger-soft); color: var(--danger); }
.tag.vibe-social { background: var(--social-soft); color: var(--social); }
.tag.vibe-serious { background: var(--serious-soft); color: var(--serious); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }

/* ---------------------------------------------------------------- home */
.hero { text-align: center; padding: 48px 0 24px; max-width: 640px; margin: 0 auto; }
.hero h1 { font-size: 2.2rem; }
.lead { font-size: 1.1rem; color: var(--muted); }
.hero-search { display: flex; flex-direction: column; gap: 10px; margin: 24px 0; }
.search-bar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.search-row { display: flex; flex-wrap: wrap; gap: 8px; }
.search-row .loc-field { flex: 1 1 340px; }
.search-row label.inline { flex: 0 0 auto; }
.search-row select { width: auto; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 10px; }
.filter-row select { width: auto; min-height: 36px; padding: 5px 10px; }
.results-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 16px 0 8px; }
.results-head p { margin: 0; }
.view-tabs { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.view-tabs a { padding: 6px 16px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.view-tabs a:hover { text-decoration: none; color: var(--text); }
.view-tabs a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.range-nav { display: flex; align-items: center; gap: 8px; margin: 8px 0 12px; flex-wrap: wrap; }
.range-label { margin: 0 0 0 8px; font-size: 1.15rem; }
.empty-state { text-align: center; padding: 24px; color: var(--muted); }

.game-card {
  display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px; color: var(--text); box-shadow: var(--shadow);
  transition: border-color .15s;
}
.game-card:hover { border-color: var(--accent); text-decoration: none; }
/* Your own relationship to a game: hosting, going, or waiting on the host. */
.game-card.mine-host { border-left: 4px solid var(--host); }
.game-card.mine-going { border-left: 4px solid var(--good); }
.game-card.mine-pending { border-left: 4px solid var(--danger); }
.gc-row { display: flex; justify-content: space-between; gap: 8px; font-size: .85rem; }
.gc-time { font-weight: 700; color: var(--accent); }
.gc-dist { color: var(--muted); }
.gc-name { font-weight: 700; line-height: 1.25; margin-top: 2px; }
.gc-hood { color: var(--muted); font-size: .875rem; }
.gc-seats { font-size: .85rem; font-weight: 600; }
.game-card.full .gc-seats { color: var(--muted); }
.gc-friends { font-size: .85rem; color: var(--friend); font-weight: 600; margin-top: 2px; }
.more { display: inline-block; font-size: .875rem; font-weight: 600; padding: 2px 0; }
.no-games { color: var(--muted); font-size: .875rem; }

.week-grid { display: flex; flex-direction: column; gap: 4px; }
.day-col { border-top: 1px solid var(--border); padding: 10px 0; }
.day-head { display: flex; align-items: baseline; gap: 8px; margin: 0 0 8px; }
.dow { font-weight: 700; text-transform: uppercase; font-size: .8rem; color: var(--muted); letter-spacing: .04em; }
.dnum { font-size: 1.3rem; font-weight: 700; }
.today-pill { background: var(--accent); color: var(--accent-ink); font-size: .7rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.day-col.today .dnum { color: var(--accent); }
@media (min-width: 900px) {
  .week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
  .day-col { border-top: 0; background: var(--surface-2); border-radius: 10px; padding: 8px; min-height: 180px; }
  .day-col.today { outline: 2px solid var(--accent); }
  .day-col .game-card { padding: 8px; font-size: .9rem; }
  .day-col .tags { gap: 3px; }
  .day-col .tag { font-size: .68rem; padding: 0 6px; }
}

.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.dow-head { text-align: center; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 4px 0; }
.month-cell { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; min-height: 56px; padding: 4px; min-width: 0; }
.month-cell.other { opacity: .45; }
.month-cell.today { outline: 2px solid var(--accent); }
.cell-head { display: flex; justify-content: space-between; align-items: center; gap: 2px; flex-wrap: wrap; }
.cell-num { font-weight: 700; font-size: .85rem; }
.cell-count { background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: .72rem; font-weight: 700; min-width: 20px; text-align: center; padding: 0 5px; }
.cell-count:hover { text-decoration: none; }
.cell-games { display: none; }
.mini-game { display: block; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); padding: 2px 4px; border-radius: 4px; background: var(--surface-2); margin-top: 3px; }
.mini-game.mine-host { box-shadow: inset 3px 0 0 var(--host); }
.mini-game.mine-going { box-shadow: inset 3px 0 0 var(--good); }
.mini-game.mine-pending { box-shadow: inset 3px 0 0 var(--danger); }
.mini-time { font-weight: 700; color: var(--accent); }
.list-day { margin: 20px 0 8px; font-size: 1rem; }
.part { margin: 12px 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
@media (min-width: 900px) {
  .month-cell { min-height: 120px; padding: 6px; }
  .cell-games { display: block; }
  .cell-count { display: none; }
}

.desk-only { display: none; }
@media (min-width: 900px) {
  .desk-only { display: block; margin-top: 20px; }
  .mobile-only { display: none; }
}

.day-chips, .chip-list { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.chip { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .875rem; font-weight: 600; white-space: nowrap; }
.chip:hover { text-decoration: none; border-color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------------------------------------------------------------- maps */
.map { border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); z-index: 0; }
.map-under { height: 380px; }
.map-main { height: 55vh; min-height: 300px; }
.map-small { height: 220px; }
.map-layout { display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 900px) {
  .map-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); align-items: start; }
  .map-pane { position: sticky; top: 76px; }
  .map-main { height: calc(100vh - 230px); }
  .list-pane { max-height: none; }
}
.pin span {
  display: block; width: 22px; height: 22px; margin: 1px 2px;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--accent); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
.pin.friend span { background: var(--friend); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); }
.leaflet-popup-content { margin: 12px 14px; }
.pop { font: 14px/1.4 var(--font); min-width: 180px; }
.pop-when { color: var(--accent); font-weight: 700; font-size: .8rem; }
.pop-name { display: block; font-weight: 700; font-size: 1rem; color: var(--text); }
.pop-hood, .pop-seats { color: var(--muted); font-size: .85rem; }
.pop-friends { color: var(--friend); font-weight: 600; font-size: .85rem; }
.pop-link { display: inline-block; margin-top: 6px; font-weight: 600; }
:root[data-theme="dark"] .leaflet-container:not(.map-vector) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .leaflet-container:not(.map-vector) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9); }
}

/* ---------------------------------------------------------------- game page */
.game-head h1 { margin-bottom: .25rem; }
.game-when { font-size: 1.05rem; margin-bottom: .25rem; }
.game-layout { display: flex; flex-direction: column; gap: 0; margin-top: 16px; }
.side-col { order: -1; }
@media (min-width: 900px) {
  .game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
  .side-col { order: 0; position: sticky; top: 76px; }
}
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.facts dt { color: var(--muted); font-weight: 500; }
.facts dd { margin: 0; }
.notes { white-space: pre-wrap; background: var(--surface-2); padding: 10px 14px; border-radius: 10px; }
.status { font-size: 1.25rem; font-weight: 700; margin-bottom: .25rem; }
.status.good { color: var(--good); }
.status.good::before { content: "✓ "; }
.status.pending { color: var(--warn); }
.status.declined { color: var(--muted); }
.join-card { border-top: 4px solid var(--accent); }
.join-card form { margin-bottom: 10px; }

.tables-pic { display: flex; flex-wrap: wrap; gap: 16px; margin: 12px 0 8px; }
.table-pic { position: relative; width: 104px; height: 104px; }
.table-top {
  position: absolute; inset: 24px; border-radius: 8px; background: var(--accent-soft);
  border: 2px solid var(--accent); display: grid; place-items: center; font-weight: 700; color: var(--accent);
}
.seat {
  position: absolute; width: 30px; height: 30px; border-radius: 50%;
  border: 2px dashed var(--border); background: var(--surface);
  display: grid; place-items: center; font-size: .68rem; font-weight: 700;
}
.seat.taken { border: 2px solid var(--accent); background: var(--accent); color: var(--accent-ink); }
.seat.s0 { top: -4px; left: 37px; }
.seat.s1 { right: -4px; top: 37px; }
.seat.s2 { bottom: -4px; left: 37px; }
.seat.s3 { left: -4px; top: 37px; }

.people { list-style: none; padding: 0; margin: 0; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.person:first-child { border-top: 0; }
.person-main { flex: 1; min-width: 150px; }
.person-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.avatar {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: .85rem;
}
blockquote.note { margin: 6px 0 0; padding: 6px 10px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 8px 8px 0; white-space: pre-wrap; font-size: .9rem; }
.host-tools h3:first-of-type { margin-top: 0; }
.host-tools form[data-confirm] { margin-top: 16px; }

/* ---------------------------------------------------------------- lists */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.my-list { display: flex; flex-direction: column; }
.my-game { display: flex; align-items: center; gap: 14px; padding: 10px 4px; border-top: 1px solid var(--border); color: var(--text); }
.my-game:first-child { border-top: 0; }
.my-game:hover { background: var(--surface-2); text-decoration: none; }
.my-when { width: 96px; flex: 0 0 auto; }
.my-main { flex: 1; min-width: 0; }
.my-status { flex: 0 0 auto; }
.muted-tag { opacity: .8; }
details.card summary { cursor: pointer; list-style: none; }
details.card summary::-webkit-details-marker { display: none; }
details.card summary::after { content: " ▾"; color: var(--muted); }
h2.inline { display: inline; }
h2.form-gap { margin-top: 2rem; }
.quick-links { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

/* ---------------------------------------------------------------- messages */
.inbox { list-style: none; padding: 0; margin: 0 0 24px; }
.conv-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; color: var(--text); background: var(--surface); border: 1px solid var(--border); margin-bottom: 8px; }
.conv-row:hover { border-color: var(--accent); text-decoration: none; }
.conv-row.unread { border-left: 4px solid var(--accent); }
.conv-row.unread .conv-preview { font-weight: 600; }
.conv-main { flex: 1; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; gap: 8px; }
.conv-preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }

.chat-wrap { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; height: calc(100vh - 150px); min-height: 420px; }
.chat-head h1 { margin: 4px 0 0; font-size: 1.4rem; }
.chat-log {
  flex: 1; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; margin: 12px 0; display: flex; flex-direction: column; gap: 8px;
}
.chat-empty { text-align: center; margin: auto; }
.msg { max-width: 80%; align-self: flex-start; }
.msg.mine { align-self: flex-end; text-align: right; }
.msg-meta { font-size: .75rem; color: var(--muted); margin: 0 6px 2px; }
.msg-body { display: inline-block; text-align: left; background: var(--surface-2); padding: 8px 12px; border-radius: 14px 14px 14px 4px; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.msg.mine .msg-body { background: var(--accent); color: var(--accent-ink); border-radius: 14px 14px 4px 14px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea { flex: 1; min-height: 46px; }
