:root {
  --bg: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --border: #e2e8f0;
  --border-subtle: #edf2f7;

  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --link-color: #0066cc;

  --brand-blue: #0066cc;
  --brand-blue-hover: #0055b3;
  --brand-badge-bg: rgba(0, 102, 204, 0.08);

  --star-color: #f59e0b;
  --badge-war-bg: #fee2e2;
  --badge-war-text: #b91c1c;
  --badge-th-bg: #eff6ff;
  --badge-th-text: #1d4ed8;
  --badge-green-bg: #ecfdf5;
  --badge-green-text: #047857;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-pill: 980px;

  /* 8-Point Spatial Grid Tokens (Apple-Style Clean & Airy) */
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 40px;
  --space-3xl: 48px;
  --space-4xl: 64px;

  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Montserrat", "Open Sans", Helvetica, Arial, sans-serif;
  --transition-apple: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

html.dark {
  --bg: #090a0f;
  --bg-subtle: #111318;
  --bg-card: #151821;
  --bg-card-hover: #1e222e;
  --border: #242938;
  --border-subtle: #191d28;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --link-color: #2997ff;

  --brand-blue: #2997ff;
  --brand-blue-hover: #47a3ff;
  --brand-badge-bg: rgba(41, 151, 255, 0.15);

  --star-color: #fbbf24;
  --badge-war-bg: rgba(239, 68, 68, 0.15);
  --badge-war-text: #f87171;
  --badge-th-bg: rgba(59, 130, 246, 0.15);
  --badge-th-text: #60a5fa;
  --badge-green-bg: rgba(16, 185, 129, 0.15);
  --badge-green-text: #34d399;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--link-color);
}

/* Base Typography Scale */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-primary);
  font-family: var(--font-main);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.02em;
  margin-top: 0;
  margin-bottom: 16px;
}

h1 {
  font-size: 1.45rem;
  font-weight: 600;
  margin-bottom: 24px;
}

h2 {
  font-size: 1.25rem;
  margin-bottom: 16px;
}

h3 {
  font-size: 1.1rem;
}

h4 {
  font-size: 1rem;
}

h5 {
  font-size: 0.9rem;
}

h6 {
  font-size: 0.825rem;
}

@media (min-width: 768px) {
  h1 {
    font-size: 1.75rem;
    margin-bottom: 32px;
  }

  h2 {
    font-size: 1.4rem;
  }
}

p {
  margin-bottom: 1rem;
}

.container {
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 12px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 64px;
}

.brand-logo {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-self: start;
}

.header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
}

.brand-logo-img {
  display: block;
  width: 109px;
  height: 16px;
  aspect-ratio: 109 / 16;
}

.logo-text {
  font-family: cursive;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.logo-text span,
.logo-text strong {
  color: var(--brand-blue);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 10px;
}

.btn-header-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  background: var(--brand-blue);
  color: #ffffff;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-apple);
  white-space: nowrap;
}

.btn-header-add:hover {
  background: var(--brand-blue-hover);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.25);
}

.btn-header-add:active {
  transform: translateY(0);
}

.btn-header-add-icon {
  flex-shrink: 0;
}

.btn-header-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-apple);
  white-space: nowrap;
}

.btn-header-login:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  background: var(--bg-hover);
}

.btn-header-login:active {
  transform: translateY(0);
}

.btn-header-login-icon {
  flex-shrink: 0;
}

.header-user-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.btn-header-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: var(--transition-apple);
  outline: none;
  overflow: hidden;
}

.btn-header-avatar:hover,
.btn-header-avatar.active {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2);
}

.header-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.header-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-apple);
}

.theme-toggle:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}

/* Speedbar */
.speedbar-wrapper {
  padding-top: 16px;
  padding-bottom: 0;
}

.speedbar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 0;
}

.speedbar::-webkit-scrollbar {
  display: none;
}

.speedbar-link,
.speedbar-separator,
.speedbar-current {
  flex-shrink: 0;
  white-space: nowrap;
}

.speedbar-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-apple);
}

.speedbar-link:hover {
  color: var(--brand-blue);
}

.speedbar-separator {
  color: var(--text-tertiary);
}

.speedbar-current {
  color: var(--text-primary);
  font-weight: 500;
}

/* Main */
.site-main {
  flex: 1;
  padding-top: 24px;
  padding-bottom: 48px;
}

@media (min-width: 768px) {
  .site-main {
    padding-top: 16px;
    padding-bottom: 64px;
  }
}

