/**
 * Asteroidle - Arcade Sci-Fi Styling
 * Inherits deep space glassmorphism, HUD, tactile controls, and modals from Spaceship Flight
 */

/* ==========================================================================
   Full Screen Arena & HUD Bar Overlay
   ========================================================================== */
#hud.asteroidle-hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  padding: max(8px, env(safe-area-inset-top, 8px)) max(14px, env(safe-area-inset-right, 14px)) 6px max(14px, env(safe-area-inset-left, 14px));
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: clamp(6px, 1.2vw, 12px);
  z-index: 30;
  pointer-events: none;
  overflow: visible;
}

#hud.asteroidle-hud .hud-left {
  display: flex;
  align-items: center;
  gap: clamp(4px, 1vw, 8px);
  flex: 0 0 auto;
  min-width: 0;
  pointer-events: auto;
}

#hud.asteroidle-hud .hud-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  min-width: 0;
  pointer-events: auto;
}

#hud.asteroidle-hud .hud-right {
  display: flex;
  align-items: center;
  gap: clamp(3px, 0.8vw, 8px);
  flex: 0 0 auto;
  min-width: 0;
  pointer-events: auto;
}

.arcade-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm, 6px);
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.arcade-back-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #00f0ff;
  color: #fff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.puzzle-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 4px 10px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 6px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.puzzle-stat .hud-label {
  font-size: 10px;
  letter-spacing: 1px;
  color: #38bdf8;
  font-weight: 800;
}

.puzzle-stat .date-value {
  font-size: 11px;
  color: #94a3b8;
  font-family: var(--font-mono);
}

/* ==========================================================================
   Center Round & Score Tracker
   ========================================================================== */
.round-tracker-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5), 0 0 10px rgba(56, 189, 248, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.round-pips {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
}

.round-pip {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #94a3b8;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.round-pip.current {
  border-color: #00f0ff;
  color: #00f0ff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
  animation: pipPulse 1.8s infinite;
}

.round-pip.hit {
  background: rgba(250, 204, 21, 0.2);
  border-color: #facc15;
  color: #facc15;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.4);
}

.round-pip.near {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
}

.round-pip.miss {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ef4444;
}

@keyframes pipPulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
  }

  50% {
    transform: scale(1.08);
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.8);
  }
}

.mode-btn {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #facc15;
  border-color: rgba(250, 204, 21, 0.4);
  padding: 6px 12px;
}

.mode-btn.unlimited-active {
  background: rgba(250, 204, 21, 0.25);
  border-color: #facc15;
  color: #fff;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.4);
}

/* ==========================================================================
   Asteroidle On-Screen Bottom Controls
   ========================================================================== */
.asteroidle-touch-controls {
  position: absolute;
  bottom: max(14px, env(safe-area-inset-bottom, 14px));
  left: 0;
  width: 100%;
  padding: 0 max(20px, env(safe-area-inset-right, 20px)) 0 max(20px, env(safe-area-inset-left, 20px));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  z-index: 25;
  pointer-events: none;
  box-sizing: border-box;
}

.asteroidle-touch-controls .touch-group-left {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.telemetry-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 6px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  margin-bottom: 2px;
}

.badge-sublabel {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #94a3b8;
}

.angle-readout {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  color: #00f0ff;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
  min-width: 42px;
  text-align: right;
}

.finetune-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.finetune-pill {
  padding: 5px 9px;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 6px;
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.finetune-pill:hover,
.finetune-pill:active {
  background: rgba(56, 189, 248, 0.3);
  border-color: #00f0ff;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Right pod: Replay & Tracer Action pills paired above Fire Button */
.asteroidle-touch-controls .touch-group-right {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.action-pills-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.ctrl-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 6px;
  color: #e0f2fe;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.ctrl-pill:hover,
.ctrl-pill:active {
  background: rgba(56, 189, 248, 0.3);
  border-color: #00f0ff;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

/* ==========================================================================
   Round Result Floating Banner Overlay
   ========================================================================== */
.round-result-banner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 7, 18, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.round-result-banner.visible {
  opacity: 1;
  pointer-events: auto;
}

.round-result-banner .result-card {
  max-width: 440px;
  width: 90%;
  text-align: center;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: resultSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes resultSlideUp {
  from {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
  }

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

.result-headline {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: #ffffff;
  text-shadow: 0 0 15px rgba(56, 189, 248, 0.6);
}

.result-points {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 900;
  color: #facc15;
  text-shadow: 0 0 20px rgba(250, 204, 21, 0.7);
}

.result-subtext {
  font-size: 13px;
  color: #94a3b8;
  font-family: var(--font-mono);
  margin-bottom: 8px;
}

.next-asteroid-btn {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  max-width: 340px !important;
  padding: 14px 24px !important;
  margin-top: 6px !important;
  gap: 4px !important;
  font-family: var(--font-display) !important;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.4) 0%, rgba(14, 165, 233, 0.8) 100%) !important;
  border: 1px solid rgba(56, 189, 248, 0.9) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.45), inset 0 0 15px rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  animation: pulseNextBtn 1.8s infinite ease-in-out !important;
}

.next-asteroid-btn:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.6) 0%, rgba(14, 165, 233, 0.95) 100%) !important;
  box-shadow: 0 0 35px rgba(56, 189, 248, 0.75), inset 0 0 20px rgba(255, 255, 255, 0.4) !important;
  transform: translateY(-2px) scale(1.02) !important;
}

