html, body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100%;
  width: 100%;
}

.gb-lobby-root {
  position: fixed;
  top: 52px;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 0;
  background-color: #1a5c30;
  background-image: url("/assets/boards/board-1-1d85e151.jpg");
  background-repeat: repeat;
  background-size: auto;
  background-attachment: fixed;
  overflow: hidden;
}

/* ── Main content area ────────────────────────────────────────────────────────*/

.lobby-main {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 1.5rem;
  padding-bottom: 60px;
}

.lobby-cards {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── LobbyMenu ────────────────────────────────────────────────────────────────*/

.lm-root {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 320px;
}

.lm-card {
  background: rgba(15, 35, 22, 0.92);
  border: 1px solid rgba(126, 207, 154, 0.25);
  border-radius: 14px;
  padding: 1.6rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  color: white;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lm-card:hover {
  border-color: rgba(126, 207, 154, 0.45);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.lm-card--secondary {
  background: rgba(15, 35, 22, 0.6);
  border-color: rgba(126, 207, 154, 0.12);
}

.lm-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.01em;
}

.lm-card-sub {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.4;
  margin-top: -0.4rem;
}

/* Waiting player slots */

.lm-slots {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.lm-slot {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.lm-slot--filled {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(126, 207, 154, 0.2);
}

.lm-slot--empty {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.35);
  font-style: italic;
}

.lm-slot--self {
  background: rgba(126, 207, 154, 0.12);
  border-color: rgba(126, 207, 154, 0.45);
  color: #c8f7e8;
  font-weight: 600;
}

.lm-slot-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(126, 207, 154, 0.6);
}

.lm-slot--empty .lm-slot-dot {
  background: rgba(255, 255, 255, 0.2);
}

.lm-slot--self .lm-slot-dot {
  background: #7ecf9a;
}

.lm-slot-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lm-slot-you {
  font-size: 0.72rem;
  font-weight: 600;
  color: #7ecf9a;
  background: rgba(126, 207, 154, 0.15);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Waiting preview (shown on join card when others are waiting) */

.lm-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: -0.2rem;
}

.lm-preview-chip {
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(126, 207, 154, 0.15);
  color: #c8f7e8;
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(126, 207, 154, 0.3);
}

.lm-preview-label {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
  margin-left: 0.2rem;
}

/* Starting message */

.lm-starting {
  padding: 0.7rem 1rem;
  text-align: center;
  background: rgba(126, 207, 154, 0.12);
  border: 1px solid rgba(126, 207, 154, 0.35);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #7ecf9a;
  animation: pulse 1.8s ease-in-out infinite;
}

/* Buttons */

.lm-btn {
  padding: 0.65rem 1.2rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  align-self: flex-start;
}

.lm-btn--join {
  background: linear-gradient(135deg, #4caf7d 0%, #2e7d52 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(76, 175, 125, 0.3);
}

.lm-btn--join:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(76, 175, 125, 0.45);
}

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

.lm-btn--leave {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.lm-btn--leave:hover {
  background: rgba(255, 255, 255, 0.16);
  color: white;
}

.lm-btn--secondary {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.lm-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  color: white;
}

/* ── LobbyResumeGame ──────────────────────────────────────────────────────────*/

.lr-card {
  background: rgba(15, 35, 22, 0.92);
  border: 1px solid rgba(126, 207, 154, 0.25);
  border-radius: 14px;
  padding: 1.6rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  color: white;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 300px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.lr-card:hover {
  border-color: rgba(126, 207, 154, 0.5);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5);
  transform: translateY(-3px);
}

.lr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.lr-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: white;
}

.lr-round {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  white-space: nowrap;
}

.lr-players {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.lr-player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.7rem;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  font-size: 0.88rem;
  transition: background 0.15s ease;
}

.lr-player--self {
  background: rgba(126, 207, 154, 0.1);
  border-color: rgba(126, 207, 154, 0.25);
}

.lr-player--active {
  border-color: rgba(126, 207, 154, 0.5);
}

.lr-player-name {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
}

.lr-player-arrow {
  font-size: 0.65rem;
  color: #7ecf9a;
  flex-shrink: 0;
}

.lr-player-you {
  font-size: 0.7rem;
  font-weight: 600;
  color: #7ecf9a;
  background: rgba(126, 207, 154, 0.15);
  padding: 0.1rem 0.45rem;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.lr-player-score {
  font-weight: 700;
  color: #7ecf9a;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.lr-turn {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: -0.3rem;
}

.lr-turn--yours {
  color: #7ecf9a;
  font-weight: 600;
}

.lr-btn {
  padding: 0.65rem 1.2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  align-self: flex-start;
}

.lr-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(102, 126, 234, 0.5);
}

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

/* ── LobbyLiveGames carousel ──────────────────────────────────────────────────*/

.llg-root {
  background: rgba(15, 35, 22, 0.92);
  border: 1px solid rgba(126, 207, 154, 0.25);
  border-radius: 14px;
  padding: 1.6rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  color: white;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 320px;
  min-height: 180px;
}

.llg-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.llg-title {
  font-size: 1rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.01em;
}

.llg-counter {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.07);
  padding: 0.15rem 0.5rem;
  border-radius: 8px;
}

.llg-empty {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.35);
  font-style: italic;
  text-align: center;
  padding: 1rem 0;
}

