/* ==========================================================================
   骰子账本 · Monopoly Ledger
   A responsive, board-game inspired realtime scoring interface.
   ========================================================================== */

:root {
  --ink: #17251d;
  --ink-soft: #33453a;
  --ink-mute: #637168;
  --paper: #f2ecdd;
  --paper-deep: #e8dfcb;
  --cream: #fbf7ec;
  --white: #fffdf8;
  --line: rgba(23, 37, 29, 0.16);
  --green: #1d5a42;
  --green-deep: #143d2d;
  --green-mid: #2c7658;
  --green-soft: #dfe9dc;
  --coral: #de5a3a;
  --coral-deep: #b9442a;
  --coral-soft: #f8ddd4;
  --gold: #e4b33f;
  --gold-deep: #b78616;
  --gold-soft: #f6e8bd;
  --sky: #4b83cc;
  --sky-soft: #dce7f6;
  --danger: #b93d2c;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --shadow-hard-sm: 0 3px 0 rgba(23, 37, 29, 0.16);
  --shadow-hard: 0 6px 0 rgba(23, 37, 29, 0.13);
  --shadow-lift: 0 18px 50px rgba(23, 37, 29, 0.14);
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans CJK SC", "Source Han Sans SC", system-ui, -apple-system, sans-serif;
  --font-display: "Avenir Next", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", Consolas, monospace;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% -10%, rgba(228, 179, 63, 0.22), transparent 32rem),
    radial-gradient(circle at 92% 2%, rgba(75, 131, 204, 0.1), transparent 28rem),
    linear-gradient(rgba(23, 37, 29, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 37, 29, 0.035) 1px, transparent 1px);
  background-size: auto, auto, 30px 30px, 30px 30px;
  background-attachment: fixed;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

body.has-room {
  background-image:
    radial-gradient(circle at 4% 0%, rgba(29, 90, 66, 0.08), transparent 30rem),
    linear-gradient(rgba(23, 37, 29, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 37, 29, 0.028) 1px, transparent 1px);
  background-size: auto, 30px 30px, 30px 30px;
}

::selection {
  color: var(--cream);
  background: var(--green);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
}

h1,
h2,
h3,
h4,
p,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

[hidden] {
  display: none !important;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: currentColor;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 16px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--cream);
  transform: translateY(-150%);
  transition: transform 0.18s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}

/* ==========================================================================
   Shared controls
   ========================================================================== */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 20px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  transform: translateY(0);
  transition:
    transform 0.16s var(--ease-out),
    box-shadow 0.16s var(--ease-out),
    background-color 0.16s ease,
    color 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--ink);
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

.btn:disabled,
.btn.is-loading {
  opacity: 0.58;
  cursor: not-allowed;
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--ink);
}

.btn .icon {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--ink);
  color: var(--cream);
  box-shadow: 0 4px 0 var(--green-deep);
}

.btn-primary:hover {
  background: #20352a;
  box-shadow: 0 6px 0 var(--green-deep);
}

.btn-primary:active {
  box-shadow: 0 1px 0 var(--green-deep);
}

.btn-accent {
  background: var(--coral);
  color: #fffaf2;
  box-shadow: 0 4px 0 var(--coral-deep);
}

.btn-accent:hover {
  background: #e66747;
  box-shadow: 0 6px 0 var(--coral-deep);
}

.btn-accent:active {
  box-shadow: 0 1px 0 var(--coral-deep);
}

.btn-gold {
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 4px 0 #8f6811;
}

.btn-gold:hover {
  background: #edc05a;
  box-shadow: 0 6px 0 #8f6811;
}

.btn-gold:active {
  box-shadow: 0 1px 0 #8f6811;
}

.btn-paper {
  background: var(--cream);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.btn-ghost:hover {
  border-color: var(--line);
  background: rgba(255, 253, 248, 0.55);
  box-shadow: none;
  transform: none;
}

.btn-small {
  min-height: 38px;
  padding: 0 14px;
  font-size: 13px;
  box-shadow: 0 3px 0 var(--ink);
}

.btn-small .icon {
  width: 16px;
  height: 16px;
}

.btn-large {
  min-height: 56px;
  padding: 0 26px;
  font-size: 16px;
}

.btn-block {
  width: 100%;
}

.btn.is-loading {
  pointer-events: none;
}

.btn .loader {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.live-dot {
  position: relative;
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green-mid);
  box-shadow: 0 0 0 3px rgba(44, 118, 88, 0.14);
}

.live-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0;
  animation: live-pulse 2.4s ease-out infinite;
}

@keyframes live-pulse {
  0% {
    transform: scale(0.7);
    opacity: 0.65;
  }
  70%,
  100% {
    transform: scale(2.1);
    opacity: 0;
  }
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(228, 179, 63, 0.2);
}

.micro-label {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

/* ==========================================================================
   Brand + landing navigation
   ========================================================================== */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  line-height: 1;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid var(--ink);
  border-radius: 13px;
  background: var(--gold);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-3deg);
}

.brand-mark svg {
  width: 25px;
  height: 25px;
}

.brand-mark-small {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: 2px 2px 0 var(--ink);
}

.brand-mark-small svg {
  width: 21px;
  height: 21px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-copy strong {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.brand-copy small {
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.landing-view {
  min-height: 100vh;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(100% - 48px, 1240px);
  margin: 0 auto;
  padding: 24px 0 18px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-mute);
  font-size: 12px;
  font-weight: 600;
}

/* ==========================================================================
   Landing hero
   ========================================================================== */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(420px, 0.98fr);
  align-items: center;
  gap: clamp(30px, 5vw, 76px);
  width: min(100% - 48px, 1240px);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 66px) 0 clamp(56px, 8vw, 96px);
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 660px;
  padding-top: 8px;
}

.hero-copy .eyebrow {
  margin-bottom: 24px;
}

.hero h1 {
  max-width: 750px;
  font-family: var(--font-display);
  font-size: clamp(3rem, 5.75vw, 5.35rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1.04;
}

.title-accent {
  position: relative;
  display: inline;
  color: var(--green);
  background-image: linear-gradient(
    transparent 68%,
    rgba(228, 179, 63, 0.62) 68%,
    rgba(228, 179, 63, 0.62) 94%,
    transparent 94%
  );
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.hero-lede {
  max-width: 580px;
  margin-top: 26px;
  color: var(--ink-soft);
  font-size: clamp(15px, 1.55vw, 18px);
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 11px 22px;
  margin-top: 30px;
  color: var(--ink-mute);
  font-size: 12px;
  font-weight: 600;
}

.hero-points li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-points .icon {
  width: 15px;
  height: 15px;
  color: var(--green-mid);
}

.recent-room {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 370px);
  margin-top: 20px;
  padding: 10px 14px 10px 10px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.62);
  text-align: left;
  cursor: pointer;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

.recent-room:hover {
  border-color: rgba(23, 37, 29, 0.3);
  background: var(--white);
  transform: translateY(-1px);
}

.recent-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green);
}

.recent-icon .icon {
  width: 18px;
  height: 18px;
}

.recent-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.recent-copy small {
  color: var(--ink-mute);
  font-size: 10px;
  font-weight: 600;
}

.recent-copy strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-arrow {
  width: 17px;
  height: 17px;
  color: var(--ink-mute);
}

/* ---- Hero visual: miniature Monopoly board + live scorecard ---- */

.hero-visual {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.board-scene {
  position: relative;
  width: min(100%, 548px);
  aspect-ratio: 1 / 1;
}

.board-frame {
  position: absolute;
  inset: 10px 4px 18px 10px;
  overflow: hidden;
  border: 2.5px solid var(--ink);
  border-radius: 26px;
  background: #e5ebda;
  box-shadow:
    12px 15px 0 rgba(23, 37, 29, 0.16),
    inset 0 0 0 8px #f8f3e6,
    inset 0 0 0 10px var(--ink);
  transform: rotate(-1.2deg);
}

.board-frame::before {
  content: "";
  position: absolute;
  inset: 58px;
  border: 1.5px solid rgba(23, 37, 29, 0.32);
  border-radius: 5px;
  background-color: #dfe7d4;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.3) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.3) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.3) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.3) 75%);
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  background-size: 18px 18px;
}

.board-edge {
  position: absolute;
  z-index: 1;
  display: flex;
}

.board-edge-top,
.board-edge-bottom {
  left: 58px;
  right: 58px;
  height: 58px;
}

.board-edge-top {
  top: 0;
}

.board-edge-bottom {
  bottom: 0;
}

.board-edge-left,
.board-edge-right {
  top: 58px;
  bottom: 58px;
  width: 58px;
  flex-direction: column;
}

.board-edge-left {
  left: 0;
}

.board-edge-right {
  right: 0;
}

.board-tile {
  position: relative;
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: flex-end;
  justify-content: center;
  padding: 5px 2px;
  border: 1px solid rgba(23, 37, 29, 0.55);
  background: #f9f4e7;
  color: rgba(23, 37, 29, 0.72);
  font-family: var(--font-mono);
  font-size: 6.5px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  letter-spacing: -0.02em;
}

.board-edge-left .board-tile,
.board-edge-right .board-tile {
  align-items: center;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  padding: 2px 5px;
}

.board-tile::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 11px;
  border-bottom: 1px solid rgba(23, 37, 29, 0.45);
  background: var(--tile-color, transparent);
}

.board-edge-left .board-tile::before,
.board-edge-right .board-tile::before {
  inset: 0 0 0 auto;
  width: 11px;
  height: auto;
  border-bottom: none;
  border-left: 1px solid rgba(23, 37, 29, 0.45);
}

.board-tile i {
  position: relative;
  z-index: 1;
  font-style: normal;
}

.tile-coral {
  --tile-color: #df6a4b;
}

.tile-gold {
  --tile-color: #e6b744;
}

