@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* Scale with viewport - supports 5120x2880 (5K) and smaller */
html {
  font-size: clamp(0.75rem, 2vmin + 0.625rem, 2.25rem);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--lobby-accent, #c9b896) 65%, var(--lobby-border, #30363d))
    var(--lobby-input-bg, #0d1117);
}

body {
  font-family: 'Press Start 2P', monospace;
  background: #0a0a0a;
  min-height: 100vh;
  height: 100vh;
  color: #ddd;
  overflow: hidden;
  image-rendering: pixelated;
}

.hidden { display: none !important; }

/* ── Game selection screen ── */
#game-select-screen {
  --lobby-bg: linear-gradient(135deg, #0a0a0a 0%, #0f1419 100%);
  --lobby-card-bg-opacity: 0.7;
  --lobby-card-bg-rgb: 22, 27, 34;
  --lobby-card-bg: rgba(var(--lobby-card-bg-rgb), var(--lobby-card-bg-opacity));
  --lobby-border: #30363d;
  --lobby-text: #c9d1d9;
  --lobby-muted: #8b949e;
  --lobby-accent: #c9b896;
  --lobby-input-bg: #0d1117;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  height: 100vh;
  padding: clamp(0.9rem, 2.8vw, 1.5rem);
  overflow: hidden;
  background: var(--lobby-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--lobby-text);
  position: relative;
}

#game-select-screen.has-bg-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 0;
}

#game-select-screen > .game-select-layout {
  position: relative;
  z-index: 1;
}

/* ── Theme overrides ── */
#game-select-screen.theme-amber {
  --lobby-bg: linear-gradient(145deg, #1e1b1a 0%, #2d2620 100%);
  --lobby-card-bg-rgb: 45, 38, 32;
  --lobby-card-bg: rgba(var(--lobby-card-bg-rgb), var(--lobby-card-bg-opacity));
  --lobby-border: #4a3f36;
  --lobby-text: #e0d4c8;
  --lobby-muted: #8b7355;
  --lobby-accent: #d4a574;
  --lobby-input-bg: #1e1b1a;
}
#game-select-screen.theme-slate {
  --lobby-bg: linear-gradient(145deg, #0f1419 0%, #1a2332 100%);
  --lobby-card-bg-rgb: 26, 35, 50;
  --lobby-card-bg: rgba(var(--lobby-card-bg-rgb), var(--lobby-card-bg-opacity));
  --lobby-border: #2d3d52;
  --lobby-text: #b8d4e8;
  --lobby-muted: #6b8fb8;
  --lobby-accent: #58a6ff;
  --lobby-input-bg: #0f1419;
}
#game-select-screen.theme-gray {
  --lobby-bg: linear-gradient(145deg, #2a2a2e 0%, #3d3d42 100%);
  --lobby-card-bg-rgb: 61, 61, 66;
  --lobby-card-bg: rgba(var(--lobby-card-bg-rgb), var(--lobby-card-bg-opacity));
  --lobby-border: #505056;
  --lobby-text: #d4d4d8;
  --lobby-muted: #71717a;
  --lobby-accent: #9ca3af;
  --lobby-input-bg: #2a2a2e;
}
#game-select-screen.theme-blue {
  --lobby-bg: linear-gradient(145deg, #0c1929 0%, #132f4c 100%);
  --lobby-card-bg-rgb: 19, 47, 76;
  --lobby-card-bg: rgba(var(--lobby-card-bg-rgb), var(--lobby-card-bg-opacity));
  --lobby-border: #1e4976;
  --lobby-text: #b8d4f0;
  --lobby-muted: #5b8fc4;
  --lobby-accent: #0ea5e9;
  --lobby-input-bg: #0c1929;
}
#game-select-screen.theme-waterfront {
  --lobby-bg: linear-gradient(145deg, #161008 0%, #1e1810 100%);
  --lobby-card-bg-rgb: 22, 16, 8;
  --lobby-card-bg: rgba(var(--lobby-card-bg-rgb), var(--lobby-card-bg-opacity));
  --lobby-border: #4a3c2a;
  --lobby-text: #e0d4c0;
  --lobby-muted: #8a7458;
  --lobby-accent: #d4a55c;
  --lobby-input-bg: #161008;
}
#game-select-screen.theme-buildings {
  --lobby-bg: linear-gradient(145deg, #12141c 0%, #1a1e2a 100%);
  --lobby-card-bg-rgb: 18, 20, 28;
  --lobby-card-bg: rgba(var(--lobby-card-bg-rgb), var(--lobby-card-bg-opacity));
  --lobby-border: #3e4258;
  --lobby-text: #c8ccd6;
  --lobby-muted: #606878;
  --lobby-accent: #7a8a9e;
  --lobby-input-bg: #12141c;
}
#game-select-screen.theme-apartments {
  --lobby-bg: linear-gradient(145deg, #14100c 0%, #1e1610 100%);
  --lobby-card-bg-rgb: 20, 16, 12;
  --lobby-card-bg: rgba(var(--lobby-card-bg-rgb), var(--lobby-card-bg-opacity));
  --lobby-border: #4a3824;
  --lobby-text: #dcd0c0;
  --lobby-muted: #887050;
  --lobby-accent: #d4a060;
  --lobby-input-bg: #14100c;
}
#game-select-screen.theme-fireflies {
  --lobby-bg: linear-gradient(145deg, #0a100e 0%, #101c18 100%);
  --lobby-card-bg-rgb: 8, 16, 14;
  --lobby-card-bg: rgba(var(--lobby-card-bg-rgb), var(--lobby-card-bg-opacity));
  --lobby-border: #2a4a3e;
  --lobby-text: #b8d4c6;
  --lobby-muted: #4a7a66;
  --lobby-accent: #5ca882;
  --lobby-input-bg: #0a100e;
}
#game-select-screen.theme-snowy-lot {
  --lobby-bg: linear-gradient(145deg, #100e16 0%, #181624 100%);
  --lobby-card-bg-rgb: 16, 14, 22;
  --lobby-card-bg: rgba(var(--lobby-card-bg-rgb), var(--lobby-card-bg-opacity));
  --lobby-border: #3a3848;
  --lobby-text: #cccad8;
  --lobby-muted: #606078;
  --lobby-accent: #8a92b8;
  --lobby-input-bg: #100e16;
}
#game-select-screen.theme-rolling-fog {
  --lobby-bg: linear-gradient(145deg, #1a1e14 0%, #242a1c 100%);
  --lobby-card-bg-rgb: 22, 26, 18;
  --lobby-card-bg: rgba(var(--lobby-card-bg-rgb), var(--lobby-card-bg-opacity));
  --lobby-border: #3d4a35;
  --lobby-text: #c8d4c0;
  --lobby-muted: #5a6b52;
  --lobby-accent: #7a9a6e;
  --lobby-input-bg: #1a1e14;
}

