[data-theme="wizard-skin"] {
  color-scheme: dark;
  --pr-bg: #0B0F23;
  --pr-surface: #101734;
  --pr-surface-2: #151D3D;
  --pr-surface-soft: rgba(255, 255, 255, 0.055);
  --pr-cyan: #00E5FF;
  --pr-purple: #7C4DFF;
  --pr-text: #FFFFFF;
  --pr-muted: #B8C4D9;
  --pr-border: rgba(255,255,255,0.14);
  --pr-radius-card: 24px;
  --pr-radius-pill: 999px;
  --pr-glow-cyan: 0 0 28px rgba(0, 229, 255, 0.24);
  --pr-glow-purple: 0 0 28px rgba(124, 77, 255, 0.24);
  --pr-gradient-accent: linear-gradient(135deg, rgba(0,229,255,.95), rgba(124,77,255,.95));

  --bg: var(--pr-bg);
  --surface: var(--pr-surface);
  --surface-variant: var(--pr-surface-2);
  --surface-raised: var(--pr-surface-2);
  --text: var(--pr-text);
  --on-surface: var(--pr-text);
  --text-muted: var(--pr-muted);
  --primary: var(--pr-cyan);
  --secondary: var(--pr-purple);
  --tertiary: var(--pr-cyan);
  --focus: var(--pr-cyan);
  --border: var(--pr-border);
  --header-bg: color-mix(in srgb, var(--pr-surface) 85%, #060a18);
  --header-text: var(--pr-text);
}

[data-theme="wizard-skin"] body {
  background: radial-gradient(circle at 10% -5%, rgba(124,77,255,.25), transparent 45%), radial-gradient(circle at 100% 0, rgba(0,229,255,.2), transparent 45%), var(--pr-bg);
}

[data-theme="wizard-skin"] .app-bar,
[data-theme="wizard-skin"] .left-rail,
[data-theme="wizard-skin"] .right-rail,
[data-theme="wizard-skin"] .card,
[data-theme="wizard-skin"] .post-card,
[data-theme="wizard-skin"] .home-dashboard-card,
[data-theme="wizard-skin"] .home-quick-card,
[data-theme="wizard-skin"] .thread-card,
[data-theme="wizard-skin"] .space-card {
  border-color: var(--pr-border);
  border-radius: var(--pr-radius-card);
}

[data-theme="wizard-skin"] .btn-primary {
  background: var(--pr-gradient-accent);
  border-color: transparent;
  color: #04101f;
  box-shadow: var(--pr-glow-cyan);
}

[data-theme="wizard-skin"] .btn-outline-primary,
[data-theme="wizard-skin"] .btn-outline-secondary {
  border-color: color-mix(in srgb, var(--pr-cyan) 45%, var(--pr-purple));
  color: var(--pr-cyan);
  background: var(--pr-surface-soft);
}

[data-theme="wizard-skin"] .btn-outline-primary:hover,
[data-theme="wizard-skin"] .btn-outline-secondary:hover,
[data-theme="wizard-skin"] .rail-link.active,
[data-theme="wizard-skin"] .rail-link[aria-current="page"] {
  color: #04101f;
  background: var(--pr-gradient-accent);
  box-shadow: var(--pr-glow-purple);
}

[data-theme="wizard-skin"] .form-control,
[data-theme="wizard-skin"] .form-select {
  background: color-mix(in srgb, var(--pr-surface) 88%, #060a18);
  color: var(--pr-text);
  border-color: var(--pr-border);
}

[data-theme="wizard-skin"] .form-control::placeholder { color: color-mix(in srgb, var(--pr-muted) 85%, transparent); }
[data-theme="wizard-skin"] a, [data-theme="wizard-skin"] .text-primary { color: var(--pr-cyan) !important; }

/* Keep active/highlighted controls readable on Wizard Skin accent gradients. */
[data-theme="wizard-skin"] .btn-primary,
[data-theme="wizard-skin"] .btn-primary:hover,
[data-theme="wizard-skin"] .btn-primary:focus-visible,
[data-theme="wizard-skin"] .btn-primary:active,
[data-theme="wizard-skin"] .btn-outline-primary:hover,
[data-theme="wizard-skin"] .btn-outline-primary:focus-visible,
[data-theme="wizard-skin"] .btn-outline-primary:active,
[data-theme="wizard-skin"] .btn-outline-secondary:hover,
[data-theme="wizard-skin"] .btn-outline-secondary:focus-visible,
[data-theme="wizard-skin"] .btn-outline-secondary:active,
[data-theme="wizard-skin"] .pocket-filter-pill.is-active,
[data-theme="wizard-skin"] .rail-link.active,
[data-theme="wizard-skin"] .rail-link[aria-current="page"],
[data-theme="wizard-skin"] .nav-link.active,
[data-theme="wizard-skin"] .nav-link[aria-current="page"],
[data-theme="wizard-skin"] .spaces-filter-chip.active,
[data-theme="wizard-skin"] .spaces-filter-chip[aria-current="page"] {
  color: #050505 !important;
}

[data-theme="wizard-skin"] .btn-primary .material-symbols-outlined,
[data-theme="wizard-skin"] .btn-outline-primary:hover .material-symbols-outlined,
[data-theme="wizard-skin"] .btn-outline-primary:focus-visible .material-symbols-outlined,
[data-theme="wizard-skin"] .btn-outline-primary:active .material-symbols-outlined,
[data-theme="wizard-skin"] .btn-outline-secondary:hover .material-symbols-outlined,
[data-theme="wizard-skin"] .btn-outline-secondary:focus-visible .material-symbols-outlined,
[data-theme="wizard-skin"] .btn-outline-secondary:active .material-symbols-outlined,
[data-theme="wizard-skin"] .pocket-filter-pill.is-active .material-symbols-outlined,
[data-theme="wizard-skin"] .rail-link.active .material-symbols-outlined,
[data-theme="wizard-skin"] .rail-link[aria-current="page"] .material-symbols-outlined,
[data-theme="wizard-skin"] .nav-link.active .material-symbols-outlined,
[data-theme="wizard-skin"] .nav-link[aria-current="page"] .material-symbols-outlined {
  color: currentColor !important;
}

[data-theme="wizard-skin"] .badge { border-radius: var(--pr-radius-pill); }

/* P0 Wizard Skin dark-surface legibility guard.
   Bootstrap ships table/form/menu text variables that can reintroduce dark text
   inside our casino panels. Keep this scoped to Wizard Skin dark/admin surfaces. */
[data-theme="wizard-skin"] {
  --ws-text: #f4f7ff;
  --ws-text-soft: #cfd6ff;
  --ws-text-muted: #aeb7d8;
  --ws-text-dim: #8d96bd;
  --ws-heading: #ffffff;
  --ws-link: #33f5ff;
  --ws-surface: rgba(9, 13, 28, 0.92);
  --ws-surface-2: rgba(15, 20, 42, 0.94);
  --ws-border: rgba(77, 235, 255, 0.32);
}

[data-theme="wizard-skin"] body.admin-surface-page,
[data-theme="wizard-skin"] .casino-panel,
[data-theme="wizard-skin"] .casino-card,
[data-theme="wizard-skin"] .admin-panel,
[data-theme="wizard-skin"] .admin-panel-section,
[data-theme="wizard-skin"] .admin-panel-card,
[data-theme="wizard-skin"] .admin-settings-card,
[data-theme="wizard-skin"] .admin-settings-group,
[data-theme="wizard-skin"] .settings-panel,
[data-theme="wizard-skin"] .settings-section,
[data-theme="wizard-skin"] .wizard-dark-surface,
[data-theme="wizard-skin"] #invite-codes-panel,
[data-theme="wizard-skin"] .admin-users-table {
  color: var(--ws-text);
}

[data-theme="wizard-skin"] body.admin-surface-page h1,
[data-theme="wizard-skin"] body.admin-surface-page h2,
[data-theme="wizard-skin"] body.admin-surface-page h3,
[data-theme="wizard-skin"] body.admin-surface-page h4,
[data-theme="wizard-skin"] body.admin-surface-page h5,
[data-theme="wizard-skin"] body.admin-surface-page h6,
[data-theme="wizard-skin"] .wizard-dark-surface h1,
[data-theme="wizard-skin"] .wizard-dark-surface h2,
[data-theme="wizard-skin"] .wizard-dark-surface h3,
[data-theme="wizard-skin"] .wizard-dark-surface h4,
[data-theme="wizard-skin"] .wizard-dark-surface h5,
[data-theme="wizard-skin"] .wizard-dark-surface h6 {
  color: var(--ws-heading);
}

[data-theme="wizard-skin"] body.admin-surface-page .text-muted,
[data-theme="wizard-skin"] body.admin-surface-page .form-text,
[data-theme="wizard-skin"] body.admin-surface-page small:not([class*="text-"]),
[data-theme="wizard-skin"] body.admin-surface-page .small:not([class*="text-"]),
[data-theme="wizard-skin"] .wizard-dark-surface .text-muted,
[data-theme="wizard-skin"] .wizard-dark-surface .form-text,
[data-theme="wizard-skin"] .wizard-dark-surface small:not([class*="text-"]),
[data-theme="wizard-skin"] .wizard-dark-surface .small:not([class*="text-"]) {
  color: var(--ws-text-muted) !important;
}

[data-theme="wizard-skin"] body.admin-surface-page a,
[data-theme="wizard-skin"] .wizard-dark-surface a {
  color: var(--ws-link);
}

[data-theme="wizard-skin"] body.admin-surface-page code,
[data-theme="wizard-skin"] .wizard-dark-surface code {
  color: #9ffcff;
  background: rgba(51, 245, 255, 0.10);
  border: 1px solid rgba(51, 245, 255, 0.22);
  border-radius: 0.35rem;
  padding: 0.05rem 0.25rem;
}

[data-theme="wizard-skin"] body.admin-surface-page .card,
[data-theme="wizard-skin"] body.admin-surface-page .modal-content,
[data-theme="wizard-skin"] body.admin-surface-page .dropdown-menu,
[data-theme="wizard-skin"] body.admin-surface-page .list-group-item,
[data-theme="wizard-skin"] .wizard-dark-surface,
[data-theme="wizard-skin"] .wizard-dark-surface .card,
[data-theme="wizard-skin"] .wizard-dark-surface .modal-content,
[data-theme="wizard-skin"] .wizard-dark-surface .dropdown-menu,
[data-theme="wizard-skin"] .wizard-dark-surface .list-group-item {
  background: radial-gradient(circle at 14% 0%, rgba(77, 235, 255, 0.09), transparent 34%), var(--ws-surface);
  border-color: var(--ws-border);
  color: var(--ws-text);
}

[data-theme="wizard-skin"] body.admin-surface-page .border,
[data-theme="wizard-skin"] .wizard-dark-surface .border,
[data-theme="wizard-skin"] body.admin-surface-page .dropdown-divider {
  border-color: var(--ws-border) !important;
}

[data-theme="wizard-skin"] body.admin-surface-page .table,
[data-theme="wizard-skin"] .wizard-dark-surface .table,
[data-theme="wizard-skin"] .casino-panel .table,
[data-theme="wizard-skin"] .casino-card .table,
[data-theme="wizard-skin"] .admin-panel .table,
[data-theme="wizard-skin"] .admin-panel-card .table,
[data-theme="wizard-skin"] .settings-panel .table,
[data-theme="wizard-skin"] .settings-section .table,
[data-theme="wizard-skin"] #invite-codes-panel .table,
[data-theme="wizard-skin"] .admin-users-table {
  --bs-table-color: var(--ws-text);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--ws-border);
  --bs-table-striped-color: var(--ws-text);
  --bs-table-striped-bg: rgba(77, 235, 255, 0.07);
  --bs-table-hover-color: var(--ws-heading);
  --bs-table-hover-bg: rgba(77, 235, 255, 0.13);
  color: var(--ws-text);
  border-color: var(--ws-border);
}

[data-theme="wizard-skin"] body.admin-surface-page .table > :not(caption) > * > *,
[data-theme="wizard-skin"] .wizard-dark-surface .table > :not(caption) > * > *,
[data-theme="wizard-skin"] #invite-codes-panel .table > :not(caption) > * > *,
[data-theme="wizard-skin"] .admin-users-table > :not(caption) > * > * {
  color: var(--ws-text);
  background-color: transparent;
  border-bottom-color: var(--ws-border);
}

[data-theme="wizard-skin"] body.admin-surface-page .table thead th,
[data-theme="wizard-skin"] .wizard-dark-surface .table thead th,
[data-theme="wizard-skin"] #invite-codes-panel .table thead th,
[data-theme="wizard-skin"] .admin-users-table thead th {
  color: var(--ws-heading);
  background: rgba(77, 235, 255, 0.10);
  border-bottom-color: rgba(77, 235, 255, 0.45);
}

body.layout:not(.home-modern-guest) .table > :not(caption) > * > * {
  background: transparent;
  border-bottom-color: rgba(125, 211, 252, .18);
  color: #ffffff;
}

body.layout:not(.home-modern-guest) .table thead th {
  color: #ffffff;
}

[data-theme="wizard-skin"] body.admin-surface-page label,
[data-theme="wizard-skin"] body.admin-surface-page .form-label,
[data-theme="wizard-skin"] body.admin-surface-page .form-check-label,
[data-theme="wizard-skin"] .wizard-dark-surface label,
[data-theme="wizard-skin"] .wizard-dark-surface .form-label,
[data-theme="wizard-skin"] .wizard-dark-surface .form-check-label {
  color: var(--ws-text-soft);
}

[data-theme="wizard-skin"] body.admin-surface-page .form-control,
[data-theme="wizard-skin"] body.admin-surface-page .form-select,
[data-theme="wizard-skin"] body.admin-surface-page textarea,
[data-theme="wizard-skin"] body.admin-surface-page input:not(.btn):not(.form-check-input),
[data-theme="wizard-skin"] body.admin-surface-page select,
[data-theme="wizard-skin"] .wizard-dark-surface .form-control,
[data-theme="wizard-skin"] .wizard-dark-surface .form-select,
[data-theme="wizard-skin"] .wizard-dark-surface textarea,
[data-theme="wizard-skin"] .wizard-dark-surface input:not(.btn):not(.form-check-input),
[data-theme="wizard-skin"] .wizard-dark-surface select {
  background-color: var(--ws-surface-2);
  border-color: var(--ws-border);
  color: var(--ws-text);
  caret-color: var(--ws-link);
}

[data-theme="wizard-skin"] body.admin-surface-page .form-control:focus,
[data-theme="wizard-skin"] body.admin-surface-page .form-select:focus,
[data-theme="wizard-skin"] body.admin-surface-page textarea:focus,
[data-theme="wizard-skin"] body.admin-surface-page input:not(.btn):not(.form-check-input):focus,
[data-theme="wizard-skin"] body.admin-surface-page select:focus,
[data-theme="wizard-skin"] .wizard-dark-surface .form-control:focus,
[data-theme="wizard-skin"] .wizard-dark-surface .form-select:focus,
[data-theme="wizard-skin"] .wizard-dark-surface textarea:focus,
[data-theme="wizard-skin"] .wizard-dark-surface input:not(.btn):not(.form-check-input):focus,
[data-theme="wizard-skin"] .wizard-dark-surface select:focus {
  background-color: rgba(18, 27, 56, 0.98);
  border-color: var(--ws-link);
  color: var(--ws-heading);
}

[data-theme="wizard-skin"] body.admin-surface-page .form-control::placeholder,
[data-theme="wizard-skin"] body.admin-surface-page textarea::placeholder,
[data-theme="wizard-skin"] body.admin-surface-page input::placeholder,
[data-theme="wizard-skin"] .wizard-dark-surface .form-control::placeholder,
[data-theme="wizard-skin"] .wizard-dark-surface textarea::placeholder,
[data-theme="wizard-skin"] .wizard-dark-surface input::placeholder {
  color: var(--ws-text-dim);
  opacity: 1;
}

[data-theme="wizard-skin"] body.admin-surface-page .form-control:disabled,
[data-theme="wizard-skin"] body.admin-surface-page .form-control[readonly],
[data-theme="wizard-skin"] body.admin-surface-page .form-select:disabled,
[data-theme="wizard-skin"] body.admin-surface-page input:disabled,
[data-theme="wizard-skin"] body.admin-surface-page input[readonly],
[data-theme="wizard-skin"] body.admin-surface-page textarea:disabled,
[data-theme="wizard-skin"] body.admin-surface-page textarea[readonly],
[data-theme="wizard-skin"] .wizard-dark-surface .form-control:disabled,
[data-theme="wizard-skin"] .wizard-dark-surface .form-control[readonly],
[data-theme="wizard-skin"] .wizard-dark-surface .form-select:disabled,
[data-theme="wizard-skin"] .wizard-dark-surface input:disabled,
[data-theme="wizard-skin"] .wizard-dark-surface input[readonly],
[data-theme="wizard-skin"] .wizard-dark-surface textarea:disabled,
[data-theme="wizard-skin"] .wizard-dark-surface textarea[readonly] {
  background-color: rgba(32, 39, 68, 0.86);
  border-color: rgba(174, 183, 216, 0.28);
  color: var(--ws-text-muted);
  opacity: 1;
}

[data-theme="wizard-skin"] body.admin-surface-page input:-webkit-autofill,
[data-theme="wizard-skin"] body.admin-surface-page textarea:-webkit-autofill,
[data-theme="wizard-skin"] body.admin-surface-page select:-webkit-autofill,
[data-theme="wizard-skin"] .wizard-dark-surface input:-webkit-autofill,
[data-theme="wizard-skin"] .wizard-dark-surface textarea:-webkit-autofill,
[data-theme="wizard-skin"] .wizard-dark-surface select:-webkit-autofill {
  -webkit-text-fill-color: var(--ws-text);
  -webkit-box-shadow: 0 0 0 1000px rgb(15, 20, 42) inset;
  caret-color: var(--ws-link);
}

[data-theme="wizard-skin"] body.admin-surface-page input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="wizard-skin"] body.admin-surface-page input[type="time"]::-webkit-calendar-picker-indicator,
[data-theme="wizard-skin"] body.admin-surface-page input[type="datetime-local"]::-webkit-calendar-picker-indicator,
[data-theme="wizard-skin"] .wizard-dark-surface input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="wizard-skin"] .wizard-dark-surface input[type="time"]::-webkit-calendar-picker-indicator,
[data-theme="wizard-skin"] .wizard-dark-surface input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.7) saturate(1.4);
  opacity: 0.9;
}

[data-theme="wizard-skin"] body.admin-surface-page .dropdown-item,
[data-theme="wizard-skin"] .wizard-dark-surface .dropdown-item {
  color: var(--ws-text);
}

[data-theme="wizard-skin"] body.admin-surface-page .dropdown-item:hover,
[data-theme="wizard-skin"] body.admin-surface-page .dropdown-item:focus,
[data-theme="wizard-skin"] .wizard-dark-surface .dropdown-item:hover,
[data-theme="wizard-skin"] .wizard-dark-surface .dropdown-item:focus {
  background-color: rgba(77, 235, 255, 0.14);
  color: var(--ws-heading);
}

[data-theme="wizard-skin"] body.admin-surface-page .btn-close,
[data-theme="wizard-skin"] .wizard-dark-surface .btn-close {
  filter: invert(1) grayscale(100%) brightness(180%);
}

[data-theme="wizard-skin"] .app-logo-image,
body.wizard-skin .app-logo-image,
body.casino-theme .app-logo-image {
  display: block;
  opacity: 1;
  visibility: visible;
  width: auto;
  max-width: 180px;
  max-height: 36px;
  overflow: visible;
}