.tile-sky {
  --tile-color: #6a9bdc;
}

.tile-green {
  --tile-color: #3b8a69;
}

.score-slip {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: 68%;
  padding: clamp(15px, 2.4vw, 23px);
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--white);
  box-shadow:
    7px 8px 0 rgba(23, 37, 29, 0.85),
    0 22px 50px rgba(23, 37, 29, 0.15);
  transform: translate(-50%, -50%) rotate(-2deg);
}

.score-slip-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(23, 37, 29, 0.22);
}

.score-slip-head strong {
  display: block;
  font-size: clamp(15px, 2vw, 19px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid rgba(29, 90, 66, 0.26);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.live-pill .live-dot {
  width: 5px;
  height: 5px;
}

.preview-ranking {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
}

.preview-ranking li {
  display: grid;
  grid-template-columns: 22px 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
}

.preview-ranking li + li {
  border-top: 1px solid rgba(23, 37, 29, 0.07);
}

.preview-rank {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--cream);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
}

.rank-gold {
  border-color: #c69118;
  background: var(--gold);
}

.rank-silver {
  background: #e8e8e4;
}

.rank-bronze {
  background: #e7c4a4;
}

.preview-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--ink);
  border-radius: 9px;
  background: var(--avatar, var(--green));
  color: #fffaf2;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 1.5px 1.5px 0 var(--ink);
}

.preview-person {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0;
}

.preview-person strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-person small {
  overflow: hidden;
  color: var(--ink-mute);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-money {
  font-family: var(--font-mono);
  font-size: clamp(10px, 1.3vw, 12px);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.score-slip-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(23, 37, 29, 0.22);
  color: var(--ink-mute);
  font-size: 8px;
  font-weight: 600;
}

.score-slip-foot > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.score-slip-foot .icon {
  width: 11px;
  height: 11px;
}

.online-stack {
  display: inline-flex;
}

.online-stack i {
  width: 11px;
  height: 11px;
  margin-left: -3px;
  border: 1.5px solid var(--white);
  border-radius: 50%;
  background: var(--green-mid);
}

.online-stack i:first-child {
  margin-left: 0;
  background: var(--coral);
}

.online-stack i:nth-child(2) {
  background: var(--gold);
}

.sync-copy {
  color: var(--green);
}

.floating-bank-card {
  position: absolute;
  z-index: 4;
  right: -12px;
  bottom: 2%;
  display: flex;
  width: 154px;
  flex-direction: column;
  gap: 1px;
  padding: 11px 14px;
  border: 2px solid var(--ink);
  border-radius: 13px;
  background: var(--green-deep);
  color: var(--cream);
  box-shadow: 5px 6px 0 rgba(23, 37, 29, 0.25);
  transform: rotate(3deg);
}

.float-label {
  color: rgba(251, 247, 236, 0.6);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.floating-bank-card strong {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: -0.04em;
}

.float-tag {
  color: rgba(251, 247, 236, 0.75);
  font-size: 8px;
}

.floating-dice {
  position: absolute;
  z-index: 4;
  top: 0;
  right: -2%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 58px;
  height: 58px;
  padding: 10px;
  border: 2px solid var(--ink);
  border-radius: 15px;
  background: var(--coral);
  box-shadow: 4px 5px 0 rgba(23, 37, 29, 0.85);
  transform: rotate(10deg);
}

.floating-dice span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff6e9;
}

.floating-dice i {
  width: 4px;
  height: 4px;
  align-self: end;
  justify-self: end;
  border-radius: 50%;
  background: rgba(255, 246, 233, 0.5);
}

.visual-caption {
  margin-top: 26px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

/* ==========================================================================
   Landing features + how it works + footer
   ========================================================================== */

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  width: min(100% - 48px, 1240px);
  margin: 0 auto;
}

.feature-card {
  position: relative;
  overflow: hidden;
  min-height: 250px;
  padding: 27px 26px 25px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--cream);
  box-shadow: var(--shadow-hard);
  transition:
    transform 0.2s var(--ease-out),
    box-shadow 0.2s var(--ease-out);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 0 rgba(23, 37, 29, 0.13);
}

.feature-card-green {
  background: #e1eadc;
}

.feature-card-coral {
  background: #f7ded5;
}

.feature-card-gold {
  background: #f6e8bd;
}

.feature-index {
  position: absolute;
  top: 20px;
  right: 24px;
  color: rgba(23, 37, 29, 0.2);
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.08em;
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 22px;
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 3px 3px 0 var(--ink);
}

.feature-icon .icon {
  width: 23px;
  height: 23px;
}

.feature-card h2 {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.feature-card p {
  max-width: 310px;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.75;
}

.how-section {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 50px;
  width: min(100% - 48px, 1240px);
  margin: clamp(64px, 9vw, 110px) auto 0;
  padding: clamp(30px, 5vw, 54px);
  border: 2px solid var(--ink);
  border-radius: 32px;
  background: var(--green-deep);
  color: var(--cream);
  box-shadow: 0 10px 0 rgba(23, 37, 29, 0.18);
}

.how-section .eyebrow {
  color: var(--gold);
}

.how-heading h2 {
  max-width: 390px;
  margin-top: 16px;
  font-size: clamp(28px, 3.4vw, 44px);
  font-weight: 850;
  letter-spacing: -0.045em;
  line-height: 1.15;
}

.how-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.how-steps li {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  padding: 20px 0;
  border-top: 1px solid rgba(251, 247, 236, 0.17);
}

.how-steps li:last-child {
  border-bottom: 1px solid rgba(251, 247, 236, 0.17);
}

.step-number {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.how-steps h3 {
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 700;
}

.how-steps p {
  color: rgba(251, 247, 236, 0.66);
  font-size: 13px;
  line-height: 1.7;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(100% - 48px, 1240px);
  margin: 0 auto;
  padding: 42px 0 38px;
  color: var(--ink-mute);
  font-size: 11px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
}

.footer-brand small {
  margin-left: 8px;
  color: var(--ink-mute);
  font-size: 10px;
  font-weight: 400;
}

.footer-note {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Room shell + top bar
   ========================================================================== */

.room-view {
  min-height: 100vh;
}

.room-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1.5px solid rgba(23, 37, 29, 0.2);
  background: rgba(242, 236, 221, 0.9);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
}

.room-topbar-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(100% - 48px, 1320px);
  min-height: 70px;
  margin: 0 auto;
}

.brand-room {
  flex: 0 0 auto;
}

.brand-room .brand-copy strong {
  font-size: 15px;
}

.room-topbar-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.room-topbar-name {
  overflow: hidden;
  max-width: 230px;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-code-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 10px;
  border: 1.5px solid rgba(23, 37, 29, 0.23);
  border-radius: 9px;
  background: rgba(255, 253, 248, 0.62);
  color: var(--ink-mute);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease;
}

.room-code-pill:hover {
  border-color: var(--ink);
  background: var(--white);
}

.room-code-pill strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.room-code-pill .icon {
  width: 14px;
  height: 14px;
}

.room-topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.live-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.live-status[data-state="connecting"] {
  color: var(--gold-deep);
}

.live-status[data-state="reconnecting"] {
  color: var(--coral-deep);
}

.live-status[data-state="reconnecting"] .live-dot,
.live-status[data-state="connecting"] .live-dot {
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(185, 134, 22, 0.14);
}

.live-status[data-state="offline"] {
  color: var(--ink-mute);
}

.live-status[data-state="offline"] .live-dot {
  background: var(--ink-mute);
  box-shadow: none;
}

.identity-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 4px 9px 4px 5px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.7);
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease;
}

.identity-chip:hover {
  border-color: var(--ink);
  background: var(--white);
}

.identity-avatar {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  border: 1.5px solid var(--ink);
  border-radius: 9px;
  background: var(--green);
  color: var(--cream);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 1.5px 1.5px 0 var(--ink);
}

.identity-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  line-height: 1.15;
}

.identity-copy small {
  color: var(--ink-mute);
  font-size: 8px;
  font-weight: 600;
}

.identity-copy strong {
  overflow: hidden;
  max-width: 120px;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-chip .chevron {
  width: 13px;
  height: 13px;
  color: var(--ink-mute);
}

.room-main {
  width: min(100% - 48px, 1320px);
  margin: 0 auto;
  padding: 30px 0 56px;
}

.room-titlebar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.room-titlebar .eyebrow {
  margin-bottom: 8px;
}

.room-titlebar h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.8vw, 44px);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1.15;
}

.room-title-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

/* ---- summary cards ---- */

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.summary-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 17px 18px 15px;
  border: 1.5px solid rgba(23, 37, 29, 0.22);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-hard-sm);
}

.summary-card::after {
  content: "";
  position: absolute;
  top: -22px;
  right: -20px;
  width: 74px;
  height: 74px;
  border: 1.5px solid rgba(23, 37, 29, 0.1);
  border-radius: 50%;
  background: var(--summary-tint, transparent);
  opacity: 0.6;
}

.summary-green {
  --summary-tint: var(--green-soft);
  background: #f2f7ed;
}

.summary-gold {
  --summary-tint: var(--gold-soft);
  background: #fbf5e1;
}

.summary-coral {
  --summary-tint: var(--coral-soft);
  background: #fcf0eb;
}

.summary-sky {
  --summary-tint: var(--sky-soft);
  background: #f0f5fb;
}

.summary-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
  color: var(--ink-mute);
  font-size: 10px;
  font-weight: 600;
}

.summary-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(23, 37, 29, 0.16);
  border-radius: 7px;
  background: rgba(255, 253, 248, 0.64);
  color: var(--ink-soft);
}

.summary-icon .icon {
  width: 14px;
  height: 14px;
}

