.base-game-navbar,
.base-game-room-header,
.base-game-section-heading,
.base-game-room-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.base-game-navbar {
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 14px;
  padding: 10px 16px;
  overflow-x: auto;
}

.base-game-home-link {
  color: #f8fafc;
  font-weight: 800;
  text-decoration: none;
}

.base-game-navbar-brand,
.base-game-hero {
  display: flex;
  align-items: baseline;
}

.base-game-navbar-brand {
  flex: 0 0 auto;
  gap: 16px;
}

.base-game-hero {
  gap: 9px;
}

.base-game-player {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #cbd5e1;
  flex: 0 0 auto;
  order: 2;
}

.base-game-player-card-content,
.base-game-chat-message,
.rps-chat-message {
  align-items: center;
}

.base-game-chat-message .player-avatar,
.rps-chat-message .player-avatar {
  vertical-align: middle;
}

.base-game-player strong,
.base-game-kicker {
  color: #fbbf24;
}

.base-game-rulebook-link,
.base-game-feedback-link {
  color: #93c5fd;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.base-game-rulebook-link:hover,
.base-game-rulebook-link:focus-visible,
.base-game-feedback-link:hover,
.base-game-feedback-link:focus-visible {
  text-decoration: underline;
}

.base-game-navbar-room {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  width: auto;
  flex: 1 1 auto;
  order: 3;
}

.base-game-navbar-room[hidden] {
  display: none;
}

.base-game-navbar-room-identity {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex: 0 0 auto;
}

.base-game-navbar-room-identity .base-game-kicker {
  grid-column: auto;
}

.base-game-navbar-room p {
  margin: 0;
}

.base-game-room-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid rgba(251, 191, 36, 0.48);
  border-radius: 10px;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.08), 0 6px 18px rgba(2, 8, 23, 0.24);
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.base-game-room-copy:hover {
  border-color: #fbbf24;
  background: rgba(51, 65, 85, 0.86);
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.16), 0 8px 22px rgba(2, 8, 23, 0.3);
}

.base-game-room-copy:active {
  transform: translateY(1px);
}

.base-game-room-copy:focus-visible {
  outline: 3px solid rgba(147, 197, 253, 0.9);
  outline-offset: 2px;
}

