/* ==========================================================================
   ELITECHESS - DEDICATED BOT GAMEPLAY INTERFACE
   - Scope: Isolated to AI Bot matches (#bot-gameplay-container)
   - Mobile (<= 1023px): Dedicated vertical stack with bot bubble & 4-action bottom bar
   - Desktop (>= 1024px): 2-Stage Master Arena (Center Board Stage + Right Desktop Panel)
   - Luxury Dark Palette: Deep Obsidian / Royal Violet (#16151F, #1D1B27)
   ========================================================================== */

#bot-gameplay-container {
  display: none !important;
}

.bot-mobile-opp-clock {
  display: none;
}

.bot-bust-frame {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: #2D2A3B;
  flex-shrink: 0;
}

.bot-avatar-box {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: #2A2738;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bot-bust-frame img,
.bot-avatar-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 1. Global Viewport Lock when Bot Match is Active */
body.bot-gameplay-active {
  overflow: hidden !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  background: #16151F !important;
  color: #FFFFFF !important;
  touch-action: manipulation;
  margin: 0 !important;
  padding: 0 !important;
  user-select: none;
  -webkit-user-select: none;
}

body.bot-gameplay-active .topbar,
body.bot-gameplay-active .app-topbar,
body.bot-gameplay-active .mobile-bottom-nav,
body.bot-gameplay-active #app-mobile-nav,
body.bot-gameplay-active .footer-container,
body.bot-gameplay-active .site-footer,
body.bot-gameplay-active .floating-theme-switch,
body.bot-gameplay-active .scroll-to-top-btn,
body.bot-gameplay-active #play-matchmaking-lobby,
body.bot-gameplay-active #play-tournament-waiting-room,
body.bot-gameplay-active #pvp-gameplay-container,
body.bot-gameplay-active #pvp-matchmaking-searching {
  display: none !important;
}

body.bot-gameplay-active .main-viewport,
body.bot-gameplay-active .app-main-content,
body.bot-gameplay-active #app-container,
body.bot-gameplay-active #view-play,
body.bot-gameplay-active.play-view-active.match-active #view-play,
body.bot-gameplay-active.play-view-active.match-active .main-viewport,
body.bot-gameplay-active.play-view-active.match-active .app-main-content,
body.bot-gameplay-active .app-content-wrapper,
body.bot-gameplay-active .app-main-layout {
  padding: 0 !important;
  margin: 0 !important;
  left: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100vh !important;
  height: 100dvh !important;
  overflow: hidden !important;
  transform: none !important;
  animation: none !important;
  box-sizing: border-box !important;
  background: #16151F !important;
}

/* ==========================================================================
   2. MOBILE LAYOUT (<= 1023px)
   ========================================================================== */