/* Hero Section */
.hero {
  padding: 16px 0 32px;
  text-align: center;
}

.hero-h1 {
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

@media (min-width: 640px) {
  .hero-h1 {
    font-size: 2.5rem;
  }
}

.hero-sub {
  font-size: 0.98rem;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto;
  font-weight: 400;
  line-height: 1.5;
}

/* Sections */
.home-section {
  margin-bottom: 40px;
}

@media (min-width: 768px) {
  .home-section {
    margin-bottom: 48px;
  }
}

.section-title {
  margin-bottom: 16px;
}

.section-title-link {
  color: var(--link-color);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.section-title-link:hover {
  color: var(--brand-blue-hover);
  opacity: 0.85;
}

/* Hall Grid: 2 columns on mobile, 4 on desktop (min-width: 860px) */
.th-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (min-width: 860px) {
  .th-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
  }
}

/* Hall Card */
.th-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 12px;
}

.th-card:hover {
  background: var(--bg-card-hover);
  border-color: #cbd5e1;
}

html.dark .th-card:hover {
  border-color: #334155;
}

.th-icon-box {
  width: 150px;
  height: 150px;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.th-badge-icon {
  width: 150px;
  height: 150px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
}

.th-name {
  font-size: 0.9rem;
  letter-spacing: -0.015em;
  color: var(--link-color);
  line-height: 1.35;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.th-card:hover .th-name {
  color: var(--brand-blue-hover);
}


/* Platform Overview Block */
.platform-overview {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 16px;
  margin-bottom: 32px;
}

@media (min-width: 768px) {
  .platform-overview {
    padding: 32px;
    margin-bottom: 48px;
  }
}

/* Category About / Editorial Guide Block (Bottom) */
.category-about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 32px;
  margin-bottom: 48px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.category-about-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.category-about-media {
  flex-shrink: 0;
}

.category-about-icon-wrap {
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
}

.category-about-icon {
  width: 100px;
  height: 100px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.12));
}

html.dark .category-about-icon {
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.45));
}

.category-about-content {
  flex: 1;
  min-width: 0;
}

.category-about-content p {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.category-about-content p:last-child {
  margin-bottom: 0;
}

.category-about-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.category-about-content ul {
  list-style: none;
  padding: 0;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-about-content li {
  position: relative;
  padding-left: 20px;
  font-size: 0.91rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.category-about-content li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-blue);
}

@media (min-width: 768px) {
  .category-about-card {
    padding: 32px;
    margin-top: 40px;
    margin-bottom: 64px;
  }

  .category-about-inner {
    flex-direction: row;
    align-items: flex-start;
    gap: 32px;
  }
}

.overview-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.overview-desc {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 10px;
}

.overview-desc:last-child {
  margin-bottom: 0;
}

/* Footer */
.site-footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  padding: 40px 0 24px;
  margin-top: auto;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 32px;
}

.footer-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
  max-width: 320px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  transition: var(--transition-apple);
}

.footer-links a:hover {
  color: var(--brand-blue);
}

.footer-languages {
  padding: 16px 0;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: center;
}

.footer-lang-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  font-size: 13px;
}

.footer-lang-item {
  color: var(--link-color);
}

.footer-lang-item.active {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
}

.footer-lang-item.passive {
  color: var(--text-muted, #718096);
  opacity: 0.55;
  text-decoration: underline dotted;
}

.footer-lang-item.passive:hover {
  opacity: 0.95;
  color: var(--brand-blue);
  text-decoration: underline;
}

.footer-lang-item.passive.active {
  color: var(--text-secondary, #a0aec0);
  font-weight: 600;
  opacity: 0.85;
}

.footer-lang-sep {
  color: var(--border);
  user-select: none;
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  .header-inner {
    gap: 12px;
  }
}



/* Bases Grid: 2 columns on mobile/tablet, 3 columns on desktop */
.bases-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

@media (min-width: 768px) {
  .bases-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 48px;
  }
}

/* Base Card (Single Link Card) - 0-width border via ring shadow for exact 320px inner content */
.base-card {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 0 0 1px var(--border), 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.2s ease;
  position: relative;
}

.base-card:hover {
  box-shadow: 0 0 0 1.5px var(--brand-blue), 0 4px 16px -2px rgba(0, 102, 204, 0.12);
}

html.dark .base-card:hover {
  box-shadow: 0 0 0 1.5px var(--brand-blue), 0 4px 16px -2px rgba(0, 102, 204, 0.35);
}

.base-thumb-box {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--bg-subtle) url('../images/no-image.png') center / cover no-repeat;
  overflow: hidden;
}