/* Body theme vars for overlays and game screens */
body {
  --lobby-accent: #c9b896;
  --lobby-border: #30363d;
  --lobby-text: #c9d1d9;
  --lobby-input-bg: #0d1117;
}
body.theme-amber { --lobby-accent: #d4a574; --lobby-border: #4a3f36; --lobby-text: #e0d4c8; --lobby-input-bg: #1e1b1a; }
body.theme-slate { --lobby-accent: #58a6ff; --lobby-border: #2d3d52; --lobby-text: #b8d4e8; --lobby-input-bg: #0f1419; }
body.theme-gray { --lobby-accent: #9ca3af; --lobby-border: #505056; --lobby-text: #d4d4d8; --lobby-input-bg: #2a2a2e; }
body.theme-blue { --lobby-accent: #0ea5e9; --lobby-border: #1e4976; --lobby-text: #b8d4f0; --lobby-input-bg: #0c1929; }
body.theme-waterfront { --lobby-accent: #d4a55c; --lobby-border: #4a3c2a; --lobby-text: #e0d4c0; --lobby-input-bg: #161008; }
body.theme-buildings { --lobby-accent: #7a8a9e; --lobby-border: #3e4258; --lobby-text: #c8ccd6; --lobby-input-bg: #12141c; }
body.theme-apartments { --lobby-accent: #d4a060; --lobby-border: #4a3824; --lobby-text: #dcd0c0; --lobby-input-bg: #14100c; }
body.theme-fireflies { --lobby-accent: #5ca882; --lobby-border: #2a4a3e; --lobby-text: #b8d4c6; --lobby-input-bg: #0a100e; }
body.theme-snowy-lot { --lobby-accent: #8a92b8; --lobby-border: #3a3848; --lobby-text: #cccad8; --lobby-input-bg: #100e16; }
body.theme-rolling-fog { --lobby-accent: #7a9a6e; --lobby-border: #3d4a35; --lobby-text: #c8d4c0; --lobby-input-bg: #1a1e14; }

/* WebKit/Chromium scrollbars — inherit --lobby-* from body or #game-select-screen */
*::-webkit-scrollbar {
  width: 0.45rem;
  height: 0.45rem;
}

*::-webkit-scrollbar-track {
  background: var(--lobby-input-bg, #0d1117);
  border-radius: 0.25rem;
}

*::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--lobby-accent, #c9b896) 55%, var(--lobby-border, #30363d));
  border-radius: 0.25rem;
  border: 0.125rem solid var(--lobby-input-bg, #0d1117);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--lobby-accent, #c9b896);
}

*::-webkit-scrollbar-corner {
  background: var(--lobby-input-bg, #0d1117);
}

.game-select-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  max-width: 52rem;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1;
}
.game-select-layout.stats-expanded {
  max-width: 100%;
  padding: 0 0.5rem;
}

/* ── Top bar ── */
.lobby-top-bar {
  --lobby-top-control-height: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--lobby-card-bg);
  border: 0.0625rem solid var(--lobby-border);
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.3);
}

.lobby-room-badge {
  height: var(--lobby-top-control-height);
  font-size: 0.4rem;
  color: var(--lobby-muted);
  padding: 0 0.45rem 0 0.5rem;
  background: transparent;
  border: 0.0625rem solid var(--lobby-border);
  border-radius: 0.35rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  max-width: min(22rem, 52vw);
  min-width: 0;
}

.game-select-room-key {
  flex-shrink: 0;
}

.lobby-room-badge-sep {
  flex-shrink: 0;
  opacity: 0.9;
}

.lobby-nickname-btn {
  font-family: inherit;
  font-size: inherit;
  color: var(--lobby-accent);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.1rem 0.15rem;
  margin: 0;
  min-width: 0;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--lobby-accent) 45%, transparent);
  text-underline-offset: 0.15em;
  border-radius: 0.2rem;
}

.lobby-nickname-btn:hover:not(:disabled) {
  color: var(--lobby-text);
  text-decoration-color: color-mix(in srgb, var(--lobby-text) 50%, transparent);
}

.lobby-nickname-btn:focus-visible {
  outline: 0.125rem solid var(--lobby-accent);
  outline-offset: 0.1rem;
}

.lobby-nickname-btn:disabled {
  cursor: default;
  color: var(--lobby-muted);
  text-decoration: none;
}

.lobby-invite-btn {
  height: var(--lobby-top-control-height);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0 0.5rem;
  border: 0.0625rem solid var(--lobby-border);
  border-radius: 0.35rem;
  background: transparent;
  color: var(--lobby-accent);
  font-family: 'Press Start 2P', monospace;
  font-size: 0.35rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.lobby-invite-btn:hover {
  background: var(--lobby-input-bg);
  border-color: var(--lobby-accent);
}

.lobby-invite-btn svg { flex-shrink: 0; }

.lobby-rebuy-btn {
  height: var(--lobby-top-control-height);
  padding: 0 0.45rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.26rem;
  line-height: 1.25;
  max-width: 9rem;
  text-align: center;
  background: var(--lobby-accent, #c9b896);
  color: #0d0d0d;
  border: 0.0625rem solid color-mix(in srgb, var(--lobby-accent, #c9b896) 72%, #0a0a0a);
  border-radius: 0.35rem;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.15s ease;
}
.lobby-rebuy-btn:hover:not(:disabled) {
  filter: brightness(1.1) saturate(1.06);
}
.lobby-rebuy-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  filter: none;
}
.lobby-rebuy-btn.hidden { display: none !important; }

.lobby-top-spacer { flex: 1; }

.lobby-now-playing {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  max-width: 10rem;
}
.lobby-now-playing.hidden { display: none; }

.lobby-now-playing-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.3rem;
  color: var(--lobby-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.lobby-now-playing-stop {
  font-size: 0.4rem;
  background: none;
  border: none;
  color: #ff6b6b;
  cursor: pointer;
  padding: 0.1rem;
  flex-shrink: 0;
}

.lobby-header-btn {
  flex-shrink: 0;
  width: var(--lobby-top-control-height);
  height: var(--lobby-top-control-height);
  padding: 0;
  border: 0.0625rem solid var(--lobby-border);
  border-radius: 0.35rem;
  background: transparent;
  color: var(--lobby-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.75;
  transition: background 0.15s, opacity 0.15s;
}

.lobby-header-icon {
  width: 0.9rem;
  height: 0.9rem;
  object-fit: contain;
  opacity: 0.85;
  transition: opacity 0.15s;
}

.lobby-header-btn:hover .lobby-header-icon {
  opacity: 1;
}

.lobby-header-btn:hover {
  background: var(--lobby-input-bg);
  border-color: var(--lobby-accent);
  opacity: 1;
}

.lobby-text-btn {
  width: auto;
  min-width: 2.8rem;
  padding: 0 0.45rem;
  border: 0.0625rem solid var(--lobby-border);
  font-family: 'Press Start 2P', monospace;
  font-size: 0.28rem;
  color: var(--lobby-accent);
}

.lobby-text-btn:hover {
  color: #000;
  background: var(--lobby-accent);
  border-color: var(--lobby-accent);
}

/* ── Two-card row ── */
.lobby-cards {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

.game-select-card {
  background: var(--lobby-card-bg);
  border: 0.0625rem solid var(--lobby-border);
  border-radius: 0.75rem;
  padding: 1.25rem 1.75rem;
  flex: 1.4;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.4);
}

.game-select-card h1 {
  font-size: 0.85rem;
  margin-bottom: 0.65rem;
  color: var(--lobby-accent);
  text-transform: uppercase;
  letter-spacing: 0.125rem;
  text-align: center;
}

/* ── Chat card ── */
.lobby-chat-card {
  background: var(--lobby-card-bg);
  border: 0.0625rem solid var(--lobby-border);
  border-radius: 0.75rem;
  flex: 1;
  min-width: 12rem;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.4);
}

.lobby-chat-header {
  padding: 0.6rem 0.75rem;
  font-size: 0.45rem;
  color: var(--lobby-accent);
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  border-bottom: 0.0625rem solid var(--lobby-border);
  background: var(--lobby-input-bg);
  flex-shrink: 0;
}

.lobby-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.lobby-chat-input-panel {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem;
  border-top: 0.0625rem solid var(--lobby-border);
  background: var(--lobby-input-bg);
  flex-shrink: 0;
}

.lobby-chat-input-panel .chat-input {
  flex: 1;
  min-width: 0;
  width: auto;
  background: var(--lobby-card-bg);
  border-color: var(--lobby-border);
  color: var(--lobby-text);
}

.lobby-chat-input-panel .chat-send {
  flex-shrink: 0;
}

/* ── Participants ── */
.game-select-participants {
  margin-bottom: 1rem;
}

.participants-label {
  font-size: 0.45rem;
  color: var(--lobby-muted);
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  margin-bottom: 0.4rem;
  border-bottom: 0.0625rem solid var(--lobby-border);
  padding-bottom: 0.3rem;
}

.participants-list {
  display: flex;
  gap: 0.35rem;
  align-items: flex-start;
}

.lobby-participants-bar {
  width: 100%;
  padding: 0.1rem 0.45rem;
  background: var(--lobby-card-bg);
  border: 0.0625rem solid var(--lobby-border);
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.3);
}

.lobby-participants-strip {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0;
}

.participant-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--lobby-text);
  flex-shrink: 0;
}

.participant-avatar {
  width: 1rem;
  height: 2rem;
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.participant-avatar-wrap {
  position: relative;
  width: 1rem;
  height: 2rem;
}

.participant-outfit {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
}

.participant-chip.you {
  filter: none;
}

.participant-name {
  margin-top: 0;
  max-width: 100%;
  text-align: center;
  white-space: nowrap;
  overflow: visible;
  text-overflow: ellipsis;
  font-size: 0.32rem;
  line-height: 1;
}

.participant-chips {
  margin-top: 0.08rem;
  font-size: 0.28rem;
  line-height: 1;
  color: var(--lobby-accent);
  white-space: nowrap;
}

/* ── Game buttons ── */
.game-option-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1;
  min-width: 6rem;
}

.game-count-badge,
.game-option-cost {
  position: absolute;
  top: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.3rem;
  color: var(--lobby-muted);
  background: var(--lobby-input-bg);
  padding: 0.15rem 0.35rem;
  border-radius: 0.25rem;
  border: 0.0625rem solid var(--lobby-border);
  white-space: nowrap;
  z-index: 1;
}

.game-option-cost {
  color: #ffd700;
}

.game-select-category {
  margin-bottom: 1rem;
}

.game-category-label {
  font-size: 0.5rem;
  color: var(--lobby-muted);
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  margin-bottom: 0.5rem;
  border-bottom: 0.0625rem solid var(--lobby-border);
  padding-bottom: 0.3rem;
}

.game-select-options {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.game-select-options-casino .game-option-btn {
  min-width: 5rem;
}

.game-option-btn {
  width: 100%;
  min-width: 6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 0.65rem;
  background: var(--lobby-input-bg);
  border: 0.125rem solid var(--lobby-border);
  border-radius: 0.5rem;
  color: var(--lobby-text);
  font-family: 'Press Start 2P', monospace;
  cursor: pointer;
  transition: all 0.2s;
}

.game-option-btn:hover {
  border-color: var(--lobby-accent);
  background: rgba(255,255,255,0.05);
  color: #fff;
  transform: translateY(-0.125rem);
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.3);
}

.game-option-icon { font-size: 1.5rem; line-height: 1; }

.game-option-img {
  width: 1.75rem;
  height: 1.75rem;
  object-fit: contain;
  filter: invert(1) brightness(0.85);
  transition: filter 0.2s;
  image-rendering: pixelated;
}

.game-option-btn:hover .game-option-img {
  filter: invert(1) brightness(1.1);
}

/* Checker/chess icons: white piece on black – keep as-is (cancel global invert) */
.game-option-btn[data-game="checkers"] .game-option-img,
.game-option-btn[data-game="chess"] .game-option-img {
  filter: invert(0) brightness(1);
}
.game-option-btn[data-game="checkers"]:hover .game-option-img,
.game-option-btn[data-game="chess"]:hover .game-option-img {
  filter: invert(0) brightness(1.1);
}

/* Slots icon has its own colors */
.game-option-btn[data-game="slots"] .game-option-img {
  filter: invert(0) brightness(1);
}
.game-option-btn[data-game="slots"]:hover .game-option-img {
  filter: invert(0) brightness(1.1);
}

.game-option-name {
  font-size: 0.38rem;
  text-transform: uppercase;
  letter-spacing: 0.04rem;
  line-height: 1.2;
}

/* ── Back / Leave buttons ── */
.btn-back-inline {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.6rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  color: #8b949e;
  background: none;
  border: 0.0625rem solid #30363d;
  border-radius: 0.35rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.btn-back-inline:hover {
  color: #c9d1d9;
  border-color: #484f58;
}

.btn-back-icon {
  width: 0.7rem;
  height: 0.7rem;
  vertical-align: middle;
  margin-right: 0.15rem;
  filter: invert(0.6);
  transition: filter 0.2s;
}

.btn-back-inline:hover .btn-back-icon {
  filter: invert(0.85);
}

.game-select-card .btn-back {
  margin-top: 0.5rem;
}

.btn-back {
  display: block;
  width: 100%;
  margin-top: 0;
  padding: 0.55rem 0.9rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  color: var(--lobby-muted);
  background: none;
  border: 0.0625rem solid var(--lobby-border);
  border-radius: 0.5rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.btn-back:hover {
  color: var(--lobby-text);
  border-color: var(--lobby-accent);
}

/* ── Chat messages (shared) ── */
.chat-message {
  font-size: 0.35rem;
  line-height: 1.5;
  color: var(--lobby-text, #c9d1d9);
  word-break: break-word;
  position: relative;
  z-index: 1;
}

.chat-message .nick {
  color: var(--lobby-muted, #8b949e);
  margin-right: 0.25rem;
}

.chat-message .nick.you {
  color: var(--lobby-accent);
}

.chat-message.system {
  color: var(--lobby-muted, #8b949e);
  font-style: italic;
  font-size: 0.3rem;
}

/* ── Lobby overlays (themes, settings) ── */
.lobby-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  padding: 1rem;
  overflow-x: hidden;
  overflow-y: auto;
}

.lobby-overlay.hidden { display: none; }

.lobby-overlay-panel {
  background: var(--lobby-input-bg);
  border-radius: 0.75rem;
  width: 100%;
  max-width: 18rem;
  max-height: 85vh;
  overflow-x: hidden;
  overflow-y: auto;
  box-shadow: 0 0.75rem 2.5rem rgba(0, 0, 0, 0.5);
  border: 0.0625rem solid var(--lobby-border);
}

.lobby-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 0.0625rem solid var(--lobby-border);
}

.lobby-overlay-header h2 {
  margin: 0;
  font-size: 0.6rem;
  color: var(--lobby-accent);
}

.lobby-overlay-close {
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 0.35rem;
  background: transparent;
  color: var(--lobby-text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.lobby-overlay-close:hover {
  background: var(--lobby-border);
  color: var(--lobby-accent);
}

.lobby-overlay-body {
  padding: 1rem;
}

#store-overlay .lobby-overlay-panel,
#closet-overlay .lobby-overlay-panel {
  max-width: min(72rem, 96vw);
  width: 96vw;
  max-height: 92vh;
}

/* ── Stats view ── */
.stats-view {
  width: 100%;
  margin: 0 auto;
  padding: 0.4rem 0.5rem 1.5rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.stats-view::-webkit-scrollbar { display: none; }
.stats-view.hidden { display: none; }
.stats-view-body { min-height: 5rem; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}
.stat-card {
  background: rgba(var(--lobby-card-bg-rgb), 0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid color-mix(in srgb, var(--lobby-accent) 12%, transparent);
  border-radius: 0.5rem;
  padding: 0.75rem 0.4rem 0.65rem;
  text-align: center;
  transition: border-color 0.3s, transform 0.25s, box-shadow 0.3s;
}
.stat-card:hover {
  border-color: color-mix(in srgb, var(--lobby-accent) 40%, transparent);
  transform: translateY(-3px);
  box-shadow: 0 6px 24px color-mix(in srgb, var(--lobby-accent) 8%, transparent);
}
.stat-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--lobby-accent);
  line-height: 1.05;
}
.stat-label {
  font-size: 0.24rem;
  color: var(--lobby-text);
  opacity: 0.45;
  margin-top: 0.18rem;
  text-transform: uppercase;
  letter-spacing: 0.06rem;
}

.stats-row {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}
.stats-row-2 { grid-template-columns: 1fr 1fr; }
.stats-row-wide-narrow { grid-template-columns: 1.6fr 1fr; }
.stats-row-1 { grid-template-columns: 1fr; }

.stats-panel {
  background: rgba(var(--lobby-card-bg-rgb), 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid color-mix(in srgb, var(--lobby-accent) 10%, transparent);
  border-radius: 0.5rem;
  padding: 0.7rem;
  min-width: 0;
}
.stats-panel-title {
  font-size: 0.44rem;
  color: var(--lobby-accent);
  margin: 0 0 0.06rem;
  font-weight: 700;
}
.stats-panel-subtitle {
  font-size: 0.26rem;
  color: var(--lobby-text);
  opacity: 0.4;
  margin: 0 0 0.4rem;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.3rem;
}
.stats-table th {
  padding: 0.2rem 0.25rem;
  text-align: left;
  color: var(--lobby-accent);
  opacity: 0.6;
  font-weight: 600;
  font-size: 0.22rem;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  border-bottom: 1px solid color-mix(in srgb, var(--lobby-accent) 15%, transparent);
}
.stats-table td {
  padding: 0.24rem 0.25rem;
  color: var(--lobby-text);
  border-bottom: 1px solid color-mix(in srgb, var(--lobby-border) 18%, transparent);
}
.stats-table tr:last-child td { border-bottom: none; }
.stats-table tr:hover td { background: rgba(var(--lobby-card-bg-rgb), 0.3); }
.stats-pos { color: color-mix(in srgb, var(--lobby-accent) 70%, #6fcf6f); }
.stats-neg { color: color-mix(in srgb, var(--lobby-accent) 20%, #e06060); }
.stats-zero { opacity: 0.3; }

.stats-chart { height: 300px; }

.stats-recent {
  list-style: none;
  padding: 0;
  margin: 0;
}
.stats-recent li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.24rem 0.25rem;
  font-size: 0.28rem;
  color: var(--lobby-text);
  border-bottom: 1px solid color-mix(in srgb, var(--lobby-border) 14%, transparent);
  transition: background 0.15s;
  border-radius: 0.15rem;
}
.stats-recent li:last-child { border-bottom: none; }
.stats-recent li:hover { background: color-mix(in srgb, var(--lobby-accent) 5%, transparent); }
.stats-recent-left { display: flex; align-items: center; gap: 0.2rem; }
.stats-recent-right { display: flex; align-items: center; gap: 0.3rem; font-size: 0.26rem; }
.stats-recent-time { opacity: 0.35; font-size: 0.22rem; }

.stats-badge {
  display: inline-block;
  padding: 0.05rem 0.16rem;
  border-radius: 0.1rem;
  font-size: 0.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03rem;
  min-width: 1rem;
  text-align: center;
}
.stats-badge-win  { background: color-mix(in srgb, var(--lobby-accent) 12%, transparent); color: color-mix(in srgb, var(--lobby-accent) 60%, #6fcf6f); }
.stats-badge-loss { background: color-mix(in srgb, var(--lobby-accent) 6%, rgba(224,96,96,0.1)); color: color-mix(in srgb, var(--lobby-accent) 15%, #e06060); }
.stats-badge-push { background: color-mix(in srgb, var(--lobby-accent) 8%, transparent); color: var(--lobby-muted, #8a9bb0); }
.stats-badge-fold { background: color-mix(in srgb, var(--lobby-accent) 8%, transparent); color: color-mix(in srgb, var(--lobby-accent) 70%, var(--lobby-text)); }

.stats-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--lobby-accent);
  opacity: 0.35;
  font-size: 0.38rem;
}

@media (max-width: 700px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.4rem; }
  .stats-row-2,
  .stats-row-wide-narrow { grid-template-columns: 1fr; }
  .stats-view { padding: 0.3rem 0.3rem 1rem; }
  .stat-value { font-size: 0.65rem; }
}

.theme-group {
  margin-bottom: 1rem;
}

.theme-group:last-child { margin-bottom: 0; }

.settings-contact {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 0.0625rem solid var(--lobby-border);
  font-size: 0.35rem;
  color: var(--lobby-text);
  opacity: 0.85;
}

.settings-contact a {
  color: var(--lobby-accent);
  text-decoration: none;
}

.settings-contact a:hover {
  text-decoration: underline;
}

/* ── Room switch overlay ── */
.room-overlay-current {
  font-size: 0.4rem;
  color: var(--lobby-text, #c9d1d9);
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  background: rgba(0,0,0,0.25);
  border-radius: 0.4rem;
}

.room-overlay-current strong {
  color: var(--lobby-accent, #c9b896);
}

.room-overlay-hint {
  font-size: 0.35rem;
  color: #8b949e;
  margin-top: 0.75rem;
}

/* ── Account overlay ── */
#account-overlay .lobby-overlay-panel {
  max-width: 24rem;
}

.account-logout-btn {
  margin-top: 1rem;
  width: 100%;
}

#account-overlay .form-group {
  margin-bottom: 0.75rem;
}

#account-overlay .form-group label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.38rem;
  color: #8b949e;
}

#account-overlay .form-control {
  width: 100%;
  padding: 0.5rem 0.625rem;
  background: var(--lobby-input-bg, #161b22);
  color: var(--lobby-text, #c9d1d9);
  border: 0.0625rem solid var(--lobby-border, #30363d);
  border-radius: 0.375rem;
  font-size: 0.42rem;
  box-sizing: border-box;
}

#account-overlay .form-control:focus {
  outline: none;
  border-color: var(--lobby-accent, #c9b896);
  box-shadow: 0 0 0 0.1875rem color-mix(in srgb, var(--lobby-accent, #c9b896) 22%, transparent);
}

#account-overlay .btn-join {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.85rem 1.5rem;
  font-size: 0.6rem;
  font-family: 'Press Start 2P', monospace;
  font-weight: 600;
  color: #0d0d0d;
  background: var(--lobby-accent, #c9b896);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.125rem;
  transition: filter 0.2s, transform 0.1s;
}

#account-overlay .btn-join:hover {
  filter: brightness(1.1) saturate(1.05);
}

#account-overlay .btn-join:active {
  transform: scale(0.98);
}

.theme-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.4rem;
  color: var(--lobby-text);
  text-transform: uppercase;
  letter-spacing: 0.05rem;
}

.store-layout {
  display: grid;
  grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr);
  gap: 0.7rem;
  min-height: min(72vh, 40rem);
}

.store-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.store-catalog {
  min-height: 0;
  border: 0.0625rem solid var(--lobby-border);
  border-radius: 0.45rem;
  background: var(--lobby-input-bg);
  padding: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.store-toolbar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.store-toolbar label {
  font-size: 0.3rem;
  color: var(--lobby-muted);
  text-transform: uppercase;
  letter-spacing: 0.04rem;
  flex-shrink: 0;
}

.store-search-input {
  width: 100%;
  height: 1.12rem;
  font-size: 0.3rem;
  padding: 0.3rem 0.5rem;
}

.store-balance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.55rem;
  border: 0.0625rem solid var(--lobby-border);
  border-radius: 0.4rem;
  background: var(--lobby-input-bg);
  font-size: 0.32rem;
}

.store-balance-row strong {
  color: var(--lobby-accent);
}

.store-preview-card {
  padding: 0.55rem;
  border: 0.0625rem solid var(--lobby-border);
  border-radius: 0.45rem;
  background: var(--lobby-input-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.store-preview-avatar {
  position: relative;
  width: 2rem;
  height: 3.5rem;
}

.store-preview-base,
.store-preview-outfit {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.store-preview-outfit {
  position: absolute;
  inset: 0;
}

.store-preview-label {
  font-size: 0.3rem;
  color: var(--lobby-muted);
  text-align: center;
}

.store-items,
.closet-items {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 0;
  overflow: auto;
  padding-right: 0.2rem;
}

.store-section {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.store-section-grid {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
}

.store-section-grid .store-item-status {
  grid-column: 1 / -1;
}

.store-item-card,
.closet-item-card {
  border: 0.0625rem solid var(--lobby-border);
  border-radius: 0.45rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.store-item-media {
  width: 100%;
  height: 4.5rem;
  border: 0.0625rem solid var(--lobby-border);
  border-radius: 0.35rem;
  background: rgba(0, 0, 0, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.store-item-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.store-item-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.3rem;
}

.store-item-price {
  color: #f0c674;
}

.store-item-actions {
  display: flex;
  gap: 0.35rem;
}

.store-item-btn {
  flex: 1;
  min-width: 0;
  border: 0.0625rem solid var(--lobby-border);
  border-radius: 0.35rem;
  background: var(--lobby-input-bg);
  color: var(--lobby-text);
  font-family: 'Press Start 2P', monospace;
  font-size: 0.28rem;
  padding: 0.3rem 0.35rem;
  cursor: pointer;
}

.store-item-btn:hover {
  border-color: var(--lobby-accent);
}

.store-item-btn.buy-btn {
  color: #80e27e;
}

.store-item-btn.equip-btn {
  color: var(--lobby-accent);
}

.store-item-status {
  font-size: 0.28rem;
  color: var(--lobby-muted);
}

.store-section-title {
  margin: 0;
  font-size: 0.32rem;
  color: var(--lobby-accent);
  text-transform: uppercase;
  letter-spacing: 0.05rem;
}

.store-auth-cta {
  margin-top: auto;
  padding-top: 0.55rem;
  border-top: 0.0625rem solid var(--lobby-border);
  font-size: 0.3rem;
  color: var(--lobby-muted);
  text-align: left;
}

.store-auth-cta a {
  color: var(--lobby-accent);
  text-decoration: none;
}

.store-auth-cta a:hover {
  text-decoration: underline;
}

@media (max-width: 980px) {
  .store-layout {
    grid-template-columns: minmax(0, 1fr);
    min-height: min(78vh, 42rem);
  }
  .store-sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
  .store-auth-cta {
    grid-column: 1 / -1;
  }
  .store-preview-card {
    min-height: 100%;
  }
}

.theme-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.theme-opt {
  padding: 0.35rem 0.6rem;
  border: 0.0625rem solid var(--lobby-border);
  border-radius: 0.35rem;
  background: var(--lobby-input-bg);
  color: var(--lobby-text);
  font-size: 0.35rem;
  font-family: 'Press Start 2P', monospace;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.theme-opt:hover {
  border-color: var(--lobby-accent);
  background: #1a1a2e;
}

.theme-opt.active {
  border-color: var(--lobby-accent);
  background: var(--lobby-accent);
  color: #0a0a0a;
}

/* ── Auth card ── */
.auth-card {
  max-width: 22rem;
}

.auth-status {
  text-align: center;
  font-size: 0.45rem;
  min-height: 1.2em;
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.auth-status.error {
  color: #f85149;
}

.auth-toggle {
  text-align: center;
  font-size: 0.42rem;
  color: #8b949e;
  margin-top: 1rem;
}

.auth-toggle a {
  color: var(--join-accent, #c9b896);
  text-decoration: none;
  cursor: pointer;
}

.auth-toggle a:hover {
  text-decoration: underline;
}

.auth-logout-btn {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.5rem;
  font-size: 0.4rem;
  font-family: 'Press Start 2P', monospace;
  color: #8b949e;
  background: transparent;
  border: 0.0625rem solid #30363d;
  border-radius: 0.375rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.0625rem;
  transition: color 0.2s, border-color 0.2s;
}

.auth-logout-btn:hover {
  color: #f85149;
  border-color: #f85149;
}

/* ── Welcome badge ── */
.welcome-badge {
  text-align: center;
  font-size: 0.42rem;
  color: #c9d1d9;
  background: rgba(201, 184, 150, 0.08);
  border: 0.0625rem solid rgba(201, 184, 150, 0.25);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  letter-spacing: 0.03rem;
}

.welcome-badge strong {
  color: var(--join-accent, #c9b896);
}

/* ── OAuth buttons ── */
.auth-oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 0.38rem;
  font-family: 'Press Start 2P', monospace;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0.02rem;
  transition: filter 0.2s, transform 0.1s;
}

.oauth-btn:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.oauth-btn:active {
  transform: translateY(0);
}

.oauth-btn svg {
  flex-shrink: 0;
}

.oauth-google {
  background: #fff;
  color: #3c4043;
}

.oauth-discord {
  background: #5865F2;
  color: #fff;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.75rem 0;
  color: #484f58;
  font-size: 0.32rem;
  font-family: 'Press Start 2P', monospace;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #30363d;
}

/* Retro overrides for OAuth */
body.lobby-retro .oauth-btn {
  border-radius: 0;
}

body.lobby-retro .welcome-badge {
  border-radius: 0;
}

/* ── Join screen ── */
#join-screen {
  --join-accent: #c9b896;
  --join-btn-bg: #238636;
  --join-btn-hover: #2ea043;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  background: linear-gradient(135deg, #0a0a0a 0%, #0f1419 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

#join-screen.splash-waterfront {
  --join-accent: #d4a55c;
  --join-btn-bg: #8a6a30;
  --join-btn-hover: #a07838;
}
#join-screen.splash-buildings {
  --join-accent: #7a8a9e;
  --join-btn-bg: #3e4e62;
  --join-btn-hover: #4e5e72;
}
#join-screen.splash-apartments {
  --join-accent: #d4a060;
  --join-btn-bg: #8a6828;
  --join-btn-hover: #a07830;
}
#join-screen.splash-fireflies {
  --join-accent: #5ca882;
  --join-btn-bg: #2e6e4e;
  --join-btn-hover: #3e7e5e;
}
#join-screen.splash-snowy-lot {
  --join-accent: #8a92b8;
  --join-btn-bg: #4a4e6a;
  --join-btn-hover: #5a5e7a;
}
#join-screen.splash-rolling-fog {
  --join-accent: #7a9a6e;
  --join-btn-bg: #3d4a35;
  --join-btn-hover: #4d5a45;
}

#join-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 0;
}

#join-screen > * {
  position: relative;
  z-index: 1;
}

.join-card {
  background: #161b22;
  border: 0.0625rem solid #30363d;
  border-radius: 0.75rem;
  padding: 2.5rem;
  max-width: 20rem;
  width: 100%;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.4), 0 0 0 0.0625rem rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.join-card h1 {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
  color: var(--join-accent, #c9b896);
  text-transform: uppercase;
  letter-spacing: 0.125rem;
  text-align: center;
  overflow-wrap: break-word;
  word-break: break-word;
  padding: 0 0.5rem;
}

.join-card .tagline {
  color: #8b949e;
  font-size: 0.5rem;
  margin-bottom: 0;
  letter-spacing: 0.0625rem;
  text-align: center;
  overflow-wrap: break-word;
  word-break: break-word;
  padding: 0 0.5rem;
  line-height: 1.6;
}

.join-form {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.join-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.join-form .form-group label {
  font-size: 0.5rem;
  color: #8b949e;
  letter-spacing: 0.0625rem;
}

.join-form .form-control {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.6rem;
  font-family: 'Press Start 2P', monospace;
  color: #e6edf3;
  background: #0d1117;
  border: 0.0625rem solid #30363d;
  border-radius: 0.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.join-form .form-control::placeholder {
  color: #484f58;
}

.join-form .form-control:hover {
  border-color: #484f58;
}

.join-form .form-control:focus {
  outline: none;
  border-color: var(--join-accent, #40916c);
  box-shadow: 0 0 0 0.1875rem rgba(255, 255, 255, 0.08);
}

.join-form .btn-join {
  margin-top: 0.5rem;
  padding: 0.85rem 1.5rem;
  font-size: 0.6rem;
  font-family: 'Press Start 2P', monospace;
  font-weight: 600;
  color: #fff;
  background: var(--join-btn-bg, #238636);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.125rem;
  transition: background 0.2s, transform 0.1s;
}

.join-form .btn-join:hover {
  background: var(--join-btn-hover, #2ea043);
}

.join-form .btn-join:active {
  transform: scale(0.98);
}

.join-card .hint {
  margin-top: 1.25rem;
  font-size: 0.45rem;
  color: #6e7681;
  line-height: 1.6;
  text-align: center;
}

/* ── Policy/Info footer links ── */
.site-footer-links {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.22rem 0.48rem;
  border-radius: 0.42rem;
  font-size: 0.26rem;
  line-height: 1.2;
  letter-spacing: 0.02rem;
  z-index: 2;
  backdrop-filter: blur(3px);
  white-space: nowrap;
  margin-top: auto;
  flex-shrink: 0;
}

#join-screen > .site-footer-links {
  color: rgba(225, 230, 236, 0.7);
  background: rgba(8, 12, 16, 0.52);
  border: 0.0625rem solid color-mix(in srgb, var(--join-accent, #c9b896) 45%, #111);
  position: absolute;
  left: 50%;
  bottom: 0.45rem;
  transform: translateX(-50%);
}

.join-card .site-footer-links {
  position: static;
  left: auto;
  bottom: auto;
  transform: none;
  margin-top: 0.75rem;
  padding: 0.55rem 0 0;
  gap: 0.35rem;
  justify-content: center;
  flex-wrap: wrap;
  white-space: normal;
  border-radius: 0;
  backdrop-filter: none;
  background: transparent;
  border: none;
  border-top: 0.0625rem solid color-mix(in srgb, var(--join-accent, #c9b896) 35%, #2a2f36);
  color: rgba(210, 221, 232, 0.72);
}

#game-select-screen .site-footer-links {
  color: rgba(220, 228, 236, 0.68);
  background: rgba(var(--lobby-card-bg-rgb), calc(var(--lobby-card-bg-opacity) * 0.7));
  border: 0.0625rem solid color-mix(in srgb, var(--lobby-accent) 45%, var(--lobby-border));
  position: static;
  transform: none;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0.28rem 0.55rem;
}

.site-footer-links a {
  color: inherit;
  text-decoration: none;
  opacity: 0.95;
}

.site-footer-links a:hover {
  color: var(--lobby-accent, var(--join-accent, #c9b896));
  opacity: 1;
}

.site-footer-sep {
  color: rgba(255, 255, 255, 0.35);
}

/* ── Standalone policy/info pages ── */
body.info-page {
  min-height: 100vh;
  height: auto;
  overflow: auto;
  background: #0b0f14;
  color: #d7dee7;
}

.info-shell {
  max-width: 42rem;
  margin: 1.25rem auto;
  padding: 1rem;
}

.info-card {
  background: rgba(18, 24, 32, 0.94);
  border: 0.0625rem solid #2c3a4a;
  border-radius: 0.75rem;
  box-shadow: 0 0.55rem 1.5rem rgba(0, 0, 0, 0.45);
  padding: 1rem 1.1rem;
}

.info-title {
  font-size: 0.72rem;
  color: #c9b896;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08rem;
}

.info-lead {
  font-size: 0.34rem;
  color: #aeb9c6;
  line-height: 1.75;
  margin-bottom: 0.85rem;
}

.info-section {
  margin-bottom: 0.8rem;
}

.info-section h2 {
  font-size: 0.4rem;
  color: #cdd7e2;
  margin-bottom: 0.38rem;
  text-transform: uppercase;
  letter-spacing: 0.04rem;
}

.info-section p,
.info-section li {
  font-size: 0.32rem;
  line-height: 1.75;
  color: #aeb9c6;
}

.info-section ul,
.info-section ol {
  margin: 0.35rem 0 0.2rem 1rem;
  padding-left: 1.2rem;
}

.info-top-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
  font-size: 0.27rem;
}

.info-top-links a {
  color: #9cc5ff;
  text-decoration: none;
}

.info-top-links a:hover {
  text-decoration: underline;
}

/* ── How to play: tabbed game rules ── */
.info-tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.85rem;
  padding: 0;
  list-style: none;
  border-bottom: 0.0625rem solid rgba(44, 58, 74, 0.9);
  padding-bottom: 0.55rem;
}

.info-tab {
  font-family: inherit;
  font-size: 0.26rem;
  padding: 0.35rem 0.5rem;
  margin: 0;
  cursor: pointer;
  color: #8a9aad;
  background: rgba(12, 16, 22, 0.65);
  border: 0.0625rem solid #2c3a4a;
  border-radius: 0.35rem;
  line-height: 1.3;
}

.info-tab:hover {
  color: #cdd7e2;
  border-color: #3d5168;
}

.info-tab[aria-selected='true'] {
  color: #0a0a0a;
  background: #c9b896;
  border-color: #c9b896;
}

.info-tab:focus-visible {
  outline: 0.125rem solid #9cc5ff;
  outline-offset: 0.125rem;
}

.info-tabpanel {
  margin-top: 0.25rem;
}

.info-tabpanel[hidden] {
  display: none !important;
}

.info-rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.3rem;
  margin: 0.4rem 0;
  color: #aeb9c6;
}

.info-rules-table th,
.info-rules-table td {
  border: 0.0625rem solid #2c3a4a;
  padding: 0.35rem 0.45rem;
  text-align: left;
}

.info-rules-table th {
  color: #cdd7e2;
  background: rgba(12, 16, 22, 0.5);
}

.info-section h3 {
  font-size: 0.34rem;
  color: #b8c5d4;
  margin: 0.65rem 0 0.3rem;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.03rem;
}

.info-section .info-note {
  font-size: 0.29rem;
  color: #8a9aad;
  font-style: italic;
  margin-top: 0.35rem;
}

/* ── Game screen ── */
#game-screen {
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}

.winner-notification {
  text-align: center;
  padding: 0.2rem 0.5rem;
  font-size: 0.5rem;
  color: #ffd700;
  background: rgba(255, 215, 0, 0.2);
  border: 0.1rem solid #ffd700;
  border-radius: 0.25rem;
}

.winner-notification.hidden {
  display: none !important;
}

.btn-restart {
  padding: 0.25rem 0.6rem;
  background: #1b4332;
  border: 0.15rem solid #40916c;
  color: #ddd;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  white-space: nowrap;
}

.waiting-msg {
  font-size: 0.35rem;
  color: var(--lobby-muted, #8b949e);
  padding: 0 0.25rem;
  white-space: nowrap;
}

.waiting-msg.hidden { display: none; }

.btn-add-bot {
  padding: 0.25rem 0.6rem;
  background: #1a3a5a;
  border: 0.15rem solid #3498db;
  color: #ddd;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  white-space: nowrap;
}

.btn-add-bot:hover { background: #2a4a6a; }

.next-hand-timer {
  font-size: 0.4rem;
  color: #8b949e;
  padding: 0 0.2rem;
  white-space: nowrap;
}

.next-hand-timer.hidden {
  display: none !important;
}

.btn-restart:hover { background: #2d6a4f; }
.btn-restart:disabled {
  background: #1a1a1a;
  border-color: #333;
  color: #444;
  cursor: not-allowed;
}

.btn-rebuy {
  background: #2d5016;
  border: 0.25rem solid #6bcb2d;
  color: #fff;
  font-size: 0.65rem;
  padding: 0.75rem 1.25rem;
  box-shadow: 0 0 1rem rgba(107, 203, 45, 0.4);
  animation: rebuy-pulse 1.5s ease-in-out infinite;
}

.btn-rebuy:hover { background: #3d6b1f; box-shadow: 0 0 1.25rem rgba(107, 203, 45, 0.6); }

@keyframes rebuy-pulse {
  0%, 100% { box-shadow: 0 0 1rem rgba(107, 203, 45, 0.4); }
  50% { box-shadow: 0 0 1.5rem rgba(107, 203, 45, 0.7); }
}

.game-scale-wrapper {
  position: relative;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1;
  overflow: auto;
}

/* Room bar (legacy base) */
.room-bar {
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.4rem;
  padding: 0.2rem 0.5rem;
  background: #111;
  border-bottom: 0.15rem solid #1a1a1a;
  flex-shrink: 0;
  overflow-x: auto;
}

/* ── Standardized top bar ── */
.std-bar {
  background: rgba(0, 0, 0, 0.5);
  border-bottom: 0.0625rem solid var(--lobby-border, #1e2a3a);
  padding: 0.3rem 0.65rem;
  gap: 0.5rem;
  backdrop-filter: blur(6px);
}

.std-bar-lobby {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem 0.5rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.32rem;
  color: var(--lobby-text, #c9d1d9);
  background: none;
  border: 0.0625rem solid var(--lobby-border, #30363d);
  border-radius: 0.3rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
  opacity: 0.8;
}

.std-bar-lobby:hover {
  border-color: var(--lobby-accent, #c9b896);
  color: var(--lobby-accent, #c9b896);
  opacity: 1;
}

.std-bar-icon {
  width: 0.6rem;
  height: 0.6rem;
  vertical-align: middle;
  filter: invert(0.7);
  transition: filter 0.15s;
}

.std-bar-lobby:hover .std-bar-icon {
  filter: invert(0.95);
}

.std-bar-player {
  font-size: 0.35rem;
  color: var(--lobby-accent, #c9b896);
  white-space: nowrap;
  flex-shrink: 0;
}

.std-bar-spacer {
  flex: 1;
}

.std-bar-game {
  font-size: 0.35rem;
  color: var(--lobby-muted, #8b949e);
  letter-spacing: 0.05rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.std-bar-btn {
  padding: 0.2rem;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.65;
  transition: opacity 0.15s;
  border-radius: 0.25rem;
}

.std-bar-btn:hover {
  opacity: 1;
}

.std-bar-btn-icon {
  width: 1rem;
  height: 1rem;
  object-fit: contain;
  display: block;
  opacity: 0.85;
}

.std-bar-btn:hover .std-bar-btn-icon {
  opacity: 1;
}

/* ── Poker action popup ── */
.game-action-popup {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
}

.game-action-popup.visible {
  display: block;
}

.game-action-popup-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: rgba(0, 0, 0, 0.85);
  border: 0.0625rem solid var(--lobby-border, #30363d);
  border-radius: 0.5rem;
  backdrop-filter: blur(8px);
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.5);
}

.game-action-btn {
  padding: 0.35rem 0.75rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.35rem;
  background: var(--lobby-input-bg, #1a1a1a);
  border: 0.0625rem solid var(--lobby-border, #30363d);
  border-radius: 0.35rem;
  color: var(--lobby-text, #c9d1d9);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  white-space: nowrap;
  transition: all 0.15s;
}

.game-action-btn:hover {
  border-color: var(--lobby-accent, #c9b896);
  color: #fff;
}

.game-action-btn.game-action-primary {
  background: rgba(30, 80, 50, 0.6);
  border-color: var(--lobby-accent, #40916c);
  color: var(--lobby-accent, #c9b896);
}

.game-action-btn.game-action-primary:hover {
  background: rgba(40, 100, 65, 0.8);
  color: #fff;
}

.game-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.game-action-btn.hidden {
  display: none;
}

/* Legacy button classes kept for backward compat (checkers/chess config panels) */
.btn-start {
  padding: 0.3rem 0.7rem;
  background: #1b4332;
  border: 0.15rem solid #40916c;
  color: #ddd;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  white-space: nowrap;
}
.btn-start:hover { background: #2d6a4f; }
.btn-start:disabled {
  background: #1a1a1a;
  border-color: #333;
  color: #444;
  cursor: not-allowed;
}
.btn-restart {
  padding: 0.3rem 0.7rem;
  background: #1b4332;
  border: 0.15rem solid #40916c;
  color: #ddd;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  cursor: pointer;
  text-transform: uppercase;
  white-space: nowrap;
}
.btn-restart:hover { background: #2d6a4f; }
.btn-restart.hidden { display: none; }

.btn-radio {
  padding: 0.2rem;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.65;
  transition: opacity 0.15s;
  border-radius: 0.25rem;
}

.btn-radio:hover { opacity: 1; }

.btn-settings-inline {
  padding: 0.2rem;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.65;
  transition: opacity 0.15s;
  border-radius: 0.25rem;
}
.btn-settings-inline:hover { opacity: 1; }

.btn-inline-icon {
  width: 1rem;
  height: 1rem;
  object-fit: contain;
  opacity: 0.85;
  vertical-align: middle;
  display: block;
}
.btn-radio:hover .btn-inline-icon,
.btn-settings-inline:hover .btn-inline-icon {
  opacity: 1;
}

.chat-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex: 1;
  min-width: 3rem;
}

.chat-input {
  flex: 1;
  min-width: 0;
  padding: 0.2rem 0.4rem;
  font-size: 0.4rem;
  font-family: 'Press Start 2P', monospace;
  color: #ddd;
  background: #0a0a0a;
  border: 0.125rem solid #333;
  border-radius: 0.2rem;
}

.chat-input::placeholder {
  color: #555;
}

.chat-input:focus {
  outline: none;
  border-color: #555;
}

.chat-send {
  padding: 0.2rem 0.35rem;
  background: #1a1a1a;
  border: 0.125rem solid #333;
  color: #c9b896;
  font-size: 0.5rem;
  cursor: pointer;
  line-height: 1;
}

.chat-send:hover {
  border-color: #c9b896;
  background: #222;
}

.seat-chat-bubble {
  position: fixed;
  padding: 0.35rem 0.6rem;
  font-size: 0.45rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.92);
  border: 0.125rem solid #555;
  border-radius: 0.4rem;
  white-space: normal;
  word-break: break-word;
  width: max-content;
  max-width: 14rem;
  text-align: center;
  pointer-events: none;
  z-index: 9999;
  animation: chatFadeIn 0.2s ease-out;
  box-shadow: 0 0.2rem 0.6rem rgba(0,0,0,0.5);
  transform: translateX(-50%);
}

@keyframes chatFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Radio overlay */
.radio-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 800;
  padding: 1rem;
  overflow-x: hidden;
  overflow-y: auto;
}

.radio-overlay.hidden {
  display: none !important;
}

.radio-panel {
  background: var(--lobby-card-bg, #0d1117);
  border: 0.0625rem solid var(--lobby-border);
  border-radius: 0.75rem;
  padding: 0;
  max-width: 22rem;
  width: 100%;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.6);
  max-height: 85vh;
  overflow-x: hidden;
  overflow-y: auto;
}

.radio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 0.0625rem solid var(--lobby-border);
  background: var(--lobby-input-bg);
  border-radius: 0.75rem 0.75rem 0 0;
}

.radio-header h2 {
  font-size: 0.5rem;
  color: var(--lobby-accent);
  text-transform: uppercase;
  letter-spacing: 0.1rem;
}

.radio-close {
  background: none;
  border: none;
  color: var(--lobby-text);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  line-height: 1;
  border-radius: 0.25rem;
  opacity: 0.6;
  transition: opacity 0.15s, color 0.15s;
}

.radio-close:hover {
  opacity: 1;
  color: var(--lobby-accent);
}

/* Radio sections */
.radio-section {
  padding: 0.6rem 1rem;
  border-bottom: 0.0625rem solid var(--lobby-border);
}

.radio-section:last-child {
  border-bottom: none;
}

.radio-section-label {
  font-size: 0.32rem;
  color: var(--lobby-muted);
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  margin-bottom: 0.5rem;
}

.radio-search-wrap {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
}

.radio-search-wrap input {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.55rem;
  border: 0.0625rem solid var(--lobby-border);
  border-radius: 0.35rem;
  background: var(--lobby-input-bg);
  color: var(--lobby-text);
  font-family: 'Press Start 2P', monospace;
  font-size: 0.35rem;
  transition: border-color 0.15s;
}

.radio-search-wrap input:focus {
  outline: none;
  border-color: var(--lobby-accent);
}

.radio-search-wrap button {
  padding: 0.4rem 0.65rem;
  background: var(--lobby-accent);
  border: none;
  border-radius: 0.35rem;
  color: #0a0a0a;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.32rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.radio-search-wrap button:hover {
  opacity: 0.85;
}

/* Audio rows */
.audio-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
}

.audio-row + .audio-row {
  border-top: 0.0625rem solid rgba(255, 255, 255, 0.04);
}

.audio-row-label {
  font-size: 0.32rem;
  color: var(--lobby-text);
  min-width: 3.5rem;
  flex-shrink: 0;
}

.audio-row input[type="range"] {
  flex: 1;
  min-width: 0;
  height: 0.15rem;
  accent-color: var(--lobby-accent);
}

.audio-row-value {
  font-size: 0.32rem;
  color: var(--lobby-accent);
  min-width: 1.75rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.audio-select {
  flex: 1;
  min-width: 0;
  background: var(--lobby-input-bg);
  color: var(--lobby-text);
  border: 0.0625rem solid var(--lobby-border);
  border-radius: 0.35rem;
  padding: 0.3rem 0.4rem;
  font-size: 0.32rem;
  font-family: 'Press Start 2P', monospace;
  cursor: pointer;
  transition: border-color 0.15s;
}

.audio-select:focus {
  outline: none;
  border-color: var(--lobby-accent);
}

.audio-select option {
  background: var(--lobby-input-bg);
  color: var(--lobby-text);
}

.audio-mute-btn {
  flex-shrink: 0;
  padding: 0.18rem 0.4rem;
  font-size: 0.28rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03rem;
  border: 0.0625rem solid var(--lobby-border);
  border-radius: 0.25rem;
  background: transparent;
  color: var(--lobby-text);
  cursor: pointer;
  transition: all 0.15s;
}

.audio-mute-btn:hover {
  background: var(--lobby-accent);
  color: var(--lobby-card-bg);
  border-color: var(--lobby-accent);
}

.audio-mute-btn.muted {
  background: rgba(180, 60, 60, 0.25);
  color: #e88;
  border-color: rgba(200, 80, 80, 0.5);
}

.audio-mute-btn.muted:hover {
  background: rgba(180, 60, 60, 0.45);
  color: #fff;
}

.settings-nickname-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.settings-nickname-wrap .chat-input {
  flex: 1;
  min-width: 0;
  background: var(--lobby-input-bg);
  border-color: var(--lobby-border);
  color: var(--lobby-text);
}
.settings-save-btn {
  padding: 0.28rem 0.55rem;
  font-size: 0.35rem;
  opacity: 1;
  flex-shrink: 0;
}

.chat-input-inner {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.chat-input-inner .chat-input {
  padding-right: 2.25rem;
}

.chat-emoji-btn {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 0.35rem;
  background: transparent;
  color: var(--lobby-accent);
  opacity: 0.8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s, background 0.15s;
}

.chat-emoji-btn:hover {
  opacity: 1;
  background: var(--lobby-border);
}

.chat-emoji-btn svg {
  flex-shrink: 0;
}

.emoji-picker-popover {
  position: absolute;
  bottom: calc(100% + 0.35rem);
  right: 0;
  width: 12rem;
  max-height: 10rem;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--lobby-input-bg);
  border: 0.0625rem solid var(--lobby-border);
  border-radius: 0.35rem;
  padding: 0.35rem;
  display: none;
  flex-wrap: wrap;
  gap: 0.15rem;
  box-shadow: 0 0.25rem 1rem rgba(0,0,0,0.5);
  z-index: 1000;
}

.emoji-picker-popover.open {
  display: flex;
}

.emoji-picker-item {
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 0.2rem;
  background: transparent;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.emoji-picker-item:hover {
  background: var(--lobby-border);
}

.chat-duration-wrap {
  display: flex;
  align-items: center;
}

.chat-duration-select {
  background: var(--lobby-input-bg);
  color: var(--lobby-text);
  border: 0.0625rem solid var(--lobby-border);
  border-radius: 0.375rem;
  padding: 0.3rem 0.5rem;
  font-size: 0.45rem;
  font-family: inherit;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  max-width: 10rem;
}

.chat-duration-select:focus {
  outline: none;
  border-color: var(--lobby-accent);
}

.chat-duration-select option {
  background: var(--lobby-input-bg);
  color: var(--lobby-text);
}

/* Legacy .sfx-bitdepth-select removed; now uses .audio-select */

.radio-results {
  max-height: 10rem;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.radio-results .radio-empty {
  text-align: center;
  color: #555;
  font-size: 0.5rem;
  padding: 1rem 0;
}

.radio-favorites {
  margin-bottom: 0.5rem;
}

.radio-favorites:empty {
  display: none;
}

.radio-favorites-label {
  font-size: 0.4rem;
  color: var(--lobby-accent);
  text-transform: uppercase;
  letter-spacing: 0.08rem;
  margin-bottom: 0.3rem;
}

.radio-fav-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 6rem;
  overflow-x: hidden;
  overflow-y: auto;
}

.radio-fav-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.45rem;
  border: 0.125rem solid var(--lobby-border);
  background: var(--lobby-input-bg);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.radio-fav-row:hover {
  border-color: var(--lobby-accent);
  background: rgba(255,255,255,0.05);
}

.radio-fav-icon {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0;
  object-fit: cover;
  background: #222;
  flex-shrink: 0;
}

.radio-fav-name {
  flex: 1;
  font-size: 0.48rem;
  color: #ddd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.radio-fav-meta {
  font-size: 0.4rem;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.radio-fav-remove {
  background: none;
  border: 0.1rem solid var(--lobby-border);
  color: var(--lobby-accent);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 0.1rem 0.25rem;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s;
}

.radio-fav-remove:hover {
  color: #ff4444;
  border-color: #ff4444;
}

.radio-station-fav {
  background: none;
  border: none;
  color: var(--lobby-border);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.1rem 0.2rem;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
}

.radio-station-fav:hover {
  color: var(--lobby-accent);
}

.radio-station-fav.is-fav {
  color: var(--lobby-accent);
}

/* Legacy audio settings grid (removed, replaced by .audio-row layout) */

.radio-station {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border: 0.125rem solid var(--lobby-border);
  background: var(--lobby-input-bg);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.radio-station:hover {
  border-color: var(--lobby-accent);
  background: rgba(255,255,255,0.05);
}

.radio-station-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0;
  object-fit: cover;
  background: #222;
  flex-shrink: 0;
}

.radio-station-info {
  flex: 1;
  min-width: 0;
}

.radio-station-name {
  font-size: 0.45rem;
  color: var(--lobby-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.radio-station-meta {
  font-size: 0.4rem;
  color: var(--lobby-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Now playing radio */
.now-playing-radio {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1rem 0.35rem;
  margin: 0;
  background: #1a1a1a;
  border: 0.1rem solid #333;
  max-width: 12rem;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
}

.now-playing-radio.hidden {
  display: none !important;
}

.now-playing-label {
  font-size: 0.4rem;
  color: #c9b896;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.now-playing-stop {
  padding: 0.15rem 0.35rem;
  background: #2a0e0e;
  border: 0.125rem solid #5a1a1a;
  color: #e74c3c;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.35rem;
  cursor: pointer;
  flex-shrink: 0;
}

.now-playing-stop:hover {
  border-color: #e74c3c;
  background: #3a0e0e;
}

/* ── Table ── */
.table-container {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0.25rem;
  overflow: hidden;
}

.poker-table {
  background: #14532d;
  border: 0.3rem solid #8b6914;
  box-shadow: inset 0 0 2.5rem rgba(0,0,0,0.5), 0 0 0 0.15rem #000;
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  border-radius: 0;
  overflow: hidden;
}

/* Phase label - inside community area flow */
.phase-label {
  font-size: 0.45rem;
  color: #6a6a4a;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  text-align: center;
}

.hand-rank-label {
  font-size: 0.4rem;
  color: #c9b896;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  text-align: center;
  margin-top: 0.1rem;
}

/* Community area: pot + board + winning hand - centered on table */
.community-area {
  position: absolute;
  top: 36%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  max-width: 75%;
  z-index: 5;
}

/* Boundary around community area - keeps bet chips from overlapping cards */
.community-boundary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.6rem 1rem;
  border: 0.15rem solid rgba(139, 105, 20, 0.6);
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 0 0.5rem rgba(0, 0, 0, 0.3);
}

.table-pot {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  background: rgba(0,0,0,0.7);
  border: 0.1rem solid #8b6914;
}

.table-pot-label {
  font-size: 0.5rem;
  color: #6a6a4a;
  text-transform: uppercase;
}

.table-pot-amount {
  font-size: 0.6rem;
  color: #ffd700;
}

.table-pot-chips {
  display: flex;
  gap: 0.1rem;
  align-items: flex-end;
}

.table-pot-chips .chip-icon {
  width: 0.8rem;
  height: 0.8rem;
}

.table-pot-chips .chip-icon.chip-stack {
  width: 0.8rem;
  height: 1.1rem;
}

.board-cards {
  display: flex;
  gap: 0.2rem;
  justify-content: center;
}

.board-cards .card {
  width: 2.5rem;
  height: 3.5rem;
  background-size: 2.5rem 3.5rem;
}

.winning-hand-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.winning-hand-row.hidden {
  display: none !important;
}

.winning-hand-row .winning-hand-cards {
  display: flex;
  gap: 0.3rem;
  justify-content: center;
}

.winning-hand-row .winning-hand-cards .card {
  width: 2.2rem;
  height: 3.1rem;
  background-size: 2.2rem 3.1rem;
}

.winning-hand-row .winning-card {
  border: 0.1rem solid transparent;
}

.winning-hand-row .winning-card.from-hole {
  box-shadow: 0 0 0.6rem rgba(255, 215, 0, 0.9);
  border: 0.15rem solid #ffd700;
}


/* ── Cards ── */
.card {
  width: 6.9rem;
  height: 9.6rem;
  background-size: 6.9rem 9.6rem;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: 0 0.15rem 0.4rem rgba(0,0,0,0.7);
  image-rendering: pixelated;
}

.card.back {
  background-image: url('/cards/backs/blue.png');
}

.card.folded {
  opacity: 0.3;
  filter: grayscale(0.8);
}

.card.dealing {
  animation: dealIn 0.35s ease-out both;
}

@keyframes dealIn {
  from {
    transform: translateY(-5rem) scale(0.5);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* ── Players ── */
.players-container {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  overflow: visible;
}

.player-seat {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  pointer-events: auto;
  max-width: 10rem;
  overflow: visible;
  z-index: 2;
}

.seat-chip-stack {
  display: flex;
  gap: 0.05rem;
  align-items: flex-end;
  justify-content: center;
}

.seat-chip-stack .chip-icon {
  width: 0.7rem;
  height: 0.7rem;
}

.seat-chip-stack .chip-icon.chip-stack {
  width: 0.7rem;
  height: 0.95rem;
}

.player-seat .player-cards {
  display: flex;
  gap: 0.2rem;
}

.player-seat .player-cards .card {
  width: 2rem;
  height: 2.8rem;
  background-size: 2rem 2.8rem;
}

.player-seat.seats-5 .player-cards .card {
  width: 1.7rem;
  height: 2.4rem;
  background-size: 1.7rem 2.4rem;
}

.player-seat.seats-6 .player-cards .card {
  width: 1.5rem;
  height: 2.1rem;
  background-size: 1.5rem 2.1rem;
}

.player-seat.is-me .player-cards .card {
  width: 2.7rem;
  height: 3.8rem;
  background-size: 2.7rem 3.8rem;
}

.seat-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
  max-width: 100%;
  overflow: visible;
}

.seat-info .seat-name {
  font-size: 0.55rem;
  color: #ddd;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat-info .seat-chips {
  font-size: 0.55rem;
  color: #c9b896;
}

.seat-info .seat-streak {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.45rem;
  color: #9a8b6e;
}

.seat-info .seat-streak-current {
  color: inherit;
}

.seat-info .seat-streak-best {
  color: #9a8b6e;
}

.seat-info .seat-streak-current-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.seat-info .seat-streak-current-wrap.seat-streak-current-fire {
  position: relative;
  padding: 0.15rem 0.3rem;
}

.seat-info .seat-streak-current-wrap .seat-streak-fire {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.6rem;
  height: 1.6rem;
  transform: translate(-50%, calc(-50% - 0.25rem));
  background: url('/feuer-fire.gif') center / contain no-repeat;
  opacity: 0.85;
  pointer-events: none;
}

.seat-info .seat-streak-current-wrap .seat-streak-current {
  position: relative;
  z-index: 1;
  color: inherit;
}

.seat-info .seat-streak-current-wrap.seat-streak-current-fire .seat-streak-current {
  color: #ffd700;
  font-weight: bold;
  text-shadow: 0 0 0.15rem #000, 0 0 0.3rem #000;
}

.seat-info .seat-folded {
  font-size: 0.45rem;
  color: #666;
  font-style: italic;
}

.player-seat.is-turn .seat-info .seat-name {
  color: #ffd700;
}

/* ── Chip icons ── */
.chip-icon {
  width: 1.75rem;
  height: 1.75rem;
  image-rendering: pixelated;
  vertical-align: middle;
  flex-shrink: 0;
}

.chip-icon.chip-stack {
  width: 1.75rem;
  height: 2.25rem;
}

.chip-icons {
  display: inline-flex;
  gap: 0.15rem;
  align-items: flex-end;
  vertical-align: middle;
  margin-left: 0.25rem;
}

.chips-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.bet-row-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 0.15rem;
}

.pot-chips {
  display: inline-flex;
  gap: 0.15rem;
  align-items: flex-end;
  margin-left: 0.4rem;
  vertical-align: middle;
}

.pot-chips .chip-icon {
  width: 1rem;
  height: 1rem;
}

.pot-chips .chip-icon.chip-stack {
  width: 1rem;
  height: 1.4rem;
}

.seat-bet {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
  pointer-events: none;
  z-index: 3;
}

.seat-bet-amount {
  font-size: 0.4rem;
  color: #ffd700;
}

.seat-bet-chips {
  display: flex;
  gap: 0.08rem;
  align-items: flex-end;
  justify-content: center;
}

.seat-bet-chips .chip-icon {
  width: 0.65rem;
  height: 0.65rem;
}

.seat-bet-chips .chip-icon.chip-stack {
  width: 0.65rem;
  height: 0.85rem;
}

/* ── Controls ── */
.controls {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.25rem 0.4rem;
  background: #111;
  border: 0.1rem solid #1a1a1a;
  flex-shrink: 0;
  min-width: 0;
  overflow-x: auto;
}

.controls-main {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  width: 100%;
}

.controls-slider-row {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  width: 100%;
}

/* Use visibility (not display:none) so space is always reserved - prevents resize on turn change */
.controls-slider-row.slider-inactive {
  visibility: hidden;
  pointer-events: none;
}

.slider-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  color: #ffd700;
  min-width: 3rem;
  text-align: center;
}

.bet-slider {
  flex: 1;
  min-width: 4rem;
  max-width: 12rem;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: #333;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.bet-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffd700;
  border: 2px solid #8b6914;
  cursor: pointer;
}

.bet-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffd700;
  border: 2px solid #8b6914;
  cursor: pointer;
}

.btn-preset {
  padding: 0.15rem 0.3rem;
  font-size: 0.35rem;
  background: #1a1a1a;
  border: 0.1rem solid #333;
  color: #c9b896;
  white-space: nowrap;
  flex-shrink: 0;
}

.turn-timer {
  font-size: 0.5rem;
  color: #ffd700;
  min-width: 2.5rem;
  text-align: center;
  padding: 0.15rem 0.35rem;
  border: 0.1rem solid #8b6914;
  background: #1a1a0a;
  display: none !important;
}

.turn-timer.hidden {
  display: none !important;
}

.seat-timer-track {
  width: 100%;
  height: 3px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.1rem;
}

.seat-timer-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ffd700, #ff8c00);
  border-radius: 2px;
  animation: timerShrink linear forwards;
}

@keyframes timerShrink {
  from { width: 100%; }
  to { width: 0%; }
}

.pot-in-controls {
  font-size: 0.6rem;
  color: #c9b896;
  min-width: 4rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
}

.btn {
  padding: 0.25rem 0.5rem;
  border: 0.15rem solid #333;
  background: #1a1a1a;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.03rem;
  transition: background 0.1s, border-color 0.1s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn:hover:not(:disabled) {
  background: #222;
  border-color: #555;
}

.btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-fold { color: #e74c3c; border-color: #5a1a1a; }
.btn-fold:hover:not(:disabled) { background: #2a0e0e; border-color: #e74c3c; }

.btn-check { color: #3498db; border-color: #1a3a5a; }
.btn-check:hover:not(:disabled) { background: #0e1a2a; border-color: #3498db; }

.btn-call { color: #2ecc71; border-color: #1a4a2a; }
.btn-call:hover:not(:disabled) { background: #0e2a1a; border-color: #2ecc71; }

.btn-bet { color: #c9b896; border-color: #4a3a1a; }
.btn-bet:hover:not(:disabled) { background: #2a1e0e; border-color: #c9b896; }

.btn-allin { color: #ff6b6b; border-color: #6b1a1a; }
.btn-allin:hover:not(:disabled) { background: #3a0e0e; border-color: #ff6b6b; }

.bet-row {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.btn-pot {
  padding: 0.25rem 0.4rem;
  font-size: 0.4rem;
  min-width: 1.5rem;
}

.btn-pot:hover:not(:disabled) {
  background: #2a1e0e;
  border-color: #c9b896;
}

.bet-row input {
  width: 3.5rem;
  min-width: 0;
  padding: 0.3rem 0.4rem;
  border: 0.125rem solid #333;
  background: #0a0a0a;
  color: #c9b896;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  text-align: center;
}

.bet-row input:focus {
  outline: none;
  border-color: #c9b896;
}

/* ── Toast ── */
.message-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  border: 0.1875rem solid #333;
  color: #ddd;
  padding: 0.75rem 1.5rem;
  font-size: 0.55rem;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 500;
}

.message-toast.show { opacity: 1; }

/* ── Showdown ── */
.showdown-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  overflow-y: auto;
}

.showdown-modal {
  background: #111;
  border: 0.1875rem solid #8b6914;
  padding: 2rem;
  max-width: 45rem;
  width: 100%;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  box-shadow: 0 0 0 0.375rem #000;
}

.showdown-winner-banner {
  font-size: 0.85rem;
  color: #ffd700;
  text-align: center;
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  background: rgba(255, 215, 0, 0.12);
  border: 0.125rem solid #ffd700;
  letter-spacing: 0.125rem;
}

.showdown-modal h2 {
  color: #c9b896;
  font-size: 0.7rem;
  margin-bottom: 1rem;
  text-align: center;
  line-height: 1.8;
}

.showdown-section-label {
  font-size: 0.5rem;
  color: #6a6a4a;
  text-transform: uppercase;
  letter-spacing: 0.125rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.showdown-board-section {
  margin-bottom: 1rem;
}

.showdown-board-cards {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.showdown-winning-section {
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 215, 0, 0.08);
  border: 0.125rem solid #ffd700;
}

.showdown-winning-label {
  font-size: 0.55rem;
  color: #ffd700;
  text-align: center;
  margin-bottom: 0.5rem;
  letter-spacing: 0.125rem;
}

.showdown-winning-cards {
  display: flex;
  gap: 0.625rem;
  justify-content: center;
}

.showdown-winning-card {
  width: 6rem;
  height: 8.3125rem;
  background-size: 6rem 8.3125rem;
  image-rendering: pixelated;
}

.showdown-winning-card.from-hole {
  box-shadow: 0 0 0.875rem rgba(255, 215, 0, 0.9);
  border: 0.1875rem solid #ffd700;
  outline: 0.125rem solid rgba(255, 215, 0, 0.5);
}

.showdown-hands-section {
  margin-bottom: 1.5rem;
}

.showdown-card {
  width: 5.5rem;
  height: 7.6875rem;
  background-size: 5.5rem 7.6875rem;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: 0 0.125rem 0.375rem rgba(0,0,0,0.6);
  image-rendering: pixelated;
}

.showdown-hands {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.showdown-hand-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.625rem;
  border: 0.125rem solid #222;
  background: rgba(255,255,255,0.02);
}

.showdown-hand-row.winner {
  border: 0.1875rem solid #ffd700;
  background: rgba(255,215,0,0.08);
}

.showdown-hand-row.folded {
  opacity: 0.7;
  border-color: #333;
}

.showdown-hand-row.folded .showdown-player-name {
  color: #666;
}

.showdown-player-name {
  min-width: 7.5rem;
  font-size: 0.55rem;
  color: #ddd;
}

.showdown-hand-row.winner .showdown-player-name {
  color: #ffd700;
}

.showdown-hand-cards {
  display: flex;
  gap: 0.375rem;
}

.btn-dismiss {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: #1b4332;
  border: 0.1875rem solid #40916c;
  color: #ddd;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.125rem;
}

.btn-dismiss:hover { background: #2d6a4f; }

/* ── Game type selector ── */
.game-type-selector {
  display: flex;
  gap: 0.25rem;
  width: 100%;
}

.game-type-btn {
  flex: 1;
  padding: 0.6rem 0.5rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  color: #8b949e;
  background: #0d1117;
  border: 0.125rem solid #30363d;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
}

.game-type-btn:hover {
  border-color: #484f58;
  color: #c9d1d9;
}

.game-type-btn.active {
  background: #1b4332;
  border-color: #40916c;
  color: #fff;
  box-shadow: 0 0 0.5rem rgba(64, 145, 108, 0.3);
}

/* ── Blackjack screen ── */
#bj-screen {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bj-table {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1rem;
  gap: 0.75rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.bj-status-label {
  font-size: 0.7rem;
  color: #c9b896;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  text-align: center;
  padding: 0.5rem;
  min-height: 1.5rem;
  flex-shrink: 0;
}

.bj-dealer-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.bj-dealer-label {
  font-size: 0.55rem;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
}

.bj-dealer-cards {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  min-height: 5rem;
  flex-shrink: 0;
}

/* Compact dealer area when 4-6 players to leave room for player rows */
.bj-table.bj-players-4 .bj-dealer-cards { min-height: 4rem; }
.bj-table.bj-players-4 .bj-dealer-cards .card { width: 3rem; height: 4.2rem; background-size: 3rem 4.2rem; }
.bj-table.bj-players-5 .bj-dealer-cards { min-height: 3.5rem; }
.bj-table.bj-players-5 .bj-dealer-cards .card { width: 2.6rem; height: 3.6rem; background-size: 2.6rem 3.6rem; }
.bj-table.bj-players-6 .bj-dealer-cards { min-height: 3rem; }
.bj-table.bj-players-6 .bj-dealer-cards .card { width: 2.2rem; height: 3rem; background-size: 2.2rem 3rem; }

.bj-dealer-total {
  font-size: 0.65rem;
  color: #e6edf3;
  text-align: center;
  min-height: 1rem;
}

.bj-players-area {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 40rem;
  padding: 0.5rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  justify-content: stretch;
}

.bj-player-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  flex: 1 1 0;
  min-height: 0;
}

/* Player count: shrink rows and cards as we approach 6 players */
.bj-players-area.bj-players-2 { gap: 0.65rem; }
.bj-players-area.bj-players-3 { gap: 0.6rem; }
.bj-players-area.bj-players-4 { gap: 0.5rem; }
.bj-players-area.bj-players-4 .bj-player-row { padding: 0.4rem 0.6rem; gap: 0.5rem; }
.bj-players-area.bj-players-4 .bj-player-cards { min-height: 3rem; }
.bj-players-area.bj-players-4 .bj-player-cards .card { width: 2.5rem; height: 3.5rem; background-size: 2.5rem 3.5rem; }
.bj-players-area.bj-players-4 .bj-player-name { min-width: 4rem; font-size: 0.45rem; }

.bj-players-area.bj-players-5 { gap: 0.4rem; }
.bj-players-area.bj-players-5 .bj-player-row { padding: 0.35rem 0.5rem; gap: 0.4rem; }
.bj-players-area.bj-players-5 .bj-player-cards { min-height: 2.5rem; }
.bj-players-area.bj-players-5 .bj-player-cards .card { width: 2.1rem; height: 2.9rem; background-size: 2.1rem 2.9rem; }
.bj-players-area.bj-players-5 .bj-player-name { min-width: 3.5rem; font-size: 0.45rem; }
.bj-players-area.bj-players-5 .bj-player-info { font-size: 0.4rem; gap: 0.5rem; }

.bj-players-area.bj-players-6 { gap: 0.25rem; }
.bj-players-area.bj-players-6 .bj-player-row { padding: 0.25rem 0.4rem; gap: 0.35rem; }
.bj-players-area.bj-players-6 .bj-player-cards { min-height: 2rem; }
.bj-players-area.bj-players-6 .bj-player-cards .card { width: 1.8rem; height: 2.5rem; background-size: 1.8rem 2.5rem; }
.bj-players-area.bj-players-6 .bj-player-name { min-width: 3rem; font-size: 0.4rem; }
.bj-players-area.bj-players-6 .bj-player-info { font-size: 0.38rem; gap: 0.4rem; }
.bj-players-area.bj-players-6 .bj-player-status { font-size: 0.35rem; padding: 0.1rem 0.3rem; }

.bj-chat-bubble {
  padding: 0.35rem 0.6rem;
  font-size: 0.45rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.9);
  border: 0.125rem solid #555;
  border-radius: 0.25rem;
  white-space: nowrap;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  z-index: 10;
  animation: chatFadeIn 0.2s ease-out;
}

.bj-player-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(13, 17, 23, 0.6);
  border: 0.125rem solid #30363d;
  border-radius: 0.5rem;
  transition: border-color 0.3s, box-shadow 0.3s;
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
}

.bj-player-row.bj-active-turn {
  border-color: #f0ad4e;
  box-shadow: 0 0 0.75rem rgba(240, 173, 78, 0.35);
}

.bj-player-row.bj-is-me {
  background: color-mix(in srgb, var(--lobby-accent) 30%, transparent);
}

.bj-player-name {
  font-size: 0.5rem;
  color: #c9b896;
  min-width: 5rem;
  text-transform: uppercase;
}

.bj-player-cards {
  display: flex;
  gap: 0.25rem;
  min-height: 4rem;
}

.bj-player-cards .card {
  width: 3rem;
  height: 4.2rem;
  background-size: 3rem 4.2rem;
  border-radius: 0.25rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.4);
}

.bj-dealer-cards .card {
  width: 3.5rem;
  height: 4.9rem;
  background-size: 3.5rem 4.9rem;
  border-radius: 0.25rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.4);
}

.bj-player-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  font-size: 0.45rem;
}

.bj-player-total {
  color: #e6edf3;
  font-weight: bold;
}

.bj-player-bet {
  color: #f0ad4e;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.bj-player-chips {
  color: #40916c;
}

.bj-player-status {
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
}

.bj-status-busted { background: #6b2020; color: #ff6b6b; }
.bj-status-blackjack { background: #3d2e0a; color: #f0ad4e; }
.bj-status-stood { background: #1a3a4a; color: #74c0fc; }
.bj-status-won { background: #1b4332; color: #52b788; }
.bj-status-lost { background: #3d1010; color: #e06666; }
.bj-status-push { background: #2d2d2d; color: #aaa; }

#bj-control-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.6rem;
  background: #111;
  border: 0.1rem solid #1a1a1a;
  flex-shrink: 0;
}

#bj-control-panel .controls-main {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  width: 100%;
}

.bj-bet-row,
.bj-action-row {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.bj-chips-display {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  color: #ffd700;
  margin-left: 0.3rem;
}

/* ── Slots (retro arcade / pixel art) ── */
#slots-screen {
  --swamp-muted: var(--lobby-accent);
  --swamp-text: var(--lobby-accent);
  --swamp-highlight: var(--lobby-accent);
  --swamp-bright: var(--lobby-accent);
  --swamp-border: var(--lobby-border);
  --swamp-border-light: var(--lobby-accent);
  --swamp-win: var(--lobby-accent);
  position: fixed;
  inset: 0;
  background: #0a0a0a url('/bayou_background.jpg') center / cover no-repeat;
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

#slots-screen .game-scale-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* Slots top bar uses .std-bar, so just keep swamp-specific overrides minimal */
#slots-screen .room-bar.std-bar {
  border-bottom-color: var(--swamp-border);
}

#slots-screen .btn-bet,
#slots-screen .slots-spin-btn {
  color: var(--swamp-muted);
  border-color: var(--swamp-border);
}

#slots-screen .btn-bet:hover:not(:disabled),
#slots-screen .slots-spin-btn:hover:not(:disabled) {
  background: rgba(46, 75, 61, 0.5);
  border-color: var(--swamp-highlight);
  color: var(--swamp-highlight);
}

.slots-container {
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  min-height: 0;
}

.slots-machines-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  align-items: stretch;
  justify-content: center;
  flex: 1;
  min-width: 0;
}

.slots-machine {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  flex: 1 1 0;
  min-width: 10rem;
  max-width: 100%;
  box-sizing: border-box;
  background: rgba(20, 20, 20, 0.95);
  border: 0.25rem solid var(--swamp-border);
  border-radius: 0;
  box-shadow:
    inset 0.2rem 0.2rem 0 rgba(0,0,0,0.9),
    inset -0.2rem -0.2rem 0 rgba(255,255,255,0.05),
    0 0 0 0.2rem var(--swamp-border),
    0.4rem 0.4rem 0 rgba(0,0,0,0.6);
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.slots-machine-bet-display {
  font-size: 0.45rem;
  color: var(--swamp-muted);
  font-family: 'Press Start 2P', monospace;
}

.slots-reels {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem;
  background: #080808;
  border: 0.2rem solid var(--swamp-border);
  border-radius: 0;
  image-rendering: pixelated;
  box-shadow: inset 0 0 0.5rem rgba(0,0,0,0.8);
}

.slots-reel {
  width: 4rem;
  height: 4rem;
  background: #050505;
  border-radius: 0;
  overflow: hidden;
  position: relative;
  image-rendering: pixelated;
  border: 0.1rem solid var(--swamp-border);
}

.slots-reel-strip {
  display: flex;
  flex-direction: column;
  will-change: transform;
  image-rendering: pixelated;
}

.slots-symbol {
  width: 4rem;
  height: 4rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slots-symbol-img {
  width: 2.8rem;
  height: 2.8rem;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.slots-symbol-text {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--swamp-muted);
  font-family: 'Press Start 2P', monospace;
}

.slots-reel-spinning .slots-reel-strip {
  /* No animation – keep icons solid while spinning */
}

.slots-machine-label {
  font-size: 0.5rem;
  color: var(--swamp-muted);
  font-family: 'Press Start 2P', monospace;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
}

.slots-machine-controls {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: center;
}

.slots-denom-buttons {
  display: flex;
  gap: 0.2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.slots-denom-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.45rem;
  font-family: 'Press Start 2P', monospace;
  background: rgba(0,0,0,0.5);
  border: 0.15rem solid var(--swamp-border);
  color: var(--swamp-muted);
  border-radius: 0;
  cursor: pointer;
  image-rendering: pixelated;
}

.slots-denom-btn:hover {
  color: var(--swamp-highlight);
  background: rgba(0,0,0,0.7);
  border-color: var(--swamp-highlight);
}

.slots-denom-btn.active {
  color: #000;
  border-color: var(--swamp-highlight);
  background: var(--swamp-highlight);
}

.slots-denom-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.slots-spin-row {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.slots-spin-btn {
  image-rendering: pixelated;
  border-radius: 0;
  padding: 0.5rem 1.25rem;
  font-size: 0.55rem;
  border-width: 0.15rem;
}

.slots-info-btn {
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  color: var(--swamp-muted);
  background: rgba(0,0,0,0.5);
  border: 0.15rem solid var(--swamp-border);
  border-radius: 0;
  cursor: pointer;
}

.slots-info-btn:hover {
  color: var(--swamp-highlight);
  background: rgba(0,0,0,0.7);
  border-color: var(--swamp-highlight);
}

.slots-payline {
  width: 100%;
  height: 0.2rem;
  background: var(--swamp-bright);
  border-radius: 0;
  image-rendering: pixelated;
}

.slots-payout-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.slots-payout-overlay.hidden {
  display: none;
}

.slots-payout-panel {
  background: rgba(20, 20, 20, 0.98);
  border: 0.25rem solid var(--lobby-accent);
  padding: 1rem;
  max-width: 16rem;
  border-radius: 0;
  box-shadow: 0 0 0 0.2rem var(--lobby-border), 0.4rem 0.4rem 0 rgba(0,0,0,0.6);
}

.slots-payout-panel h3 {
  margin: 0 0 0.5rem;
  font-size: 0.5rem;
  color: var(--lobby-accent);
  font-family: 'Press Start 2P', monospace;
}

.slots-payout-list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  font-size: 0.4rem;
  color: var(--lobby-accent);
}

.slots-payout-list li {
  padding: 0.2rem 0;
  border-bottom: 0.1rem solid var(--lobby-border);
}

.slots-payout-list li:last-child {
  border-bottom: none;
}

.slots-payout-close {
  width: 100%;
  padding: 0.35rem;
  font-size: 0.4rem;
  border-radius: 0;
}

.slots-chat-card {
  display: flex;
  flex-direction: column;
  width: 11rem;
  min-width: 11rem;
  max-width: 11rem;
  min-height: 12rem;
  align-self: stretch;
  box-sizing: border-box;
  background: rgba(15, 15, 15, 0.95);
  border: 0.2rem solid var(--swamp-border);
  border-radius: 0;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: inset 0.1rem 0.1rem 0 rgba(0,0,0,0.9), 0.2rem 0.2rem 0 rgba(0,0,0,0.5);
}

.slots-chat-header {
  padding: 0.3rem 0.5rem;
  font-size: 0.4rem;
  color: var(--swamp-muted);
  text-transform: uppercase;
  letter-spacing: 0.08rem;
  border-bottom: 0.15rem solid var(--swamp-border);
  background: rgba(0, 0, 0, 0.5);
}

.slots-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 5rem;
  font-size: 0.35rem;
}

.slots-chat-messages .chat-message,
.slots-chat-messages .ck-chat-msg {
  font-size: 0.35rem;
}

.slots-chat-input-panel {
  display: flex;
  gap: 0.2rem;
  padding: 0.3rem;
  border-top: 0.15rem solid var(--swamp-border);
  background: rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

#slots-screen .slots-chat-input-panel .chat-input {
  flex: 1;
  min-width: 0;
  font-size: 0.35rem;
  padding: 0.25rem 2.25rem 0.25rem 0.25rem;
  background: #0a0a0a;
  border: 0.15rem solid var(--swamp-border);
  color: var(--swamp-muted);
}

.slots-result {
  font-size: 0.6rem;
  color: var(--swamp-muted);
  min-height: 1.5rem;
  text-align: center;
  font-family: 'Press Start 2P', monospace;
}

#slots-screen .slots-result.slots-result-win {
  color: var(--swamp-highlight);
}

#slots-spin-btn {
  padding: 0.8rem 2rem;
  font-size: 1rem;
}

#slots-spin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Lobby style toggle ── */
.lobby-style-toggle {
  display: flex;
  gap: 0.4rem;
}

.lobby-style-btn {
  padding: 0.35rem 0.6rem;
  border: 0.0625rem solid var(--lobby-border);
  border-radius: 0.35rem;
  background: var(--lobby-input-bg);
  color: var(--lobby-text);
  font-size: 0.35rem;
  font-family: 'Press Start 2P', monospace;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.lobby-style-btn:hover {
  border-color: var(--lobby-accent);
  background: rgba(255,255,255,0.05);
}

.lobby-style-btn.active {
  border-color: var(--lobby-accent);
  background: var(--lobby-accent);
  color: #0a0a0a;
}

/* ══════════════════════════════════════════
   Retro mode overrides (body.lobby-retro)
   All border-radius → 0, pixel borders,
   hard drop shadows, no smooth transitions
   ══════════════════════════════════════════ */

body.lobby-retro *::-webkit-scrollbar-track,
body.lobby-retro *::-webkit-scrollbar-thumb {
  border-radius: 0;
}

/* ── Join / splash screen ── */
body.lobby-retro .join-card,
body.lobby-retro .auth-card {
  border-radius: 0;
  border-width: 2px;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.7);
}

body.lobby-retro .auth-logout-btn {
  border-radius: 0;
}

body.lobby-retro .join-form .form-control {
  border-radius: 0;
  border-width: 2px;
  transition: none;
}

body.lobby-retro .join-form .form-control:focus {
  box-shadow: none;
  border-color: var(--join-accent, #c9b896);
}

body.lobby-retro .join-form .btn-join {
  border-radius: 0;
  border: 2px solid rgba(255, 255, 255, 0.15);
  transition: none;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
}

body.lobby-retro .join-form .btn-join:hover {
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6);
}

body.lobby-retro .join-form .btn-join:active {
  box-shadow: 0 0 0 rgba(0, 0, 0, 0.6);
  transform: translate(2px, 2px);
}

body.lobby-retro #account-overlay .form-control:focus {
  box-shadow: none;
  border-color: var(--lobby-accent, #c9b896);
}

body.lobby-retro #account-overlay .btn-join {
  border-radius: 0;
  border: 2px solid rgba(0, 0, 0, 0.35);
  transition: none;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
}

body.lobby-retro #account-overlay .btn-join:hover {
  filter: brightness(1.06);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6);
}

body.lobby-retro #account-overlay .btn-join:active {
  box-shadow: 0 0 0 rgba(0, 0, 0, 0.6);
  transform: translate(2px, 2px);
}

/* ── Lobby screen ── */
body.lobby-retro .game-select-layout {
  max-width: 60rem;
  max-height: calc(100dvh - 1.5rem);
}

body.lobby-retro .lobby-top-bar {
  border-radius: 0;
  border-width: 2px;
  border-style: solid;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
  padding: 0.4rem 0.6rem;
}

body.lobby-retro .lobby-participants-bar {
  border-radius: 0;
  border-width: 2px;
  border-style: solid;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
  padding: 0.2rem 0.45rem;
}

body.lobby-retro #game-select-screen .site-footer-links {
  border-radius: 0;
  border-width: 2px;
  border-style: solid;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
  backdrop-filter: none;
}

body.lobby-retro .lobby-room-badge {
  border-radius: 0;
  border-width: 2px;
}

body.lobby-retro .lobby-nickname-btn:focus-visible {
  outline-width: 2px;
  border-radius: 0;
}

body.lobby-retro .lobby-invite-btn {
  border-radius: 0;
  border-width: 2px;
  transition: none;
}

body.lobby-retro .lobby-invite-btn:hover {
  background: var(--lobby-accent);
  color: #000;
}

body.lobby-retro .lobby-header-btn {
  border-radius: 0;
  border-width: 2px;
  border-style: solid;
  transition: none;
}

body.lobby-retro .lobby-header-btn:hover {
  background: var(--lobby-accent);
}

body.lobby-retro .lobby-rebuy-btn {
  border-radius: 0;
  border-width: 2px;
  border-style: solid;
  border-color: color-mix(in srgb, var(--lobby-accent, #c9b896) 72%, #0a0a0a);
  transition: none;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.45);
}

body.lobby-retro .lobby-rebuy-btn:hover {
  filter: brightness(1.06);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.45);
}

body.lobby-retro .lobby-rebuy-btn:active {
  box-shadow: 0 0 0 rgba(0, 0, 0, 0.45);
  transform: translate(2px, 2px);
}

body.lobby-retro .game-select-card {
  border-radius: 0;
  border-width: 2px;
  border-style: solid;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
  padding: 1rem 1.25rem;
}

body.lobby-retro .lobby-chat-card {
  border-radius: 0;
  border-width: 2px;
  border-style: solid;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
}

body.lobby-retro .game-select-card h1 {
  border-bottom: 2px solid var(--lobby-border);
  padding-bottom: 0.5rem;
  margin-bottom: 0.6rem;
  letter-spacing: 0.2rem;
}

body.lobby-retro .participants-label {
  border-bottom-width: 2px;
}

body.lobby-retro .participant-chip {
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

body.lobby-retro .game-category-label {
  border-bottom-width: 2px;
}

body.lobby-retro .game-count-badge {
  border-radius: 0;
  border-width: 2px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
}

body.lobby-retro .game-option-btn {
  border-radius: 0;
  border-width: 2px;
  transition: none;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
}

body.lobby-retro .game-option-btn:hover {
  transform: none;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
  border-color: var(--lobby-accent);
  background: var(--lobby-accent);
  color: #000;
}

body.lobby-retro .game-option-btn:active {
  box-shadow: 0 0 0 rgba(0, 0, 0, 0.5);
  transform: translate(2px, 2px);
}

body.lobby-retro .game-option-img {
  image-rendering: pixelated;
  width: 2rem;
  height: 2rem;
}

body.lobby-retro .btn-back {
  border-radius: 0;
  border-width: 2px;
  transition: none;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
}

body.lobby-retro .btn-back:hover {
  background: var(--lobby-accent);
  color: #000;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

body.lobby-retro .btn-back:active {
  box-shadow: 0 0 0 rgba(0, 0, 0, 0.5);
  transform: translate(2px, 2px);
}

body.lobby-retro .lobby-chat-header {
  border-bottom-width: 2px;
}

body.lobby-retro .lobby-chat-input-panel {
  border-top-width: 2px;
}

body.lobby-retro .lobby-chat-input-panel .chat-input {
  border-radius: 0;
  border-width: 2px;
}

/* ── Lobby overlays (themes, settings) ── */
body.lobby-retro .lobby-overlay-panel {
  border-radius: 0;
  border-width: 2px;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.7);
}

body.lobby-retro .lobby-overlay-header {
  border-bottom-width: 2px;
}

body.lobby-retro .lobby-overlay-close {
  border-radius: 0;
}

body.lobby-retro .store-catalog,
body.lobby-retro .store-balance-row,
body.lobby-retro .store-preview-card,
body.lobby-retro .store-item-card,
body.lobby-retro .closet-item-card,
body.lobby-retro .store-item-media,
body.lobby-retro .store-item-btn,
body.lobby-retro .store-search-input {
  border-radius: 0;
  border-width: 2px;
}

body.lobby-retro .theme-opt {
  border-radius: 0;
  border-width: 2px;
  transition: none;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
}

body.lobby-retro .theme-opt:hover {
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.4);
}

body.lobby-retro .theme-opt.active {
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.3);
}

body.lobby-retro .lobby-style-btn {
  border-radius: 0;
  border-width: 2px;
  transition: none;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
}

body.lobby-retro .lobby-style-btn:hover {
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.4);
}

body.lobby-retro .lobby-style-btn.active {
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.3);
}

body.lobby-retro .chat-duration-select {
  border-radius: 0;
}

/* ── Game screens: shared elements ── */
body.lobby-retro .btn {
  border-radius: 0;
  transition: none;
}

body.lobby-retro .btn-start {
  border-radius: 0;
}

body.lobby-retro .btn-restart {
  border-radius: 0;
}

body.lobby-retro .btn-add-bot {
  border-radius: 0;
}

body.lobby-retro .btn-back-inline {
  border-radius: 0;
}

body.lobby-retro .std-bar-lobby {
  border-radius: 0;
  border-width: 2px;
  border-style: solid;
  transition: none;
}

body.lobby-retro .std-bar-lobby:hover {
  background: var(--lobby-accent, #c9b896);
  color: #000;
}

body.lobby-retro .chat-input {
  border-radius: 0;
}

body.lobby-retro .btn-radio {
  border-radius: 0;
}

body.lobby-retro .seat-chat-bubble {
  border-radius: 0;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
}

body.lobby-retro .winner-notification {
  border-radius: 0;
}

body.lobby-retro .btn-rebuy {
  border-radius: 0;
  box-shadow: 4px 4px 0 rgba(107, 203, 45, 0.4);
  animation: none;
}

body.lobby-retro .btn-rebuy:hover {
  box-shadow: 2px 2px 0 rgba(107, 203, 45, 0.6);
}

body.lobby-retro .message-toast {
  border-radius: 0;
}

body.lobby-retro .bet-slider {
  border-radius: 0;
}

body.lobby-retro .bet-slider::-webkit-slider-thumb {
  border-radius: 0;
}

body.lobby-retro .bet-slider::-moz-range-thumb {
  border-radius: 0;
}

/* ── Showdown overlay ── */
body.lobby-retro .showdown-modal {
  border-radius: 0;
  box-shadow: 6px 6px 0 #000;
}

body.lobby-retro .btn-dismiss {
  border-radius: 0;
}

body.lobby-retro .showdown-winner-banner {
  border-radius: 0;
}

/* ── Radio overlay ── */
body.lobby-retro .radio-panel {
  border-radius: 0;
  box-shadow: 6px 6px 0 #000;
}

body.lobby-retro .radio-header {
  border-radius: 0;
}

body.lobby-retro .radio-close {
  border-radius: 0;
}

body.lobby-retro .radio-search-wrap input,
body.lobby-retro .radio-search-wrap button,
body.lobby-retro .audio-select,
body.lobby-retro .audio-mute-btn {
  border-radius: 0;
}

/* ── Game type selector (lobby) ── */
body.lobby-retro .game-type-btn {
  border-radius: 0;
  transition: none;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4);
}

body.lobby-retro .game-type-btn.active {
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.3);
}

/* ── Blackjack ── */
body.lobby-retro .bj-player-row {
  border-radius: 0;
  transition: none;
}

body.lobby-retro .bj-player-status {
  border-radius: 0;
}

body.lobby-retro .bj-player-cards .card {
  border-radius: 0 !important;
}

body.lobby-retro .bj-dealer-cards .card {
  border-radius: 0 !important;
}

body.lobby-retro .bj-chat-bubble {
  border-radius: 0;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
}

/* ── Chess screen (ensure visibility when shown) ── */
#ch-screen {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Checkers / Chess (inline-style overrides) ── */
body.lobby-retro #ck-screen .btn-start,
body.lobby-retro #ck-screen .btn-restart {
  border-radius: 0 !important;
}

body.lobby-retro #ck-screen select {
  border-radius: 0 !important;
}

body.lobby-retro #ch-screen .btn-start,
body.lobby-retro #ch-screen .btn-restart {
  border-radius: 0 !important;
}

body.lobby-retro #ch-screen select {
  border-radius: 0 !important;
}

/* ── Checkers / Chess wager & game over menus (retro) ── */
body.lobby-retro .ck-config-panel,
body.lobby-retro .ck-config-chat,
body.lobby-retro .ck-gameover-panel {
  border-radius: 0 !important;
  border-width: 2px !important;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.7) !important;
}

body.lobby-retro .ch-config-panel,
body.lobby-retro .ch-config-chat,
body.lobby-retro .ch-gameover-panel {
  border-radius: 0 !important;
  border-width: 2px !important;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.7) !important;
}

body.lobby-retro .ck-config-panel .ck-lock-btn,
body.lobby-retro .ck-config-buttons button,
body.lobby-retro .ck-gameover-buttons button,
body.lobby-retro .ch-config-panel .ch-lock-btn,
body.lobby-retro .ch-config-buttons button,
body.lobby-retro .ch-gameover-buttons button {
  border-radius: 0 !important;
}

body.lobby-retro .ck-config-panel select,
body.lobby-retro .ck-config-panel input[type="range"],
body.lobby-retro .ch-config-panel select,
body.lobby-retro .ch-config-panel input[type="range"] {
  border-radius: 0 !important;
}

/* ── Responsive lobby: compact at short viewports ── */
@media (max-height: 750px) {
  .game-select-card {
    padding: 0.75rem 1rem;
  }
  .game-select-card h1 {
    font-size: 0.65rem;
    margin-bottom: 0.35rem;
  }
  .game-select-participants {
    margin-bottom: 0.5rem;
  }
  .participants-label {
    font-size: 0.35rem;
    margin-bottom: 0.25rem;
    padding-bottom: 0.2rem;
  }
  .game-select-category {
    margin-bottom: 0.5rem;
  }
  .game-category-label {
    font-size: 0.4rem;
    margin-bottom: 0.3rem;
    padding-bottom: 0.2rem;
  }
  .game-option-btn {
    padding: 0.4rem 0.4rem;
    gap: 0.25rem;
    min-width: 4.5rem;
  }
  .game-select-options-casino .game-option-btn {
    min-width: 3.5rem;
  }
  .game-option-img {
    width: 1.2rem;
    height: 1.2rem;
  }
  .game-option-name {
    font-size: 0.28rem;
  }
  .game-select-card .btn-back {
    margin-top: 0.3rem;
  }
  .btn-back {
    padding: 0.35rem 0.6rem;
    font-size: 0.32rem;
  }
}

/* ── Responsive lobby: narrow viewports ── */
@media (max-width: 700px) {
  .lobby-cards {
    flex-direction: column;
  }
  .lobby-top-bar {
    flex-wrap: wrap;
  }
}

/* ── Mock Ad Overlay ── */
.mock-ad-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
}
.mock-ad-overlay.hidden {
  display: none;
}
.mock-ad-box {
  background: #1c1c1c;
  border: 1px solid #383838;
  border-radius: 10px;
  padding: 44px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  min-width: 280px;
  text-align: center;
}
.mock-ad-label {
  margin: 0;
  font-size: 0.95rem;
  color: #999;
  letter-spacing: 0.03em;
}
.mock-ad-timer {
  margin: 0;
  font-size: 2.4rem;
  font-weight: 700;
  color: #e0e0e0;
  font-variant-numeric: tabular-nums;
}
.mock-ad-skip {
  padding: 8px 22px;
  background: #3a3a3a;
  color: #ddd;
  border: 1px solid #555;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: background 0.15s;
}
.mock-ad-skip:hover {
  background: #4a4a4a;
}
.mock-ad-skip.hidden {
  visibility: hidden;
  pointer-events: none;
}