@media (max-width: 959px) {
  body.bot-gameplay-active .app-sidebar {
    display: none !important;
  }

  body.bot-gameplay-active #bot-gameplay-container {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    margin: 0 !important;
    background: #14131A !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    justify-content: space-between !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 100 !important;
  }

  .bot-desktop-panel,
  .bot-player-card {
    display: none !important;
  }

  .bot-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 12px !important;
    box-sizing: border-box !important;
    background: rgba(22, 21, 31, 0.95) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    flex-shrink: 0 !important;
    z-index: 20 !important;
  }

  .bot-header-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #CBD5E1;
    cursor: pointer;
    padding: 0;
  }

  .bot-header-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    font-weight: 800;
    color: #FFFFFF;
  }

  .bot-opponent-strip {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 6px 12px !important;
    background: #1D1B27 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
  }

  .bot-character-col {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  .bot-bust-frame {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    border-radius: 50%;
    overflow: hidden;
    background: #2D2A3B;
    flex-shrink: 0;
  }

  .bot-bust-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .bot-name-tag {
    display: flex;
    flex-direction: column;
  }

  .bot-name-label {
    font-weight: 700;
    font-size: 0.88rem;
    color: #FFF;
  }

  .bot-elo-badge {
    font-size: 0.72rem;
    color: #D4AF37;
    font-weight: 600;
  }

  .bot-speech-bubble {
    flex: 1;
    min-width: 0;
    background: #272436;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.8rem;
    color: #E2E8F0;
    line-height: 1.3;
    word-break: break-word;
  }

  .bot-board-stage {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 4px 0 !important;
    box-sizing: border-box !important;
    gap: 4px !important;
    overflow: hidden !important;
  }

  .bot-mobile-opp-clock {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono, monospace);
    font-size: 0.86rem;
    font-weight: 800;
    padding: 4px 9px;
    border-radius: 7px;
    background: rgba(15, 20, 30, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #E2E8F0;
    flex-shrink: 0;
    min-width: 56px;
  }

  .bot-mobile-opp-clock.active,
  .bot-current-player-card .bot-clock.active {
    background: rgba(212, 175, 55, 0.18) !important;
    border-color: rgba(212, 175, 55, 0.55) !important;
    color: #FDE68A !important;
  }

  .bot-mobile-opp-clock.low-time,
  .bot-current-player-card .bot-clock.low-time {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: rgba(239, 68, 68, 0.6) !important;
    color: #FCA5A5 !important;
  }

  .bot-player-card.bot-current-player-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: calc(100% - 12px) !important;
    max-width: min(calc(100vw - 12px), calc(100dvh - 196px)) !important;
    padding: 6px 10px !important;
    background: #1D1B27 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    margin: 4px auto 0 !important;
  }

  .bot-current-player-card .bot-player-badge {
    display: none !important;
  }

  .bot-current-player-card .bot-player-info-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .bot-current-player-card .bot-avatar-box {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
  }

  .bot-current-player-card .bot-player-name {
    font-size: 0.84rem;
    font-weight: 700;
    color: #F8FAFC;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .bot-current-player-card .bot-clock {
    font-family: var(--font-mono, monospace);
    font-size: 0.88rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 6px;
    background: rgba(15, 20, 30, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #E2E8F0;
    min-width: 56px;
    text-align: center;
  }

  .bot-board-side-tools {
    display: none !important;
  }

  .bot-board-wrapper {
    width: 100% !important;
    max-width: min(100vw, calc(100dvh - 196px)) !important;
    max-height: min(100vw, calc(100dvh - 196px)) !important;
    aspect-ratio: 1 / 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    margin: 0 auto !important;
  }

  .bot-board-frame {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    background: #1E1B29 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
    touch-action: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
  }

  .bot-history-strip {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    height: 34px !important;
    min-height: 34px !important;
    background: #1D1B27 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
    padding: 0 8px !important;
    box-sizing: border-box !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
  }

  .bot-nav-arrow-btn {
    width: 28px;
    height: 26px;
    min-width: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #CBD5E1;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
  }

  .bot-nav-arrow-btn:disabled {
    opacity: 0.35;
    cursor: default;
  }

  .bot-moves-scroller {
    flex: 1;
    overflow-x: auto;
  }

  .bot-moves-list {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
  }

  .bot-controls-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-around !important;
    width: 100% !important;
    height: calc(54px + env(safe-area-inset-bottom, 0px)) !important;
    min-height: 54px !important;
    background: #14131A !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    z-index: 50 !important;
    touch-action: manipulation !important;
  }

  .bot-control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    touch-action: manipulation;
    color: #94A3B8;
    font-size: 0.68rem;
    font-weight: 600;
    gap: 3px;
    cursor: pointer;
    flex: 1;
    height: 100%;
  }

  .bot-control-btn:hover {
    color: #FFF;
  }
}

/* ==========================================================================
   3. DESKTOP LAYOUT (>= 1024px)
   ========================================================================== */