.llg-card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  flex: 1;
}

.llg-players {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.llg-player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
}

.llg-player--leading {
  background: rgba(126, 207, 154, 0.1);
  border: 1px solid rgba(126, 207, 154, 0.25);
}

.llg-player-name {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.llg-player--leading .llg-player-name {
  color: #c8f7e8;
  font-weight: 700;
}

.llg-player-score {
  font-weight: 700;
  color: #7ecf9a;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.llg-watch-btn {
  align-self: flex-start;
  padding: 0.5rem 1rem;
  background: rgba(126, 207, 154, 0.15);
  border: 1px solid rgba(126, 207, 154, 0.3);
  border-radius: 8px;
  color: #7ecf9a;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.llg-watch-btn:hover {
  background: rgba(126, 207, 154, 0.25);
  border-color: rgba(126, 207, 154, 0.5);
}

.llg-nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: auto;
}

.llg-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.llg-nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  color: white;
}

.llg-nav-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

.llg-history-btn {
  width: 100%;
  padding: 0.5rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: color 0.2s ease;
  letter-spacing: 0.02em;
}

.llg-history-btn:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* ── Footer ───────────────────────────────────────────────────────────────────*/

.app-footer {
  padding: 1.2rem 2rem;
  text-align: center;
  z-index: 50;
  margin-top: auto;
}

.gb-lobby-root .app-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.15) 100%);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.footer-link {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
}

.footer-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.footer-link--active {
  color: #7ecf9a;
  font-size: 0.82rem;
  padding: 0.3rem 0.6rem;
  font-weight: 600;
  cursor: default;
}

.footer-separator {
  color: rgba(255, 255, 255, 0.4);
}

.footer-copyright {
  margin: 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.78rem;
}

/* ── Responsive ───────────────────────────────────────────────────────────────*/

@media (max-width: 639px) {
  .footer-links {
    display: none;
  }

  .lobby-main {
    overflow-y: auto;
    align-items: flex-start;
  }

  .lobby-cards {
    width: 100%;
    padding: 0 1rem;
    box-sizing: border-box;
  }

  .lm-root,
  .llg-root {
    width: 100%;
    box-sizing: border-box;
  }
}

/* ── Game-ready modal ────────────────────────────────────────────────────────*/

.gr-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.gr-modal {
  background: rgba(15, 35, 22, 0.98);
  border: 1px solid rgba(126, 207, 154, 0.4);
  border-radius: 16px;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  color: white;
}

.gr-modal-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #c8f7e8;
}

.gr-modal-sub {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1.5rem;
}

.gr-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.gr-btn {
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gr-btn--join {
  background: linear-gradient(135deg, #4caf7d 0%, #2e7d52 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(76, 175, 125, 0.3);
}

.gr-btn--join:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(76, 175, 125, 0.45);
}

.gr-btn--dismiss {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.gr-btn--dismiss:hover {
  background: rgba(255, 255, 255, 0.16);
  color: white;
}

/* ── Shared animations ────────────────────────────────────────────────────────*/

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; }
}