.next-asteroid-btn .btn-main-label {
  font-size: 1.15rem;
  letter-spacing: 1.5px;
  font-weight: 900;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
}

.next-asteroid-btn .btn-sub-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.85);
}

@keyframes pulseNextBtn {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4), inset 0 0 10px rgba(255, 255, 255, 0.2);
  }

  50% {
    box-shadow: 0 0 35px rgba(56, 189, 248, 0.8), inset 0 0 18px rgba(255, 255, 255, 0.35);
  }
}

/* ==========================================================================
   Responsive Adaptations & Mobile De-Crowding
   ========================================================================== */

/* 1. Mobile Landscape & Compact Viewports (iPhone, Android in landscape, small windows) */
@media (max-width: 1100px),
(max-height: 540px) {
  #hud.asteroidle-hud {
    padding: max(4px, env(safe-area-inset-top, 4px)) max(8px, env(safe-area-inset-right, 8px)) 4px max(8px, env(safe-area-inset-left, 8px));
    gap: clamp(4px, 1vw, 8px);
  }

  /* Compact HUD Left: icon-only back button and short puzzle badge */
  .arcade-back-btn {
    padding: 4px 8px;
    font-size: 10px;
    gap: 4px;
    height: 28px;
    box-sizing: border-box;
  }

  .arcade-back-btn .btn-text {
    display: none !important;
  }

  .puzzle-stat {
    padding: 2px 6px;
    height: 28px;
    box-sizing: border-box;
    justify-content: center;
  }

  .puzzle-stat .date-value {
    display: none !important;
  }

  .puzzle-stat .hud-label {
    font-size: 9px;
    letter-spacing: 0.5px;
  }

  /* Compact HUD Center: slim round tracker & mini pips */
  .round-tracker-container {
    padding: 2px 8px;
    gap: 6px;
    border-radius: 8px;
    flex-shrink: 1;
    min-width: 0;
  }

  .score-substat .hud-label {
    font-size: 7.5px;
    letter-spacing: 0.5px;
  }

  .score-substat .hud-value {
    font-size: 12px;
  }

  .score-divider {
    height: 16px;
    margin: 0 1px;
  }

  .round-pips {
    gap: 3px;
    margin-left: 2px;
  }

  .round-pip {
    width: 16px;
    height: 16px;
    font-size: 9px;
    border-radius: 3px;
  }

  /* Compact HUD Right: icon-only mode toggle and mini utility buttons */
  #hud.asteroidle-hud .hud-right {
    gap: 4px;
  }

  .mode-segmented-toggle {
    padding: 2px;
    gap: 2px;
  }

  .mode-toggle-btn {
    padding: 4px 6px;
    font-size: 10px;
  }

  .mode-toggle-btn .mode-label {
    display: none !important;
  }

  .mode-toggle-btn .mode-icon {
    font-size: 12px;
    line-height: 1;
  }

  #hud.asteroidle-hud .hud-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    max-width: 28px;
    padding: 0;
    font-size: 13px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Compact Auth Profile on Mobile */
  .user-profile-badge {
    height: 28px;
    padding: 2px 4px;
    gap: 2px;
  }

  .user-display-name {
    display: none !important;
  }

  .dropdown-caret {
    font-size: 7px;
    margin-left: 1px;
  }

  .google-btn {
    height: 28px;
    padding: 0 6px;
  }

  .google-btn-text {
    display: none !important;
  }

  .google-btn svg {
    margin-right: 0 !important;
  }

  /* Compact Touch Controls: side-anchored with zero center clutter */
  .asteroidle-touch-controls {
    bottom: max(6px, env(safe-area-inset-bottom, 6px));
    padding: 0 max(10px, env(safe-area-inset-right, 10px)) 0 max(10px, env(safe-area-inset-left, 10px));
  }

  .telemetry-badge-pill {
    padding: 2px 7px;
    gap: 5px;
    border-radius: 5px;
    margin-bottom: 1px;
  }

  .badge-sublabel {
    font-size: 7.5px;
    letter-spacing: 0.5px;
  }

  .angle-readout {
    font-size: 12px;
    min-width: 36px;
  }

  .finetune-row {
    gap: 4px;
    margin-bottom: 2px;
  }

  .finetune-pill {
    padding: 3px 6px;
    font-size: 9.5px;
    min-width: 26px;
  }

  .touch-rot-row {
    gap: 6px;
  }

  .ctrl-btn.loop-btn {
    width: clamp(46px, 12.5vh, 58px);
    height: clamp(46px, 12.5vh, 58px);
  }

  .action-pills-row {
    gap: 4px;
    margin-bottom: 2px;
  }

  .ctrl-pill {
    padding: 3px 6px;
    font-size: 9px;
    gap: 3px;
    border-radius: 5px;
  }

  .ctrl-pill svg {
    width: 12px;
    height: 12px;
  }

  .ctrl-btn.action-btn.fire-btn {
    width: clamp(52px, 14vh, 64px);
    height: clamp(52px, 14vh, 64px);
    border-radius: 14px;
  }

  .ctrl-btn.action-btn.fire-btn svg {
    width: 22px;
    height: 22px;
  }

  .ctrl-btn.action-btn.fire-btn .btn-subtext {
    font-size: 7.5px;
  }
}