.summary-value {
  display: block;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: clamp(19px, 2.1vw, 25px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.summary-card small {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--ink-mute);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- room layout ---- */

.room-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  align-items: start;
  gap: 22px;
}

.col-main,
.col-side {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 22px;
}

.panel {
  min-width: 0;
  padding: 24px;
  border: 1.5px solid rgba(23, 37, 29, 0.45);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-hard);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.panel-head-tight {
  margin-bottom: 16px;
}

.panel-kicker {
  margin-bottom: 5px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.panel-head h2,
.bank-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 850;
  letter-spacing: -0.045em;
  line-height: 1.2;
}

.panel-subtitle {
  margin-top: 5px;
  color: var(--ink-mute);
  font-size: 11px;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border: 1px solid rgba(23, 37, 29, 0.2);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

/* ==========================================================================
   Leaderboard
   ========================================================================== */

.leaderboard-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 142px 138px 38px;
  gap: 14px;
  padding: 0 12px 8px;
  border-bottom: 1px dashed rgba(23, 37, 29, 0.2);
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.leaderboard-head .align-right {
  text-align: right;
}

.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 8px;
}

.player-row {
  position: relative;
  display: grid;
  grid-template-columns: 38px 46px minmax(0, 1fr) 142px 138px 38px;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 9px 12px;
  border: 1.5px solid transparent;
  border-radius: 15px;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s var(--ease-out);
  animation: row-in 0.35s var(--ease-out) both;
}

@keyframes row-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.player-row:hover {
  border-color: rgba(23, 37, 29, 0.13);
  background: rgba(242, 236, 221, 0.5);
}

.player-row.is-self {
  border-color: rgba(29, 90, 66, 0.32);
  background: #f1f7ed;
}

.player-row.is-first {
  background:
    linear-gradient(90deg, rgba(246, 232, 189, 0.66), rgba(255, 253, 248, 0) 72%);
}

.player-row.is-first.is-self {
  background:
    linear-gradient(90deg, rgba(246, 232, 189, 0.65), rgba(241, 247, 237, 0.86) 72%);
}

.rank-badge {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border: 1.5px solid rgba(23, 37, 29, 0.22);
  border-radius: 10px;
  background: var(--cream);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.rank-badge.rank-1 {
  border-color: var(--ink);
  background: var(--gold);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}

.rank-badge.rank-2 {
  border-color: #9c9c96;
  background: #ebeae4;
}

.rank-badge.rank-3 {
  border-color: #b57c4d;
  background: #ecd0b3;
}

.rank-crown {
  position: absolute;
  top: -9px;
  left: 13px;
  color: var(--gold-deep);
  transform: rotate(-14deg);
}

.rank-crown .icon {
  width: 14px;
  height: 14px;
}

.player-avatar {
  display: grid;
  place-items: center;
  width: 41px;
  height: 41px;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  background: var(--avatar, var(--green));
  color: #fffaf2;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 2px 2px 0 var(--ink);
}

.player-identity {
  min-width: 0;
}

.player-name-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.player-name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.self-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border: 1px solid rgba(29, 90, 66, 0.3);
  border-radius: 5px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.host-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border: 1px solid rgba(183, 134, 22, 0.35);
  border-radius: 5px;
  background: var(--gold-soft);
  color: var(--gold-deep);
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.player-meta-line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 3px;
  color: var(--ink-mute);
  font-size: 9px;
}

.player-presence {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.presence-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #a5ada7;
}

.presence-dot.online {
  background: var(--green-mid);
  box-shadow: 0 0 0 2px rgba(44, 118, 88, 0.13);
}

.player-share {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.share-track {
  overflow: hidden;
  width: 96px;
  height: 7px;
  border: 1px solid rgba(23, 37, 29, 0.13);
  border-radius: 999px;
  background: rgba(23, 37, 29, 0.07);
}

.share-fill {
  display: block;
  width: var(--share, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--bar-color, var(--green-mid));
  transition: width 0.55s var(--ease-out);
}

.share-number {
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.player-balance {
  min-width: 0;
  text-align: right;
}

.player-balance strong {
  display: block;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.05em;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.player-balance small {
  display: block;
  margin-top: 1px;
  color: var(--ink-mute);
  font-size: 8px;
}

.send-shortcut {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1.5px solid rgba(23, 37, 29, 0.24);
  border-radius: 10px;
  background: var(--cream);
  color: var(--ink-soft);
  cursor: pointer;
  transition:
    background-color 0.16s ease,
    color 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

.send-shortcut:hover {
  border-color: var(--ink);
  background: var(--green);
  color: var(--cream);
  transform: translateY(-1px);
}

.send-shortcut .icon {
  width: 16px;
  height: 16px;
}

.send-shortcut.is-disabled {
  visibility: hidden;
  pointer-events: none;
}

.leaderboard-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(23, 37, 29, 0.2);
  color: var(--ink-mute);
  font-size: 9px;
}

.leaderboard-foot > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.leaderboard-foot .live-dot {
  width: 5px;
  height: 5px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 46px 20px 44px;
  text-align: center;
}

.empty-state-compact {
  padding: 32px 18px;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 14px;
  border: 1.5px dashed rgba(23, 37, 29, 0.3);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink-mute);
}

.empty-icon .icon {
  width: 24px;
  height: 24px;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 700;
}

.empty-state p {
  max-width: 330px;
  margin-top: 5px;
  color: var(--ink-mute);
  font-size: 11px;
}

.empty-state .btn {
  margin-top: 16px;
}

/* ==========================================================================
   History
   ========================================================================== */

.history-head {
  align-items: flex-end;
}

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(23, 37, 29, 0.14);
  border-radius: 9px;
  background: var(--paper);
}

.segmented button {
  min-height: 27px;
  padding: 0 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-mute);
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.16s ease,
    color 0.16s ease;
}

.segmented button:hover {
  color: var(--ink);
}

.segmented button.active {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(23, 37, 29, 0.1);
}

.history-list {
  display: flex;
  max-height: 530px;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(23, 37, 29, 0.22) transparent;
}

.history-list::-webkit-scrollbar {
  width: 5px;
}

.history-list::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(23, 37, 29, 0.18);
}

.history-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px 8px;
  border-bottom: 1px dashed rgba(23, 37, 29, 0.12);
  animation: row-in 0.3s var(--ease-out) both;
}

.history-item:last-child {
  border-bottom: 0;
}

.history-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid rgba(23, 37, 29, 0.14);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink-soft);
}

.history-icon .icon {
  width: 15px;
  height: 15px;
}

.history-icon[data-type="player"] {
  background: var(--green-soft);
  color: var(--green);
}

.history-icon[data-type="bank-grant"],
.history-icon[data-type="bank-open"],
.history-icon[data-type="bank-fund"],
.history-icon[data-type="bank-collect"],
.history-icon[data-type="player-add"] {
  background: var(--gold-soft);
  color: var(--gold-deep);
}

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

.history-route {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-size: 11px;
  font-weight: 600;
}

.history-route .route-name {
  overflow: hidden;
  max-width: 42%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-arrow {
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 10px;
}

.history-note {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  color: var(--ink-mute);
  font-size: 9px;
}

.history-note time {
  font-family: var(--font-mono);
  font-size: 8px;
}

.history-note .dot-sep {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: currentColor;
}

.history-amount {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.history-type {
  display: block;
  margin-top: 1px;
  color: var(--ink-mute);
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0;
}

/* ==========================================================================
   Transfer panel
   ========================================================================== */

.instant-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border: 1px solid rgba(29, 90, 66, 0.2);
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.instant-chip .icon {
  width: 11px;
  height: 11px;
}

.guest-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 12px 14px;
  text-align: center;
}

.guest-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 12px;
  border: 1.5px dashed rgba(23, 37, 29, 0.28);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink-mute);
}

.guest-icon .icon {
  width: 21px;
  height: 21px;
}

.guest-state h3 {
  font-size: 14px;
  font-weight: 700;
}

.guest-state p {
  max-width: 280px;
  margin: 5px 0 14px;
  color: var(--ink-mute);
  font-size: 10px;
  line-height: 1.65;
}

.wallet-strip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  margin-bottom: 16px;
  padding: 12px;
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  background:
    radial-gradient(circle at 90% 20%, rgba(228, 179, 63, 0.18), transparent 36%),
    var(--green-deep);
  color: var(--cream);
  box-shadow: 2px 2px 0 rgba(23, 37, 29, 0.25);
}

.wallet-strip::after {
  content: "";
  position: absolute;
  top: -14px;
  right: -10px;
  width: 60px;
  height: 60px;
  border: 1px solid rgba(251, 247, 236, 0.14);
  border-radius: 50%;
}

.wallet-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1.5px solid rgba(251, 247, 236, 0.8);
  border-radius: 11px;
  background: var(--coral);
  color: #fffaf2;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.22);
}

.wallet-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.wallet-copy small {
  color: rgba(251, 247, 236, 0.66);
  font-size: 8px;
}

