/**
 * AIChessJS - Cyber Theme & Complete Vanilla UI System
 * Fully standalone, high-performance styling for Chess Arena, Navbar, Modals, Tables, Cards, Controls, and Utilities.
 * Replaces 100% of Bootstrap CSS, Bootstrap JS, and Popper JS with zero external dependencies.
 */

:root {
  --cyber-bg-dark: #070c18;
  --cyber-bg-card: rgba(15, 23, 42, 0.94);
  --cyber-bg-surface: rgba(30, 41, 59, 0.8);
  --cyber-cyan: #00f0ff;
  --cyber-cyan-glow: rgba(0, 240, 255, 0.4);
  --cyber-blue: #38bdf8;
  --cyber-amber: #f59e0b;
  --cyber-amber-glow: rgba(245, 158, 11, 0.4);
  --cyber-green: #22c55e;
  --cyber-red: #ef4444;
  --cyber-border: rgba(56, 189, 248, 0.25);
  --cyber-text: #f1f5f9;
  --cyber-text-muted: #94a3b8;
}

/* =========================================================================
 * 1. GLOBAL RESETS & TYPOGRAPHY
 * ========================================================================= */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: sans-serif;
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--cyber-text) !important;
  text-align: left;
  background-color: var(--cyber-bg-dark) !important;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

a {
  color: var(--cyber-cyan);
  text-decoration: none;
  background-color: transparent;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--cyber-blue);
  text-decoration: underline;
}

img {
  vertical-align: middle;
  border-style: none;
}

button, input, optgroup, select, textarea {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

button, input {
  overflow: visible;
}

button, select {
  text-transform: none;
}

button, [type="button"], [type="reset"], [type="submit"] {
  -webkit-appearance: button;
}

/* =========================================================================
 * 2. GRID & LAYOUT UTILITIES
 * ========================================================================= */
.container {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
  max-width: 1140px;
}

.container-fluid {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -10px;
  margin-left: -10px;
}

.no-gutters {
  margin-right: 0;
  margin-left: 0;
}

.no-gutters > .col,
.no-gutters > [class*="col-"] {
  padding-right: 0;
  padding-left: 0;
}

.col, [class*="col-"] {
  position: relative;
  width: 100%;
  padding-right: 10px;
  padding-left: 10px;
}

.col { flex-basis: 0; flex-grow: 1; max-width: 100%; }
.col-auto { flex: 0 0 auto; width: auto; max-width: 100%; }
.col-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
.col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

@media (min-width: 576px) {
  .col-sm-auto { flex: 0 0 auto; width: auto; max-width: 100%; }
  .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
  .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
  .mt-sm-0 { margin-top: 0 !important; }
}

@media (min-width: 768px) {
  .col-md-auto { flex: 0 0 auto; width: auto; max-width: 100%; }
  .col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-md-3 { flex: 0 0 25%; max-width: 25%; }
  .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-md-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-md-6 { flex: 0 0 50%; max-width: 50%; }
  .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-md-12 { flex: 0 0 100%; max-width: 100%; }
}

/* =========================================================================
 * 3. FLEXBOX & DISPLAY UTILITIES
 * ========================================================================= */
.d-none { display: none !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }

.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }

.justify-content-start { justify-content: flex-start !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around { justify-content: space-around !important; }

.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.align-items-center { align-items: center !important; }
.align-items-stretch { align-items: stretch !important; }
.align-self-center { align-self: center !important; }

.w-100 { width: 100% !important; }
.w-75 { width: 75% !important; }
.w-50 { width: 50% !important; }
.w-25 { width: 25% !important; }
.h-100 { height: 100% !important; }

/* =========================================================================
 * 4. SPACING UTILITIES (Margin & Padding)
 * ========================================================================= */
.m-0 { margin: 0 !important; }
.m-1 { margin: 0.25rem !important; }
.m-2 { margin: 0.5rem !important; }
.m-3 { margin: 1rem !important; }
.m-auto { margin: auto !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }
.mt-auto { margin-top: auto !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }
.mb-auto { margin-bottom: auto !important; }

.ml-0 { margin-left: 0 !important; }
.ml-1 { margin-left: 0.25rem !important; }
.ml-2 { margin-left: 0.5rem !important; }
.ml-3 { margin-left: 1rem !important; }
.ml-auto { margin-left: auto !important; }

.mr-0 { margin-right: 0 !important; }
.mr-1 { margin-right: 0.25rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.mr-3 { margin-right: 1rem !important; }
.mr-auto { margin-right: auto !important; }

.mx-0 { margin-left: 0 !important; margin-right: 0 !important; }
.mx-1 { margin-left: 0.25rem !important; margin-right: 0.25rem !important; }
.mx-2 { margin-left: 0.5rem !important; margin-right: 0.5rem !important; }
.mx-3 { margin-left: 1rem !important; margin-right: 1rem !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }

.my-0 { margin-top: 0 !important; margin-bottom: 0 !important; }
.my-1 { margin-top: 0.25rem !important; margin-bottom: 0.25rem !important; }
.my-2 { margin-top: 0.5rem !important; margin-bottom: 0.5rem !important; }
.my-3 { margin-top: 1rem !important; margin-bottom: 1rem !important; }
.my-4 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }

.pt-0 { padding-top: 0 !important; }
.pt-1 { padding-top: 0.25rem !important; }
.pt-2 { padding-top: 0.5rem !important; }
.pt-3 { padding-top: 1rem !important; }

.pb-0 { padding-bottom: 0 !important; }
.pb-1 { padding-bottom: 0.25rem !important; }
.pb-2 { padding-bottom: 0.5rem !important; }
.pb-3 { padding-bottom: 1rem !important; }

.px-0 { padding-left: 0 !important; padding-right: 0 !important; }
.px-1 { padding-left: 0.25rem !important; padding-right: 0.25rem !important; }
.px-2 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }

.py-0 { padding-top: 0 !important; padding-bottom: 0 !important; }
.py-1 { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }

/* =========================================================================
 * 5. TEXT, COLORS & BORDERS
 * ========================================================================= */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.font-weight-bold { font-weight: 700 !important; }
.small { font-size: 85% !important; }