@media (min-width: 960px) {
  /* Slim Rail Sidebar (72px) */
  body.bot-gameplay-active .app-sidebar {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: #12101A !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
    z-index: 500 !important;
    flex-direction: column !important;
    padding: 16px 0 !important;
    box-sizing: border-box !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }

  body.bot-gameplay-active .app-sidebar .sidebar-brand {
    padding: 0 0 16px 0 !important;
    justify-content: center !important;
    width: 100% !important;
  }

  body.bot-gameplay-active .app-sidebar .sidebar-brand-title {
    display: none !important;
  }

  body.bot-gameplay-active .app-sidebar .sidebar-nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    align-items: center !important;
    width: 100% !important;
  }

  body.bot-gameplay-active .app-sidebar .sidebar-btn {
    width: 48px !important;
    height: 48px !important;
    padding: 0 !important;
    justify-content: center !important;
    border-radius: 12px !important;
  }

  body.bot-gameplay-active .app-sidebar .sidebar-btn span:not(.sidebar-icon) {
    display: none !important;
  }

  /* Offset main area for slim sidebar without compounding margin */
  body.bot-gameplay-active .app-main-content,
  body.bot-gameplay-active .main-viewport,
  body.bot-gameplay-active #app-container,
  body.bot-gameplay-active #view-play {
    position: fixed !important;
    top: 0 !important;
    left: 72px !important;
    right: 0 !important;
    bottom: 0 !important;
    width: calc(100vw - 72px) !important;
    max-width: calc(100vw - 72px) !important;
    height: 100vh !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #16151F !important;
    overflow: hidden !important;
  }

  /* Master Gameplay Arena Container: EXACT 50/50 pixel-perfect centering */
  body.bot-gameplay-active #bot-gameplay-container {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: clamp(28px, 4vw, 56px) !important;
    width: 100% !important;
    max-width: 1240px !important;
    height: 100vh !important;
    height: 100dvh !important;
    margin: 0 auto !important;
    padding: 16px 24px !important;
    box-sizing: border-box !important;
    background: transparent !important;
  }

  /* Hide mobile-specific elements on desktop */
  .bot-header,
  .bot-opponent-strip,
  .bot-history-strip,
  .bot-controls-bar {
    display: none !important;
  }

  /* Center Board Stage (Left Column) */
  .bot-board-stage {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 12px !important;
    width: min(72vh, 640px) !important;
    max-width: 640px !important;
    flex-shrink: 0 !important;
    position: relative !important;
  }

  .bot-board-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    width: 100% !important;
  }

  /* Floating Side Tools (+, -, ⌖) */
  .bot-board-side-tools {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    position: absolute !important;
    left: -48px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: rgba(22, 20, 32, 0.88) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 20px !important;
    padding: 6px 4px !important;
    z-index: 25 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
  }

  .bot-side-tool-btn {
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    color: #94A3B8 !important;
    font-size: 1.1rem !important;
    cursor: pointer !important;
    border-radius: 50% !important;
    transition: all 0.15s ease !important;
  }

  .bot-side-tool-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #FFFFFF !important;
  }

  /* Perfectly Square 1:1 Chessboard with 16px Rounded Outer Corners */
  .bot-board-frame {
    width: min(72vh, 640px) !important;
    height: min(72vh, 640px) !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    background: #1E1B29 !important;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    touch-action: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
  }

  /* Desktop Player Cards (Clean, Unboxed, Spacious) */
  .bot-player-card {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 4px 6px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    height: auto !important;
    min-height: 0 !important;
  }

  .bot-player-info-left {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    min-width: 0 !important;
  }

  .bot-avatar-box {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    background: #2A2738 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    border: 2px solid rgba(255, 255, 255, 0.12) !important;
  }

  .bot-avatar-box img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  .bot-player-meta {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    gap: 2px !important;
  }

  .bot-player-row-top {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 1rem !important;
    font-weight: 800 !important;
  }

  .bot-player-name {
    color: #FFFFFF !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    max-width: 200px !important;
    font-size: 1.05rem !important;
  }

  .bot-player-badge {
    background: #3B82F6 !important;
    color: #FFF !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    padding: 2px 7px !important;
    border-radius: 5px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
  }

  .bot-player-rating {
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 0.88rem !important;
    font-weight: 600 !important;
  }

  .bot-player-card-right {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
  }

  /* Clocks */
  .bot-clock {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 10px !important;
    padding: 7px 18px !important;
    font-family: 'SF Mono', 'Roboto Mono', 'JetBrains Mono', monospace !important;
    font-size: 1.25rem !important;
    font-weight: 800 !important;
    color: rgba(255, 255, 255, 0.9) !important;
    letter-spacing: 1px !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .bot-clock.active {
    background: #FFFFFF !important;
    color: #0E0D14 !important;
    border-color: #FFFFFF !important;
    font-weight: 900 !important;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.45) !important;
    transform: scale(1.02) !important;
  }

  /* Right Desktop Panel (Transparent Wrapper Hosting 2 Floating Rounded Cards) */
  .bot-desktop-panel {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    width: clamp(340px, 26vw, 390px) !important;
    height: min(84vh, 740px) !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    flex-shrink: 0 !important;
  }

  /* Card 1: Bot Match Meta, Controls & Move History Table */
  .bot-match-meta-card {
    background: #1B1926 !important;
    border-radius: 16px !important;
    border: 1px solid rgba(255, 255, 255, 0.07) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45) !important;
    padding: 16px 18px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    flex: 1 1 56% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .bot-match-meta-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
  }

  .bot-match-meta-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
  }

  .bot-match-meta-title {
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    color: #FFFFFF !important;
  }

  .bot-match-meta-sub {
    font-size: 0.76rem !important;
    color: #94A3B8 !important;
  }

  .bot-meta-crest {
    width: 38px !important;
    height: 38px !important;
    background: rgba(59, 130, 246, 0.15) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .bot-match-meta-actions {
    display: flex !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .bot-pill-btn {
    flex: 1 !important;
    height: 38px !important;
    border-radius: 10px !important;
    font-size: 0.85rem !important;
    font-weight: 800 !important;
    display: flex;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: #FFFFFF !important;
  }

  .bot-pill-btn[style*="display: none"],
  .bot-pill-btn.hidden,
  .bot-pill-btn[hidden],
  body.game-over-active #btn-bot-desktop-resign,
  body.game-over-active #btn-bot-resign,
  body.game-over-active #btn-bot-desktop-hint,
  body.game-over-active #btn-bot-hint,
  body.game-over-active #btn-bot-desktop-undo,
  body.game-over-active #btn-bot-undo {
    display: none !important;
  }

  .bot-pill-btn.danger {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.25) !important;
    color: #F87171 !important;
  }

  .bot-pill-btn.danger:hover {
    background: #E11D48 !important;
    color: #FFF !important;
  }

  /* Move Navigation Toolbar */
  .bot-nav-toolbar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 6px 12px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border-radius: 10px !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    flex-shrink: 0 !important;
  }

  .bot-nav-btn {
    width: 34px !important;
    height: 32px !important;
    border-radius: 8px !important;
    border: none !important;
    background: transparent !important;
    color: #94A3B8 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.12s ease !important;
  }

  .bot-nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #FFFFFF !important;
  }

  /* 3-Column Move History Notation Table */
  .bot-notation-container {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    background: transparent !important;
    border: none !important;
  }

  .bot-notation-header {
    display: grid !important;
    grid-template-columns: 1fr 48px 1fr !important;
    padding: 6px 10px !important;
    font-size: 0.75rem !important;
    font-weight: 800 !important;
    color: #64748B !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    text-align: center !important;
    flex-shrink: 0 !important;
  }

  .bot-desktop-notation-table {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    padding: 4px 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
  }

  .bot-empty-notation {
    text-align: center !important;
    color: #64748B !important;
    font-size: 0.8rem !important;
    padding: 20px 0 !important;
  }

  .bot-notation-row {
    display: grid !important;
    grid-template-columns: 1fr 48px 1fr !important;
    align-items: center !important;
    padding: 3px 0 !important;
    border-radius: 6px !important;
    text-align: center !important;
  }

  .bot-notation-row:nth-child(even) {
    background: rgba(255, 255, 255, 0.02) !important;
  }

  .bot-notation-cell.move-num {
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    color: #64748B !important;
    font-family: 'SF Mono', monospace !important;
  }

  .bot-ply-btn {
    border: none !important;
    background: transparent !important;
    color: #CBD5E1 !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    font-family: 'SF Mono', monospace !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.1s ease !important;
  }

  .bot-ply-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #FFF !important;
  }

  .bot-ply-btn.active {
    background: rgba(255, 255, 255, 0.14) !important;
    color: #FFFFFF !important;
    font-weight: 800 !important;
  }

  /* Card 2: Coach Commentary & Dialogue Stream */
  .bot-desktop-dialogue-container {
    background: #1B1926 !important;
    border-radius: 16px !important;
    border: 1px solid rgba(255, 255, 255, 0.07) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45) !important;
    padding: 14px 16px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    flex: 1 1 44% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .bot-desktop-dialogue-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    flex-shrink: 0 !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    color: #FFFFFF !important;
  }

  .bot-desktop-quick-actions {
    display: flex !important;
    gap: 8px !important;
  }

  .bot-quick-action-btn {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #FFFFFF !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    padding: 5px 10px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
  }

  .bot-quick-action-btn:hover {
    background: rgba(255, 255, 255, 0.12) !important;
  }

  .bot-desktop-dialogue-stream {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding-right: 4px !important;
  }

  .bot-dialogue-msg {
    max-width: 86% !important;
    padding: 8px 12px !important;
    border-radius: 12px !important;
    font-size: 0.85rem !important;
    line-height: 1.4 !important;
  }

  .bot-dialogue-msg.bot {
    align-self: flex-start !important;
    background: #252233 !important;
    color: #E2E8F0 !important;
    border-bottom-left-radius: 3px !important;
  }

  .bot-dialogue-msg.user {
    align-self: flex-end !important;
    background: #143528 !important;
    color: #E2E8F0 !important;
    border-bottom-right-radius: 3px !important;
  }
}
/* 4. Bot Modals */
.bot-options-modal,
.bot-resign-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.78) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 999999 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.bot-options-modal.active,
.bot-resign-modal.active {
  display: flex !important;
}

.bot-options-box,
.bot-resign-box {
  background: #1E1B29;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  width: 100%;
  max-width: 380px;
  padding: 20px;
  box-sizing: border-box;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: pvpModalPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.bot-modal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 42px;
  border-radius: 8px;
  border: none;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bot-modal-btn.primary {
  background: #10B981;
  color: #FFF;
}

.bot-modal-btn.danger {
  background: #DC2626;
  color: #FFF;
}

.bot-modal-btn.secondary {
  background: #2D2A3B;
  color: #E2E8F0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