.wallet-copy strong {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.wallet-name {
  overflow: hidden;
  max-width: 110px;
  margin-left: auto;
  color: rgba(251, 247, 236, 0.72);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.money-form,
.bank-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.field > label {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
}

.field > label span {
  color: var(--ink-mute);
  font-weight: 400;
}

.input,
.field input,
.select-wrap select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1.5px solid rgba(23, 37, 29, 0.2);
  border-radius: 10px;
  background: var(--cream);
  color: var(--ink);
  font-size: 13px;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease;
}

.field input::placeholder {
  color: #9ba39d;
}

.field input:hover,
.select-wrap select:hover {
  border-color: rgba(23, 37, 29, 0.36);
}

.field input:focus,
.select-wrap select:focus {
  border-color: var(--green);
  outline: none;
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(29, 90, 66, 0.12);
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  padding-right: 36px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.select-wrap select option {
  background: var(--white);
  color: var(--ink);
}

.select-arrow {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 15px;
  height: 15px;
  color: var(--ink-mute);
  pointer-events: none;
  transform: translateY(-50%);
}

.money-input {
  position: relative;
  display: flex;
  align-items: center;
  height: 56px;
  border: 1.5px solid rgba(23, 37, 29, 0.22);
  border-radius: 12px;
  background: var(--cream);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease;
}

.money-input:focus-within {
  border-color: var(--green);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(29, 90, 66, 0.12);
}

.money-input .currency {
  padding-left: 14px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
}

.money-input input {
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0 14px 0 7px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.055em;
  outline: none;
  font-variant-numeric: tabular-nums;
}

.money-input input::placeholder {
  color: #b1b7b1;
}

.amount-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.amount-hints button {
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(23, 37, 29, 0.17);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}

.amount-hints button:hover {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.form-error {
  padding: 8px 10px;
  border: 1px solid rgba(185, 61, 44, 0.25);
  border-radius: 8px;
  background: #fbe8e4;
  color: var(--danger);
  font-size: 10px;
  line-height: 1.5;
}

.form-hint {
  color: var(--ink-mute);
  font-size: 9px;
  line-height: 1.6;
  text-align: center;
}

/* ==========================================================================
   Bank panel (dark)
   ========================================================================== */

.bank-panel {
  position: relative;
  overflow: hidden;
  border-color: var(--ink);
  background:
    radial-gradient(circle at 110% -10%, rgba(228, 179, 63, 0.2), transparent 40%),
    var(--green-deep);
  color: var(--cream);
  box-shadow: 0 7px 0 rgba(23, 37, 29, 0.18);
}

.bank-panel::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(251, 247, 236, 0.12);
  border-radius: 19px;
  pointer-events: none;
}

.bank-panel > * {
  position: relative;
  z-index: 1;
}

.bank-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.bank-title-wrap {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.bank-emblem {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1.5px solid var(--gold);
  border-radius: 11px;
  background: rgba(228, 179, 63, 0.12);
  color: var(--gold);
}

.bank-emblem .icon {
  width: 21px;
  height: 21px;
}

.bank-head .panel-kicker {
  color: rgba(251, 247, 236, 0.48);
}

.bank-head h2 {
  overflow: hidden;
  max-width: 180px;
  font-size: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bank-balance {
  flex: 0 0 auto;
  text-align: right;
}

.bank-balance small {
  display: block;
  color: rgba(251, 247, 236, 0.55);
  font-size: 8px;
}

.bank-balance strong {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
}

.bank-meta {
  margin-bottom: 15px;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(251, 247, 236, 0.14);
  color: rgba(251, 247, 236, 0.55);
  font-size: 9px;
}

.bank-admin {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tool-button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(251, 247, 236, 0.18);
  border-radius: 10px;
  background: rgba(251, 247, 236, 0.06);
  color: var(--cream);
  text-align: left;
  cursor: pointer;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease;
}

.tool-button:hover {
  border-color: rgba(251, 247, 236, 0.4);
  background: rgba(251, 247, 236, 0.1);
}

.tool-icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  border-radius: 7px;
  background: rgba(228, 179, 63, 0.14);
  color: var(--gold);
}

.tool-icon .icon {
  width: 14px;
  height: 14px;
}

.tool-button span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0;
}

.tool-button strong {
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.tool-button small {
  overflow: hidden;
  color: rgba(251, 247, 236, 0.45);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bank-form {
  padding-top: 13px;
  border-top: 1px solid rgba(251, 247, 236, 0.14);
}

.bank-form .field > label {
  color: rgba(251, 247, 236, 0.7);
}

.bank-form .field > label span {
  color: rgba(251, 247, 236, 0.4);
}

.bank-form .field input,
.select-wrap-dark select {
  border-color: rgba(251, 247, 236, 0.2);
  background: rgba(251, 247, 236, 0.08);
  color: var(--cream);
}

.bank-form .field input::placeholder {
  color: rgba(251, 247, 236, 0.35);
}

.bank-form .field input:hover,
.select-wrap-dark select:hover {
  border-color: rgba(251, 247, 236, 0.4);
}

.bank-form .field input:focus,
.select-wrap-dark select:focus {
  border-color: var(--gold);
  background: rgba(251, 247, 236, 0.12);
  box-shadow: 0 0 0 3px rgba(228, 179, 63, 0.13);
}

.select-wrap-dark .select-arrow {
  color: rgba(251, 247, 236, 0.6);
}

.select-wrap-dark select option {
  background: #224b39;
  color: var(--cream);
}

.money-input-dark {
  border-color: rgba(251, 247, 236, 0.2);
  background: rgba(251, 247, 236, 0.08);
}

.money-input-dark:focus-within {
  border-color: var(--gold);
  background: rgba(251, 247, 236, 0.12);
  box-shadow: 0 0 0 3px rgba(228, 179, 63, 0.13);
}

.money-input-dark .currency {
  color: rgba(251, 247, 236, 0.6);
}

.money-input-dark input {
  color: var(--gold);
}

.money-input-dark input::placeholder {
  color: rgba(251, 247, 236, 0.3);
}

.amount-hints-dark button {
  border-color: rgba(251, 247, 236, 0.16);
  background: rgba(251, 247, 236, 0.06);
  color: rgba(251, 247, 236, 0.65);
}

.amount-hints-dark button:hover {
  border-color: var(--gold);
  background: rgba(228, 179, 63, 0.14);
  color: var(--gold);
}

.form-error-dark {
  border-color: rgba(255, 195, 181, 0.25);
  background: rgba(117, 35, 24, 0.5);
  color: #ffd4ca;
}

.network-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 8px 9px;
  border: 1px dashed rgba(251, 247, 236, 0.22);
  border-radius: 8px;
  color: rgba(251, 247, 236, 0.55);
  font-size: 8px;
  line-height: 1.6;
}

.network-hint .icon {
  width: 12px;
  height: 12px;
  margin-top: 1px;
  color: var(--gold);
}

.network-hint button {
  padding: 0;
  border: none;
  background: transparent;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 8px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.bank-public {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bank-public p {
  color: rgba(251, 247, 236, 0.62);
  font-size: 10px;
  line-height: 1.65;
}

.bank-seal {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid rgba(251, 247, 236, 0.18);
  border-radius: 5px;
  color: rgba(251, 247, 236, 0.48);
  font-size: 8px;
}

.bank-seal .icon {
  width: 11px;
  height: 11px;
}

.room-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px dashed rgba(23, 37, 29, 0.18);
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.03em;
}

.room-footer strong {
  color: var(--ink-soft);
  letter-spacing: 0.1em;
}

/* ==========================================================================
   Mobile bottom nav
   ========================================================================== */

.mobile-nav {
  display: none;
}

/* ==========================================================================
   Modals + forms
   ========================================================================== */

#modal-root {
  position: relative;
  z-index: 100;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 27, 20, 0.58);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: backdrop-in 0.2s ease both;
}

@keyframes backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  position: relative;
  width: min(100%, 540px);
  max-height: min(90dvh, 880px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 26px;
  border: 2px solid var(--ink);
  border-radius: 24px;
  background: var(--cream);
  box-shadow: 12px 12px 0 rgba(10, 20, 14, 0.28);
  animation: modal-in 0.28s var(--ease-spring) both;
  scrollbar-width: thin;
}

.modal-wide {
  width: min(100%, 650px);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px dashed rgba(23, 37, 29, 0.22);
}

.modal-kicker {
  margin-bottom: 4px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: 1.25;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1.5px solid rgba(23, 37, 29, 0.22);
  border-radius: 9px;
  background: var(--white);
  color: var(--ink-soft);
  cursor: pointer;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

.modal-close:hover {
  border-color: var(--ink);
  background: var(--paper);
  transform: rotate(3deg);
}

.modal-close .icon {
  width: 16px;
  height: 16px;
}

.modal-body {
  padding-top: 18px;
}

.modal-lede {
  margin-bottom: 18px;
  color: var(--ink-mute);
  font-size: 12px;
  line-height: 1.75;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions .btn {
  flex: 1;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
}

.field-label > span {
  color: var(--ink-mute);
  font-weight: 400;
}

.field-hint {
  color: var(--ink-mute);
  font-size: 9px;
  line-height: 1.6;
}

.room-code-input {
  height: 60px;
  padding: 0 16px;
  border: 2px solid rgba(23, 37, 29, 0.3);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-align: center;
  text-transform: uppercase;
}

.room-code-input::placeholder {
  color: #c2c7c2;
  letter-spacing: 0.28em;
}

.room-code-input:focus {
  border-color: var(--green);
  outline: none;
  box-shadow: 0 0 0 3px rgba(29, 90, 66, 0.12);
}

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

.swatch {
  position: relative;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 9px;
  background: var(--swatch);
  cursor: pointer;
  transition:
    transform 0.16s var(--ease-spring),
    border-color 0.16s ease;
}

.swatch:hover {
  transform: scale(1.06);
}

.swatch.active {
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}

.swatch.active::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fffaf2;
  transform: translate(-50%, -50%);
}

.invite-success {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.success-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(29, 90, 66, 0.22);
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
  font-weight: 600;
}

.success-badge .icon {
  width: 17px;
  height: 17px;
}

.invite-card {
  padding: 16px;
  border: 1.5px solid rgba(23, 37, 29, 0.28);
  border-radius: 14px;
  background: var(--white);
}

.invite-player {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 13px;
  border-bottom: 1px dashed rgba(23, 37, 29, 0.18);
}

.invite-player .player-avatar {
  width: 38px;
  height: 38px;
  font-size: 14px;
}

.invite-player h3 {
  font-size: 14px;
  font-weight: 700;
}

.invite-player p {
  color: var(--ink-mute);
  font-size: 9px;
}

.pin-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.pin-display span {
  color: var(--ink-mute);
  font-size: 9px;
}

.pin-display strong {
  font-family: var(--font-mono);
  font-size: 24px;
  letter-spacing: 0.18em;
  line-height: 1;
}

.invite-link-row {
  display: flex;
  gap: 6px;
}

.invite-link-row input {
  width: 100%;
  min-width: 0;
  height: 37px;
  padding: 0 10px;
  border: 1px solid rgba(23, 37, 29, 0.18);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 9px;
}

.invite-link-row .btn {
  flex: 0 0 auto;
  min-height: 37px;
  padding: 0 11px;
  font-size: 10px;
}

.copy-feedback {
  margin-top: 6px;
  color: var(--green-mid);
  font-size: 9px;
}

.invite-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.invite-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(23, 37, 29, 0.14);
  border-radius: 11px;
  background: var(--white);
}

.invite-row .player-avatar {
  width: 34px;
  height: 34px;
  font-size: 12px;
  box-shadow: 1.5px 1.5px 0 var(--ink);
}

.invite-row-main {
  min-width: 0;
}

.invite-row-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
}

.invite-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: var(--ink-mute);
  font-size: 8px;
}

