:root {
  color-scheme: dark;
  --bg: #08090b;
  --surface: #111318;
  --surface-2: #171a20;
  --surface-3: #20242c;
  --ink: #f8faf7;
  --muted: #a8b0a7;
  --soft: #d8ded4;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: #4df7a4;
  --accent-strong: #20d985;
  --gold: #ffd15c;
  --red: #ff5d5d;
  --blue: #62a7ff;
  --violet: #b78cff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(135deg, #08090b 0%, #101318 44%, #090b0d 100%);
  background-size: 42px 42px, 42px 42px, auto;
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(110deg, rgba(77, 247, 164, 0.08), transparent 28%, rgba(255, 209, 92, 0.06) 64%, transparent),
    linear-gradient(180deg, transparent 0%, rgba(8, 9, 11, 0.74) 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

input {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input[type="file"] {
  height: auto;
  padding: 11px;
}

input:focus {
  border-color: rgba(77, 247, 164, 0.72);
  box-shadow: 0 0 0 3px rgba(77, 247, 164, 0.12);
  background: rgba(0, 0, 0, 0.4);
}

label,
.field-label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr) 390px;
  grid-template-rows: 78px minmax(0, 1fr);
  min-height: 100vh;
}

.topbar {
  grid-column: 1 / -1;
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 11, 0.86);
  backdrop-filter: blur(18px);
}

.brand-lockup,
.topbar-actions,
.profile-topline,
.chat-header,
.auth-card-header,
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(77, 247, 164, 0.95), rgba(255, 209, 92, 0.92)),
    #151915;
  color: #08100c;
  box-shadow: 0 0 28px rgba(77, 247, 164, 0.2);
  font-weight: 950;
  animation: brandPulse 3.2s ease-in-out infinite;
}

.topbar h1,
.profile-panel h2,
.rail-section h2,
.view-panel h2,
.chat-header h2,
.fair-panel h2,
.auth-card h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 1.45rem;
  line-height: 1.05;
}

.eyebrow,
.category {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.network-pill,
.section-head > span,
.chat-header > span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.network-pill[data-mode="mainnet-lite"] {
  border-color: rgba(255, 209, 92, 0.46);
  background:
    linear-gradient(135deg, rgba(255, 209, 92, 0.15), rgba(77, 247, 164, 0.08)),
    rgba(255, 255, 255, 0.055);
  color: #ffe39a;
  box-shadow: 0 0 22px rgba(255, 209, 92, 0.1);
}

.payment-busy .network-pill {
  animation: statusPulse 1s ease-in-out infinite;
}

.primary-button,
.secondary-button,
.danger-button,
.icon-button,
.tab,
.side-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  font-weight: 900;
  color: var(--ink);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--gold));
  color: #07100b;
  box-shadow: 0 14px 34px rgba(77, 247, 164, 0.16);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 42px rgba(77, 247, 164, 0.24);
}

.secondary-button,
.icon-button,
.side-button,
.tab {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.secondary-button:hover,
.icon-button:hover,
.side-button:hover,
.tab:hover {
  border-color: rgba(98, 167, 255, 0.72);
  color: var(--blue);
}

.danger-button {
  border-color: rgba(255, 93, 93, 0.32);
  background: rgba(255, 93, 93, 0.11);
  color: #ffaaa6;
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled,
.side-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.icon-button {
  width: 38px;
  padding: 0;
}

.compact {
  min-width: 82px;
}

.full {
  width: 100%;
}

.sidebar,
.right-rail {
  min-width: 0;
  padding: 18px;
  background: rgba(10, 11, 14, 0.76);
  backdrop-filter: blur(12px);
}

.sidebar {
  border-right: 1px solid var(--line);
}

.right-rail {
  display: grid;
  align-content: start;
  gap: 14px;
  border-left: 1px solid var(--line);
}

.workspace {
  min-width: 0;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 16px;
}

.profile-panel,
.rail-section,
.chat-panel,
.fair-panel,
.view-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.034));
  box-shadow: var(--shadow);
}

.profile-panel,
.rail-section,
.fair-panel {
  padding: 14px;
}