.base-game-room-copy strong {
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.base-game-navbar-room .base-game-settings-summary {
  margin: 0;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  justify-content: center;
}

.base-game-navbar-room .base-game-settings-summary span,
.base-game-navbar-room .base-game-room-actions,
.base-game-navbar-room-identity {
  white-space: nowrap;
}

.base-game-navbar-room .base-game-room-actions {
  flex: 0 0 auto;
  gap: 8px;
}

.base-game-navbar-room .base-game-button {
  min-height: 38px;
  padding: 7px 11px;
}

.base-game-shell {
  width: min(100% - 32px, 980px);
  margin: 0 auto;
  padding: 24px 0;
}

body.base-game-game-active .base-game-shell {
  width: 100%;
  padding: 0;
}

body.base-game-game-active .base-game-room,
body.base-game-game-active .base-game-game {
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}


.base-game-hero {
  margin: 0;
}

.base-game-hero h1 {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1;
}

.base-game-hero p {
  margin: 0;
}

.base-game-kicker {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.base-game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.base-game-grid[hidden],
.base-game-room[hidden],
.base-game-players[hidden] {
  display: none;
}

.base-game-panel {
  padding: 24px;
  border: 1px solid rgba(251, 191, 36, 0.24);
  border-radius: 12px;
  background: rgba(26, 40, 68, 0.84);
  box-shadow: 0 18px 50px rgba(2, 8, 23, 0.28);
}

.base-game-panel h2 {
  margin-bottom: 8px;
}

.base-game-panel p {
  margin-bottom: 18px;
}

.base-game-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #b45309);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.base-game-button[hidden] {
  display: none !important;
}

.base-game-button-icon {
  width: 18px;
  height: 18px;
  margin-inline-start: 6px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.base-game-button-icon[hidden] {
  display: none;
}

.base-game-button-secondary {
  border: 1px solid rgba(253, 230, 138, 0.35);
  background: rgba(15, 23, 42, 0.55);
  color: #fef3c7;
}

.base-game-button-danger {
  border: 1px solid rgba(252, 165, 165, 0.38);
  background: rgba(127, 29, 29, 0.7);
  color: #fee2e2;
}

.base-game-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.base-game-confirm-dialog {
  width: min(430px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 18px;
  color: #f8fafc;
  background: linear-gradient(180deg, #1e293b, #111827);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.65);
}

.base-game-confirm-dialog::backdrop {
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(4px);
}

.base-game-confirm-dialog h3,
.base-game-confirm-dialog p {
  margin: 0;
}

.base-game-confirm-dialog h3 {
  color: #fef3c7;
  font-size: 1.35rem;
}

.base-game-confirm-dialog p {
  margin-top: 10px;
  color: #cbd5e1;
  line-height: 1.5;
}

.base-game-confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.base-game-settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.base-game-settings-form label {
  display: grid;
  gap: 6px;
  color: #e2e8f0;
  font-weight: 800;
}

.base-game-settings-form select {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid rgba(253, 230, 138, 0.28);
  border-radius: 10px;
  background: #172033;
  color: #f8fafc;
}

.base-game-settings-form .base-game-checkbox-setting {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
}

.base-game-checkbox-setting input {
  width: 18px;
  height: 18px;
  accent-color: #f59e0b;
}

.base-game-settings-form .base-game-button {
  align-self: end;
}

.base-game-settings-form .base-game-position-summary {
  align-self: center;
  margin: 0;
  color: #86efac;
  font-weight: 800;
}

.base-game-settings-form .base-game-position-summary.error {
  color: #fca5a5;
}

.base-game-section-heading {
  align-items: flex-start;
}

.base-game-section-heading p {
  margin-bottom: 0;
}

.base-game-lobby-board,
.base-game-rooms-list,
.base-game-room {
  display: grid;
  gap: 16px;
}

.base-game-lobby-board {
  align-content: start;
}

.base-game-room-search {
  display: grid;
  align-self: start;
  gap: 6px;
  min-height: 0;
}

.base-game-room-search span {
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.base-game-room-search input {
  box-sizing: border-box;
  width: 100%;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.68);
  font: inherit;
}

.base-game-room-search input:focus {
  border-color: rgba(250, 204, 21, 0.72);
  outline: none;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.18);
}

.base-game-room-search input:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.base-game-empty-state,
.base-game-room-card,
.base-game-player-card,
.base-game-ready {
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.48);
}

.base-game-room-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.base-game-room-card-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.base-game-room-card-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.base-game-room-card-topline strong,
.base-game-room-header h2 {
  color: #f8fafc;
  letter-spacing: 0.1em;
}

.base-game-room-card-topline span {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
  font-size: 0.76rem;
  font-weight: 800;
}

.base-game-room-card p {
  margin: 0 0 4px;
  color: #e2e8f0;
  overflow-wrap: anywhere;
}

.base-game-room-card small,
.base-game-empty-state {
  color: #94a3b8;
}

.base-game-room-card-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 8px;
}

.base-game-room-header h2 {
  font-size: 2rem;
}

.base-game-room-progress {
  margin: 6px 0 0;
  color: #cbd5e1;
  font-weight: 800;
}

.base-game-players {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.base-game-settings-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.base-game-settings-summary span {
  padding: 7px 10px;
  border: 1px solid rgba(253, 230, 138, 0.18);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.5);
  color: #cbd5e1;
  font-size: 0.86rem;
}

.base-game-settings-summary strong {
  color: #fde68a;
}

.base-game-player-card {
  min-height: 116px;
  padding: 16px;
}

.base-game-player-card--participant {
  display: flex;
  align-items: center;
  gap: 14px;
}

.base-game-player-card--participant .base-game-player-card-content {
  min-width: 0;
  flex: 1;
}

.base-game-player-card strong {
  display: block;
  color: #f8fafc;
  font-size: 1.1rem;
}

.base-game-player-card-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.base-game-player-card-details {
  min-width: 0;
  flex: 1;
}

.base-game-player-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.base-game-player-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.base-game-badge {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.base-game-player-card span,
.base-game-ready p {
  color: #cbd5e1;
}

.base-game-player-card-empty {
  border-style: dashed;
}

.base-game-ready-text {
  color: #86efac !important;
  font-weight: 800;
}

.base-game-kick-button {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid rgba(252, 165, 165, 0.38);
  border-radius: 8px;
  background: rgba(127, 29, 29, 0.52);
  color: #fee2e2;
  font-weight: 800;
}

.base-game-readiness-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.base-game-game {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(253, 230, 138, 0.2);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.48);
}

.base-game-game[hidden],
.base-game-game form[hidden],
.base-game-game-heading[hidden],
.base-game-bet-message[hidden] {
  display: none;
}

.base-game-game-heading,
.base-game-bet-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.base-game-game-heading h3 {
  margin-bottom: 5px;
}

.base-game-game-heading p,
.base-game-bet-footer p,
.base-game-bet-message {
  margin: 0;
  color: #cbd5e1;
}

.base-game-bet-positions {
  display: grid;
  gap: 12px;
}

.base-game-bet-row {
  display: grid;
  grid-template-columns: 90px 92px minmax(160px, 1fr);
  align-items: center;
  gap: 12px;
}

.base-game-bet-row label {
  color: #f8fafc;
  font-weight: 900;
}

.base-game-bet-row input[type="number"] {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(253, 230, 138, 0.28);
  border-radius: 9px;
  background: #172033;
  color: #f8fafc;
}

.base-game-bet-row input[type="range"] {
  width: 100%;
  accent-color: #f59e0b;
}

.base-game-bet-footer {
  margin-top: 16px;
}

.base-game-bet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.base-game-bet-footer strong {
  color: #86efac;
}

.base-game-bet-footer strong.error {
  color: #fca5a5;
}

.base-game-ranking-panel {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.base-game-ranking-panel[hidden] {
  display: none;
}

.base-game-position-selection-message {
  margin: 0;
  color: #cbd5e1;
}

.base-game-ranking-table-wrap {
  overflow-x: auto;
}

.base-game-ranking-table {
  width: 100%;
  min-width: 620px;
  table-layout: fixed;
  border-collapse: collapse;
}

.base-game-ranking-table thead th:first-child,
.base-game-ranking-table tbody th {
  width: 100px;
}

.base-game-ranking-table th,
.base-game-ranking-table td {
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  text-align: left;
}

.base-game-ranking-table thead th,
.base-game-ranking-table tbody th {
  background: rgba(15, 23, 42, 0.72);
  color: #fde68a;
}

.base-game-ranking-table .base-game-active-rank {
  background: rgba(245, 158, 11, 0.2);
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.55);
}

.base-game-ranking-table tr.base-game-position-taken > th,
.base-game-ranking-table tr.base-game-position-taken > td {
  opacity: 0.58;
}

.base-game-ranking-table tr.base-game-position-taken > td.base-game-selected-position,
.base-game-ranking-table .base-game-selected-position {
  opacity: 1;
  background: rgba(34, 197, 94, 0.24);
  box-shadow: inset 0 0 0 2px rgba(74, 222, 128, 0.82);
}

.base-game-ranked-player {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e2e8f0;
  white-space: nowrap;
}

.base-game-ranked-player-name {
  min-width: 0;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.base-game-ranked-player strong {
  margin-left: auto;
  color: #f8fafc;
}

.base-game-position-choice {
  width: 100%;
  padding: 5px;
  border: 1px solid rgba(251, 191, 36, 0.7);
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.16);
  box-shadow: none;
}

.base-game-position-choice:hover {
  transform: translateY(-1px);
  background: rgba(245, 158, 11, 0.28);
}

.base-game-ready h3 {
  margin-bottom: 8px;
}

.base-game-ready p {
  margin: 0;
}

.base-game-status {
  min-height: 1.6rem;
  margin-top: 18px;
  color: #cbd5e1;
}

.base-game-status.error {
  color: #fca5a5;
}


.base-game-lobby-chat {
  grid-column: 1 / -1;
}

.base-game-chat {
  display: grid;
  gap: 12px;
}

.base-game-chat h2,
.base-game-chat h3 {
  margin: 0;
}

.base-game-chat-messages {
  min-height: 112px;
  max-height: 240px;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 10px;
  background: rgba(43, 27, 15, 0.5);
}

.base-game-chat-message,
.base-game-chat-empty {
  margin: 0;
  overflow-wrap: anywhere;
}

.base-game-chat-message + .base-game-chat-message {
  margin-top: 6px;
}

.base-game-chat-message time {
  color: #d6b98c;
}

.base-game-chat-message strong {
  color: #fde68a;
}

.base-game-chat-empty {
  color: #d6b98c;
}

.base-game-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.base-game-chat-form input {
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 10px;
  color: #fff7ed;
  background: rgba(43, 27, 15, 0.62);
}

body.base-game-game-active .base-game-chat {
  padding: 12px;
  background: #1a2844;
}

.base-game-private-notes {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
  padding: 12px;
  border-bottom: 1px solid rgba(251, 191, 36, 0.3);
  background: #1a2844;
}

.base-game-private-notes-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.base-game-private-notes h3 {
  margin: 0;
}

.base-game-private-notes-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.base-game-private-notes-actions {
  display: flex;
  gap: 4px;
}

.base-game-private-notes-action {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 5px;
  border: 1px solid rgba(251, 191, 36, 0.34);
  border-radius: 7px;
  color: #fde68a;
  background: rgba(43, 27, 15, 0.58);
  cursor: pointer;
}

.base-game-private-notes-action:hover:not(:disabled),
.base-game-private-notes-action:focus-visible {
  border-color: #fbbf24;
  color: #fff7ed;
  background: rgba(146, 64, 14, 0.48);
}

.base-game-private-notes-delete:hover:not(:disabled),
.base-game-private-notes-delete:focus-visible {
  border-color: #f87171;
  color: #fecaca;
  background: rgba(127, 29, 29, 0.48);
}

.base-game-private-notes-action:disabled {
  opacity: 0.38;
  cursor: default;
}

.base-game-private-notes-action svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.base-game-private-notes textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  resize: none;
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 10px;
  color: #fff7ed;
  background: rgba(43, 27, 15, 0.62);
  font: inherit;
}