.base-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: -webkit-optimize-contrast;
}

/* Base Card Stats Bar */
.base-card-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  gap: 12px;
}

.base-stats-group {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.base-stat-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.base-stat-icon {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.base-stat-rating {
  color: var(--text-primary);
  font-weight: 700;
}

.base-stat-rating .star-icon {
  color: #f59e0b;
}

.base-stat-val {
  line-height: 1;
}

@media (max-width: 480px) {
  .base-card-stats {
    padding: 7px 9px;
    gap: 6px;
  }

  .base-stats-group {
    gap: 8px;
  }

  .base-stat-item {
    font-size: 11px;
    gap: 3px;
  }

  .base-stat-icon {
    width: 11px;
    height: 11px;
  }

  .btn-header-add {
    padding: 0 10px;
    font-size: 12px;
    gap: 4px;
  }
}

.btn-copy-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--brand-blue);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-copy-link:hover {
  background: var(--brand-blue-hover);
  color: #ffffff;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 32px;
}

.empty-state-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-state-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Single Base Detail View styles moved to base-layout.css
   Loaded conditionally on [aviable=base] to optimize global page weight.
   ========================================================================== */

/* Pagination Component */
.pagination-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 40px;
  margin-bottom: 40px;
}

@media (min-width: 768px) {
  .pagination-wrap {
    margin-top: 48px;
    margin-bottom: 48px;
  }
}

.pagination-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 7px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.pagination-link:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

.pagination-link.active {
  background: var(--brand-blue);
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(0, 102, 204, 0.25);
}

.pagination-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 36px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
  user-select: none;
}

/* Global Center Toast Notification (Theme-Adaptive Frosted Glass HUD) */
.toast-notification {
  --toast-glow: rgba(16, 185, 129, 0.32);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  max-width: min(280px, calc(100vw - 40px));
  padding: 16px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 24px 50px -10px rgba(15, 23, 42, 0.16),
              0 0 32px -4px var(--toast-glow),
              inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              box-shadow 0.22s ease,
              visibility 0.22s;
  z-index: 100000;
  text-align: center;
  user-select: none;
}

.toast-notification.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
  cursor: pointer;
}

/* Status Glow Palettes */
.toast-notification.star { --toast-glow: rgba(245, 158, 11, 0.35); }
.toast-notification.error { --toast-glow: rgba(239, 68, 68, 0.35); }

/* Dark Theme Overrides */
html.dark .toast-notification {
  background: rgba(26, 32, 44, 0.94);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 50px -10px rgba(0, 0, 0, 0.65),
              0 0 36px -4px var(--toast-glow),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* 3D Icon Badges */
.toast-hud-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin-bottom: 8px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 6px 14px -2px rgba(16, 185, 129, 0.4),
              inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.toast-hud-icon svg {
  width: 18px;
  height: 18px;
}

.toast-hud-icon.star {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  box-shadow: 0 6px 14px -2px rgba(245, 158, 11, 0.45),
              inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.toast-hud-icon.error {
  background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
  box-shadow: 0 6px 14px -2px rgba(239, 68, 68, 0.45),
              inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.toast-hud-text {
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.35;
  color: inherit;
  word-break: break-word;
}

/* ==========================================================================
   Auth Modal Content Styles (inside #coc_popup.auth-modal)
   ========================================================================== */
#coc_popup.auth-modal .form-group {
  margin-bottom: 12px;
}

/* OAuth Container in Modal */
.auth-modal .oauth-providers-box {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 14px;
}

.auth-modal .btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  box-sizing: border-box;
}

.auth-modal .btn-oauth:active {
  transform: scale(0.99);
}

.auth-modal .btn-oauth .oauth-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: block;
}

.auth-modal .btn-oauth-google {
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
}

.auth-modal .btn-oauth-google:hover {
  background: #f8f9fa;
  border-color: #d2d5d9;
  box-shadow: 0 2px 6px rgba(60, 64, 67, 0.15);
  color: #1f1f1f;
}

.auth-modal .btn-oauth-facebook {
  background: #1877f2;
  color: #ffffff;
  border: 1px solid #1877f2;
}

.auth-modal .btn-oauth-facebook:hover {
  background: #166fe5;
  border-color: #166fe5;
  color: #ffffff;
}

.auth-modal .btn-oauth-discord {
  background: #5865f2;
  color: #ffffff;
  border: 1px solid #5865f2;
}