.profile-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.profile-panel h2 {
  font-size: 1rem;
}

.profile-panel p:not(.eyebrow),
.profile-card-large p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.avatar,
.avatar-choice {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #07100b;
  font-weight: 950;
  flex: 0 0 auto;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.custom-avatar {
  color: transparent;
}

.avatar-neon {
  background: linear-gradient(135deg, #4df7a4, #b7ffe0);
}

.avatar-gold {
  background: linear-gradient(135deg, #ffd15c, #fff2b4);
}

.avatar-red {
  background: linear-gradient(135deg, #ff5d5d, #ffc0b8);
}

.avatar-blue {
  background: linear-gradient(135deg, #62a7ff, #c2e0ff);
}

.avatar-purple {
  background: linear-gradient(135deg, #b78cff, #f2d5ff);
}

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

.tab {
  justify-content: flex-start;
}

.tab.active,
.side-button.active {
  border-color: rgba(77, 247, 164, 0.72);
  background: rgba(77, 247, 164, 0.14);
  color: var(--accent);
}

.metric-list {
  margin: 0;
  display: grid;
  gap: 10px;
}

.metric-list div {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  align-items: center;
  gap: 12px;
}

.metric-list dt {
  color: var(--muted);
  font-size: 0.78rem;
}

.metric-list dd {
  margin: 0;
  color: var(--soft);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: right;
  overflow-wrap: anywhere;
}

.hero-strip {
  min-height: 116px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(77, 247, 164, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-strip h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4.6rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 10px;
}

.hero-stats div,
.chance-card,
.pnl-grid div {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.22);
}

.hero-stats span,
.chance-card span,
.pnl-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.hero-stats strong,
.chance-card strong,
.pnl-grid strong {
  font-size: 1.15rem;
  line-height: 1.1;
}

.view-panel {
  padding: 18px;
  display: grid;
  gap: 16px;
  animation: viewIn 180ms ease both;
}

.section-head {
  justify-content: space-between;
  align-items: flex-start;
}

.section-head h2 {
  font-size: 1.35rem;
}

.coinflip-create {
  display: block;
}

.branded-coin {
  position: relative;
  width: 172px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--coin-bg);
  border: 8px solid var(--coin-ring);
  box-shadow:
    inset 0 -18px 28px rgba(88, 47, 5, 0.34),
    inset 0 14px 26px rgba(255, 255, 255, 0.34),
    0 22px 60px var(--coin-glow);
  color: #120d05;
  animation: coinHover 3.4s ease-in-out infinite;
}

.heads-brand {
  --coin-bg:
    radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.96), transparent 18%),
    radial-gradient(circle at 50% 50%, #fff5c5 0 25%, #ffd15c 26% 55%, #f3a72d 56% 72%, #81500c 100%);
  --coin-ring: #ffed9b;
  --coin-glow: rgba(255, 209, 92, 0.28);
}

.tails-brand {
  --coin-bg:
    radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.94), transparent 18%),
    radial-gradient(circle at 50% 50%, #dff0ff 0 25%, #62a7ff 26% 55%, #376bd7 56% 72%, #162756 100%);
  --coin-ring: #d8ebff;
  --coin-glow: rgba(98, 167, 255, 0.32);
  color: #06101f;
}

.branded-coin::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  border: 2px dashed rgba(18, 13, 5, 0.32);
}

.branded-coin span {
  position: absolute;
  top: 35px;
  font-size: 0.92rem;
  font-weight: 950;
}

.branded-coin strong {
  position: relative;
  font-size: 4.3rem;
  line-height: 1;
  letter-spacing: 0;
}

.create-controls {
  display: grid;
  grid-template-columns: 1.1fr minmax(150px, 0.45fr) minmax(220px, 0.8fr) minmax(180px, 0.55fr);
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
}

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

.side-button {
  min-height: 64px;
  font-size: 1rem;
}

.rooms-grid {
  display: grid;
  gap: 12px;
}

.coinflip-room {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(77, 247, 164, 0.08), transparent 38%),
    rgba(0, 0, 0, 0.22);
  animation: rowEnter 180ms ease both;
  position: relative;
  overflow: hidden;
}

.coinflip-room.ready {
  border-color: rgba(255, 209, 92, 0.38);
}

.coinflip-room.mainnet-lite-room::before {
  content: "verified mainnet deposit";
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  border: 1px solid rgba(77, 247, 164, 0.28);
  border-radius: 999px;
  background: rgba(77, 247, 164, 0.08);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.coinflip-room.pending-payout {
  border-color: rgba(255, 209, 92, 0.52);
  box-shadow: inset 0 0 0 1px rgba(255, 209, 92, 0.08);
}

.coinflip-room.settled {
  opacity: 0.78;
}

.cf-bar-player {
  min-width: 0;
  min-height: 88px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.cf-bar-player .avatar {
  width: 58px;
  height: 58px;
}

.cf-bar-player strong,
.cf-bar-player span {
  min-width: 0;
  color: var(--soft);
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-side {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold);
  font-size: 0.78rem;
  background: rgba(255, 209, 92, 0.08);
}

.cf-bar-center {
  min-height: 92px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  border: 1px solid rgba(255, 209, 92, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 209, 92, 0.08);
  text-align: center;
}

.cf-bar-center span {
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 950;
}

.cf-bar-center strong {
  font-size: 1.18rem;
}

.cf-bar-center small {
  color: var(--muted);
  font-size: 0.74rem;
}

.coinflip-stage {
  display: grid;
  place-items: center;
  gap: 10px;
  perspective: 1200px;
}

.duel-coin {
  width: 118px;
  border-width: 6px;
  animation: coinHover 3.4s ease-in-out infinite;
}

.duel-coin span {
  top: 23px;
  font-size: 0.72rem;
}

.duel-coin strong {
  font-size: 3.05rem;
}

.coin-spinning {
  animation: coinFlipResult 2.4s cubic-bezier(0.22, 0.72, 0.16, 1) both;
}

.versus-pot {
  width: 100%;
  min-height: 82px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  border: 1px solid rgba(255, 209, 92, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 209, 92, 0.08);
  text-align: center;
}

.versus-pot span {
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 950;
}

.versus-pot strong {
  font-size: 1.18rem;
}

.versus-pot small {
  color: var(--muted);
  font-size: 0.74rem;
}

.room-actions {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  gap: 8px;
}

.room-actions button {
  width: min(280px, 100%);
  justify-self: center;
}

.jackpot-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(260px, 0.7fr);
  gap: 18px;
  align-items: center;
}

.wheel-wrap {
  position: relative;
  min-height: 520px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(98, 167, 255, 0.1), transparent),
    rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.wheel-pointer {
  position: absolute;
  top: 20px;
  left: 50%;
  z-index: 4;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 34px solid var(--gold);
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.42));
}