.pin-tag {
  padding: 1px 5px;
  border: 1px solid rgba(23, 37, 29, 0.14);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.invite-row-actions {
  display: flex;
  gap: 5px;
}

.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(23, 37, 29, 0.18);
  border-radius: 6px;
  background: var(--cream);
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease;
}

.mini-button:hover {
  border-color: var(--ink);
  background: var(--paper);
}

.mini-button .icon {
  width: 11px;
  height: 11px;
}

.seat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.seat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(23, 37, 29, 0.16);
  border-radius: 11px;
  background: var(--white);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    transform 0.16s ease;
}

.seat-row:hover {
  border-color: var(--green);
  background: #f4f8ef;
  transform: translateX(2px);
}

.seat-row .player-avatar {
  width: 35px;
  height: 35px;
  font-size: 12px;
  box-shadow: 1.5px 1.5px 0 var(--ink);
}

.seat-row-main {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.seat-row-main strong {
  font-size: 12px;
  font-weight: 700;
}

.seat-row-main small {
  color: var(--ink-mute);
  font-size: 8px;
}

.seat-row .icon {
  width: 15px;
  height: 15px;
  color: var(--ink-mute);
}

.seat-empty {
  padding: 20px;
  border: 1px dashed rgba(23, 37, 29, 0.22);
  border-radius: 12px;
  color: var(--ink-mute);
  font-size: 10px;
  text-align: center;
}

.join-stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.room-preview {
  padding: 13px 14px;
  border: 1.5px solid rgba(23, 37, 29, 0.2);
  border-radius: 12px;
  background: var(--white);
}

.room-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

.room-preview-head h3 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.room-preview-head p {
  color: var(--ink-mute);
  font-size: 9px;
}

.room-preview-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 13px;
  color: var(--ink-mute);
  font-size: 9px;
}

.room-preview-stats strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
}

.pin-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pin-input {
  height: 56px;
  border: 2px solid rgba(23, 37, 29, 0.3);
  border-radius: 11px;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 26px;
  letter-spacing: 0.36em;
  text-align: center;
}

.pin-input:focus {
  border-color: var(--green);
  outline: none;
  box-shadow: 0 0 0 3px rgba(29, 90, 66, 0.12);
}

.pin-input::placeholder {
  color: #c4c9c4;
  letter-spacing: 0.28em;
}

.confirm-summary {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 16px;
  border: 1.5px solid rgba(23, 37, 29, 0.2);
  border-radius: 13px;
  background: var(--white);
}

.confirm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 13px;
  border-bottom: 1px dashed rgba(23, 37, 29, 0.16);
  font-size: 11px;
}

.confirm-row:last-child {
  border-bottom: 0;
}

.confirm-row span {
  color: var(--ink-mute);
}

.confirm-row strong {
  overflow: hidden;
  max-width: 70%;
  font-weight: 700;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.confirm-amount {
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.confirm-amount.is-negative {
  color: var(--coral-deep);
}

.confirm-note {
  padding: 10px 12px;
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  background: var(--gold-soft);
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.6;
}

.identity-sheet {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.identity-sheet-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1.5px solid rgba(23, 37, 29, 0.2);
  border-radius: 14px;
  background: var(--white);
}

.identity-sheet-avatar {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  background: var(--green);
  color: var(--cream);
  font-size: 18px;
  font-weight: 800;
  box-shadow: 2px 2px 0 var(--ink);
}

.identity-sheet-info h3 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.identity-sheet-info p {
  margin-top: 2px;
  color: var(--ink-mute);
  font-size: 10px;
}

.identity-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid rgba(23, 37, 29, 0.16);
  border-radius: 11px;
  background: var(--white);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease;
}

.action-row:hover {
  border-color: var(--ink);
  background: var(--paper);
}

.action-row.danger {
  color: var(--danger);
}

.action-row .icon {
  width: 16px;
  height: 16px;
}

.action-row-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.identity-note {
  padding: 10px 12px;
  border: 1px dashed rgba(23, 37, 29, 0.2);
  border-radius: 9px;
  color: var(--ink-mute);
  font-size: 9px;
  line-height: 1.65;
}

/* ==========================================================================
   Toasts
   ========================================================================== */

.toast-root {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 200;
  display: flex;
  width: min(calc(100% - 32px), 460px);
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border: 1.5px solid var(--ink);
  border-radius: 11px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 4px 5px 0 rgba(23, 37, 29, 0.2);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
  pointer-events: auto;
  animation: toast-in 0.28s var(--ease-spring) both;
}

.toast.is-leaving {
  animation: toast-out 0.22s ease both;
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green);
}

.toast-icon .icon {
  width: 13px;
  height: 13px;
}

.toast-error .toast-icon {
  background: var(--coral-soft);
  color: var(--danger);
}

.toast-info .toast-icon {
  background: var(--gold-soft);
  color: var(--gold-deep);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1180px) {
  .room-grid {
    grid-template-columns: minmax(0, 1fr) 350px;
  }

  .leaderboard-head,
  .player-row {
    grid-template-columns: 38px 42px minmax(0, 1fr) 104px 124px 34px;
    gap: 11px;
  }

  .share-track {
    width: 66px;
  }

  .player-avatar {
    width: 38px;
    height: 38px;
  }

  .panel {
    padding: 21px;
  }

  .bank-balance strong {
    font-size: 18px;
  }
}

@media (max-width: 1020px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
    gap: 32px;
  }

  .hero h1 {
    font-size: clamp(2.8rem, 5.4vw, 4.3rem);
  }

  .floating-bank-card {
    right: -4px;
  }

  .feature-card {
    padding: 23px 20px;
  }

  .room-grid {
    grid-template-columns: minmax(0, 1fr) 330px;
  }

  .room-topbar-name {
    max-width: 150px;
  }
}