/* 2. Extra Narrow Viewports (<= 760px wide) */
@media (max-width: 760px) {
  #hud.asteroidle-hud {
    gap: 3px;
    padding: max(3px, env(safe-area-inset-top, 3px)) max(6px, env(safe-area-inset-right, 6px)) 3px max(6px, env(safe-area-inset-left, 6px));
  }

  #hud.asteroidle-hud .hud-left {
    gap: 3px;
  }

  #hud.asteroidle-hud .hud-right {
    gap: 3px;
  }

  #hud.asteroidle-hud .hud-btn {
    width: 26px;
    height: 26px;
    min-width: 26px;
    max-width: 26px;
    font-size: 11px;
  }

  .arcade-back-btn {
    width: 26px;
    height: 26px;
    padding: 0;
    justify-content: center;
  }

  .puzzle-stat {
    padding: 1px 4px;
    height: 26px;
  }

  .puzzle-stat .hud-label {
    font-size: 8px;
  }

  .mode-toggle-btn {
    padding: 3px 5px;
  }

  .user-profile-badge {
    height: 26px;
    padding: 0 4px;
  }

  .round-tracker-container {
    padding: 2px 4px;
    gap: 3px;
  }

  .round-pip {
    width: 15px;
    height: 15px;
    font-size: 8px;
  }

  .score-substat .hud-label {
    font-size: 7px;
  }

  .score-substat .hud-value {
    font-size: 10.5px;
  }
}

/* 3. Portrait Orientation: 2-Tier Upper HUD above Letterboxed Canvas */
@media (max-width: 600px) and (orientation: portrait) {
  #hud.asteroidle-hud {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    padding: max(8px, env(safe-area-inset-top, 8px)) 10px 4px 10px;
    row-gap: 8px;
  }

  #hud.asteroidle-hud .hud-left {
    order: 1;
  }

  #hud.asteroidle-hud .hud-right {
    order: 2;
  }

  #hud.asteroidle-hud .hud-center {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 2px;
  }

  .round-tracker-container {
    width: 100%;
    max-width: 320px;
    justify-content: space-around;
  }

  /* In portrait, touch controls stay comfortably below the letterboxed canvas */
  .asteroidle-touch-controls {
    bottom: max(20px, env(safe-area-inset-bottom, 20px));
    padding: 0 16px;
  }

  .ctrl-btn.loop-btn {
    width: 64px;
    height: 64px;
  }

  .ctrl-btn.action-btn.fire-btn {
    width: 68px;
    height: 68px;
  }
}