.text-white { color: #ffffff !important; }
.text-light { color: #f8fafc !important; }
.text-dark { color: #0f172a !important; }
.text-muted { color: var(--cyber-text-muted) !important; }
.text-primary { color: var(--cyber-cyan) !important; }
.text-info { color: var(--cyber-blue) !important; }
.text-success { color: var(--cyber-green) !important; }
.text-warning { color: var(--cyber-amber) !important; }
.text-danger { color: var(--cyber-red) !important; }

.bg-dark { background-color: rgba(11, 19, 41, 0.95) !important; }
.bg-success { background-color: var(--cyber-green) !important; }
.bg-primary { background-color: var(--cyber-cyan) !important; }
.bg-warning { background-color: var(--cyber-amber) !important; }
.bg-danger { background-color: var(--cyber-red) !important; }

.border-0 { border: 0 !important; }
.border-top { border-top: 1px solid var(--cyber-border) !important; }
.border-bottom { border-bottom: 1px solid var(--cyber-border) !important; }
.border-secondary { border-color: var(--cyber-border) !important; }
.rounded { border-radius: 8px !important; }
.rounded-circle { border-radius: 50% !important; }
.shadow-sm { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4) !important; }

/* =========================================================================
 * 6. CYBER BUTTONS & BUTTON GROUPS (Direct Bootstrap Drop-In)
 * ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid var(--cyber-border);
  padding: 0.4rem 0.85rem;
  font-size: 0.875rem;
  line-height: 1.4;
  border-radius: 0.5rem;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  text-decoration: none !important;
  outline: none !important;
  background-color: var(--cyber-bg-surface);
  color: var(--cyber-text);
  gap: 6px;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--cyber-cyan);
  color: #ffffff;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #00f0ff 100%) !important;
  color: #040d1a !important;
  border-color: #00f0ff !important;
  font-weight: 700 !important;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.4) !important;
}

.btn-primary:hover {
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.8) !important;
}

.btn-info {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3) !important;
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.85) !important;
  color: #e2e8f0 !important;
  border-color: rgba(56, 189, 248, 0.3) !important;
}

.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.95) !important;
  border-color: var(--cyber-cyan) !important;
}

.btn-success {
  background: linear-gradient(135deg, #15803d 0%, #22c55e 100%) !important;
  color: #ffffff !important;
  border-color: #22c55e !important;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.35) !important;
}

.btn-warning {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%) !important;
  color: #040d1a !important;
  border-color: #f59e0b !important;
  font-weight: 700 !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4) !important;
}

.btn-danger {
  background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%) !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.35) !important;
}

.btn-dark {
  background: #0b1329 !important;
  color: #cbd5e1 !important;
  border-color: var(--cyber-border) !important;
}

.btn-outline-primary {
  background: transparent !important;
  color: var(--cyber-cyan) !important;
  border-color: var(--cyber-cyan) !important;
}

.btn-outline-primary:hover {
  background: rgba(0, 240, 255, 0.15) !important;
  color: #ffffff !important;
}

.btn-outline-secondary {
  background: transparent !important;
  color: var(--cyber-text-muted) !important;
  border-color: rgba(56, 189, 248, 0.3) !important;
}

.btn-outline-secondary:hover {
  background: rgba(56, 189, 248, 0.15) !important;
  color: #ffffff !important;
  border-color: var(--cyber-cyan) !important;
}

.btn-outline-info {
  background: transparent !important;
  color: var(--cyber-blue) !important;
  border-color: var(--cyber-blue) !important;
}

.btn-outline-warning {
  background: transparent !important;
  color: var(--cyber-amber) !important;
  border-color: var(--cyber-amber) !important;
}

.btn-outline-dark {
  background: transparent !important;
  color: var(--cyber-text-muted) !important;
  border-color: #334155 !important;
}

.btn-sm, .btn-group-sm > .btn {
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
  border-radius: 0.35rem;
}

.btn-xs {
  padding: 0.15rem 0.45rem;
  font-size: 0.75rem;
  border-radius: 0.3rem;
}

.btn-lg, .btn-group-lg > .btn {
  padding: 0.6rem 1.25rem;
  font-size: 1.05rem;
  border-radius: 0.6rem;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-group {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
}

.btn-group > .btn {
  position: relative;
  flex: 1 1 auto;
  border-radius: 0;
}

.btn-group > .btn:first-child {
  border-top-left-radius: 0.5rem;
  border-bottom-left-radius: 0.5rem;
}

.btn-group > .btn:last-child {
  border-top-right-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
}

/* =========================================================================
 * 7. BADGES & PILLS
 * ========================================================================= */
.badge {
  display: inline-block;
  padding: 0.3em 0.55em;
  font-size: 75%;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.35rem;
}

.badge-primary { color: #040d1a; background-color: var(--cyber-cyan); }
.badge-secondary { color: #e2e8f0; background-color: #334155; }
.badge-success { color: #ffffff; background-color: var(--cyber-green); }
.badge-danger { color: #ffffff; background-color: var(--cyber-red); }
.badge-warning { color: #040d1a; background-color: var(--cyber-amber); }
.badge-info { color: #ffffff; background-color: #0284c7; }
.badge-dark { color: #ffffff; background-color: #0f172a; border: 1px solid var(--cyber-border); }

/* =========================================================================
 * 8. FORM CONTROLS & SWITCHES
 * ========================================================================= */
.form-control {
  display: block;
  width: 100%;
  padding: 0.45rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--cyber-text);
  background-color: rgba(15, 23, 42, 0.9);
  background-clip: padding-box;
  border: 1px solid var(--cyber-border);
  border-radius: 0.5rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  background-color: rgba(15, 23, 42, 1);
  border-color: var(--cyber-cyan);
  outline: 0;
  box-shadow: 0 0 0 0.2rem var(--cyber-cyan-glow);
  color: #ffffff;
}

.form-control-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  border-radius: 0.35rem;
}

.form-check {
  position: relative;
  display: block;
  padding-left: 1.25rem;
}

.form-check-input {
  position: absolute;
  margin-top: 0.3rem;
  margin-left: -1.25rem;
  cursor: pointer;
}

.form-check-label {
  margin-bottom: 0;
  cursor: pointer;
}

.form-text {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--cyber-text-muted);
}

/* Custom UI Switches */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #334155;
  transition: .3s;
  border: 1px solid var(--cyber-border);
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: #f1f5f9;
  transition: .3s;
}

input:checked + .slider {
  background: linear-gradient(135deg, #0284c7 0%, #00f0ff 100%);
  border-color: var(--cyber-cyan);
  box-shadow: 0 0 10px var(--cyber-cyan-glow);
}

input:checked + .slider:before {
  transform: translateX(22px);
  background-color: #040d1a;
}

.slider.round {
  border-radius: 22px;
}

.slider.round:before {
  border-radius: 50%;
}

/* =========================================================================
 * 9. CARDS & PANELS
 * ========================================================================= */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-color: var(--cyber-bg-card);
  background-clip: border-box;
  border: 1px solid var(--cyber-border);
  border-radius: 0.75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.card-header {
  padding: 0.75rem 1.25rem;
  margin-bottom: 0;
  background-color: rgba(30, 41, 59, 0.5);
  border-bottom: 1px solid var(--cyber-border);
  border-top-left-radius: calc(0.75rem - 1px);
  border-top-right-radius: calc(0.75rem - 1px);
  font-weight: 700;
  color: var(--cyber-cyan);
}

.card-body {
  flex: 1 1 auto;
  padding: 1.25rem;
}

.card-footer {
  padding: 0.75rem 1.25rem;
  background-color: rgba(30, 41, 59, 0.5);
  border-top: 1px solid var(--cyber-border);
  border-bottom-right-radius: calc(0.75rem - 1px);
  border-bottom-left-radius: calc(0.75rem - 1px);
}

/* =========================================================================
 * 10. MODALS (Universal Drop-In Replacement for Bootstrap Modals)
 * ========================================================================= */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1050;
  display: none;
  width: 100%;
  height: 100%;
  overflow: hidden;
  outline: 0;
}

.modal.show {
  display: block !important;
  overflow-x: hidden;
  overflow-y: auto;
}

.modal-dialog {
  position: relative;
  width: auto;
  margin: 1.75rem auto;
  max-width: 500px;
  pointer-events: none;
  padding: 0 10px;
}

.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - 3.5rem);
}

.modal-lg {
  max-width: 800px;
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background: linear-gradient(135deg, #0f172a 0%, #090d16 100%) !important;
  background-clip: padding-box;
  border: 1.5px solid var(--cyber-border);
  border-radius: 0.85rem;
  outline: 0;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 25px rgba(0, 240, 255, 0.2);
  color: var(--cyber-text) !important;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--cyber-border);
  border-top-left-radius: calc(0.85rem - 1.5px);
  border-top-right-radius: calc(0.85rem - 1.5px);
}

.modal-title {
  margin-bottom: 0;
  line-height: 1.5;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cyber-cyan);
  letter-spacing: 0.5px;
}

.modal-header .close, .close {
  float: right;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--cyber-text-muted);
  text-shadow: none;
  opacity: 0.75;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease;
}

.close:hover {
  color: #ffffff;
  opacity: 1;
  text-decoration: none;
}

.modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 1.25rem;
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--cyber-border);
  border-bottom-right-radius: calc(0.85rem - 1.5px);
  border-bottom-left-radius: calc(0.85rem - 1.5px);
  gap: 8px;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1040;
  width: 100vw;
  height: 100vh;
  background-color: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-backdrop.fade { opacity: 0; }
