:root {
  color-scheme: light;
  
  /* Expose safe-area-inset values as custom properties for JS access */
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  
  /* Light Theme - Lobby Colors */
  --primary-start: #2d9da8;
  --primary-end: #1e7a85;
  --primary-color: #2d9da8;
  --primary-hover: #1e7a85;
  --secondary-bg: #f5f5f5;
  --text-primary: #333;
  --text-secondary: #555;
  --text-light: #666;
  --bg-white: #ffffff;
  --border-color: #e0e0e0;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --shadow-hover: rgba(45, 157, 168, 0.4);
  
  /* Success/Error colors */
  --success-color: #4caf50;
  --success-hover: #45a049;
  --danger-color: #f44336;
  --danger-hover: #da190b;
  
  /* Modern Backgammon Board Colors - Light Theme */
  --board-border: #c4a17c;          /* Light brown border */
  --board-surface: #c4d4c0;         /* Muted sage green recessed areas */
  --board-point-light: #ff9966;     /* Light orange points */
  --board-point-dark: #fff8e7;      /* Cream points */
  --board-home: #c4d4c0;            /* Muted sage green home areas */
  --checker-black: #7a3a2a;         /* Red/brown resin checkers */
  --checker-white: #e8e5e3;         /* White marble checkers */
  --checker-black-accent: #4a2218;  /* Darker resin tones */
  --checker-white-accent: #c5c3c1;  /* Gray marble veins */
  --board-text: #333;               /* Dark text for light theme */
  --board-button: #c4a17c;          /* Light brown button */
  --board-button-hover: #b08960;    /* Darker brown on hover */
}

[data-theme="dark"] {
  color-scheme: dark;
  
  /* Dark Theme - Lobby Colors */
  --primary-start: #2d9da8;
  --primary-end: #1e7a85;
  --primary-color: #2d9da8;
  --primary-hover: #3db4c0;
  --secondary-bg: #2a2a2a;
  --text-primary: #e0e0e0;
  --text-secondary: #b0b0b0;
  --text-light: #888;
  --bg-white: #1a1a1a;
  --border-color: #404040;
  --shadow-color: rgba(0, 0, 0, 0.5);
  --shadow-hover: rgba(45, 157, 168, 0.6);
  
  /* Success/Error colors (slightly adjusted for dark theme) */
  --success-color: #66bb6a;
  --success-hover: #5cb85c;
  --danger-color: #ef5350;
  --danger-hover: #e53935;
  
  /* Modern Backgammon Board Colors - Dark Theme */
  --board-border: #5d4a3a;          /* Dark brown border */
  --board-surface: #2d5c3f;         /* Dark green recessed areas */
  --board-point-light: #ff9966;     /* Light orange points (same) */
  --board-point-dark: #fff8e7;      /* Cream points (same) */
  --board-home: #2d5c3f;            /* Dark green home areas */
  --checker-black: #7a3a2a;         /* Red/brown resin (same) */
  --checker-white: #e8e5e3;         /* White marble (same) */
  --checker-black-accent: #4a2218;  /* Darker resin tones */
  --checker-white-accent: #c5c3c1;  /* Gray marble veins */
  --board-text: #ffffff;            /* White text for dark theme */
  --board-button: #5d4a3a;          /* Dark brown button */
  --board-button-hover: #7d6a5a;    /* Lighter brown on hover */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, var(--primary-start) 0%, var(--primary-end) 100%);
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  color: var(--text-primary);
  /* Fix for iOS Safari address bar resizing */
  min-height: -webkit-fill-available;
}

#root {
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  /* Fix for iOS Safari address bar resizing */
  min-height: -webkit-fill-available;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Login and Auth Screens */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-box {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 10px 40px var(--shadow-color);
  max-width: 450px;
  width: 100%;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  display: block;
  border-radius: 50%;
}

.auth-box h1 {
  text-align: center;
  color: var(--text-primary);
  margin-bottom: 30px;
  font-size: 28px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.3s;
  background: var(--bg-white);
  color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.btn {
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  padding: 10px 16px;
  font-size: 14px;
  width: auto;
  margin: 0;
}

/* Form buttons - full width */
form .btn,
.btn[type="submit"] {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  margin-bottom: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-start) 0%, var(--primary-end) 100%);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 5px 15px var(--shadow-hover);
}

.btn-primary:disabled {
  background: var(--border-color);
  color: var(--text-light);
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-secondary {
  background: var(--secondary-bg);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--border-color);
}

.btn-secondary:disabled {
  background: #f5f5f5;
  color: #bbb;
  cursor: not-allowed;
  opacity: 0.5;
}

.btn-success {
  background: var(--success-color);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: var(--success-hover);
  box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.btn-success:disabled {
  background: #a5d6a7;
  color: #fff;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-info {
  background: var(--primary-color);
  color: white;
}

.btn-info:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 5px 15px var(--shadow-hover);
}

.btn-info:disabled {
  background: var(--border-color);
  color: var(--text-light);
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-danger {
  background: var(--danger-color);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-hover);
  box-shadow: 0 5px 15px rgba(244, 67, 54, 0.4);
}