@media (max-width: 959px) {
  body {
    background-attachment: scroll;
  }

  body.has-room {
    padding-bottom: 0;
  }

  .site-nav,
  .hero,
  .feature-strip,
  .how-section,
  .site-footer {
    width: min(100% - 36px, 700px);
  }

  .site-nav {
    padding-top: 18px;
  }

  .nav-live {
    display: none;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    padding-top: 36px;
    padding-bottom: 60px;
  }

  .hero-copy {
    max-width: 700px;
  }

  .hero h1 {
    font-size: clamp(2.75rem, 10vw, 4.6rem);
  }

  .hero-visual {
    width: min(100%, 540px);
    margin: 0 auto;
  }

  .feature-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature-card {
    min-height: 0;
  }

  .feature-card p {
    max-width: 550px;
  }

  .how-section {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .room-topbar-inner {
    width: calc(100% - 30px);
    min-height: 62px;
    gap: 10px;
  }

  .brand-room .brand-copy {
    display: none;
  }

  .brand-room .brand-mark {
    width: 32px;
    height: 32px;
  }

  .room-topbar-meta {
    padding-left: 10px;
    gap: 8px;
  }

  .room-topbar-name {
    display: none;
  }

  .room-code-pill {
    padding: 0 8px;
    gap: 5px;
  }

  .room-code-pill span {
    display: none;
  }

  .room-code-pill strong {
    font-size: 11px;
  }

  .live-status .live-status-text {
    display: inline;
    font-size: 9px;
  }

  .identity-copy small {
    display: none;
  }

  .identity-copy strong {
    max-width: 86px;
    font-size: 10px;
  }

  .room-main {
    width: calc(100% - 30px);
    padding-top: 20px;
    padding-bottom: calc(94px + env(safe-area-inset-bottom));
  }

  .room-titlebar {
    align-items: center;
    margin-bottom: 18px;
  }

  .room-titlebar .eyebrow {
    display: none;
  }

  .room-titlebar h1 {
    font-size: 26px;
  }

  .room-title-actions .refresh-label {
    display: none;
  }

  .room-title-actions .btn {
    padding: 0 11px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 18px;
  }

  .summary-card {
    padding: 13px 14px 12px;
  }

  .summary-value {
    font-size: 19px;
  }

  .summary-card small {
    font-size: 8px;
  }

  .room-grid {
    display: block;
    position: relative;
    min-height: 420px;
  }

  .col-main,
  .col-side {
    display: contents;
  }

  .room-grid > * > [data-mobile-tab],
  .room-grid [data-mobile-tab] {
    display: none;
  }

  .room-grid [data-mobile-tab].is-mobile-active {
    display: block;
    animation: panel-in 0.25s var(--ease-out) both;
  }

  [data-mobile-tab="board"].is-mobile-active {
    display: block;
  }

  .summary-grid {
    display: none;
  }

  .summary-grid[data-mobile-tab].is-mobile-active {
    display: grid;
  }

  @keyframes panel-in {
    from {
      opacity: 0;
      transform: translateY(6px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .panel {
    padding: 19px;
    border-radius: 21px;
  }

  .leaderboard-head {
    display: none;
  }

  .leaderboard {
    padding-top: 0;
  }

  .player-row {
    grid-template-columns: 32px 40px minmax(0, 1fr) auto 34px;
    gap: 9px;
    min-height: 64px;
    padding: 8px;
    border-radius: 12px;
  }

  .rank-badge {
    width: 29px;
    height: 29px;
    border-radius: 8px;
    font-size: 10px;
  }

  .rank-crown {
    top: -7px;
    left: 8px;
  }

  .player-avatar {
    width: 37px;
    height: 37px;
    border-radius: 10px;
    font-size: 13px;
  }

  .player-share {
    display: none;
  }

  .player-balance strong {
    font-size: 14px;
  }

  .player-balance small {
    display: none;
  }

  .send-shortcut {
    width: 32px;
    height: 32px;
  }

  .leaderboard-foot {
    margin-top: 10px;
  }

  .col-side [data-mobile-tab].is-mobile-active {
    margin-top: 0;
  }

  .history-list {
    max-height: none;
  }

  .history-panel,
  .transfer-panel,
  .bank-panel {
    margin-top: 0;
  }

  .mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 6px max(10px, env(safe-area-inset-right))
      calc(6px + env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
    border-top: 1.5px solid rgba(23, 37, 29, 0.25);
    background: rgba(251, 247, 236, 0.94);
    backdrop-filter: blur(18px) saturate(1.3);
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
    box-shadow: 0 -8px 30px rgba(23, 37, 29, 0.08);
  }

  .mobile-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 48px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--ink-mute);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition:
      color 0.16s ease,
      background-color 0.16s ease;
  }

  .mobile-nav-item .icon {
    width: 20px;
    height: 20px;
  }

  .mobile-nav-item.active {
    background: rgba(29, 90, 66, 0.08);
    color: var(--green);
  }

  .mobile-nav-item.active::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 50%;
    width: 16px;
    height: 2px;
    border-radius: 99px;
    background: var(--coral);
    transform: translateX(-50%);
  }

  .room-footer {
    display: none;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 92dvh;
    padding: 22px 17px calc(22px + env(safe-area-inset-bottom));
    border-width: 2px 0 0;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -16px 44px rgba(10, 20, 14, 0.22);
    animation: sheet-in 0.3s var(--ease-out) both;
  }

  @keyframes sheet-in {
    from {
      opacity: 0.6;
      transform: translateY(40px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .toast-root {
    bottom: calc(84px + env(safe-area-inset-bottom));
  }

  .modal-title {
    font-size: 21px;
  }

  .modal-head {
    padding-bottom: 13px;
  }
}

@media (max-width: 700px) {
  .site-nav,
  .hero,
  .feature-strip,
  .how-section,
  .site-footer {
    width: calc(100% - 30px);
  }

  .site-nav {
    gap: 8px;
  }

  .nav-actions .btn {
    min-height: 36px;
    padding: 0 12px;
    font-size: 12px;
  }

  .brand-copy strong {
    font-size: 16px;
  }

  .brand-copy small {
    font-size: 7px;
  }

  .brand-mark {
    width: 37px;
    height: 37px;
    border-radius: 11px;
  }

  .brand-mark svg {
    width: 22px;
    height: 22px;
  }

  .hero {
    padding-top: 26px;
    padding-bottom: 52px;
  }

  .hero-copy .eyebrow {
    margin-bottom: 17px;
    font-size: 9px;
  }

  .hero h1 {
    font-size: clamp(2.55rem, 12.2vw, 3.7rem);
    letter-spacing: -0.06em;
  }

  .hero-lede {
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.8;
  }

  .hero-actions {
    gap: 9px;
    margin-top: 25px;
  }

  .hero-actions .btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 50px;
    padding: 0 12px;
    font-size: 14px;
  }

  .hero-actions .btn .icon {
    width: 16px;
    height: 16px;
  }

  .hero-points {
    gap: 7px 13px;
    margin-top: 20px;
    font-size: 10px;
  }

  .recent-room {
    width: 100%;
    margin-top: 15px;
  }

  .board-scene {
    width: min(100%, 430px);
  }

  .board-frame {
    inset: 4px 2px 10px 4px;
    border-radius: 19px;
    box-shadow:
      7px 9px 0 rgba(23, 37, 29, 0.16),
      inset 0 0 0 5px #f8f3e6,
      inset 0 0 0 7px var(--ink);
  }

  .board-frame::before {
    inset: 43px;
  }

  .board-edge-top,
  .board-edge-bottom {
    left: 43px;
    right: 43px;
    height: 43px;
  }

  .board-edge-left,
  .board-edge-right {
    top: 43px;
    bottom: 43px;
    width: 43px;
  }

  .board-tile {
    font-size: 5px;
    padding: 3px 1px;
  }

  .board-tile::before {
    height: 8px;
  }

  .board-edge-left .board-tile::before,
  .board-edge-right .board-tile::before {
    width: 8px;
    height: auto;
  }

  .score-slip {
    width: 72%;
    padding: 13px;
    border-radius: 13px;
    box-shadow:
      4px 5px 0 rgba(23, 37, 29, 0.85),
      0 14px 32px rgba(23, 37, 29, 0.14);
  }

  .preview-ranking li {
    grid-template-columns: 18px 26px minmax(0, 1fr) auto;
    gap: 6px;
    padding: 5px 0;
  }

  .preview-avatar {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    font-size: 9px;
  }

  .preview-rank {
    width: 18px;
    height: 18px;
    font-size: 8px;
  }

  .preview-person strong {
    font-size: 9px;
  }

  .preview-person small {
    font-size: 7px;
  }

  .preview-money {
    font-size: 9px;
  }

  .floating-bank-card {
    right: 0;
    bottom: 0;
    width: 122px;
    padding: 8px 10px;
  }

  .floating-bank-card strong {
    font-size: 12px;
  }

  .floating-dice {
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
    padding: 8px;
    gap: 3px;
    border-radius: 11px;
  }

  .floating-dice span {
    width: 5px;
    height: 5px;
  }

  .visual-caption {
    margin-top: 15px;
  }

  .feature-strip {
    gap: 12px;
  }

  .feature-card {
    padding: 21px 18px;
    border-radius: 20px;
  }

  .feature-icon {
    width: 42px;
    height: 42px;
    margin-bottom: 16px;
    border-radius: 12px;
  }

  .feature-index {
    top: 15px;
    right: 18px;
    font-size: 28px;
  }

  .feature-card h2 {
    font-size: 18px;
  }

  .feature-card p {
    font-size: 12px;
  }

  .how-section {
    margin-top: 48px;
    padding: 26px 20px;
    border-radius: 23px;
  }

  .how-heading h2 {
    font-size: 28px;
  }

  .how-steps li {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 8px;
    padding: 16px 0;
  }

  .how-steps p {
    font-size: 12px;
  }

  .site-footer {
    padding: 30px 0 26px;
  }

  .footer-brand small {
    display: none;
  }

  .footer-note {
    font-size: 8px;
  }

  .room-topbar-inner {
    width: calc(100% - 20px);
    min-height: 58px;
  }

  .room-topbar-actions {
    gap: 7px;
  }

  .identity-chip {
    min-height: 38px;
    padding-right: 5px;
  }

  .identity-copy {
    display: none;
  }

  .identity-avatar {
    width: 29px;
    height: 29px;
  }

  .identity-chip .chevron {
    display: none;
  }

  .live-status {
    gap: 6px;
    font-size: 9px;
  }

  .room-main {
    width: calc(100% - 20px);
    padding-top: 16px;
  }

  .room-titlebar h1 {
    font-size: 23px;
  }

  .room-title-actions {
    gap: 6px;
  }

  .room-title-actions .btn {
    min-height: 35px;
    padding: 0 9px;
    font-size: 11px;
  }

  .summary-grid {
    gap: 8px;
    margin-bottom: 14px;
  }

  .summary-card {
    border-radius: 15px;
    padding: 11px 12px;
  }

  .summary-card-top {
    margin-bottom: 5px;
    font-size: 9px;
  }

  .summary-icon {
    width: 21px;
    height: 21px;
  }

  .summary-value {
    font-size: 17px;
  }

  .summary-card small {
    margin-top: 2px;
    font-size: 7px;
  }

  .panel {
    padding: 15px;
    border-radius: 19px;
  }

  .panel-head {
    gap: 10px;
    margin-bottom: 14px;
  }

  .panel-head h2,
  .bank-head h2 {
    font-size: 20px;
  }

  .panel-subtitle {
    font-size: 9px;
  }

  .panel-actions {
    gap: 5px;
  }

  .panel-actions .btn {
    min-height: 34px;
    padding: 0 9px;
    font-size: 10px;
  }

  .panel-actions .btn .icon {
    width: 14px;
    height: 14px;
  }

  .player-row {
    grid-template-columns: 27px 36px minmax(0, 1fr) auto 30px;
    gap: 7px;
    padding: 7px 6px;
  }

  .rank-badge {
    width: 25px;
    height: 25px;
    border-radius: 7px;
    font-size: 9px;
  }

  .player-avatar {
    width: 34px;
    height: 34px;
    font-size: 12px;
    border-radius: 9px;
  }

  .player-name {
    font-size: 12px;
  }

  .self-tag,
  .host-tag {
    height: 16px;
    padding: 0 4px;
    font-size: 7px;
  }

  .player-meta-line {
    margin-top: 2px;
    font-size: 8px;
  }

  .player-balance strong {
    font-size: 13px;
  }

  .send-shortcut {
    width: 29px;
    height: 29px;
    border-radius: 8px;
  }

  .send-shortcut .icon {
    width: 14px;
    height: 14px;
  }

  .history-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-head .segmented {
    width: 100%;
  }

  .history-head .segmented button {
    flex: 1;
  }

  .history-item {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 10px 4px;
  }

  .history-icon {
    width: 28px;
    height: 28px;
  }

  .history-route {
    font-size: 10px;
  }

  .history-note {
    font-size: 8px;
  }

  .history-amount {
    font-size: 11px;
  }

  .bank-head {
    gap: 8px;
  }

  .bank-emblem {
    width: 35px;
    height: 35px;
  }

  .bank-head h2 {
    max-width: 135px;
    font-size: 17px;
  }

  .bank-balance strong {
    font-size: 17px;
  }

  .admin-tools {
    grid-template-columns: 1fr;
  }

  .amount-hints button {
    min-height: 32px;
    padding: 0 11px;
    font-size: 10px;
  }

  .mini-button {
    min-height: 34px;
    padding: 0 10px;
  }

  .segmented button {
    min-height: 32px;
  }

  .toast-root {
    width: calc(100% - 24px);
  }

  .modal {
    padding-right: 15px;
    padding-left: 15px;
  }

  .modal-title {
    font-size: 20px;
  }

  .field-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .invite-link-row {
    flex-direction: column;
  }

  .invite-link-row .btn {
    width: 100%;
  }

  .invite-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .invite-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .room-code-input {
    font-size: 23px;
  }

  .pin-input {
    font-size: 23px;
  }
}

@media (max-width: 390px) {
  .hero h1 {
    font-size: 2.35rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    flex: none;
    width: 100%;
  }

  .player-row {
    grid-template-columns: 24px 32px minmax(0, 1fr) auto 28px;
    gap: 6px;
  }

  .rank-badge {
    width: 23px;
    height: 23px;
    font-size: 8px;
  }

  .player-avatar {
    width: 31px;
    height: 31px;
  }

  .player-name {
    font-size: 11px;
  }

  .player-balance strong {
    font-size: 12px;
  }

  .send-shortcut {
    width: 27px;
    height: 27px;
  }

  .room-title-actions .btn {
    font-size: 10px;
  }

  .summary-value {
    font-size: 15px;
  }
}

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

  .live-dot::after {
    display: none;
  }
}

/* ==========================================================================
   Lobby (main screen): choose an open table or create one
   ========================================================================== */

.lobby-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(410px, 0.97fr);
  align-items: center;
  gap: clamp(28px, 4.5vw, 68px);
  width: min(100% - 48px, 1240px);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 52px) 0 clamp(38px, 6vw, 66px);
}