.modal-backdrop.show { opacity: 1; }

/* =========================================================================
 * 11. TABLES, PROGRESS BARS & SPINNERS
 * ========================================================================= */
.table {
  width: 100%;
  margin-bottom: 1rem;
  color: var(--cyber-text);
  vertical-align: top;
  border-collapse: collapse;
}

.table th, .table td {
  padding: 0.55rem 0.75rem;
  vertical-align: middle;
  border-top: 1px solid rgba(56, 189, 248, 0.15);
}

.table thead th {
  vertical-align: bottom;
  border-bottom: 2px solid var(--cyber-border);
  font-weight: 700;
  color: var(--cyber-cyan);
}

.table-sm th, .table-sm td {
  padding: 0.35rem 0.5rem;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(56, 189, 248, 0.04);
}

.table-hover tbody tr:hover {
  background-color: rgba(56, 189, 248, 0.12);
}

.table-dark {
  background-color: rgba(11, 19, 41, 0.95);
  color: var(--cyber-text);
}

.table-bordered {
  border: 1px solid var(--cyber-border);
}

.table-bordered th, .table-bordered td {
  border: 1px solid var(--cyber-border);
}

.table-responsive {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.progress {
  display: flex;
  height: 1rem;
  overflow: hidden;
  font-size: 0.75rem;
  background-color: rgba(30, 41, 59, 0.8);
  border-radius: 0.375rem;
  border: 1px solid var(--cyber-border);
}

.progress-bar {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  color: #040d1a;
  text-align: center;
  white-space: nowrap;
  background: linear-gradient(135deg, #0284c7 0%, #00f0ff 100%);
  transition: width 0.6s ease;
  font-weight: 700;
}

.spinner-border {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  vertical-align: text-bottom;
  border: 0.25em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner-border 0.75s linear infinite;
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.2em;
}

@keyframes spinner-border {
  100% { transform: rotate(360deg); }
}

/* =========================================================================
 * 12. CYBER NAVBAR (Vanilla JS Dropdowns & Mobile Collapse)
 * ========================================================================= */
.cyber-navbar {
  background: rgba(7, 12, 24, 0.92) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--cyber-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 240, 255, 0.1);
  padding: 8px 16px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cyber-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
  color: #ffffff !important;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 1px;
}

.cyber-brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1.5px solid var(--cyber-cyan);
  box-shadow: 0 0 10px var(--cyber-cyan-glow);
}