.jackpot-wheel {
  --wheel-bg: conic-gradient(#232832 0deg 360deg);
  --wheel-rotation: 0deg;
  position: relative;
  width: min(430px, 88vw);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 12px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.42),
    0 26px 80px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.jackpot-wheel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--wheel-bg);
  transform: rotate(var(--wheel-rotation));
  transition: transform 2.2s cubic-bezier(0.2, 0.72, 0.12, 1);
}

.jackpot-wheel::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 0 38px rgba(0, 0, 0, 0.38);
}

.wheel-segment-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 50%;
  transform: rotate(var(--wheel-rotation));
  transition: transform 2.2s cubic-bezier(0.2, 0.72, 0.12, 1);
}

.jackpot-wheel.wheel-spinning::before,
.wheel-spinning .wheel-segment-layer {
  transition: transform 7.2s cubic-bezier(0.28, 0.02, 0.08, 1);
}

.jackpot-wheel.pending-payout {
  border-color: rgba(255, 209, 92, 0.32);
  box-shadow:
    inset 0 0 0 2px rgba(255, 209, 92, 0.16),
    0 26px 80px rgba(255, 209, 92, 0.08),
    0 26px 80px rgba(0, 0, 0, 0.4);
}

.wheel-wrap::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: var(--radius);
  pointer-events: none;
  background: linear-gradient(120deg, transparent 0 38%, rgba(255, 255, 255, 0.08) 48%, transparent 60% 100%);
  mix-blend-mode: screen;
}