.btn-danger:disabled {
  background: #ef9a9a;
  color: #fff;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-google {
  background: var(--bg-white);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-google:hover {
  border-color: var(--primary-color);
}

.link-button {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  font-size: 14px;
  text-decoration: underline;
  padding: 5px;
}

.error-message {
  background: #fee;
  color: #c33;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 20px;
  text-align: center;
}

/* Main Lobby */
.lobby-container {
  background: var(--bg-white);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: auto;
  position: relative;
  box-sizing: border-box;
}

/* In fullscreen, keep content away from notch/camera/rounded corners */
.lobby-container.fullscreen {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

.lobby-header {
  background: linear-gradient(135deg, var(--primary-start) 0%, var(--primary-end) 100%);
  color: white;
  padding: clamp(2px, 1vh, 20px) clamp(4px, 1.5vh, 20px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  flex-shrink: 0;
}

.lobby-header h1 {
  font-size: clamp(10px, 2.5vh, 24px);
  display: flex;
  align-items: center;
  gap: clamp(4px, 1.5vh, 15px);
}

.lobby-header h1 .app-name {
  white-space: nowrap;
}

.lobby-header .logo {
  width: clamp(16px, 5vh, 50px);
  height: clamp(16px, 5vh, 50px);
  margin: 0;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: clamp(4px, 1.5vh, 15px);
  flex-shrink: 0;
}

.user-info span {
  white-space: nowrap;
}

.user-avatar {
  width: clamp(14px, 4vh, 40px);
  height: clamp(14px, 4vh, 40px);
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: clamp(8px, 2vh, 16px);
  color: var(--primary-color);
  flex-shrink: 0;
}

/* Progressive hiding of header elements on smaller screens - horizontal layout */
@media (max-width: 400px) {
  .lobby-container:not(.vertical-layout) .lobby-header h1 .app-name {
    display: none;
  }
}

@media (max-width: 300px) {
  .lobby-container:not(.vertical-layout) .lobby-header h1 .user-avatar {
    display: none;
  }
}

@media (max-width: 200px) {
  .lobby-container:not(.vertical-layout) .lobby-header h1 span {
    display: none;
  }
}

/* Progressive hiding of header elements on smaller screens - vertical layout (based on height) */
@media (max-height: 250px) {
  .lobby-container.vertical-layout .lobby-header h1 .app-name {
    display: none;
  }
}

@media (max-height: 200px) {
  .lobby-container.vertical-layout .lobby-header h1 .user-avatar {
    display: none;
  }
}

@media (max-height: 150px) {
  .lobby-container.vertical-layout .lobby-header h1 span {
    display: none;
  }
  .lobby-container.vertical-layout .lobby-header .logo {
    display: none;
  }
}

.tabs {
  display: flex;
  background: var(--secondary-bg);
  border-bottom: 2px solid var(--border-color);
  overflow: hidden;
  position: relative;
}

.tab {
  padding: 15px 30px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-light);
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Compact tab size */
.tabs[data-tab-size="compact"] .tab {
  padding: 12px 20px;
  font-size: 15px;
  gap: 6px;
}

/* Minimal tab size */
.tabs[data-tab-size="minimal"] .tab {
  padding: 10px 15px;
  font-size: 14px;
  gap: 5px;
}

.tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.close-tab-btn {
  flex-shrink: 0;
  padding: 0 6px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-light);
}

.close-tab-btn:hover {
  color: var(--text-primary);
}

.tab:hover {
  background: var(--border-color);
}

.tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background: var(--bg-white);
}

.tab-dropdown {
  position: relative;
  flex-shrink: 0;
}

.tab-more {
  position: relative;
}

.tab-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  min-width: 200px;
  max-width: 280px;
  width: max-content;
  max-height: 400px;
  overflow-y: auto;
  margin-top: 2px;
}

.tab-dropdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 8px 14px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-light);
  text-align: left;
  transition: background 0.2s;
}

@media (min-width: 850px) {
  .tab-dropdown-item {
    padding: 12px 20px;
    font-size: 16px;
  }
}

.tab-dropdown-item:last-child {
  border-bottom: none;
}

.tab-dropdown-item:hover {
  background: var(--secondary-bg);
}

.tab-dropdown-item.active {
  color: var(--primary-color);
  background: var(--secondary-bg);
}

/* Menu dropdown styles */
.btn-small.menu-button {
  font-size: clamp(12px, 3vh, 23px);
  padding: clamp(2px, 1vh, 11px) clamp(4px, 1.5vh, 16px);
  min-width: clamp(28px, 6vh, 60px);
  height: clamp(20px, 5vh, 46px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-dropdown {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  min-width: 130px;
  max-height: 90vh;
  overflow-y: auto;
}

/* Tabs dropdown menu - for narrow vertical layout */
.tabs-dropdown-menu {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  min-width: 130px;
  max-height: 90vh;
  overflow-y: auto;
}

@media (min-width: 850px) {
  .tabs-dropdown-menu {
    min-width: 200px;
  }
  .menu-dropdown {
    min-width: 200px;
  }
}

.menu-item {
  display: block;
  width: 100%;
  padding: 12px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-primary);
  text-align: left;
  transition: background 0.2s;
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item:hover {
  background: var(--secondary-bg);
}

/* Compact menu items on small screens */
@media (max-width: 849px) {
  .menu-item {
    padding: 4px 10px;
    font-size: 13px;
  }
}

/* On mobile/touch devices, maintain minimum 16px font size to prevent zoom */
@media (hover: none) and (pointer: coarse) {
  .menu-item {
    font-size: 16px !important;
  }
}

.menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

.tab-dropdown-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tab-content > div:not(.lobby-floating-titlebar) {
  flex: 1;
  overflow: auto;
  min-height: 0;
}

.tab-content > [id^="game-root-"] {
  overflow: hidden;
}

.tab-content > div:not([id^="game-root-"]):not(.lobby-floating-titlebar) {
  padding: 30px;
}

[id^="game-root-"] {
  flex: 1;
  overflow: hidden;
  padding: 0;
  margin: 0;
  border: none;
  position: relative;
}

/* Floating lobby title bar for landscape game tabs */
.lobby-floating-titlebar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  background: linear-gradient(135deg, var(--primary-start) 0%, var(--primary-end) 100%);
  padding: 0 4px;
  overflow: hidden;
}

/* In fullscreen, add right padding to keep icons away from the notch/cutout
   and the device's rounded display corners. */
.lobby-floating-titlebar.fullscreen {
  padding-right: max(env(safe-area-inset-right, 40px), 40px);
}

.floating-titlebar-btn {
  border: none;
  background: transparent;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  flex-shrink: 0;
}

.floating-titlebar-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
}

.floating-titlebar-btn img {
  filter: brightness(0) invert(1);
}

/* Lists */
.list-item {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  transition: all 0.3s;
}