.cyber-nav-list {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.cyber-nav-item {
  position: relative;
}

.cyber-nav-link {
  color: #cbd5e1 !important;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none !important;
  transition: all 0.2s ease;
  user-select: none;
}

.cyber-nav-link:hover,
.cyber-nav-link.active {
  color: var(--cyber-cyan) !important;
  background: rgba(56, 189, 248, 0.12);
  text-shadow: 0 0 8px var(--cyber-cyan-glow);
}

/* Vanilla Dropdown Menu */
.cyber-dropdown-menu,
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 230px;
  max-height: 82vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(11, 19, 41, 0.96) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--cyber-border);
  border-radius: 10px;
  padding: 6px 0;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85), 0 0 20px rgba(0, 240, 255, 0.2);
  z-index: 1060;
  margin-top: 4px;
}

.cyber-dropdown-menu::-webkit-scrollbar {
  width: 5px;
}
.cyber-dropdown-menu::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 4px;
}
.cyber-dropdown-menu::-webkit-scrollbar-thumb {
  background: var(--cyber-cyan);
  border-radius: 4px;
}

.cyber-dropdown-menu.show,
.dropdown-menu.show {
  display: block;
  animation: cyberFadeDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dropdown-menu-right {
  right: 0;
  left: auto;
}

.cyber-dropdown-header {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--cyber-blue);
  text-transform: uppercase;
  padding: 6px 16px 4px 16px;
}

.cyber-dropdown-item,
.dropdown-item {
  display: flex;
  align-items: center;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #e2e8f0;
  text-decoration: none !important;
  cursor: pointer;
  transition: all 0.15s ease;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
}

.cyber-dropdown-item:hover,
.dropdown-item:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #ffffff;
  padding-left: 19px;
}

.cyber-dropdown-divider,
.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 5px 0;
}

/* Mobile Hamburger Toggle */
.cyber-toggler {
  display: none;
  background: transparent;
  border: 1px solid var(--cyber-border);
  color: var(--cyber-cyan);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  outline: none;
}

@media (max-width: 991px) {
  .cyber-toggler {
    display: block;
  }
  .cyber-nav-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(7, 12, 24, 0.98);
    backdrop-filter: blur(16px);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px;
    border-bottom: 1px solid var(--cyber-border);
    gap: 4px;
  }
  .cyber-nav-list.show {
    display: flex;
  }
  .cyber-dropdown-menu {
    position: static;
    box-shadow: none;
    background: rgba(15, 23, 42, 0.8) !important;
    margin: 4px 0 8px 12px;
  }
}

