@font-face {
  font-family: Minecraft;
  src: url('/fonts/minecraft.woff2') format('woff2');
  font-display: swap;
}

:root {
  --bs-primary: #007bff;
  --legacy-blue: #007bff;
  --legacy-green: #28a745;
  --legacy-danger: #dc3545;
  --page-bg: #f4f6f9;
  --text: #343a40;
  --muted: #6c757d;
  --border: #dee2e6;
  --card: #ffffff;
}

* { box-sizing: border-box; }

html,
body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  background: var(--page-bg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

button,
input,
select,
textarea { font: inherit; }

button { cursor: pointer; }

a { color: var(--legacy-blue); }

a:hover { color: #0056b3; }

.hidden { display: none !important; }

.sr-only,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Public home, following the original Blessing Skin home layout. */
.home-page {
  min-height: 100vh;
  color: #fff;
  background: #2b3942;
}

.home-background {
  position: fixed;
  z-index: 0;
  inset: 0;
  min-height: 100vh;
  background-image: url('/images/home-bg.webp');
  background-position: center;
  background-size: cover;
}

.home-background::after {
  position: absolute;
  inset: 0;
  background: rgba(20, 30, 35, 0.16);
  content: '';
}

.home-navbar {
  z-index: 1030;
  min-height: 58px;
  background: rgba(255, 255, 255, 0.24);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
}

.home-navbar .navbar-brand {
  color: #4d5357;
  font-family: Minecraft, sans-serif;
  font-size: 1.38rem;
}

.home-navbar .nav-link {
  color: #343a40;
  font-size: 0.95rem;
}

.home-navbar .nav-link:hover { color: #111; }

.home-hero {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: calc(100vh - 60px);
  align-items: center;
  justify-content: center;
  padding-top: 58px;
  padding-bottom: 74px;
}

.splash {
  width: min(780px, 100%);
  text-align: center;
}

.splash-head {
  margin: 0 0 0.5rem;
  color: #fff;
  font-family: Minecraft, sans-serif;
  font-size: clamp(2.25rem, 5vw, 4.4rem);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0;
  text-shadow: 0 4px 3px rgba(0, 0, 0, 0.4), 0 8px 13px rgba(0, 0, 0, 0.1), 0 18px 23px rgba(0, 0, 0, 0.1);
}

.splash-subhead {
  margin: 0 0 2.25rem;
  color: #fff;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.splash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.main-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.65rem 1.75rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.13);
  font-size: 1rem;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.main-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  text-decoration: none;
}

.main-button.secondary { background: rgba(0, 0, 0, 0.28); }

.home-intro {
  position: relative;
  z-index: 1;
  padding: 4rem 0 3.7rem;
  color: #343a40;
  border-top: 5px solid #bdc3c7;
  background: #fff;
}

.home-intro h2 { font-size: 1.8rem; }

.home-intro h3 { margin-top: 1rem; font-size: 1.12rem; }

.home-intro p { margin: 0; color: #6c757d; }

.home-feature-icon {
  color: #007bff;
  font-size: 3.4rem;
}

.home-footer {
  position: relative;
  z-index: 1;
  padding: 1rem 0;
  color: #e9ecef;
  background: #222;
  font-size: 0.85rem;
}

/* Authentication */
.legacy-auth-page {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: #e9ecef;
}

.legacy-auth-page .login-box {
  width: min(360px, 100%);
  margin: 0;
}

.legacy-auth-page .login-logo { margin-bottom: 1rem; }

.legacy-auth-page .login-logo a {
  color: #343a40;
  font-family: Minecraft, sans-serif;
  font-size: 2rem;
}

.legacy-auth-page .login-logo a:hover {
  color: #42a5f5;
  text-decoration: none;
}

.legacy-auth-page .card { border-radius: 3px; }

.legacy-auth-page .login-card-body { padding: 1.45rem; }

.legacy-auth-page .login-box-msg { margin-bottom: 1.25rem; }

.legacy-auth-page .form-control,
.legacy-auth-page .input-group-text { border-color: #ced4da; }

/* Standalone skin detail and upload pages follow the original top-nav skinlib layout. */
.standalone-page { min-height: 100vh; background: var(--page-bg); }

.standalone-navbar {
  min-height: 57px;
  border-bottom: 1px solid #dee2e6;
  background: #fff;
}

.standalone-navbar .navbar-brand { color: #343a40; font-family: Minecraft, sans-serif; }

.standalone-content { padding-top: 1rem; padding-bottom: 2rem; }

.standalone-content .content-header { padding: 0.8rem 0 1rem; }

.standalone-content h1 { color: #343a40; font-size: 1.55rem; font-weight: 400; }

.standalone-preview { min-height: 430px; height: min(62vw, 560px); }

#skin-detail-canvas { display: block; width: 100%; height: 100%; cursor: grab; }

#skin-detail-canvas:active { cursor: grabbing; }

.standalone-upload-preview { display: flex; gap: 1rem; align-items: center; }

.standalone-upload-preview img {
  width: 110px;
  height: 110px;
  border: 1px solid #ced4da;
  background: #f8f9fa;
  image-rendering: pixelated;
  object-fit: contain;
}

/* AdminLTE-compatible workspace */
.legacy-workspace {
  min-height: 100vh;
  background: var(--page-bg);
}

.legacy-workspace .main-header {
  position: fixed;
  z-index: 1035;
  top: 0;
  right: 0;
  left: 0;
  min-height: 57px;
  margin-left: 250px;
  border-bottom: 1px solid #dee2e6;
  box-shadow: none;
}

.legacy-workspace .main-sidebar {
  position: fixed;
  z-index: 1038;
  top: 0;
  bottom: 0;
  left: 0;
  width: 250px;
  overflow-y: auto;
  background: #343a40;
}

.legacy-workspace .brand-link {
  display: block;
  height: 57px;
  padding: 0.88rem 0.5rem;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  font-family: Minecraft, sans-serif;
  font-size: 1.23rem;
  line-height: 1.55;
  white-space: nowrap;
}

.legacy-workspace .brand-link:hover { color: #fff; text-decoration: none; }

.legacy-workspace .sidebar { padding-top: 0.25rem; }

.legacy-workspace .user-panel { align-items: center; }

.legacy-workspace .user-panel .info { overflow: hidden; }

#sidebar-user-label {
  overflow: hidden;
  color: #c2c7d0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-avatar {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  background: #6c757d;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
}

.user-panel .user-avatar { width: 34px; height: 34px; }

.legacy-workspace .nav-header {
  padding: 0.8rem 1rem 0.35rem;
  margin: 0;
  color: #c2c7d0;
  font-size: 0.74rem;
  font-weight: 600;
}

.legacy-workspace .nav-sidebar .nav-item { width: 100%; }

.legacy-workspace .nav-sidebar .nav-link {
  width: calc(100% - 1rem);
  margin: 0.1rem 0.5rem;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #c2c7d0;
  text-align: left;
}

.legacy-workspace .nav-sidebar .nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

.legacy-workspace .nav-sidebar .nav-link.active { color: #fff; background: #007bff; }

.legacy-workspace .nav-sidebar .nav-link p { margin: 0; }

.icon-action {
  border: 0;
  background: transparent;
}

.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  border: 0;
  background: transparent;
  color: #343a40;
}

.legacy-workspace .content-wrapper {
  min-height: 100vh;
  margin-left: 250px;
  padding-top: 57px;
  background: var(--page-bg);
}

.legacy-workspace .content-header { padding: 1rem 0.5rem; }

.legacy-workspace .content-header h1 { color: #343a40; font-size: 1.55rem; font-weight: 400; }

.breadcrumb-label { color: #6c757d; font-size: 0.86rem; }

.legacy-workspace .content { padding: 0 0.5rem 1rem; }

.legacy-workspace .main-footer {
  min-height: 57px;
  margin-left: 250px;
  padding: 1rem;
  color: #869099;
  border-top: 1px solid #dee2e6;
  background: #fff;
  font-size: 0.83rem;
}

.legacy-workspace .card { border-radius: 3px; box-shadow: none; }

.legacy-workspace .card-header { min-height: 48px; padding: 0.8rem 1rem; }

.legacy-workspace .card-title { font-size: 1rem; font-weight: 600; }

.legacy-workspace .card-footer { border-top-color: #e9ecef; background: #fff; }

.workspace { margin-bottom: 1rem; }

.workspace-overview { margin-bottom: 1rem; }

.overview-card .card-body { min-height: 240px; }

.overview-card h2 { margin-bottom: 0.55rem; }

.quick-stats strong {
  display: block;
  color: #007bff;
  font-size: 1.75rem;
  font-weight: 600;
}

.quick-stats span {
  display: block;
  color: #6c757d;
  font-size: 0.84rem;
}

.preview-card .card-body { padding: 0; }

.preview-stage {
  position: relative;
  min-height: 220px;
  height: 220px;
  overflow: hidden;
  background-color: #ebeff2;
}

#skin-preview-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#skin-preview-canvas:active { cursor: grabbing; }

.preview-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  margin: 0;
  color: #6c757d;
  font-size: 0.85rem;
  pointer-events: none;
  text-align: center;
}

.preview-card.has-texture .preview-empty { display: none; }

.dashboard-score-card .info-box { min-height: 88px; }

.score-display #current-score {
  margin: 0.35rem 0;
  color: #007bff;
  font-family: Minecraft, sans-serif;
  font-size: 3.2rem;
  line-height: 1.1;
}

.message {
  position: fixed;
  z-index: 1100;
  top: 68px;
  right: 1rem;
  display: none;
  width: min(420px, calc(100vw - 2rem));
  padding: 0.72rem 1rem;
  margin: 0 0 1rem;
  border: 1px solid transparent;
  border-radius: 3px;
}

.message.error,
.message.success { display: block; }

.message.error { color: #721c24; border-color: #f5c6cb; background: #f8d7da; }

.message.success { color: #155724; border-color: #c3e6cb; background: #d4edda; }

.service-status {
  color: #28a745;
  font-size: 0.79rem;
  white-space: nowrap;
}

.service-status .fa-circle { font-size: 0.58rem; }

.service-status.offline { color: #dc3545; }

/* Dynamic content generated by app.js. */
.data-list { display: grid; gap: 0.8rem; }

.empty-state {
  padding: 1.5rem;
  margin: 0;
  color: #6c757d;
  border: 1px dashed #ced4da;
  border-radius: 3px;
  text-align: center;
}

.data-row,
.admin-row {
  border: 1px solid #dee2e6;
  border-radius: 3px;
  background: #fff;
}

.data-row { padding: 1rem; }

.player-row { display: grid; grid-template-columns: minmax(150px, 0.75fr) minmax(300px, 2fr) auto; gap: 1rem; align-items: end; }

.row-heading { display: grid; gap: 0.25rem; align-self: center; }

.row-heading strong { color: #343a40; font-size: 1rem; }

.row-heading code,
.admin-row code { color: #6c757d; font-size: 0.72rem; word-break: break-all; }

.player-editor,
.texture-editor { display: grid; gap: 0.6rem; }

.player-editor { grid-template-columns: minmax(110px, 1fr) minmax(130px, 1fr) minmax(130px, 1fr) auto; align-items: end; }

.player-editor label,
.texture-editor label { display: grid; gap: 0.32rem; margin: 0; color: #495057; font-size: 0.78rem; font-weight: 600; }

.player-editor input,
.player-editor select,
.texture-editor input,
.texture-editor select,
.inline-form input,
.inline-form select,
.admin-row input,
.admin-row select {
  width: 100%;
  min-height: 32px;
  padding: 0.25rem 0.5rem;
  border: 1px solid #ced4da;
  border-radius: 3px;
  background: #fff;
  color: #495057;
}

.row-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0.33rem 0.75rem;
  border: 1px solid #007bff;
  border-radius: 3px;
  background: #007bff;
  color: #fff;
  font-size: 0.82rem;
  line-height: 1.25;
}

.button:hover { background: #0069d9; border-color: #0062cc; }

.button.quiet { border-color: #6c757d; background: #fff; color: #6c757d; }

.button.quiet:hover { border-color: #5a6268; background: #6c757d; color: #fff; }

.button.danger { border-color: #dc3545; background: #dc3545; color: #fff; }

.button.danger:hover { border-color: #bd2130; background: #c82333; }

.texture-row { display: grid; grid-template-columns: 74px minmax(150px, 0.65fr) minmax(300px, 1.5fr) auto; gap: 0.9rem; align-items: start; }

.texture-preview {
  width: 74px;
  height: 74px;
  object-fit: contain;
  border: 1px solid #dee2e6;
  background: #f8f9fa;
  image-rendering: pixelated;
}

.texture-info { display: grid; gap: 0.25rem; padding-top: 0.15rem; }

.texture-info strong { word-break: break-word; }

.muted { color: #6c757d; font-size: 0.82rem; }

.texture-editor { grid-template-columns: repeat(4, minmax(105px, 1fr)) auto; align-items: end; }

.texture-editor > :first-child { min-width: 130px; }

.check-label {
  display: inline-flex !important;
  min-height: 32px;
  align-items: center;
  gap: 0.38rem;
  font-weight: 500 !important;
}

.check-label input { width: auto; min-height: 0; }

.library-row { display: grid; grid-template-columns: 74px minmax(130px, 0.65fr) minmax(170px, 1fr) minmax(170px, 1fr) auto; gap: 0.85rem; align-items: start; }

.library-row .texture-info { min-width: 0; }

.library-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.4rem; }

.guest-library-row { grid-template-columns: 74px minmax(130px, 1fr) auto auto; align-items: center; }

.library-signin { text-decoration: none; }

.library-uploader {
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: #007bff;
  font-size: 0.82rem;
  text-align: left;
}

.library-uploader:hover { color: #0056b3; text-decoration: underline; }

.library-pagination {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
}

.library-pagination .button { width: 32px; padding: 0; }

.library-page-label { min-width: 150px; text-align: center; }

.metric-list dt,
.metric-list dd { margin-bottom: 0.75rem; }

.metric-list dt { color: #6c757d; font-weight: 400; }

.metric-list dd { color: #343a40; font-weight: 600; text-align: right; }

.admin-row { display: grid; gap: 0.6rem; padding: 0.8rem; }

.admin-editor { grid-template-columns: minmax(75px, 0.7fr) minmax(150px, 1.3fr) minmax(100px, 1fr) 70px 82px auto minmax(115px, 1fr) auto auto; align-items: center; }

.admin-identity { display: grid; gap: 0.2rem; }

.compact-check { justify-content: center; }

.report-row { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; }

.user-report-row { border: 1px solid #dee2e6; border-radius: 3px; background: #fff; padding: 0.8rem; }

.oauth-row { grid-template-columns: 48px minmax(120px, 1fr) minmax(150px, 1.2fr) minmax(150px, 1.5fr) auto; align-items: center; }

.oauth-row code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.report-detail { display: grid; gap: 0.25rem; min-width: 0; }

.status-badge { padding: 0.25rem 0.45rem; border-radius: 3px; background: #ffc107; color: #212529; font-size: 0.75rem; }

.code-output {
  max-height: 190px;
  padding: 0.75rem;
  overflow: auto;
  border: 1px solid #ced4da;
  border-radius: 3px;
  background: #f8f9fa;
  color: #343a40;
  font-size: 0.8rem;
}

.notification-menu { width: min(330px, calc(100vw - 1.5rem)); max-height: min(420px, 70vh); overflow-y: auto; }

.notification-empty { padding: 0.85rem 1rem; margin: 0; text-align: center; }

.notification-item { display: flex; align-items: center; white-space: normal; }

.notification-dialog {
  width: min(520px, calc(100vw - 2rem));
  padding: 0;
  border: 1px solid #ced4da;
  border-radius: 3px;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.24);
}

.notification-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }

.notification-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 1rem; border-bottom: 1px solid #dee2e6; }

.notification-dialog-content { min-height: 2.5rem; padding: 1rem; margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }

.notification-dialog time { display: block; padding: 0 1rem 1rem; }

.callout .btn-link { color: #007bff; font-size: inherit; }

.custom-file-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Public skin library uses the same top-nav shape as the PHP skinlib page. */
#skinlib-header { display: none; }

body.guest-library .legacy-workspace { min-height: 100vh; }

body.guest-library #workspace-header,
body.guest-library .main-sidebar { display: none; }

body.guest-library #skinlib-header {
  display: flex;
  margin-left: 0;
}

body.guest-library .content-wrapper { margin-left: 0; padding-top: 57px; }

body.guest-library .main-footer { margin-left: 0; }

body.guest-library .breadcrumb-label { display: none; }

body.guest-library #workspace-overview .overview-card { border-top-color: #007bff; }

body.guest-library #workspace-overview { display: flex; }

/* Standalone skinlib pages mirror the original AdminLTE library proportions. */
.skinlib-page {
  min-height: 100vh;
  color: #343a40;
  background: #f4f6f9;
}

.skinlib-navbar {
  min-height: 57px;
  border-bottom: 1px solid #dee2e6;
  background: #fff;
}

.skinlib-navbar .container { min-height: 57px; }

.skinlib-navbar .navbar-brand {
  color: #343a40;
  font-family: Minecraft, sans-serif;
  font-size: 1.15rem;
}

.skinlib-navbar .nav-link { color: #495057; }

.skinlib-navbar .nav-link:hover,
.skinlib-navbar .nav-item.active > .nav-link { color: #007bff; }

.skinlib-navbar .icon-action {
  position: relative;
  border: 0;
  background: transparent;
}

.skinlib-navbar .navbar-badge { top: 2px; right: 2px; }

.skinlib-content-wrapper {
  min-height: calc(100vh - 110px);
  margin-left: 0;
  padding-top: 57px;
  background: #f4f6f9;
}

.skinlib-content-wrapper .content-header { padding: 15px 0; }

.skinlib-content-wrapper .content-header h1 {
  color: #343a40;
  font-size: 1.65rem;
  font-weight: 400;
}

.skinlib-library-card { border-top: 3px solid #007bff; }

.skinlib-library-card > .card-body { min-height: 300px; padding: 1.25rem 0.75rem; }

.skinlib-item-link {
  width: 245px;
  color: #343a40;
  text-decoration: none;
}

.skinlib-item-link:hover { color: #343a40; text-decoration: none; }

.skinlib-item {
  width: 245px;
  margin: 0;
  overflow: hidden;
  border: 1px solid #dee2e6;
  border-radius: 2px;
  background: #fff;
  transition: box-shadow 0.3s ease;
}

.skinlib-item:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.skinlib-item .card-body {
  background-color: #eff1f0;
}

.skinlib-card-preview {
  display: block;
  width: 100%;
  height: 210px;
  image-rendering: pixelated;
}

.skinlib-preview-source { display: none; }

.skinlib-preview-source.skinlib-card-preview-fallback {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: contain;
  image-rendering: pixelated;
}

.skinlib-item .card-footer {
  min-height: 74px;
  padding: 0.55rem 0.65rem;
  border-top: 1px solid #dee2e6;
  background: #fff;
}

.skinlib-item .card-footer .text-truncate { min-width: 0; }

.skinlib-item .fa-lock { height: 24px; }

.skinlib-item .badge { padding-top: 0.4rem; }

.skinlib-uploader {
  max-width: 100px;
  overflow: hidden;
  padding: 0.2rem 0.4rem;
  border: 0;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skinlib-like {
  flex: 0 0 auto;
  padding: 0.12rem 0.25rem;
  color: #6c757d;
  border: 0;
  background: transparent;
  font-size: 0.9rem;
}

.skinlib-like:hover,
.skinlib-like.liked { color: #dc3545; }

.skinlib-like .fa-heart { transition: transform 0.15s ease; }

.skinlib-like:hover .fa-heart { transform: scale(1.12); }

.skinlib-filter-dropdown .dropdown-menu { min-width: 8rem; }

.skinlib-filter-dropdown .dropdown-item.active,
.skinlib-filter-dropdown .dropdown-item:active { color: #fff; background: #007bff; }

.skinlib-library-card .btn.bg-olive { border-color: #6b7d23; }

.skinlib-library-card .btn.bg-olive.active,
.skinlib-library-card .btn.bg-olive:hover { color: #fff; background: #4f6218; }

.skinlib-viewer-card { border-top: 3px solid #007bff; }

.skinlib-viewer-canvas {
  position: relative;
  min-height: 500px;
  height: min(62vw, 570px);
  overflow: hidden;
  background: #eff1f0;
}

.skinlib-viewer-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.skinlib-viewer-canvas canvas:active { cursor: grabbing; }

.skinlib-viewer-canvas .preview-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(90%, 320px);
  margin: 0;
  color: #6c757d;
  text-align: center;
  transform: translate(-50%, -50%);
}

.skinlib-preview-tools { display: flex; gap: 0.25rem; }

.skinlib-icon-button {
  width: 30px;
  height: 30px;
  padding: 0;
  color: #6c757d;
  border: 0;
  background: transparent;
}

.skinlib-icon-button:hover,
.skinlib-icon-button.active { color: #007bff; }

.skinlib-color-controls { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.7rem; }

.btn-color {
  display: inline-flex;
  width: 40px;
  height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #adb5bd;
  border-radius: 999px;
}

.btn-color.bg-white { background: #fff; }
.btn-color.bg-black { background: #111; }
.btn-color.bg-gray { background: #6c757d; }
.btn-color.bg-green { color: #fff; background: #6b7d23; }

.skinlib-detail-likes { display: inline-flex; align-items: center; margin-left: auto; }

.skinlib-detail-editable {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.35rem;
}

.skinlib-detail-edit {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  color: #6c757d;
  border: 0;
  background: transparent;
}

.skinlib-detail-edit:hover { color: #007bff; }

.skinlib-action-dialog {
  width: min(520px, calc(100vw - 2rem));
  max-height: min(720px, calc(100vh - 2rem));
  padding: 0;
  color: #343a40;
  border: 1px solid #ced4da;
  border-radius: 4px;
  box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.22);
}

.skinlib-action-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }

.skinlib-action-dialog-header,
.skinlib-action-dialog-footer {
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 0.75rem 1rem;
  border-color: #dee2e6;
}

.skinlib-action-dialog-header {
  justify-content: space-between;
  border-bottom: 1px solid #dee2e6;
}

.skinlib-action-dialog-footer {
  justify-content: flex-end;
  gap: 0.5rem;
  border-top: 1px solid #dee2e6;
}

.skinlib-action-dialog-body {
  max-height: min(500px, calc(100vh - 165px));
  padding: 1rem;
  overflow-y: auto;
}

.skinlib-dialog-form label { display: block; margin: 0; font-weight: 600; }
.skinlib-dialog-form input,
.skinlib-dialog-form select { margin-top: 0.45rem; font-weight: 400; }

.skinlib-player-list { display: grid; gap: 0.5rem; max-height: 332px; overflow-y: auto; }

.skinlib-player-choice {
  display: flex;
  align-items: center;
  min-height: 52px;
  margin: 0;
}

.skinlib-player-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
}

.skinlib-footer { margin-left: 0; padding: 0.8rem 0; background: #343a40; }

.skinlib-footer .container { color: #fff; }

body[data-theme='dark'] .skinlib-page,
body[data-theme='dark'] .skinlib-content-wrapper { color: #f8f9fa; background: #454d55; }

body[data-theme='dark'] .skinlib-navbar,
body[data-theme='dark'] .skinlib-item,
body[data-theme='dark'] .skinlib-item .card-footer,
body[data-theme='dark'] .skinlib-viewer-card,
body[data-theme='dark'] .skinlib-content-wrapper .card { color: #f8f9fa; border-color: #56606a; background: #343a40; }

body[data-theme='dark'] .skinlib-navbar .navbar-brand,
body[data-theme='dark'] .skinlib-navbar .nav-link,
body[data-theme='dark'] .skinlib-content-wrapper .content-header h1 { color: #f8f9fa; }

body[data-theme='dark'] .skinlib-action-dialog {
  color: #f8f9fa;
  border-color: #56606a;
  background: #343a40;
}

body[data-theme='dark'] .skinlib-action-dialog-header,
body[data-theme='dark'] .skinlib-action-dialog-footer { border-color: #56606a; }

body[data-theme='dark'] .skinlib-detail-edit { color: #ced4da; }

@media (max-width: 767.98px) {
  .skinlib-item-link,
  .skinlib-item { width: calc(50vw - 1.3rem); max-width: 245px; }

  .skinlib-item .card-body { width: 100%; }

  .skinlib-card-preview,
  .skinlib-preview-source.skinlib-card-preview-fallback { height: auto; aspect-ratio: 245 / 210; }

  .skinlib-viewer-canvas { min-height: 320px; height: 74vw; }

  .skinlib-content-wrapper { padding-top: 57px; }
}

@media (max-width: 420px) {
  .skinlib-item-link,
  .skinlib-item { width: calc(50vw - 0.9rem); }

  .skinlib-item .card-footer { min-height: 82px; }

  .skinlib-uploader { max-width: 82px; }
}

/* Dark mode matches the AdminLTE dark surface without changing page structure. */
body[data-theme='dark'] { --page-bg: #454d55; --text: #f8f9fa; --muted: #ced4da; --card: #343a40; }

body[data-theme='dark'] .legacy-workspace .content-wrapper,
body[data-theme='dark'] .legacy-workspace { background: #454d55; }

body[data-theme='dark'] .legacy-workspace .main-header,
body[data-theme='dark'] .legacy-workspace .main-footer,
body[data-theme='dark'] .legacy-workspace .card,
body[data-theme='dark'] .data-row,
body[data-theme='dark'] .admin-row { color: #f8f9fa; border-color: #56606a; background: #343a40; }

body[data-theme='dark'] .legacy-workspace .content-header h1,
body[data-theme='dark'] .user-menu-trigger,
body[data-theme='dark'] .row-heading strong,
body[data-theme='dark'] .metric-list dd { color: #f8f9fa; }

body[data-theme='dark'] .legacy-workspace .card-footer { border-color: #56606a; background: #343a40; }

body[data-theme='dark'] .player-editor input,
body[data-theme='dark'] .player-editor select,
body[data-theme='dark'] .texture-editor input,
body[data-theme='dark'] .texture-editor select,
body[data-theme='dark'] .inline-form input,
body[data-theme='dark'] .inline-form select,
body[data-theme='dark'] .admin-row input,
body[data-theme='dark'] .admin-row select { color: #f8f9fa; border-color: #6c757d; background: #454d55; }

body[data-theme='dark'] .button.quiet { border-color: #adb5bd; background: #343a40; color: #adb5bd; }

body[data-theme='dark'] .preview-stage { background-color: #2b3035; }

body[data-theme='dark'] .standalone-page,
body[data-theme='dark'] .standalone-navbar,
body[data-theme='dark'] .standalone-content .card,
body[data-theme='dark'] .standalone-content .user-report-row { color: #f8f9fa; border-color: #56606a; background: #343a40; }

body[data-theme='dark'] .standalone-content h1 { color: #f8f9fa; }

body[data-theme='dark'] .notification-dialog { color: #f8f9fa; border-color: #56606a; background: #343a40; }

body[data-theme='dark'] .notification-dialog-header { border-color: #56606a; }

body[data-theme='dark'] .library-uploader { color: #78b8ff; }

@media (max-width: 991.98px) {
  .legacy-workspace .main-header,
  .legacy-workspace .content-wrapper,
  .legacy-workspace .main-footer { margin-left: 0; }

  .legacy-workspace .main-sidebar {
    transform: translateX(-250px);
    transition: transform 0.2s ease;
  }

  body.sidebar-open .legacy-workspace .main-sidebar { transform: translateX(0); }

  body.sidebar-open::after {
    position: fixed;
    z-index: 1037;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    content: '';
  }

  .workspace-overview > [class*='col-'] + [class*='col-'] { margin-top: 1rem; }

  .player-row,
  .texture-row,
  .library-row,
  .guest-library-row { grid-template-columns: 74px minmax(0, 1fr); }

  .player-row .row-heading,
  .player-row .player-editor,
  .player-row .row-actions,
  .texture-row .texture-editor,
  .texture-row .row-actions,
  .library-row .library-action,
  .library-row > .button,
  .guest-library-row > .button,
  .guest-library-row > a { grid-column: 1 / -1; }

  .texture-row .texture-info,
  .library-row .texture-info,
  .guest-library-row .texture-info { grid-column: 2; }

  .player-editor,
  .texture-editor { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .oauth-row { grid-template-columns: 1fr 1fr; }

  .oauth-row > :last-child { grid-column: 1 / -1; }

  .player-editor .button,
  .texture-editor .button { grid-column: 1 / -1; }
}

@media (max-width: 575.98px) {
  .home-navbar .navbar-brand { font-size: 1.1rem; }

  .home-navbar .nav-link { padding-right: 0.45rem; padding-left: 0.45rem; font-size: 0.82rem; }

  .home-hero { min-height: calc(100vh - 60px); }

  .splash-head { font-size: 2.2rem; }

  .splash-actions { display: grid; width: min(280px, 100%); margin: auto; }

  .home-footer .container { gap: 0.4rem; }

  .legacy-workspace .content-header { padding-top: 0.8rem; }

  .legacy-workspace .content-header h1 { font-size: 1.28rem; }

  .legacy-workspace .card-header { gap: 0.55rem; }

  .legacy-workspace .form-inline { width: 100%; }

  .legacy-workspace .form-inline .form-control { flex: 1 1 120px; width: auto; }

  .player-row,
  .texture-row,
  .library-row,
  .guest-library-row,
  .player-editor,
  .texture-editor,
  .library-action,
  .admin-editor,
  .report-row,
  .oauth-row { grid-template-columns: 1fr; }

  .texture-preview { width: 88px; height: 88px; }

  .texture-row .texture-info,
  .library-row .texture-info,
  .guest-library-row .texture-info { grid-column: auto; }

  .player-row .row-heading,
  .player-row .player-editor,
  .player-row .row-actions,
  .texture-row .texture-editor,
  .texture-row .row-actions,
  .library-row .library-action,
  .library-row > .button,
  .guest-library-row > .button,
  .guest-library-row > a { grid-column: auto; }

  .row-actions .button { flex: 1 1 auto; }

  .preview-stage { height: 250px; }

  .service-status { display: none; }

  .standalone-preview { min-height: 280px; height: 280px; }
}