.wheel-segment-avatar {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40px;
  height: 40px;
  margin: -20px;
  transform: rotate(var(--avatar-angle)) translateY(-142px) rotate(var(--avatar-counter));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.34);
}

.wheel-center {
  position: relative;
  z-index: 3;
  width: 142px;
  height: 142px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line-strong);
  background: rgba(8, 9, 11, 0.88);
  text-align: center;
}

.wheel-center strong {
  font-size: 1.32rem;
}

.wheel-center span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.jackpot-side {
  display: grid;
  gap: 12px;
}

.player-list {
  max-height: 260px;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 4px;
}

.player-row,
.profile-row {
  min-width: 0;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
}

.player-row span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.player-row .avatar {
  width: 32px;
  height: 32px;
  font-size: 0.76rem;
}

.player-row strong,
.profile-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-row em,
.profile-row em,
.profile-row span {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
  white-space: nowrap;
}

.profile-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.profile-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.9fr);
  gap: 14px;
}

.profile-card-large {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
}

.profile-card-large h3,
.subhead {
  margin: 0;
}

.big-avatar {
  width: 74px;
  height: 74px;
  font-size: 1.35rem;
}

.pnl-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.profile-list {
  display: grid;
  gap: 9px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.admin-summary,
.empty-state {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
  color: var(--muted);
}

.admin-payout-list {
  display: grid;
  gap: 10px;
}

.admin-payout-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 209, 92, 0.24);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 209, 92, 0.08), transparent 40%),
    rgba(0, 0, 0, 0.22);
}

.admin-payout-row strong,
.admin-payout-row span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-payout-row span,
.admin-payout-row em {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
}

.admin-payout-row em {
  color: var(--gold);
  font-weight: 900;
  white-space: nowrap;
}

.empty-state {
  text-align: center;
}

.chat-panel {
  min-height: 470px;
  display: grid;
  grid-template-rows: auto minmax(230px, 1fr) auto;
  padding: 14px;
}

.chat-header {
  justify-content: space-between;
  margin-bottom: 12px;
}

.chat-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.chat-message {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
  animation: messageIn 160ms ease both;
}

.chat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.chat-meta strong {
  min-width: 0;
  color: var(--soft);
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-message p {
  margin: 4px 0 0;
  color: #e8eee4;
  overflow-wrap: anywhere;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
}

.fair-panel h2 {
  font-size: 1.05rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(31, 35, 43, 0.98), rgba(12, 14, 18, 0.98));
  box-shadow: var(--shadow);
  animation: modalIn 180ms ease both;
}

.auth-card-header {
  justify-content: space-between;
}

.join-card {
  width: min(680px, 100%);
}

.join-modal-coin {
  min-height: 168px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(77, 247, 164, 0.08), transparent),
    rgba(0, 0, 0, 0.22);
  perspective: 1200px;
}

.join-modal-coin .duel-coin {
  width: 138px;
}

.join-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.join-preview-player,
.join-preview-pot {
  min-height: 162px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.24);
  text-align: center;
}

.join-preview-player .avatar {
  width: 82px;
  height: 82px;
  font-size: 1.22rem;
}

.join-preview-player span,
.join-preview-pot small {
  color: var(--muted);
  font-size: 0.78rem;
}

.join-preview-pot span {
  color: var(--gold);
  font-weight: 950;
}

.auth-error {
  min-height: 20px;
  color: #ffaaa6;
  font-size: 0.82rem;
  font-weight: 800;
}

.wallet-help {
  min-height: 58px;
  display: grid;
  align-content: center;
  padding: 12px 13px;
  border: 1px solid rgba(77, 247, 164, 0.28);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(77, 247, 164, 0.11), rgba(255, 209, 92, 0.06)),
    rgba(0, 0, 0, 0.22);
  color: var(--soft);
  font-size: 0.86rem;
  font-weight: 850;
  line-height: 1.35;
}