/* =========================================================================
 * 13. ANIMATIONS
 * ========================================================================= */
@keyframes cyberFadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cyberModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes cyberModalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* =========================================================================
 * 14. CYBER GLASS ARENA BOARD THEME (Matching Banner & Cyber Pieces)
 * ========================================================================= */
#board.theme-cyber-glass,
.theme-cyber-glass .board-b72b1,
.theme-cyber-glass#board {
  border: 2px solid transparent !important;
  border-image: linear-gradient(to top, #00f0ff 0%, #22d3ee 20%, #38bdf8 38%, #818cf8 62%, #e879f9 82%, #f472b6 100%) 1 !important;
  box-shadow: 
    0 0 25px rgba(0, 240, 255, 0.45),
    0 0 50px rgba(244, 114, 182, 0.35),
    inset 0 0 20px rgba(0, 240, 255, 0.15) !important;
  background-color: #010206 !important;
  overflow: hidden;
}

.theme-cyber-glass .square-55d63 {
  position: relative;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

/* Light & Dark Squares Base Glass Defaults (Rank spectrum dynamically applied by setTheme) */
.theme-cyber-glass .white-1e1d7 {
  box-shadow: 
    inset 0 0 0 1px rgba(255, 255, 255, 0.95), 
    inset 0 0 14px rgba(0, 240, 255, 0.5),
    0 0 8px #00f0ff;
}

.theme-cyber-glass .black-3c85d {
  box-shadow: 
    inset 0 0 0 1px rgba(255, 255, 255, 0.85), 
    inset 0 0 12px rgba(0, 240, 255, 0.4),
    0 0 8px #00f0ff;
}

/* Pieces Depth & Floating Effect */
.theme-cyber-glass .piece-417db {
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 10px rgba(0, 240, 255, 0.25));
}

/* Coordinate Notations */
.theme-cyber-glass .notation-322f9 {
  z-index: 3;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
  font-size: 11px;
  font-weight: 700;
}
.theme-cyber-glass .white-1e1d7 .notation-322f9 {
  color: #ffffff !important;
  text-shadow: 0 0 6px #00f0ff, 0 0 12px rgba(0, 240, 255, 0.8) !important;
}
.theme-cyber-glass .black-3c85d .notation-322f9 {
  color: #e0f2fe !important;
  text-shadow: 0 0 6px #38bdf8, 0 0 12px rgba(56, 189, 248, 0.8) !important;
}

/* Neon Glow Move Highlights in Cyber Glass Mode */
.theme-cyber-glass .highlight-white-from {
  box-shadow: inset 0 0 0 2px #22c55e, inset 0 0 14px rgba(34, 197, 94, 0.75), 0 0 15px rgba(34, 197, 94, 0.5) !important;
}

.theme-cyber-glass .highlight-white-to {
  box-shadow: inset 0 0 0 2px #ffffff, inset 0 0 16px rgba(0, 240, 255, 0.9), 0 0 22px rgba(0, 240, 255, 0.7) !important;
}

.theme-cyber-glass .highlight-black-from {
  box-shadow: inset 0 0 0 2px #f43f5e, inset 0 0 14px rgba(244, 63, 94, 0.75), 0 0 15px rgba(244, 63, 94, 0.5) !important;
}

.theme-cyber-glass .highlight-black-to {
  box-shadow: inset 0 0 0 2px #ec4899, inset 0 0 16px rgba(236, 72, 153, 0.85), 0 0 20px rgba(236, 72, 153, 0.6) !important;
}

.theme-cyber-glass .highlight-premove-from,
.theme-cyber-glass .highlight-premove-to {
  box-shadow: inset 0 0 0 2px #38bdf8, inset 0 0 14px rgba(56, 189, 248, 0.8) !important;
}

.theme-cyber-glass .highlight-white-option-white-square,
.theme-cyber-glass .highlight-white-option-black-square {
  box-shadow: inset 0 0 0 2px #06b6d4, inset 0 0 10px rgba(6, 182, 212, 0.6) !important;
}



