/* === BUTTON === */
.hamburger-button {
  background-color: transparent;
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: var(--z-index-menu-button);
  position: relative;
}

.hamburger-label {
  margin-left: var(--spacing-small);
  font-size: var(--font-size-m);
  color: #333;
}

/* === MENU CONTAINER === */
.hamburger-menu {
  position: fixed;
  top: 60px;
  right: max(10px, calc((100vw - var(--app-max-width)) / 2 + 10px));
  width: 65vw;
  max-width: 320px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  overflow-x: visible;
  overscroll-behavior: contain;
  background: #ffffff;
  color: #333;
  border-radius: 16px;
  border: none;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.04),
    0 8px 24px rgba(0, 0, 0, 0.08),
    0 16px 48px rgba(0, 0, 0, 0.12);
  z-index: var(--z-index-menu);
  pointer-events: auto;
  display: none;
  padding: 4px;
  animation: menuSlideIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes menuSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hamburger-menu.open {
  display: block;

}



.hamburger-label {
  font-size: var(--font-size-s);
  color: black;
  margin-left: 3px;
  /* Reduced from 7px to center better on icon */
  position: relative;
  transform: translateY(-48%);
  /* Center on the horizontal lines of the menu icon */
}

/* === MENU ITEMS === */

/* Category parent items (contain category label + submenu) */
.hamburger-menu-item {
  padding: 0;
  margin: 4px 0 2px 0;
  /* Reduced from 10px 0 4px 0 */
  cursor: default;
  pointer-events: none;
  font-weight: 700;
  font-size: clamp(0.7rem, 0.65rem + 0.3vw, 0.75rem);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #1f1f1f;
  display: block;
  position: relative;
  padding-left: 16px;
  padding-bottom: 2px;
  /* Reduced from 4px */
  border-bottom: 2px solid #667eea;
  margin-left: 4px;
  margin-right: 4px;
}

.hamburger-menu-item:first-child {
  margin-top: 2px;
  /* Reduced from 4px */
}

/* Category label accent - no ::before needed now */

/* Divider line between categories */
.hamburger-menu-item:not(:first-child) {
  margin-top: 8px;
  /* Reduced from 16px */
}

/* Actual clickable menu items inside submenu */

/* Add padding to category label itself */
.hamburger-menu-item {
  padding-left: 12px;
}

.hamburger-submenu-item {
  padding: 1px 6px;
  /* Reduced from 2px 6px */
  cursor: pointer;
  font-size: clamp(0.8rem, 0.75rem + 0.5vw, 0.9rem);
  color: #1f1f1f;
  position: relative;
  z-index: var(--z-index-menu);
  pointer-events: auto;
  background-color: transparent;
  text-align: left;
  border-radius: 10px;
  margin: 0;
  font-weight: 500;
  display: flex;
  align-items: center;
  min-height: 28px;
  /* Reduced from 36px */
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

/* Actual clickable submenu items */
.hamburger-submenu-item {
  display: flex;
  align-items: center;
}

.hamburger-submenu-item:active {
  transform: scale(0.98);
  background: #e9ecef;
}

/* Disabled menu items - show but not clickable */
.hamburger-submenu-item[disabled],
.hamburger-submenu-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: #999;
  /* Do NOT use pointer-events: none - we handle clicks via JS */
}

.hamburger-submenu-item[disabled] i,
.hamburger-submenu-item.disabled i {
  opacity: 0.6;
  color: #bbb;
}

.hamburger-submenu-item[disabled]:hover,
.hamburger-submenu-item.disabled:hover {
  background-color: transparent;
}

/* === MENU ICONS === */
.hamburger-submenu-item i,
.hamburger-menu-item i {
  width: 1.2em;
  margin-right: 0.6em;
  font-size: 1em;
  color: #495057;
  flex-shrink: 0;
}

/* === SUBMENU === */
.hamburger-submenu {
  padding-left: 0;
  margin-left: 0;
  background-color: transparent;
  font-size: var(--font-size-m);
  margin-top: 0;
  margin-bottom: 0;
  text-align: left;
  position: relative;
  z-index: var(--z-index-menu);
  pointer-events: auto;
  border-left: none;
}

/* === DISABLED ITEMS === */
.menu-item-disabled {
  cursor: not-allowed;
  color: #adb5bd;
  opacity: 0.5;
}

/* === PROFILE CIRCLE === */
.profile-circle {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(96, 96, 96, 0.75);
  /* Muted gray for player role */
  color: white;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  border: 2px solid #f8f9fa;
  margin-right: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  /* Softer shadow */
}

.profile-circle.admin-role {
  background: rgba(128, 128, 128, 0.75);
  /* Muted gray for admin roles */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  /* Softer shadow */
}

.profile-label-wrapper {
  display: inline-flex;
  align-items: center;
}

/* === BACKDROP === */
.hamburger-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  /* backdrop-filter removed - doesn't work consistently on iPhone and can cause click bleed-through */
  z-index: var(--z-index-menu-backdrop);
  display: none;
  pointer-events: none;
  /* Disabled when hidden to prevent blocking other dialogs */
  animation: backdropFadeIn 0.2s ease;
  /* iOS Safari optimizations */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  /* Force proper stacking and rendering on iOS */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: opacity;
}

.hamburger-backdrop.open {
  display: block;
  pointer-events: auto;
  /* Enable when visible to block clicks */
}

@keyframes backdropFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* === CUSTOM SCROLLBAR === */
.hamburger-menu::-webkit-scrollbar {
  width: 8px;
}

.hamburger-menu::-webkit-scrollbar-track {
  background: transparent;
  margin: 8px;
}

.hamburger-menu::-webkit-scrollbar-thumb {
  background: #dee2e6;
  border-radius: 4px;
}