.auth-modal .btn-oauth-discord:hover {
  background: #4752c4;
  border-color: #4752c4;
  color: #ffffff;
}

html.dark .auth-modal .btn-oauth-google {
  background: #1e232d;
  color: #f3f4f6;
  border-color: #2e3644;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

html.dark .auth-modal .btn-oauth-google:hover {
  background: #262c38;
  border-color: #3b4556;
  color: #ffffff;
}

html.dark .auth-modal .btn-oauth-facebook {
  background: #1877f2;
  color: #ffffff;
  border-color: #1877f2;
}

html.dark .auth-modal .btn-oauth-facebook:hover {
  background: #166fe5;
  border-color: #166fe5;
}

html.dark .auth-modal .btn-oauth-discord {
  background: #5865f2;
  color: #ffffff;
  border-color: #5865f2;
}

html.dark .auth-modal .btn-oauth-discord:hover {
  background: #4752c4;
  border-color: #4752c4;
}

/* Modal Divider */
.auth-modal .auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0;
  color: var(--text-muted, #9ca3af);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.auth-modal .auth-divider::before,
.auth-modal .auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.auth-modal .auth-divider span {
  padding: 0 12px;
}

.auth-modal .form-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.auth-modal .required-asterisk {
  color: #ef4444;
  margin-left: 2px;
  font-weight: 700;
}

/* Modal Input with Icons */
.input-with-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-with-icon-wrapper .input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted, #9ca3af);
  pointer-events: none;
  flex-shrink: 0;
}

.input-with-icon-wrapper .form-input.with-icon {
  padding-left: 40px;
  padding-right: 40px;
  height: 42px;
  width: 100%;
  border-radius: 9px;
  font-size: 14px;
  box-sizing: border-box;
}

.btn-toggle-password {
  position: absolute;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  color: var(--text-muted, #9ca3af);
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s ease;
}

.btn-toggle-password:hover {
  color: var(--text-primary);
}

.btn-modal-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  margin-top: 14px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.auth-modal-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-switch-link {
  color: var(--brand-blue, #0066cc);
  font-weight: 700;
  text-decoration: none;
  margin-left: 4px;
}

.auth-switch-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Stripe-Style 4-Digit Email Verification (OTP) UI
   ========================================================================== */
.auth-verify-view {
  animation: authFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-verify-desc {
  margin: 0 0 16px 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  text-align: center;
}

@keyframes authFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-verify-email-target {
  display: inline-block;
  margin-top: 4px;
  color: var(--text, #111827);
  font-weight: 700;
  word-break: break-all;
}

.otp-inputs-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 22px 0 24px;
}

.otp-digit-input {
  width: 58px;
  height: 64px;
  border-radius: 12px;
  border: 1.5px solid var(--border, #d1d5db);
  background: var(--bg-soft, #f9fafb);
  color: var(--text, #111827);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  line-height: 1;
  caret-color: var(--brand-blue, #0066cc);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, transform 0.12s ease;
  -moz-appearance: textfield;
}

.otp-digit-input::-webkit-outer-spin-button,
.otp-digit-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.otp-digit-input:focus {
  background: var(--bg-card, #ffffff);
  border-color: var(--brand-blue, #0066cc);
  box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.14);
  transform: translateY(-1px);
}

.otp-digit-input.is-filled {
  background: var(--bg-card, #ffffff);
  border-color: #9ca3af;
}

.otp-digit-input.is-error {
  border-color: #dc2626 !important;
  background: rgba(220, 38, 38, 0.04);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
  animation: otpShake 0.34s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.otp-digit-input.is-success {
  border-color: #16a34a !important;
  background: rgba(22, 163, 74, 0.06);
  color: #15803d;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

@keyframes otpShake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}

html.dark .otp-digit-input {
  background: #141923;
  border-color: #2b3548;
  color: #f8fafc;
}

html.dark .otp-digit-input:focus {
  background: #1a2130;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.22);
}

html.dark .otp-digit-input.is-filled {
  background: #1a2130;
  border-color: #475569;
}

html.dark .otp-digit-input.is-success {
  border-color: #22c55e !important;
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
}

.auth-verify-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  font-size: 13px;
}

.btn-otp-resend {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-blue, #0066cc);
  cursor: pointer;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.btn-otp-resend:hover:not(:disabled) {
  text-decoration: underline;
}

.btn-otp-resend:disabled {
  color: var(--text-muted, #9ca3af);
  cursor: default;
  font-weight: 500;
}

.auth-verify-sep {
  color: var(--text-muted, #9ca3af);
  user-select: none;
}

.link-otp-change-email {
  color: var(--text-secondary, #4b5563);
  font-weight: 600;
  text-decoration: none;
}

.link-otp-change-email:hover {
  color: var(--text, #111827);
  text-decoration: underline;
}

/* ==========================================================================
   User Account Dropdown Menu (AJAX Loaded)
   ========================================================================== */
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 260px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.04);
  z-index: 1000;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.97);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: top right;
}

.user-dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

html.dark .user-dropdown-menu {
  background: #171b22;
  border-color: #28303d;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 12px 14px;
}

.user-dropdown-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.user-dropdown-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-dropdown-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.user-dropdown-meta {
  min-width: 0;
  flex: 1;
}

.user-dropdown-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.user-dropdown-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  min-width: 0;
}

.user-dropdown-email {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.user-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.4;
  white-space: nowrap;
}

.user-role-badge.badge-admin {
  background: rgba(220, 38, 38, 0.12);
  color: #ef4444;
  border: 1px solid rgba(220, 38, 38, 0.25);
}

.user-role-badge.badge-editor {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.user-role-badge.badge-member {
  background: rgba(0, 102, 204, 0.1);
  color: var(--brand-blue);
  border: 1px solid rgba(0, 102, 204, 0.2);
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.user-dropdown-items {
  display: flex;
  flex-direction: column;
  padding: 2px 6px;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  cursor: pointer;
}

.user-dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--brand-blue);
}

.user-dropdown-item-icon {
  flex-shrink: 0;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.user-dropdown-item:hover .user-dropdown-item-icon {
  color: var(--brand-blue);
}

.user-dropdown-item-admin {
  font-weight: 600;
  color: #ef4444;
}

.user-dropdown-item-admin .user-dropdown-item-icon {
  color: #ef4444;
}

.user-dropdown-item-admin:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.user-dropdown-item-admin:hover .user-dropdown-item-icon {
  color: #dc2626;
}

.user-dropdown-item-analytics {
  font-weight: 600;
  color: #8b5cf6;
}

.user-dropdown-item-analytics .user-dropdown-item-icon {
  color: #8b5cf6;
}

.user-dropdown-item-analytics:hover {
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
}

.user-dropdown-item-analytics:hover .user-dropdown-item-icon {
  color: #7c3aed;
}

.user-dropdown-item-logout {
  color: var(--text-secondary);
}

.user-dropdown-item-logout:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
}

.user-dropdown-item-logout:hover .user-dropdown-item-icon {
  color: #ef4444;
}

@media (max-width: 480px) {
  .btn-header-login-text {
    display: none;
  }
  .btn-header-login {
    padding: 0 8px;
    width: 36px;
  }
  .auth-modal {
    padding: 12px;
  }
  .auth-modal-card {
    padding: 26px 18px;
    border-radius: 16px;
  }
  .user-dropdown-menu {
    right: 0;
    width: calc(100vw - 32px);
    max-width: 270px;
  }
}

/* ==========================================================================
   Hub Subcategory Directory (/town-hall/ & /builder-hall/)
   ========================================================================== */
.hub-directory-section {
  margin-top: 48px;
}

.hub-dir-list {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  box-shadow: 0 0 0 1px var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.hub-dir-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.hub-dir-row:last-child {
  border-bottom: none;
}

.hub-dir-level {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 176px;
  flex-shrink: 0;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  transition: color 0.15s ease;
}

.hub-dir-level:hover {
  color: var(--brand-blue);
}

.hub-dir-thumb {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.hub-dir-level-name {
  white-space: nowrap;
}

.hub-dir-level-cnt {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--text-tertiary, #94a3b8);
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.hub-dir-subcats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.hub-dir-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.hub-dir-pill svg {
  flex-shrink: 0;
  color: var(--text-tertiary, #94a3b8);
  transition: color 0.15s ease;
}

.hub-dir-pill-cnt {
  font-size: 0.7rem;
  color: var(--text-tertiary, #94a3b8);
  font-variant-numeric: tabular-nums;
}

.hub-dir-pill:hover {
  background: rgba(0, 113, 227, 0.1);
  color: var(--brand-blue);
  box-shadow: 0 0 0 1px rgba(0, 113, 227, 0.25);
}

.hub-dir-pill:hover svg,
.hub-dir-pill:hover .hub-dir-pill-cnt {
  color: var(--brand-blue);
}

@media (max-width: 720px) {
  .hub-dir-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px;
  }

  .hub-dir-level {
    min-width: 0;
  }
}