.utility-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}
/* Same safe-area offset on every tab: rooms/profile/ranking/club must line up. */
.utility-row.compact { padding: calc(env(safe-area-inset-top, 0px) + 14px) var(--page-gutter) 4px; max-width: 620px; margin: 0 auto; }

.balance-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 13px;
  background: rgba(8,8,10,0.7);
  backdrop-filter: blur(10px);
}
.balance-line { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.balance-line .icon { width: 15px; height: 15px; color: var(--gold); }
.balance-line--coins .icon { color: #f0c869; }
.balance-line--crystals .icon { color: #83d8ff; }
.balance-line b { font-size: 13px; font-variant-numeric: tabular-nums; }
.balance-line small { color: var(--text-muted); font-size: 11px; }
.balance-divider { width: 1px; height: 20px; background: rgba(255,255,255,0.12); }

.utility-actions { display: flex; gap: 7px; }
.square-button {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(8,8,10,0.72);
  backdrop-filter: blur(10px);
  transition: background 160ms ease, transform 160ms ease;
}
.square-button .icon { width: 17px; height: 17px; }
.square-button:active { transform: scale(0.94); background: var(--surface-raised); }
.square-button .dot { position: absolute; top: 8px; right: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent-text); }

.icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
}
.icon-button .icon { width: 17px; height: 17px; }

.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 54px;
  border: 1px solid #8f2038;
  border-radius: var(--button-radius);
  background: var(--accent);
  color: #fff5f6;
  font-size: 15px;
  font-weight: 650;
  box-shadow: 0 8px 24px rgba(120, 12, 36, 0.2);
  transition: transform 140ms ease, background 140ms ease;
}
.primary-button .icon { width: 18px; height: 18px; }
.primary-button:active { transform: scale(0.985); background: #8f1932; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 600;
}
.text-link .icon { width: 14px; height: 14px; }

.avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(145deg, #4a353c, #1b171b 70%);
  border: 1px solid rgba(255,255,255,0.1);
  color: #e8d9d0;
  font-weight: 650;
  text-transform: uppercase;
}
.avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 32% 24%, rgba(255,255,255,0.18), transparent 45%);
}
.avatar[data-seed="1"], .avatar[data-seed="7"] { background: linear-gradient(145deg, #704a35, #26191b); }
.avatar[data-seed="2"], .avatar[data-seed="8"] { background: linear-gradient(145deg, #3f5463, #171d25); }
.avatar[data-seed="3"], .avatar[data-seed="9"] { background: linear-gradient(145deg, #6b2f45, #201319); }
.avatar[data-seed="4"], .avatar[data-seed="10"] { background: linear-gradient(145deg, #5e5639, #1d1b14); }
.avatar[data-seed="5"], .avatar[data-seed="11"] { background: linear-gradient(145deg, #4c3f64, #191522); }
.avatar[data-seed="6"], .avatar[data-seed="12"] { background: linear-gradient(145deg, #634637, #221712); }
.avatar-xs { width: 22px; height: 22px; font-size: 10px; }
.avatar-md { width: 42px; height: 42px; font-size: 15px; }
.avatar-xl { width: 104px; height: 104px; font-size: 34px; }

.live-badge {
  padding: 3px 7px;
  border: 1px solid rgba(232,128,153,0.55);
  border-radius: 6px;
  color: #f0a7ba;
  background: rgba(90, 12, 30, 0.45);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.filter-row { display: flex; gap: 8px; margin-top: 18px; }
.filter-chip {
  min-height: 34px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
}
.filter-chip.is-selected { border-color: var(--text); background: var(--text); color: #111; font-weight: 650; }

.secondary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-raised);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.create-form, .nickname-form { display: grid; gap: 10px; }
.create-form label, .nickname-form label { color: var(--text-muted); font-size: 12px; }
.create-form input, .nickname-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #0f0f11;
  color: var(--text);
  font-size: 14px;
}
.create-form .check-line { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; }
.create-form .check-line input { width: 16px; min-height: auto; }
.create-form p { color: var(--text-muted); font-size: 11px; }
.confirm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

.demo-footnote { margin: 20px 0 8px; color: #777176; font-size: 11px; }

/* Update nudge for the first APK build, which cannot check for updates itself. */
.update-banner {
  position: fixed;
  z-index: 80;
  top: max(8px, env(safe-area-inset-top));
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 620px;
  margin: 0 auto;
  padding: 9px 10px;
  border: 1px solid rgba(74, 222, 128, 0.42);
  border-radius: 14px;
  background: #142019;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.update-banner[hidden] { display: none; }
.update-banner > .icon { width: 20px; height: 20px; flex: none; color: #4ade80; }
.update-banner-text { display: grid; gap: 1px; min-width: 0; flex: 1; }
.update-banner-text strong { font-size: 12px; line-height: 1.25; }
.update-banner-text small { color: var(--text-muted); font-size: 10px; line-height: 1.25; }
.update-banner-link {
  flex: none;
  padding: 7px 10px;
  border-radius: 9px;
  background: #4ade80;
  color: #08130c;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.update-banner-close {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.update-banner-close .icon { width: 16px; height: 16px; }