.lobby-copy {
  min-width: 0;
}

.lobby-copy .eyebrow {
  margin-bottom: 20px;
}

.lobby-copy h1 {
  max-width: 700px;
  font-family: var(--font-display);
  font-size: clamp(3rem, 5.4vw, 5.05rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1.05;
}

.lobby-lede {
  max-width: 575px;
  margin-top: 22px;
  color: var(--ink-soft);
  font-size: clamp(14px, 1.45vw, 17px);
  line-height: 1.85;
}

.lobby-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
  margin-top: 28px;
}

.lobby-create-button {
  width: min(100%, 360px);
  min-height: 72px;
  justify-content: flex-start;
  padding: 10px 15px 10px 12px;
  border-radius: 18px;
  background: var(--ink);
  color: var(--cream);
  box-shadow: 0 5px 0 var(--green-deep);
  text-align: left;
}

.lobby-create-button:hover {
  background: #20352a;
  box-shadow: 0 7px 0 var(--green-deep);
}

.lobby-create-plus {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
}

.lobby-create-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.lobby-create-copy strong {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.lobby-create-copy small {
  color: rgba(251, 247, 236, 0.58);
  font-size: 9px;
  font-weight: 400;
}

.lobby-create-button > .icon {
  width: 17px;
  height: 17px;
  opacity: 0.72;
}

.lobby-code-button {
  min-height: 72px;
  border-radius: 18px;
  padding: 0 20px;
}

.lobby-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 24px;
  color: var(--ink-mute);
  font-size: 10px;
  font-weight: 500;
}

.lobby-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.lobby-meta strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.lobby-meta .icon {
  width: 13px;
  height: 13px;
}

.lobby-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line);
}

.lobby-points {
  margin-top: 20px;
}

.lobby-panel {
  position: relative;
  display: flex;
  min-width: 0;
  max-height: 660px;
  flex-direction: column;
  overflow: hidden;
  padding: 22px;
  border: 2px solid var(--ink);
  border-radius: 27px;
  background:
    radial-gradient(circle at 100% 0, rgba(228, 179, 63, 0.13), transparent 24rem),
    var(--white);
  box-shadow:
    10px 11px 0 rgba(23, 37, 29, 0.17),
    var(--shadow-lift);
}

.lobby-panel::after {
  content: "";
  position: absolute;
  top: -25px;
  right: -20px;
  width: 92px;
  height: 92px;
  border: 1.5px solid rgba(23, 37, 29, 0.09);
  border-radius: 50%;
  pointer-events: none;
}

.lobby-panel-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(23, 37, 29, 0.13);
}

.lobby-panel-head .eyebrow {
  margin-bottom: 5px;
}

.lobby-panel-head h2 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: clamp(19px, 2vw, 23px);
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.lobby-refresh {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid rgba(23, 37, 29, 0.2);
  border-radius: 8px;
  background: var(--cream);
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease;
}

.lobby-refresh:hover {
  border-color: var(--ink);
  background: var(--paper);
}

.lobby-refresh .icon {
  width: 13px;
  height: 13px;
}

.lobby-refresh.is-loading .icon {
  animation: spin 0.8s linear infinite;
}

.lobby-panel-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 2px 9px;
  color: var(--ink-mute);
  font-size: 8px;
}

.lobby-panel-sub > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.lobby-panel-sub .live-dot {
  width: 5px;
  height: 5px;
}

.lobby-room-list {
  display: flex;
  min-height: 200px;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 2px 4px 2px 1px;
  scrollbar-width: thin;
  scrollbar-color: rgba(23, 37, 29, 0.2) transparent;
}

.lobby-room-list::-webkit-scrollbar {
  width: 4px;
}

.lobby-room-list::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(23, 37, 29, 0.15);
}

.lobby-room-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px;
  border: 1.5px solid rgba(23, 37, 29, 0.15);
  border-radius: 14px;
  background: var(--cream);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.16s var(--ease-out),
    border-color 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease;
}

.lobby-room-card:hover {
  border-color: var(--ink);
  background: var(--white);
  box-shadow: 0 3px 0 rgba(23, 37, 29, 0.14);
  transform: translateY(-1px);
}

.lobby-room-card.is-mine {
  border-color: rgba(29, 90, 66, 0.4);
  background: #f2f8ee;
}

.lobby-room-avatars {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
}

.lobby-room-avatars .mini-avatar {
  position: absolute;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: var(--avatar);
  color: #fffaf2;
  font-size: 8px;
  font-weight: 800;
  box-shadow: 1px 1px 0 var(--ink);
}

.lobby-room-avatars .mini-avatar:nth-child(1) {
  top: 1px;
  left: 0;
  z-index: 3;
}

.lobby-room-avatars .mini-avatar:nth-child(2) {
  top: 2px;
  right: 0;
  z-index: 2;
}

.lobby-room-avatars .mini-avatar:nth-child(3) {
  right: 5px;
  bottom: 0;
  z-index: 1;
}

.lobby-room-avatars .empty-room-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px dashed rgba(23, 37, 29, 0.28);
  border-radius: 11px;
  background: var(--paper);
  color: var(--ink-mute);
}

.lobby-room-avatars .empty-room-icon .icon {
  width: 17px;
  height: 17px;
}

.lobby-room-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.lobby-room-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.lobby-room-name > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-lock {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  height: 16px;
  padding: 0 4px;
  border: 1px solid rgba(185, 61, 44, 0.2);
  border-radius: 4px;
  background: rgba(222, 90, 58, 0.09);
  color: var(--coral-deep);
  font-size: 7px;
  font-weight: 700;
}

.room-lock .icon {
  width: 9px;
  height: 9px;
}

.room-open {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  height: 16px;
  padding: 0 4px;
  border: 1px solid rgba(29, 90, 66, 0.2);
  border-radius: 4px;
  background: rgba(29, 90, 66, 0.07);
  color: var(--green);
  font-size: 7px;
  font-weight: 700;
}

.room-open .icon {
  width: 9px;
  height: 9px;
}

.lobby-room-sub {
  overflow: hidden;
  color: var(--ink-mute);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobby-room-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 8px;
  margin-top: 2px;
  color: var(--ink-mute);
  font-size: 8px;
}

.lobby-room-stats > span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.lobby-room-stats .presence-dot {
  width: 4px;
  height: 4px;
}

.lobby-room-action {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  padding: 5px 7px;
  border: 1px solid rgba(23, 37, 29, 0.15);
  border-radius: 7px;
  background: var(--white);
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.lobby-room-action .icon {
  width: 11px;
  height: 11px;
}

.lobby-room-card:hover .lobby-room-action {
  border-color: var(--green);
  background: var(--green);
  color: var(--cream);
}

.lobby-room-card.is-full .lobby-room-action {
  color: var(--ink-mute);
  background: var(--paper);
}

.lobby-room-skeleton {
  height: 76px;
  flex: 0 0 auto;
  border-radius: 14px;
  background:
    linear-gradient(100deg, rgba(23, 37, 29, 0.045) 20%, rgba(255, 255, 255, 0.56) 38%, rgba(23, 37, 29, 0.045) 56%),
    var(--cream);
  background-size: 200% 100%;
  animation: skeleton-sweep 1.5s ease-in-out infinite;
}

@keyframes skeleton-sweep {
  to {
    background-position: -200% 0;
  }
}

.lobby-empty {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
  text-align: center;
}

.lobby-empty-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin-bottom: 12px;
  border: 1.5px dashed rgba(23, 37, 29, 0.28);
  border-radius: 15px;
  background: var(--paper);
  color: var(--ink-mute);
}