.list-item:hover {
  box-shadow: 0 4px 12px var(--shadow-color);
  transform: translateY(-2px);
}

/* Player list items - compact horizontal layout */
.player-list-item {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 12px;
  margin-bottom: 4px;
  transition: all 0.3s;
}

.player-list-item:hover {
  box-shadow: 0 4px 12px var(--shadow-color);
  transform: translateY(-2px);
}

.list-item h3 {
  color: var(--text-primary);
  margin-bottom: 10px;
  font-size: 18px;
}

.list-item p {
  color: var(--text-secondary);
  margin-bottom: 5px;
  font-size: 14px;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-right: 8px;
  margin-top: 8px;
}

.badge-public {
  background: #e3f2fd;
  color: #1976d2;
}

.badge-private {
  background: #fce4ec;
  color: #c2185b;
}

.badge-active {
  background: #e8f5e9;
  color: #388e3c;
}

.badge-scheduled {
  background: #fff3e0;
  color: #f57c00;
}

.badge-online {
  background: #4caf50;
  color: white;
}

/* Player Cards */
.player-card {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.player-photo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--secondary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  color: var(--text-secondary);
  flex-shrink: 0;
}

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

.player-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 1px;
  line-height: 1.2;
}

.player-details {
  color: var(--text-secondary);
  font-size: 12px;
  margin-top: 1px;
  line-height: 1.2;
}

.rating-stars {
  color: #ffa000;
  font-size: 11px;
  margin-top: 0;
}

/* Buttons in lists */
.action-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.btn-small {
  padding: 4px 8px;
  font-size: 12px;
  width: auto;
  margin: 0;
  white-space: nowrap;
  line-height: 1.2;
}

.btn-session {
  padding: 4px 8px;
  font-size: 12px;
  width: auto;
  margin: 0;
  white-space: nowrap;
  line-height: 1.2;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 30px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-small {
  max-width: 400px;
}

.modal h2 {
  margin-bottom: 20px;
  color: var(--text-primary);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.empty-state p {
  font-size: 18px;
  margin-bottom: 20px;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 18px;
}

/* Rating Display */
.rating-detail {
  background: var(--secondary-bg);
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 15px;
  border: 1px solid var(--border-color);
}

.rating-category {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
}

/* Detail text used in session cards, rating UI, etc. */
.detail-text {
  font-size: 13px;
}

.rating-response {
  background: #e3f2fd;
  padding: 15px;
  border-radius: 6px;
  margin-top: 10px;
  font-style: italic;
}

/* Smartphone scrollable tab bar */
.lobby-container.smartphone:not(.vertical-layout) .tabs {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}
.lobby-container.smartphone:not(.vertical-layout) .tabs::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* Responsive */
@media (max-width: 768px) {
  .tabs {
    justify-content: flex-start;
  }

  /* Default tab sizing on mobile - will be overridden by data-tab-size if set */
  .tabs:not([data-tab-size]) .tab {
    padding: 12px 20px;
    font-size: 14px;
  }

  .tab-content > div:not([id^="game-root-"]):not(.lobby-floating-titlebar) {
    padding: 15px;
  }

  .auth-box {
    padding: 30px 20px;
  }

  .modal {
    padding: 20px;
  }
}

/* Vertical space optimization for Create Account form */
/* Medium spacing: 850-1050px height */
@media (max-height: 1050px) {
  .auth-container {
    align-items: flex-start;
    padding: 10px;
  }

  .auth-box {
    padding: 25px;
    margin: 10px 0;
  }

  .auth-box h1 {
    margin-bottom: 20px;
    font-size: 24px;
  }

  .logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
  }

  .form-group {
    margin-bottom: 15px;
  }

  .form-group label {
    margin-bottom: 5px;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 10px;
  }
}

/* Compact spacing: below 850px height */
@media (max-height: 850px) {
  .auth-container {
    padding: 5px;
  }

  .auth-box {
    padding: 15px;
    margin: 5px 0;
  }

  .auth-box h1 {
    margin-bottom: 10px;
    font-size: 18px;
  }

  .logo {
    width: 40px;
    height: 40px;
    margin: 0 auto 8px;
  }

  .form-group {
    margin-bottom: 8px;
  }

  .form-group label {
    margin-bottom: 3px;
    font-size: 13px;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 6px;
    font-size: 13px;
  }

  .auth-container .btn {
    padding: 8px 16px;
    font-size: 13px;
    margin-top: 5px;
  }

  /* My Chouettes Tab - responsive buttons */
  .action-buttons {
    flex-wrap: wrap;
    gap: 4px;
  }

  .action-buttons .btn-small {
    padding: 4px 8px;
    font-size: 10px;
  }

  /* Chouette header - stack vertically on mobile */
  .chouette-header {
    flex-direction: column;
    align-items: stretch !important;
  }

  .chouette-header h2 {
    margin-bottom: 10px !important;
  }

  .chouette-header .btn {
    width: 100%;
    font-size: 14px;
  }
}

/* Very compact spacing: below 700px height */
@media (max-height: 700px) {
  .auth-box .logo {
    width: 30px;
    height: 30px;
    margin: 0 auto 5px;
  }

  .auth-box .step-indicator {
    display: none;
  }
  
  .auth-box {
    padding: 10px 15px;
    margin: 0;
  }
  
  .auth-box h1 {
    margin-bottom: 5px;
    margin-top: 0;
    font-size: 16px;
  }

  .form-group {
    margin-bottom: 6px;
  }
}

/* Theme toggle and fullscreen toggle buttons - specific override for icon buttons */
.btn-small.theme-toggle,
.btn-small.fullscreen-toggle {
  padding: clamp(1px, 0.5vh, 4px) clamp(2px, 1vh, 8px);
  font-size: clamp(10px, 2.5vh, 18px);
  min-width: clamp(20px, 5vh, 40px);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tabs toggle button should match menu button styling */
.btn-small.tabs-toggle {
  font-size: clamp(12px, 3vh, 23px);
  padding: clamp(2px, 1vh, 11px) clamp(4px, 1.5vh, 16px);
  min-width: clamp(28px, 6vh, 60px);
  height: clamp(20px, 5vh, 46px);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Make theme toggle icon larger to match fullscreen icon size */
.btn-small.theme-toggle {
  font-size: clamp(14px, 3.5vh, 26px);
}

/* Container for icon buttons in vertical layout */
.icon-buttons-container {
  display: flex;
  gap: clamp(2px, 1vh, 8px);
}

/* Smooth transitions for theme changes - applied to specific elements only */
body,
.lobby-container,
.tab-button,
.btn,
.modal-content,
.session-card,
input,
textarea,
select,
.tab-content {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Modal Content */
.modal-content {
  background: var(--bg-white);
  border-radius: 12px;
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-white);
  flex-shrink: 0;
}

.modal-header h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 18px;
}

.close-button {
  background: none;
  border: none;
  font-size: 32px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.close-button:hover {
  color: var(--text-primary);
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: var(--secondary-bg);
}

/* Tab Content - for modals and other contexts */
.modal .tab-content {
  padding: 30px;
  overflow-y: auto;
  flex: 1;
}

/* Main lobby tab content should not have padding */
.lobby-container .tab-content {
  padding: 0;
}

.settings-section {
  display: flex;
  flex-direction: column;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 14px;
}

.form-group input[type="number"],
.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group select {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  background: var(--bg-white);
  color: var(--text-primary);
}

/* Date/time picker dropdown styling in dark mode */
[data-theme="dark"] input[type="date"]::-webkit-datetime-edit,
[data-theme="dark"] input[type="time"]::-webkit-datetime-edit {
  color: var(--text-primary);
}

[data-theme="dark"] input[type="date"]::-webkit-datetime-edit-fields-wrapper,
[data-theme="dark"] input[type="time"]::-webkit-datetime-edit-fields-wrapper {
  background: var(--bg-white);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(45, 157, 168, 0.1);
}

.form-group.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.form-group.checkbox label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: normal;
}

.form-group.checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.help-text {
  color: var(--text-light);
  font-size: 12px;
  margin-top: 4px;
  display: block;
}

.session-details-box {
  padding: 10px;
  background: var(--secondary-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
}

.session-details-box p {
  margin: 6px 0;
}

/* Modal Footer */
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-white);
  flex-shrink: 0;
}

.modal-footer .primary-button,
.modal-footer .secondary-button,
.modal-footer .btn {
  padding: 8px 20px;
}

/* Modal Body */
.modal-body {
  padding: 20px 24px;
  flex: 1 1 auto;
  overflow-y: auto;
}

.primary-button,
.secondary-button {
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.primary-button {
  background: var(--primary-color);
  color: white;
}

.primary-button:hover {
  background: var(--primary-hover);
}

.secondary-button {
  background: var(--border-color);
  color: var(--text-primary);
}

.secondary-button:hover {
  background: var(--text-light);
  color: white;
}

/* EditChouetteModal - Compact Form Styles */
.edit-chouette-label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  color: var(--text-primary);
  font-weight: 500;
}

.edit-chouette-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-white);
  color: var(--text-primary);
}