.base-game-private-notes-count {
  color: #cbd5e1;
  font-size: 0.78rem;
  line-height: 1;
}

@media (max-width: 760px) {
  .base-game-grid,
  .base-game-players,
  .base-game-room-card,
  .base-game-settings-form,
  .base-game-chat-form {
    grid-template-columns: 1fr;
  }

  .base-game-room-header,
  .base-game-section-heading,
  .base-game-room-actions,
  .base-game-room-card-actions,
  .base-game-player {
    align-items: flex-start;
    flex-direction: column;
  }

  .base-game-navbar-brand {
    gap: 12px;
  }

  .base-game-private-notes textarea {
    min-height: 120px;
    resize: vertical;
  }

  .base-game-navbar-room {
    display: flex;
    gap: 10px;
  }

  .base-game-navbar-room .base-game-room-actions {
    flex-direction: row;
  }

  .base-game-navbar .base-game-player {
    align-items: center;
    flex-direction: row;
  }

  .base-game-hero {
    gap: 6px;
  }

  .base-game-kicker {
    display: none;
  }

  .base-game-room-copy .base-game-kicker {
    display: inline;
  }

  .base-game-hero h1 {
    font-size: 1.1rem;
  }

  .base-game-bet-row {
    grid-template-columns: 72px 86px minmax(100px, 1fr);
  }

  .base-game-game-heading,
  .base-game-bet-footer {
    align-items: flex-start;
    flex-direction: column;
  }

}