.lobby-empty-icon .icon {
  width: 23px;
  height: 23px;
}

.lobby-empty h3 {
  font-size: 15px;
  font-weight: 750;
}

.lobby-empty p {
  margin: 4px 0 13px;
  color: var(--ink-mute);
  font-size: 10px;
}

.lobby-error {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  padding: 9px 10px;
  border: 1px solid rgba(185, 61, 44, 0.22);
  border-radius: 9px;
  background: #fbe8e4;
  color: var(--danger);
  font-size: 9px;
}

.lobby-error .icon {
  width: 14px;
  height: 14px;
}

.lobby-error button {
  margin-left: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 9px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.lobby-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px dashed rgba(23, 37, 29, 0.16);
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.02em;
}

.lobby-panel-foot > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lobby-panel-foot .icon {
  width: 10px;
  height: 10px;
}

.lobby-panel.is-loading .lobby-room-list {
  pointer-events: none;
}

/* ==========================================================================
   Room access + character picker
   ========================================================================== */

.join-room-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
  padding: 12px;
  border: 1.5px solid rgba(23, 37, 29, 0.17);
  border-radius: 13px;
  background: var(--white);
}

.join-room-banner .room-badge {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border: 1.5px solid var(--ink);
  border-radius: 13px;
  background: var(--green-deep);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  box-shadow: 2px 2px 0 var(--ink);
}

.join-room-banner-main {
  min-width: 0;
  flex: 1;
}

.join-room-banner-main h3 {
  overflow: hidden;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.join-room-banner-main p {
  overflow: hidden;
  margin-top: 2px;
  color: var(--ink-mute);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.join-room-banner-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 7px;
  color: var(--ink-mute);
  font-size: 8px;
}

.join-room-banner-meta strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 9px;
}

.join-room-lock {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 4px 6px;
  border: 1px solid rgba(185, 61, 44, 0.2);
  border-radius: 5px;
  background: var(--coral-soft);
  color: var(--coral-deep);
  font-size: 8px;
  font-weight: 700;
}

.join-room-lock .icon {
  width: 11px;
  height: 11px;
}

.room-access-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap input {
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-mute);
  cursor: pointer;
}

.password-toggle:hover {
  background: var(--paper);
  color: var(--ink);
}

.password-toggle .icon {
  width: 16px;
  height: 16px;
}

.join-stage-note {
  padding: 9px 11px;
  border: 1px dashed rgba(23, 37, 29, 0.18);
  border-radius: 8px;
  background: rgba(242, 236, 221, 0.58);
  color: var(--ink-mute);
  font-size: 9px;
  line-height: 1.6;
}

.character-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.character-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.character-section-head h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 750;
}

.character-section-head span {
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 8px;
}

.character-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.character-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(23, 37, 29, 0.15);
  border-radius: 11px;
  background: var(--white);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    transform 0.16s ease;
}

.character-row:hover:not(:disabled) {
  border-color: var(--green);
  background: #f3f8ee;
  transform: translateX(2px);
}

.character-row:disabled,
.character-row.is-online {
  cursor: not-allowed;
  background: rgba(242, 236, 221, 0.54);
}

.character-row .player-avatar {
  width: 36px;
  height: 36px;
  font-size: 12px;
  box-shadow: 1.5px 1.5px 0 var(--ink);
}

.character-row-main {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.character-row-main strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-row-main small {
  color: var(--ink-mute);
  font-size: 8px;
}

.character-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  padding: 3px 6px;
  border: 1px solid rgba(23, 37, 29, 0.12);
  border-radius: 5px;
  font-size: 8px;
  font-weight: 650;
  white-space: nowrap;
}

.character-status.offline {
  border-color: rgba(29, 90, 66, 0.2);
  background: var(--green-soft);
  color: var(--green);
}

.character-status.online {
  border-color: rgba(23, 37, 29, 0.12);
  background: var(--paper);
  color: var(--ink-mute);
}

.character-status .presence-dot {
  width: 4px;
  height: 4px;
}

.character-row .row-enter {
  width: 14px;
  height: 14px;
  color: var(--ink-mute);
}

.character-row:hover:not(:disabled) .row-enter {
  color: var(--green);
}

.character-row.is-online .player-avatar {
  opacity: 0.55;
}

.character-empty {
  padding: 14px;
  border: 1px dashed rgba(23, 37, 29, 0.2);
  border-radius: 10px;
  color: var(--ink-mute);
  font-size: 9px;
  line-height: 1.6;
  text-align: center;
}

.new-character-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 2px;
  padding: 11px;
  border: 1.5px dashed rgba(23, 37, 29, 0.26);
  border-radius: 11px;
  background: rgba(242, 236, 221, 0.35);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease;
}

.new-character-card:hover {
  border-color: var(--green);
  background: #f3f8ee;
}

.new-character-card .plus-badge {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid rgba(23, 37, 29, 0.2);
  border-radius: 9px;
  background: var(--paper);
  color: var(--green);
}

.new-character-card .plus-badge .icon {
  width: 16px;
  height: 16px;
}

.new-character-card span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.new-character-card strong {
  font-size: 11px;
  font-weight: 700;
}

.new-character-card small {
  color: var(--ink-mute);
  font-size: 8px;
}

.character-create-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.modal-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 11px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--ink-mute);
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
}

.modal-back-link:hover {
  color: var(--ink);
}

.modal-back-link .icon {
  width: 13px;
  height: 13px;
}

.join-mode-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.join-mode-label {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
}

.join-mode-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  border: 1px solid rgba(23, 37, 29, 0.17);
  border-radius: 10px;
  background: var(--paper);
}

.join-mode-option {
  position: relative;
  display: flex;
}

.join-mode-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.join-mode-option span {
  display: inline-flex;
  width: 100%;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--ink-mute);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}

.join-mode-option input:checked + span {
  border-color: rgba(23, 37, 29, 0.16);
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(23, 37, 29, 0.08);
}

.join-mode-option input:focus-visible + span {
  outline: 2px solid var(--coral);
  outline-offset: 1px;
}

.join-mode-option .icon {
  width: 13px;
  height: 13px;
}

.join-room-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border: 1px solid rgba(23, 37, 29, 0.12);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink-mute);
  font-size: 8px;
}

.join-room-badge .icon {
  width: 10px;
  height: 10px;
}

/* ==========================================================================
   Lobby responsive
   ========================================================================== */

@media (max-width: 1020px) {
  .lobby-hero {
    grid-template-columns: minmax(0, 1fr) minmax(350px, 0.86fr);
    gap: 30px;
  }

  .lobby-copy h1 {
    font-size: clamp(2.8rem, 5.2vw, 4.3rem);
  }

  .lobby-create-button {
    width: min(100%, 330px);
  }
}

@media (max-width: 959px) {
  .lobby-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    width: min(100% - 36px, 700px);
    padding-top: 34px;
    padding-bottom: 42px;
  }

  .lobby-copy h1 {
    font-size: clamp(2.85rem, 10vw, 4.7rem);
  }

  .lobby-lede {
    max-width: 640px;
  }

  .lobby-actions {
    align-items: stretch;
  }

  .lobby-create-button {
    width: min(100%, 380px);
  }

  .lobby-panel {
    max-height: none;
    padding: 18px;
    border-radius: 22px;
  }

  .lobby-room-list {
    max-height: 430px;
  }
}

@media (max-width: 700px) {
  .lobby-hero {
    width: calc(100% - 30px);
    padding-top: 24px;
    padding-bottom: 36px;
  }

  .lobby-copy h1 {
    font-size: clamp(2.6rem, 12.5vw, 3.8rem);
  }

  .lobby-lede {
    margin-top: 18px;
    font-size: 14px;
    line-height: 1.8;
  }

  .lobby-actions {
    flex-direction: column;
    gap: 9px;
    margin-top: 22px;
  }

  .lobby-create-button,
  .lobby-code-button {
    width: 100%;
  }

  .lobby-create-button {
    min-height: 68px;
  }

  .lobby-code-button {
    min-height: 50px;
  }

  .lobby-meta {
    margin-top: 18px;
    font-size: 9px;
  }

  .lobby-points {
    display: none;
  }

  .lobby-panel {
    padding: 15px;
    border-radius: 20px;
    box-shadow: 0 7px 0 rgba(23, 37, 29, 0.14);
  }

  .lobby-panel-head h2 {
    font-size: 19px;
  }

  .lobby-refresh {
    min-height: 30px;
  }

  .lobby-room-list {
    max-height: none;
  }

  .lobby-room-card {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    padding: 10px;
  }

  .lobby-room-name {
    font-size: 11px;
  }

  .lobby-room-action {
    padding: 5px 6px;
  }

  .lobby-panel-foot {
    font-size: 7px;
  }

  .join-room-banner {
    padding: 10px;
  }

  .join-room-banner .room-badge {
    width: 41px;
    height: 41px;
  }

  .join-room-banner-main h3 {
    font-size: 14px;
  }

  .modal-actions .btn {
    min-width: 0;
  }
}

@media (max-width: 390px) {
  .lobby-copy h1 {
    font-size: 2.45rem;
  }

  .lobby-create-copy strong {
    font-size: 14px;
  }

  .lobby-create-copy small {
    font-size: 8px;
  }

  .lobby-room-stats {
    gap: 2px 6px;
  }

  .lobby-panel-foot > span:last-child {
    display: none;
  }
}