.edit-chouette-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(45, 157, 168, 0.1);
}

.edit-chouette-checkbox-label {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 0;
  cursor: pointer;
  color: var(--text-primary);
}

.edit-chouette-section-header {
  padding-bottom: 4px;
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
  color: var(--primary-color);
}

.edit-chouette-help-icon {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  cursor: help;
  font-size: 12px;
  color: #666;
  position: relative;
  flex-shrink: 0;
  z-index: 1;
}

[data-theme="dark"] .edit-chouette-help-icon {
  color: #999;
}

.edit-chouette-tooltip {
  position: absolute;
  top: -5px;
  background-color: #333;
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  pointer-events: none;
  line-height: 1.4;
}

/* During measurement phase, don't wrap */
.edit-chouette-tooltip.measuring {
  white-space: nowrap;
}

/* After positioning, allow wrapping with max-width */
.edit-chouette-tooltip.positioned {
  white-space: normal;
  max-width: 300px;
  word-wrap: break-word;
}

.edit-chouette-tooltip.tooltip-left {
  right: 20px;
}

.edit-chouette-tooltip.tooltip-right {
  left: 20px;
}

.edit-chouette-tooltip.tooltip-center {
  left: 50%;
  transform: translateX(-50%);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-height: 95vh;
  }

  .modal-header {
    padding: 15px 20px;
  }

  .modal-header h2 {
    font-size: 18px;
  }

  .modal .tab-content {
    padding: 20px;
  }
  
  .lobby-container .tab-content {
    padding: 0;
  }

  /* Reduce gap in header to make room for menu button */
  .lobby-header h1 {
    gap: 8px;
    font-size: 18px;
  }
  
  .lobby-header .logo {
    width: 35px;
    height: 35px;
  }
  
  .user-avatar {
    width: 30px !important;
    height: 30px !important;
    font-size: 14px !important;
  }

  /* Default tab sizing on mobile - will be overridden by data-tab-size if set */
  .tabs:not([data-tab-size]) .tab {
    padding: 12px 15px;
    font-size: 13px;
    white-space: nowrap;
  }
}

/* Reduce tab height for small screens or smartphone landscape - except in vertical layout */
@media (max-height: 700px) {
  .lobby-container:not(.vertical-layout) .tabs .tab {
    padding-top: 2px;
    padding-bottom: 2px;
  }
}

/* Smartphone landscape mode - applied via class - only when NOT in vertical layout */
.lobby-container.smartphone-landscape:not(.vertical-layout) .tabs .tab {
  padding-top: 2px;
  padding-bottom: 2px;
}

/* Session Cards */
.session-card {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

/* Visibility Badges */
.visibility-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
}

.visibility-badge.public {
  background-color: #d4edda;
  color: #155724;
}