/* Firefox scrollbar */
.hamburger-menu {
  scrollbar-width: thin;
  scrollbar-color: #dee2e6 transparent;
}

/* === RIPPLE EFFECT REMOVED === */
.hamburger-menu-item,
.hamburger-submenu-item {
  overflow: hidden;
  position: relative;
}

/* === ENHANCED BUTTON === */
.hamburger-button:active {
  transform: scale(0.95);
}

/* === MENU MODE SELECTOR (RADIO STYLE) === */
/* Header container for mode selector */
.menu-mode-header-container {
  position: sticky;
  top: 0;
  z-index: var(--z-index-menu);
  background: var(--bg-primary, #fff);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  margin: 0;
  padding: 0;
  min-height: 34px;
  /* Reduced from 40px */
}

/* Menu spacer for non-admin users - same height as mode header */
.menu-spacer-container {
  position: sticky;
  top: 0;
  z-index: var(--z-index-menu);
  background: var(--bg-primary, #fff);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  margin: 0;
  padding: 0;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-spacer-label {
  font-weight: 500;
  color: #667eea;
  font-size: var(--font-size-l);
  padding: 3px 10px;
  user-select: none;
}

/* Horizontal radio button group */
.menu-mode-radio-group {
  display: flex;
  gap: 2px;
  justify-content: center;
  padding: 1px 4px;
  /* Reduced from 2px 6px */
  pointer-events: auto !important;
  background: none;
  border-radius: 0;
  margin: 0;
}

/* Header variant - mobile-friendly */
.menu-mode-radio-group.menu-header {
  padding: 1px 4px;
  /* Reduced from 2px 6px */
  margin: 0;
  background: rgba(0, 0, 0, 0.01);
}

.menu-mode-option {
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px 10px;
  /* Reduced from 4px 10px */
  border-radius: 6px;
  pointer-events: auto !important;
  min-height: 32px;
  /* Reduced from 36px */
  min-width: 32px;
  /* Reduced from 36px */
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  font-size: var(--font-size-l);
  /* Increased from m to l for larger labels */
  line-height: 1.2;
  touch-action: manipulation;
}

.menu-mode-option:hover {
  background-color: rgba(0, 0, 0, 0.04);
  transform: none;
  /* Remove lift effect for compactness */
}

.menu-mode-option:active {
  transform: scale(0.95);
  background-color: rgba(0, 0, 0, 0.08);
}

/* Show filled circle only when selected - larger icons for mobile */
.menu-mode-option .fa-circle-dot {
  display: none;
  color: #667eea;
  pointer-events: none;
  font-size: 1em;
  /* Increased from 0.7em to 1em for better visibility */
}

.menu-mode-option.selected .fa-circle-dot {
  display: inline;
}

/* Show hollow circle only when not selected - larger icons for mobile */
.menu-mode-option .fa-circle {
  display: inline;
  color: #adb5bd;
  pointer-events: none;
  font-size: 1em;
  /* Increased from 0.7em to 1em for better visibility */
}

.menu-mode-option.selected .fa-circle {
  display: none;
}

/* Emphasize selected option text */
.menu-mode-option.selected {
  color: #667eea;
}

/* Ensure proper spacing after header - adjusted for new height */
.menu-mode-header-container+.hamburger-menu-item {
  margin-top: 6px;
  /* Slightly increased margin */
}

/* Responsive touch targets without media queries */
.menu-mode-option {
  /* Smaller touch targets */
  min-height: clamp(32px, 5.5vw, 36px);
  /* Reduced from 36px/40px */
  min-width: clamp(32px, 5.5vw, 36px);
  /* Reduced from 36px/40px */
  padding: clamp(3px, 1.2vw, 5px) clamp(10px, 2.5vw, 14px);
  /* Reduced vertical padding */
  font-size: clamp(var(--font-size-m), 3vw, var(--font-size-l));
  /* Increased from s/m to m/l */
}

.menu-mode-option .fa-circle-dot,
.menu-mode-option .fa-circle {
  font-size: clamp(0.9em, 1.5vw, 1em);
}

.menu-mode-header-container {
  min-height: clamp(34px, 6vw, 38px);
  /* Reduced from 40px/45px */
}

.menu-spacer-container {
  min-height: clamp(34px, 6vw, 38px);
  /* Match mode header height */
}

.menu-mode-radio-group {
  padding: clamp(1px, 0.6vw, 3px) clamp(4px, 1.2vw, 6px);
  /* Reduced from 2px/4px and 6px/8px */
  gap: clamp(2px, 0.5vw, 3px);
}

/* Ensure touch events work properly on all mobile devices */
.menu-mode-option {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  /* Prevent iOS text selection issues */
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  /* Ensure proper touch handling */
  touch-action: manipulation;
  /* Ensure element is properly recognized as interactive */
  cursor: pointer;
  /* Force hardware acceleration for better performance */
  will-change: transform;
  /* Ensure proper stacking context */
  position: relative;
  z-index: 1;
}

/* Add visual feedback for active state to ensure users know their touch registered */
.menu-mode-option:active {
  transform: scale(0.95);
  background-color: rgba(0, 0, 0, 0.12);
  /* Darker background for better feedback */
  transition: none;
  /* Remove transition on active for immediate feedback */
}

/* Restore transition after active state */
.menu-mode-option:not(:active) {
  transition: all 0.15s ease;
}

/* Force clickability for Android devices - override any potential conflicts */
.menu-mode-header-container .menu-mode-option,
.hamburger-menu .menu-mode-option {
  pointer-events: auto !important;
  touch-action: manipulation !important;
  cursor: pointer !important;
  /* Ensure minimum viable touch target */
  min-width: 32px !important;
  /* Reduced from 36px */
  min-height: 32px !important;
  /* Reduced from 36px */
}