/* 4. Extra Narrow Portrait Screens (e.g. iPhone SE / mini) */
@media (max-width: 380px) and (orientation: portrait) {
  #hud.asteroidle-hud .hud-right {
    gap: 3px;
  }

  #hud.asteroidle-hud .hud-btn {
    width: 26px;
    height: 26px;
    min-width: 26px;
    font-size: 12px;
  }

  .round-tracker-container {
    max-width: 290px;
    padding: 2px 6px;
    gap: 4px;
  }

  .round-pip {
    width: 15px;
    height: 15px;
    font-size: 8px;
  }

  .finetune-pill {
    padding: 3px 5px;
    font-size: 9px;
    min-width: 24px;
  }

  .ctrl-btn.loop-btn {
    width: 56px;
    height: 56px;
  }

  .ctrl-btn.action-btn.fire-btn {
    width: 60px;
    height: 60px;
  }
}

/* ==========================================================================
   Google Auth Widget & Account Dropdown (Exact Match to User Specs)
   ========================================================================== */
.auth-pill-container {
  display: inline-flex;
  align-items: center;
  position: relative;
}

.google-btn {
  height: 32px;
  padding: 0 10px;
  background: #f1f3f4;
  color: #111827;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.google-btn:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.user-auth-widget {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* Compact pill matching user screenshot and other HUD buttons */
.user-profile-badge {
  height: 32px;
  padding: 0 10px;
  background: #ececec;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #111827;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.user-profile-badge:hover,
.user-profile-badge:focus-visible {
  background: #e2e8f0;
  border-color: #9ca3af;
}

/* Profile thumbnail strictly matching button height */
.user-avatar-img {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  max-width: 20px;
  max-height: 20px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.user-display-name {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  i white-space: nowrap;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.dropdown-caret {
  font-size: 8.5px;
  color: #111827;
  margin-left: 2px;
  line-height: 1;
  pointer-events: none;
}

/* Dropdown popover matching user screenshot */
.user-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 260px;
  max-width: 320px;
  background: #ffffff;
  border: 2px solid #000000;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  padding: 14px 16px;
  z-index: 100;
  text-align: left;
  box-sizing: border-box;
}

.user-dropdown-menu.active {
  display: flex;
  flex-direction: column;
}

.account-title {
  font-size: 15px;
  font-weight: 800;
  color: #000000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  letter-spacing: -0.2px;
  margin: 0;
}

.account-divider {
  border: 0;
  border-top: 1.5px solid #000000;
  margin: 6px 0 10px 0;
  width: 100%;
}

.account-email-row {
  font-size: 13px;
  color: #111827;
  margin-bottom: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  word-break: break-all;
  line-height: 1.4;
}

.account-email-row strong {
  font-weight: 700;
  color: #000000;
}

.user-email-text {
  color: #1e293b;
  font-weight: 500;
}

/* Red Sign Out button matching user screenshot */
.account-signout-btn {
  background: #dc2626;
  border: 2px solid #000000;
  border-radius: 6px;
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  padding: 7px 16px;
  cursor: pointer;
  width: 100%;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  transition: background 0.15s ease, transform 0.1s ease;
}

.account-signout-btn:hover {
  background: #b91c1c;
}

.account-signout-btn:active {
  transform: scale(0.98);
}



/* Segmented Mode Toggle (Daily vs. Practice) */
.mode-segmented-toggle {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  padding: 3px;
  gap: 2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.mode-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 5px 11px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.mode-toggle-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
}

.mode-toggle-btn.active {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.45);
}

.mode-toggle-btn[data-mode="practice"].active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.45);
}

.mode-toggle-btn .mode-icon {
  font-size: 12px;
}

.share-actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.reset-puzzle-btn {
  background: rgba(239, 68, 68, 0.16) !important;
  border: 1px solid rgba(239, 68, 68, 0.55) !important;
  color: #fca5a5 !important;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  padding: 10px 16px;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: all 0.2s ease;
}

.reset-puzzle-btn:hover {
  background: rgba(239, 68, 68, 0.3) !important;
  border-color: #f87171 !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.45);
}

/* New Practice Mission Buttons */
.new-practice-hud-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245, 158, 11, 0.22) !important;
  border: 1px solid rgba(245, 158, 11, 0.55) !important;
  color: #fef08a !important;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.new-practice-hud-btn:hover {
  background: rgba(245, 158, 11, 0.38) !important;
  border-color: #facc15 !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.new-practice-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  border: 1px solid #fde047 !important;
  color: #ffffff !important;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 12px 20px;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.new-practice-btn:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #b45309 100%) !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.6);
  transform: translateY(-1px);
}

/* Completed & Disabled Controls State */
.ctrl-btn.disabled,
.ctrl-btn:disabled {
  opacity: 0.45 !important;
  filter: grayscale(0.7);
  cursor: not-allowed !important;
  pointer-events: none !important;
  box-shadow: none !important;
}

.ctrl-pill:disabled,
.finetune-pill:disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}