.visibility-badge.friends {
  background-color: #d1ecf1;
  color: #0c5460;
}

.visibility-badge.private {
  background-color: #f8d7da;
  color: #721c24;
}

[data-theme="dark"] .visibility-badge.public {
  background-color: #1a3a1a;
  color: #66bb6a;
}

[data-theme="dark"] .visibility-badge.friends {
  background-color: #1a3a4a;
  color: #64b5f6;
}

[data-theme="dark"] .visibility-badge.private {
  background-color: #4a1a1a;
  color: #ef5350;
}

/* Collapsible Section Headers - Shared by SessionsTab and MyChouettesTab */
.section-header {
  cursor: pointer;
  padding: 15px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-header h3 {
  margin: 0;
}

.section-header .collapse-icon {
  font-size: 20px;
}

.section-group {
  margin-bottom: 30px;
}

.section-header.success {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #28a745;
}

.section-header.info {
  background-color: #d1ecf1;
  border: 1px solid #bee5eb;
  color: #0c5460;
}

.section-header.challenge {
  background-color: #e7f3ff;
  border: 1px solid #b3d9ff;
  color: #0056b3;
}

.section-header.warning {
  background-color: #fff3cd;
  border: 1px solid #ffeaa7;
  color: #856404;
}

.section-header.danger {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.section-header.secondary {
  background-color: #e2e3e5;
  border: 1px solid #d6d8db;
  color: #6c757d;
}

[data-theme="dark"] .section-header.success {
  background-color: #1a3a1a;
  border-color: #2d5a2d;
  color: #66bb6a;
}

[data-theme="dark"] .section-header.info {
  background-color: #1a3a4a;
  border-color: #2d5a7a;
  color: #4fc3f7;
}

[data-theme="dark"] .section-header.challenge {
  background-color: #1a2a4a;
  border-color: #2d4a8a;
  color: #64b5f6;
}

[data-theme="dark"] .section-header.warning {
  background-color: #4a3a1a;
  border-color: #6a5a2a;
  color: #ffd54f;
}

[data-theme="dark"] .section-header.danger {
  background-color: #4a1a1a;
  border-color: #6a2a2a;
  color: #ef5350;
}

[data-theme="dark"] .section-header.secondary {
  background-color: #2a2a2a;
  border-color: #4a4a4a;
  color: #9e9e9e;
}

/* Content area for collapsible sections */
.section-content {
  padding: 10px;
  border-radius: 4px;
}

.section-content.info {
  background: #f0f8ff;
  border: 1px solid #bee5eb;
}

[data-theme="dark"] .section-content.info {
  background: #1a2a3a;
  border-color: #2d4a6a;
}

/* ========================================
   Sessions Tab - Two-Table Layout
   ======================================== */

/* Sessions tab parent wrapper is styled inline with display:flex in MainLobby.jsx */

.sessions-tab-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  gap: 12px;
}

/* Panel (each table) */
.st-panel {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-white);
}

.st-panel-top {
  flex: 1 1 0;
  /* min-height: header (~44px) + 2 rows (~37px each) */
  min-height: 118px;
}

.st-panel-bottom {
  flex: 3 1 0;
  min-height: 0;
}

/* Panel header / title bar */
.st-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--secondary-bg);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  gap: 10px;
  flex-wrap: wrap;
}

.st-panel-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  white-space: nowrap;
}

.st-panel-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Filter row inside bottom panel header */
.st-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.st-filter-sep {
  width: 1px;
  height: 24px;
  background: var(--border-color);
  flex-shrink: 0;
}

.st-filter-label {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  font-weight: 500;
}

.st-filter-select {
  padding: 4px 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-white);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
}

.st-filter-select-narrow {
  width: 90px;
}

/* Toggle buttons (pressed/depressed) */
.st-toggle-btn {
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border-color);
  background: var(--bg-white);
  color: var(--text-primary);
  transition: all 0.15s ease;
  cursor: pointer;
}

.st-toggle-btn:hover {
  background: var(--secondary-bg);
}

.st-toggle-btn.st-toggle-active {
  background: #5a7d8c;
  color: white;
  border-color: #5a7d8c;
}

.st-toggle-btn.st-toggle-active:hover {
  background: #4a6b78;
}

.st-toggle-sm {
  padding: 3px 10px;
  font-size: 12px;
}

.st-panel-bottom > .st-panel-header {
  flex-direction: column;
  align-items: flex-start;
}

.st-panel-bottom > .st-panel-header > .st-panel-title {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Panel body (scrollable) */
.st-panel-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* Empty state inside a panel */
.st-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
}

/* Session list (CSS Grid for aligned columns with progressive hiding) */
.st-table {
  display: grid;
  grid-template-columns: minmax(30px, auto) minmax(0, 1fr) auto;
  width: 100%;
}

.st-row {
  display: contents;
}

/* Apply row border and hover via cells */
.st-row > .st-cell-name,
.st-row > .st-cell-info,
.st-row > .st-cell-actions {
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s;
}

.st-row:last-child > .st-cell-name,
.st-row:last-child > .st-cell-info,
.st-row:last-child > .st-cell-actions {
  border-bottom: none;
}

.st-row:hover > .st-cell-name,
.st-row:hover > .st-cell-info,
.st-row:hover > .st-cell-actions {
  background: var(--secondary-bg);
}

/* Name cell: auto-width based on widest name, truncates when space is tight */
.st-cell-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  cursor: default;
}

/* Info cell: fills remaining space, clips from right */
.st-cell-info {
  overflow: hidden;
  padding: 8px 12px;
  display: flex;
  align-items: center;
}

.st-info-tags {
  display: flex;
  gap: 8px;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
}

.st-info-tag {
  flex-shrink: 0;
  font-size: 13px;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
}

.st-info-icon {
  width: 14px;
  height: 14px;
  vertical-align: middle;
  margin-right: 2px;
}