.upload-field {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.avatar-gallery {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 7px;
}

.avatar-choice {
  width: 100%;
  height: 54px;
  color: #07100b;
}

.avatar-choice.active {
  outline: 3px solid rgba(77, 247, 164, 0.5);
}

.winner-reveal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(8px);
}

.winner-card {
  width: min(420px, 100%);
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 28px;
  border: 1px solid rgba(77, 247, 164, 0.45);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(77, 247, 164, 0.18), rgba(255, 209, 92, 0.1)),
    rgba(12, 14, 18, 0.96);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.52);
  text-align: center;
  animation: winnerPop 520ms cubic-bezier(0.18, 0.88, 0.22, 1.16) both;
}

.winner-avatar {
  width: 86px;
  height: 86px;
  font-size: 1.4rem;
}

.winner-card h2 {
  margin: 0;
  font-size: 2rem;
}

.winner-card > strong {
  font-size: 1.4rem;
  color: var(--gold);
}

.hidden {
  display: none !important;
}

.hidden-dev-control {
  display: none !important;
}

@keyframes brandPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

@keyframes coinHover {
  0%,
  100% {
    transform: translateY(0) rotateY(-14deg);
  }
  50% {
    transform: translateY(-8px) rotateY(16deg);
  }
}

@keyframes coinFlipResult {
  0% {
    transform: rotateY(0deg) rotateX(0deg) scale(1);
  }
  18% {
    transform: rotateY(120deg) rotateX(12deg) scale(1.04);
  }
  62% {
    transform: rotateY(940deg) rotateX(-8deg) scale(1.08);
  }
  100% {
    transform: rotateY(1440deg) rotateX(0deg) scale(1);
  }
}

@keyframes winnerPop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes statusPulse {
  0%,
  100% {
    transform: translateY(0);
    box-shadow: 0 0 20px rgba(255, 209, 92, 0.08);
  }
  50% {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(77, 247, 164, 0.18);
  }
}

@keyframes rowEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

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

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 250px minmax(0, 1fr);
    grid-template-rows: 78px auto auto;
  }

  .right-rail {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.65fr);
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .chat-panel {
    min-height: 360px;
  }
}

@media (max-width: 980px) {
  .app-shell {
    display: block;
  }

  .topbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .network-pill {
    grid-column: 1 / -1;
  }

  .sidebar,
  .workspace,
  .right-rail {
    padding: 14px;
    border: 0;
  }

  .tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tab {
    justify-content: center;
    padding: 0 8px;
  }

  .hero-strip,
  .coinflip-create,
  .jackpot-layout,
  .profile-dashboard,
  .admin-grid,
  .admin-payout-row,
  .coinflip-room {
    grid-template-columns: 1fr;
  }

  .create-controls {
    grid-template-columns: 1fr;
  }

  .hero-stats,
  .pnl-grid,
  .right-rail {
    grid-template-columns: 1fr;
  }

  .room-actions {
    min-width: 0;
  }

  .room-actions button {
    width: 100%;
  }

  .wheel-wrap {
    min-height: 420px;
  }

  .wheel-segment-avatar {
    transform: rotate(var(--avatar-angle)) translateY(-116px) rotate(var(--avatar-counter));
  }
}

@media (max-width: 560px) {
  .topbar-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar-actions .icon-button {
    width: 100%;
  }

  .hero-strip {
    padding: 18px;
  }

  .hero-strip h2 {
    font-size: 2.15rem;
  }

  .section-head,
  .profile-card-large,
  .player-row,
  .profile-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .section-head {
    display: grid;
  }

  .cf-bar-player {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .join-preview {
    grid-template-columns: 1fr;
  }

  .jackpot-wheel {
    width: min(330px, 84vw);
  }

  .wheel-center {
    width: 118px;
    height: 118px;
  }

  .wheel-segment-avatar {
    width: 34px;
    height: 34px;
    margin: -17px;
    transform: rotate(var(--avatar-angle)) translateY(-96px) rotate(var(--avatar-counter));
  }

  .chat-form {
    grid-template-columns: 1fr;
  }
}
