/* Mobile-First Main Menu & Garage Styles */

#menu-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--panel-bg);
  padding: 20px 16px;
  border-radius: var(--border-radius-lg);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  width: calc(100% - 24px);
  max-width: 440px;
  min-height: auto;
  position: relative;
  box-sizing: border-box;
  margin: calc(56px + env(safe-area-inset-top)) auto calc(60px + env(safe-area-inset-bottom)) auto;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@media (min-width: 600px) {
  #menu-container {
    gap: 24px;
    padding: 32px 28px;
    margin: 30px auto;
  }
}

.menu-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 16px;
}

.subtitle {
  color: var(--text-muted);
  font-size: clamp(10px, 3vw, 13px);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  text-align: center;
  margin-top: 4px;
  margin-bottom: 16px;
  font-family: var(--font-title);
}

@media (min-width: 600px) {
  .subtitle {
    margin-bottom: 22px;
  }
}

h1 {
  font-size: clamp(24px, 7.5vw, 42px);
  font-weight: 900;
  margin: 0;
  letter-spacing: 2.5px;
  background: linear-gradient(45deg, var(--neon-cyan), var(--neon-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  text-shadow: 0 0 20px rgba(102, 252, 241, 0.2);
  line-height: 1.15;
}

/* Sidebar Footer & Buttons */
.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.btn-logout {
  background: rgba(231, 76, 60, 0.1);
  color: var(--text-muted);
  border: 1px solid var(--neon-red);
  padding: 12px 15px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-title);
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.btn-logout:hover,
.btn-logout:active {
  background: var(--neon-red);
  color: #fff;
}

.btn-delete-acc {
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--neon-red);
  padding: 12px 15px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-title);
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.btn-delete-acc:hover,
.btn-delete-acc:active {
  background: var(--neon-red);
  color: #fff;
  border-style: solid;
}

/* User Profile Trigger & Icon */
.profile-trigger {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: calc(12px + env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 2px solid var(--neon-cyan);
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(102, 252, 225, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  background: #1a1a24;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  touch-action: manipulation;
}

@media (min-width: 600px) {
  .profile-trigger {
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
  }
}

.profile-trigger:hover,
.profile-trigger:active {
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(102, 252, 225, 0.5);
}

.profile-trigger img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.default-avatar {
  width: 24px;
  height: 24px;
  fill: var(--neon-cyan);
}

/* Sidebar Backdrop */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1050;
}

.sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Sidebar Menu */
.sidebar-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 320px;
  height: 100vh;
  height: 100dvh;
  background: var(--sidebar-bg);
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom)) 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6);
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1100;
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 600px) {
  .sidebar-panel {
    right: -340px;
    width: 320px;
    max-width: 85%;
  }
}

.sidebar-panel.open {
  right: 0;
}

.sidebar-close {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  margin-top: -4px;
  margin-right: -4px;
  transition: all 0.2s ease;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.sidebar-close:hover,
.sidebar-close:active {
  color: #fff;
  border-color: var(--neon-cyan);
  background: rgba(102, 252, 241, 0.15);
}

.user-welcome {
  font-family: var(--font-title);
  font-size: 15px;
  color: var(--neon-cyan);
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
  margin-bottom: 4px;
  word-break: break-all;
}

.panel-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(0, 0, 0, 0.2);
  padding: 12px 14px;
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.panel-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.panel-value {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

#highscore-val {
  color: #ffaa00;
}

#coins-val {
  color: var(--neon-yellow);
}

/* Online status and Support widgets */
.online-trigger {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: calc(12px + env(safe-area-inset-left));
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 2px solid var(--neon-green);
  cursor: pointer;
  box-shadow: 0 0 15px rgba(46, 204, 113, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  background: #1a1a24;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  font-weight: 800;
  color: var(--neon-green);
  font-size: 14px;
  font-family: var(--font-title);
  touch-action: manipulation;
}

@media (min-width: 600px) {
  .online-trigger {
    top: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
  }
}

.online-trigger:hover,
.online-trigger:active {
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(46, 204, 113, 0.5);
}

.online-indicator {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 9px;
  height: 9px;
  background: var(--neon-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--neon-green);
}

.support-trigger {
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom));
  right: calc(16px + env(safe-area-inset-right));
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 50%;
  border: 2px solid var(--neon-blue);
  cursor: pointer;
  box-shadow: 0 0 15px rgba(52, 152, 219, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  background: #1a1a24;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  color: var(--neon-blue);
  font-size: 20px;
  font-weight: bold;
  text-decoration: none;
  touch-action: manipulation;
}

@media (min-width: 600px) {
  .support-trigger {
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
  }
}

.support-trigger:hover,
.support-trigger:active {
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(52, 152, 219, 0.5);
}

.support-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--neon-red);
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
  box-shadow: 0 0 8px var(--neon-red);
  display: none;
}