/* Actions cell: auto-width, right-aligned, won't shrink */
.st-cell-actions {
  white-space: nowrap;
  text-align: right;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.st-cell-actions .btn {
  margin-left: 6px;
}

.st-row-title {
  margin-right: 6px;
}

/* Badges */
.st-badge-private,
.st-badge-friends {
  font-size: 12px;
  margin-left: 4px;
  vertical-align: middle;
}

/* Session row button */
.btn-session-row {
  padding: 4px 12px;
  font-size: 13px;
  min-width: 0;
}

/* Last active indicator in session rows */
.st-last-active {
  font-size: 11px;
  font-weight: 400;
  margin-left: 6px;
  white-space: nowrap;
}

.st-last-active-now {
  color: var(--success-color);
}

.st-last-active-recent {
  color: var(--text-light);
}

.st-last-active-inactive {
  color: var(--danger-color);
  opacity: 0.8;
}

/* Bottom table row animations */
@keyframes st-row-slide-out {
  from { opacity: 1; max-height: 50px; transform: translateX(0); }
  to   { opacity: 0; max-height: 0; transform: translateX(-30px); }
}

@keyframes st-row-slide-in {
  from { opacity: 0; max-height: 0; transform: translateX(30px); }
  to   { opacity: 1; max-height: 50px; transform: translateX(0); }
}

.st-row-removing > * {
  animation: st-row-slide-out 0.35s ease-in forwards;
  overflow: hidden;
}

.st-row-adding > * {
  animation: st-row-slide-in 0.35s ease-out forwards;
  overflow: hidden;
}

/* Responsive: stack filter rows on narrow screens */
@media (max-width: 600px) {
  .st-panel-header {
    padding: 8px 10px;
  }
  
  .st-filter-row {
    gap: 6px;
  }
  
  .st-toggle-btn {
    padding: 4px 8px;
    font-size: 12px;
  }
  
  .st-filter-select {
    font-size: 12px;
    padding: 3px 6px;
  }
  
  .btn-session-row {
    padding: 3px 8px;
    font-size: 12px;
  }
  
  .st-cell-name,
  .st-cell-info,
  .st-cell-actions {
    padding: 6px 8px;
    font-size: 13px;
  }
  
  .st-panel-header-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* Dark mode overrides for new sessions tab elements */
[data-theme="dark"] .st-panel {
  border-color: var(--border-color);
}

[data-theme="dark"] .st-panel-header {
  background: var(--secondary-bg);
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .st-filter-select {
  background: var(--bg-white);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .st-toggle-btn {
  background: var(--bg-white);
  color: var(--text-primary);
  border-color: var(--border-color);
}

[data-theme="dark"] .st-toggle-btn:hover {
  background: #333;
}

[data-theme="dark"] .st-toggle-btn.st-toggle-active {
  background: #5a7d8c;
  color: white;
  border-color: #5a7d8c;
}

[data-theme="dark"] .st-row:hover > .st-cell-name,
[data-theme="dark"] .st-row:hover > .st-cell-info,
[data-theme="dark"] .st-row:hover > .st-cell-actions {
  background: #2a2a2a;
}

/* Inline alert/banner boxes */
.alert-box {
  margin-top: 10px;
  padding: 10px;
  border-radius: 4px;
}

.alert-box.success {
  background: #d4edda;
  border: 1px solid #c3e6cb;
}

.alert-box.danger {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
}

.alert-box.info {
  background: #d1ecf1;
  border: 1px solid #bee5eb;
}

[data-theme="dark"] .alert-box.success {
  background: #1a3a1a;
  border-color: #2d5a2d;
}

[data-theme="dark"] .alert-box.danger {
  background: #4a1a1a;
  border-color: #6a2a2a;
}

[data-theme="dark"] .alert-box.info {
  background: #1a3a4a;
  border-color: #2d5a7a;
}

/* Contextual text colors with dark mode support */
.text-success { color: #155724; }
.text-warning { color: #856404; }
.text-danger { color: #721c24; }
.text-info { color: #0c5460; }
.text-muted { color: var(--text-light); }

[data-theme="dark"] .text-success { color: #66bb6a; }
[data-theme="dark"] .text-warning { color: #ffd54f; }
[data-theme="dark"] .text-danger { color: #ef5350; }
[data-theme="dark"] .text-info { color: #4fc3f7; }

/* Small inline action buttons (accept/decline/cancel in lists) */
.btn-inline-success {
  font-size: 11px;
  padding: 2px 6px;
  margin-left: 3px;
  background-color: var(--success-color);
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

.btn-inline-danger {
  font-size: 11px;
  padding: 2px 6px;
  margin-left: 3px;
  background-color: var(--danger-color);
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

.btn-inline-success:disabled,
.btn-inline-danger:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Badge for unread counts */
.badge-count {
  background-color: var(--success-color);
  color: #fff;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: bold;
}

/* Tab badge (sup element) */
.tab-badge {
  margin-left: 5px;
  color: var(--success-color);
  font-weight: bold;
  font-size: 0.8em;
}

/* Form validation colors */
.text-field-success { color: var(--success-color); }
.text-field-error { color: var(--danger-color); display: block; margin-top: 4px; }

/* Step indicator */
.step-indicator {
  margin-bottom: 20px;
  padding: 10px;
  background: var(--secondary-bg);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-light);
}

/* Hint/helper text */
.hint-text {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 5px;
}

/* Divider line */
.divider-line {
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

/* Tab badge sup */
.tab sup,
.tab-dropdown-item sup {
  margin-left: 5px;
  color: var(--success-color);
  font-weight: bold;
  font-size: 0.8em;
}

/* Selectable item rows (modals with checkboxes) */
.selectable-item {
  display: flex;
  align-items: center;
  padding: 8px;
  cursor: pointer;
  border-radius: 4px;
}

.selectable-item input[type="checkbox"] {
  margin-right: 8px;
}

/* Checkbox list layout */
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Checkbox row */
.checkbox-row {
  display: flex;
  align-items: center;
}

/* Pagination */
.pagination-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 15px;
  padding: 10px;
}

.pagination-btn {
  padding: 5px 10px;
}

.pagination-info {
  font-size: 14px;
  color: var(--text-light);
}

/* Standard textarea */
.textarea-standard {
  width: 100%;
  padding: 10px;
  font-size: 14px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  resize: vertical;
  font-family: inherit;
  background-color: var(--bg-white);
  color: var(--text-primary);
}

/* Compact select for modals */
.form-select-compact {
  width: 100%;
  padding: 6px 10px;
}

/* Detail field groups (expanded player cards) */
.detail-field-group {
  margin-bottom: 6px;
}

.detail-label {
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
}

.detail-value {
  color: var(--text-primary);
  margin-top: 2px;
}

/* Review/response quote blocks */
.review-quote {
  margin-top: 10px;
  padding: 10px;
  background-color: var(--bg-white);
  border-left: 3px solid var(--border-color);
  font-size: 14px;
}

.review-quote.italic {
  font-style: italic;
}

/* Chouette section header */
.chouette-section-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  cursor: pointer;
  align-items: center;
  padding: 10px;
  background: var(--secondary-bg);
  border-radius: 4px;
}

.chouette-section-header h2 {
  margin: 0;
}

/* Link colors */
.link-accent {
  color: var(--primary-color);
  text-decoration: underline;
}

/* Connection status banner */
.connection-banner {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #f0ad4e;
  color: #333;
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10001;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
}

.connection-banner .retry-btn {
  background-color: var(--bg-white);
  color: var(--text-primary);
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background-color 0.2s;
}

.connection-banner .retry-btn:hover {
  background-color: var(--secondary-bg);
}

/* Error form message */
.form-error {
  background-color: #fee;
  border: 1px solid #fcc;
  padding: 10px;
  margin-bottom: 15px;
  border-radius: 4px;
  color: #c00;
}

[data-theme="dark"] .form-error {
  background-color: #4a1a1a;
  border-color: #6a2a2a;
  color: #ef5350;
}

/* Player ratings modal */
.rating-card {
  margin-bottom: 15px;
  padding: 15px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-white);
}

.rating-review {
  margin-top: 10px;
  padding: 10px;
  background: var(--secondary-bg);
  border-radius: 4px;
}

.rating-response {
  margin-top: 10px;
  padding: 10px;
  background: var(--secondary-bg);
  border-radius: 4px;
  border-left: 3px solid var(--primary-color);
}

.ratings-container {
  flex: 1;
  padding: 15px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--secondary-bg);
  box-shadow: 0 2px 4px var(--shadow-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ratings-summary {
  margin-bottom: 20px;
  padding: 15px;
  background: var(--bg-white);
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.ratings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.ratings-header button {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  color: var(--text-light);
}

/* Selected item highlight */
.item-selected {
  background-color: rgba(45, 157, 168, 0.15);
}

[data-theme="dark"] .item-selected {
  background-color: rgba(45, 157, 168, 0.25);
}

/* Messages Tab */
.conversation-list {
  flex: 0 0 280px;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  background-color: var(--bg-white);
}

/* On narrower screens, make conversations column about 1/4 of messages column width */
@media (max-width: 900px) {
  .conversation-list {
    flex: 0 0 25%;
    min-width: 100px;
  }
}

.conversation-list-header {
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
  font-weight: bold;
  background-color: var(--secondary-bg);
  font-size: clamp(12px, 1.5vw, 16px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-item {
  padding: 15px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-white);
  transition: background-color 0.2s;
  overflow: hidden;
}

.conversation-username {
  font-size: clamp(12px, 1.4vw, 16px);
}

.conversation-meta {
  font-size: clamp(10px, 1.1vw, 12px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-item:hover {
  background-color: var(--secondary-bg);
}

.conversation-item.selected {
  background-color: var(--secondary-bg);
}

.message-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-white);
}

.message-view-header {
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
  font-weight: bold;
  background-color: var(--secondary-bg);
  font-size: clamp(12px, 1.5vw, 16px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-bubble {
  max-width: 70%;
  padding: 10px 15px;
  border-radius: 10px;
}

.message-bubble.from-me {
  background-color: #007bff;
  color: white;
}

.message-bubble.from-other {
  background-color: var(--secondary-bg);
  color: var(--text-primary);
}

[data-theme="dark"] .message-bubble.from-other {
  background-color: #3a3a3a;
}

.message-input-area {
  padding: 15px;
  border-top: 1px solid var(--border-color);
  background-color: var(--secondary-bg);
}

/* Vertical Layout Styles */
.lobby-container.vertical-layout {
  display: flex;
  flex-direction: row;
  height: 100vh;
  height: 100dvh;
}

.lobby-container.vertical-layout .lobby-header {
  flex-direction: column;
  width: max(30px, 8vw);
  min-width: 30px;
  padding: clamp(2px, 1vw, 20px) clamp(4px, 1.5vw, 20px);
  align-items: stretch;
  height: 100%;
  max-height: none;
  overflow: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  flex-shrink: 0;
}


.lobby-container.vertical-layout .lobby-header h1 {
  flex-direction: column;
  font-size: clamp(6px, 1.2vw, 18px);
  text-align: center;
  gap: clamp(2px, 0.5vw, 10px);
  margin-bottom: clamp(2px, 0.5vw, 10px);
  word-wrap: break-word;
  hyphens: auto;
  line-height: 1.2;
}

.lobby-container.vertical-layout .lobby-header h1 .app-name {
  white-space: normal;
}

.lobby-container.vertical-layout .lobby-header .logo {
  width: clamp(16px, 5vw, 50px);
  height: clamp(16px, 5vw, 50px);
}

.lobby-container.vertical-layout .user-info {
  flex-direction: column;
  gap: clamp(4px, 1.5vw, 15px);
  align-items: stretch;
  margin-top: auto;
  padding-top: clamp(4px, 1.5vw, 15px);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.lobby-container.vertical-layout .user-info span {
  text-align: center;
  font-size: clamp(6px, 1vw, 16px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobby-container.vertical-layout .user-info .user-avatar {
  margin: 0 auto;
  width: clamp(14px, 4vw, 40px);
  height: clamp(14px, 4vw, 40px);
  font-size: clamp(8px, 2vw, 16px);
}

.lobby-container.vertical-layout .user-info button {
  width: 100%;
  padding: clamp(1px, 0.5vw, 4px) clamp(2px, 1vw, 8px);
  font-size: clamp(10px, 2.5vw, 18px);
}

/* Override font size for theme toggle in vertical layout to match fullscreen icon */
.lobby-container.vertical-layout .user-info .theme-toggle {
  font-size: clamp(14px, 3.5vw, 26px);
}

/* Menu button in vertical layout needs larger icon */
.lobby-container.vertical-layout .user-info .menu-button {
  font-size: clamp(12px, 3vw, 23px);
}

/* In vertical layout, icon buttons container should flex evenly */
.lobby-container.vertical-layout .icon-buttons-container {
  display: flex;
  gap: clamp(2px, 1vw, 8px);
  width: 100%;
}

.lobby-container.vertical-layout .icon-buttons-container button {
  flex: 1;
  min-width: 0; /* Allow buttons to shrink below their content size */
  padding: clamp(1px, 0.5vw, 4px) clamp(1px, 0.5vw, 4px);
}

.lobby-container.vertical-layout .tabs {
  flex-direction: column;
  width: 150px;
  min-width: 100px;
  border-bottom: none;
  border-right: 2px solid var(--border-color);
  overflow-y: auto;
  overflow-x: hidden;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
}

/* Stack icon buttons vertically on very narrow screens OR in mobile landscape mode to save vertical space */
@media (max-width: 800px), (max-height: 600px) and (orientation: landscape) {
  .lobby-container.vertical-layout .icon-buttons-container {
    flex-direction: column;
    gap: 2px;
  }
  
  /* Reduce tab bar width on narrow screens or mobile landscape */
  .lobby-container.vertical-layout .tabs {
    width: 99px; /* 10% narrower than the previous 110px */
    min-width: 99px;
  }
}

/* Vertical layout tab sizing - applies to all sizes */
.lobby-container.vertical-layout .tabs .tab {
  border-bottom: 3px solid transparent;
  border-right: none;
  text-align: left;
  width: 100%;
  flex-shrink: 0;
  flex-grow: 0;
  margin: 0;
  word-wrap: break-word;
  hyphens: auto;
  line-height: 1.3;
}

/* Vertical layout tab sizes - controlled by data-tab-size attribute */
.lobby-container.vertical-layout .tabs[data-tab-size="normal"] .tab {
  padding: 15px 12px;
  font-size: 14px;
  line-height: 1.3;
}

/* Vertical layout compact size */
.lobby-container.vertical-layout .tabs[data-tab-size="compact"] .tab {
  padding: 12px 10px;
  font-size: 13px;
  line-height: 1.3;
}

/* Vertical layout minimal size */
.lobby-container.vertical-layout .tabs[data-tab-size="minimal"] .tab {
  padding: 10px 8px;
  font-size: 12px;
  line-height: 1.3;
}

.lobby-container.vertical-layout .tab.active {
  border-bottom-color: var(--primary-color);
  border-right: none;
  background: var(--bg-white);
}

.lobby-container.vertical-layout .tab-dropdown {
  width: 100%;
}

.lobby-container.vertical-layout .tab-more {
  width: 100%;
  text-align: left;
}

.lobby-container.vertical-layout .tab-dropdown-menu {
  left: 100%;
  top: auto;
  bottom: 0;
  right: auto;
  max-height: 80vh;
}

.lobby-container.vertical-layout .tab-content,
.lobby-container.vertical-layout .game-container {
  flex: 1;
  overflow: auto;
}

/* Error Overlays */
.error-toast {
  position: fixed;
  bottom: 20px;
  left: 20px;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
}

.error-toast.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.error-toast.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

/* Lobby-level stacking overlays */
.lobby-overlay-stack {
  position: fixed;
  bottom: 0;
  left: 20px;
  z-index: 10000;
  pointer-events: none;
}

.lobby-overlay {
  position: absolute;
  left: 0;
  padding: 14px 32px;
  border-radius: 8px;
  font-size: 15px;
  max-width: 500px;
  text-align: left;
  white-space: nowrap;
  pointer-events: auto;
  animation: overlaySlideUp 0.3s ease-out;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.lobby-overlay-error {
  background: #dc3545;
  color: white;
}

.lobby-overlay-success {
  background: #28a745;
  color: white;
}

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

.error-overlay-center {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #dc3545;
  color: white;
  padding: 20px 40px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  font-size: 16px;
  max-width: 500px;
  text-align: center;
}

/* Dark mode variants */
[data-theme="dark"] .error-toast.error {
  background-color: #5a1a1a;
  color: #f8d7da;
  border: 1px solid #8b2e2e;
}

[data-theme="dark"] .error-toast.success {
  background-color: #1e4620;
  color: #d4edda;
  border: 1px solid #2d6930;
}

[data-theme="dark"] .error-overlay-center {
  background: #a82a2a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .lobby-overlay-error {
  background: #a82a2a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .lobby-overlay-success {
  background: #1e6e28;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

/* Session hover bubble */
.st-bubble {
  position: fixed;
  z-index: 2000;
  background: var(--bg-white);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 4px 16px var(--shadow-color);
  max-width: 420px;
  min-width: 200px;
  pointer-events: none;
  font-size: 13px;
  line-height: 1.5;
}

.st-bubble-line {
  white-space: normal;
  word-wrap: break-word;
}

.st-bubble-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 4px;
}

.st-bubble-line + .st-bubble-line {
  margin-top: 2px;
}

[data-theme="dark"] .st-bubble {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
  .st-bubble {
    font-size: 15px;
  }
  .st-bubble-title {
    font-size: 16px;
  }
}

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