/* === TERMINAL FONT === */
@font-face {
  font-family: 'Modenine-2OPd';
  src: url('fonts/Modenine-2OPd.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* GLOBAL */
body {
  font-family: 'Modenine-2OPd', monospace !important;
}

/* ALL KEY ELEMENTS */
.logo-wrapper,
.logo-main,
.logo-abbrev,
.categories_title,
.stats_title,
.donate-section,
.category-title,
.category-name,
.stat-label,
.footer-buttons .footer-button {
  font-family: 'Modenine-2OPd', monospace !important;
}

/* Modal content fonts */
.modal-content,
.modal-content ,
.modal-content h2,
.modal-content h3,
.modal-content h4,
.modal-content h5,
.modal-content h6,
.modal-content p,
.modal-content span,
.modal-content a,
.service-title,
.service-name {
  font-family: 'Modenine-2OPd', monospace !important;
}

/* Body styles and theme transitions */
body {
  margin: 0;
  font-family: sans-serif;
  transition: background .3s cubic-bezier(.4,0,.2,1),color .3s cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow-x: hidden;
  will-change: background,color;
  backface-visibility: hidden
}

/* Canvas background */
canvas#bgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  pointer-events: none;
  will-change: opacity
}

/* Dark and light theme backgrounds */
body.dark {
  background: #111;
  color: #eee
}
body.light {
  background: #fff;
  color: #222
}

/* Header layout */
header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  position: relative;
  will-change: transform
}

/* Site logo styles */
.site-logo-text {
  font-weight: 700;
  font-size: 1.5rem;
  text-align: center;
  flex: none
}

/* Top right buttons */
.top-buttons {
  position: absolute;
  right: 1rem;
  display: flex;
  gap: 10px;
  align-items: center;
  will-change: opacity
}

/* Language toggle button */
#languageToggle {
  background: #444;
  color: #fff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  border: none;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
  transition: background .2s,color .2s,box-shadow .2s;
  will-change: background,color
}

/* Theme toggle button */
#themeToggle {
  background: 0 0;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 24px;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: color .2s;
  will-change: color
}

/* Generic circle button */
.circle-button {
  background: #444;
  color: #fff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  font-weight: 700;
  border: none;
  font-size: 18px;
  user-select: none;
  transition: background .2s,color .2s,box-shadow .2s,transform .2s;
  will-change: background,color,transform
}
.circle-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  transition: fill .2s;
  will-change: fill
}

/* Main page content container */
.page-content {
  max-width: 900px;
  margin: 40px auto 30px;
  padding: 0 1rem;
  will-change: margin
}

/* Category grid layout */
.grid-layout {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 1rem;
  text-align: center;
  will-change: transform
}

/* Category card styles */
.category {
  background: rgba(255,255,255,.05);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform .2s ease;
  will-change: transform;
  border: 1.5px solid #666;
}
body.light .category {
  background: #f9f9f9;
  border: 1.5px solid #bbb;
  color: #000;
}

/* Category title button */
.category-title {
  background: 0 0;
  border: none;
  color: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  text-align: center;
  user-select: none;
  transition: background .2s,color .2s,transform .2s;
  will-change: background,color,transform
}

/* Modal overlay and content */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  will-change: opacity;
  transition: opacity .2s
}
.modal-overlay.active {
  display: flex;
  opacity: 1
}
.modal-content {
  background: #222;
  color: #fff;
  border-radius: 16px;
  max-width: 800px;
  width: 80%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 0 12px rgba(0,0,0,.5);
  outline: 0;
  will-change: transform,opacity;
  transition: transform .2s,opacity .2s
}
body.light .modal-content {
  background: #fff;
  color: #222
}

/* Custom scrollbars for modal and body */
.modal-content,
body {
  scrollbar-width: thin;
  scrollbar-color: #444 #222
}
body.light,
body.light .modal-content {
  scrollbar-color: #bbb #e0e0e0
}
.modal-content::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 10px;
  background: 0 0
}
.modal-content::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 12px;
  border: 2px solid #222;
  min-height: 40px;
  transition: background .2s
}
body.light .modal-content::-webkit-scrollbar-thumb,
body.light::-webkit-scrollbar-thumb {
  background: #bbb;
  border: 2px solid #e0e0e0
}
.modal-content::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  background: #666
}
body.light .modal-content::-webkit-scrollbar-thumb:hover,
body.light::-webkit-scrollbar-thumb:hover {
  background: #888
}
.modal-content::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: #222;
  border-radius: 12px
}
body.light .modal-content::-webkit-scrollbar-track,
body.light::-webkit-scrollbar-track {
  background: #e0e0e0
}

/* Donate section styles */
.donate-section {
  padding: 1rem 0;
  text-align: center
}
.donate-grid {
  display: flex;
  gap: 2rem;
  justify-content: center;
}

/* Donate box styles */
.donate-box {
  padding: 1rem;
  background: rgba(255,255,255,.07);
  border-radius: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background .2s;
  user-select: none;
  color: currentColor;
  border: 1.5px solid #999;
}
body.light .donate-box {
  background: #f9f9f9;
  border: 1.5px solid #bbb;
  color: #000;
}
.donate-box:hover {
  background: rgba(255,255,255,.15);
}
body.light .donate-box:hover {
  background: rgba(0,0,0,.15);
}

/* Toast notification for copy */
#copyToast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: #333;
  color: #fff;
  padding: .8rem 1.2rem;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity .2s,transform .2s;
  z-index: 2000;
  user-select: none;
  will-change: opacity,transform
}
#copyToast.show {
  opacity: 1;
  transform: translateY(0)
}

/* Footer styles */
footer {
  max-width: 900px;
  margin: 0 auto 10px;
  color: #888;
  font-size: .9rem;
  text-align: center;
  user-select: none
}

/* Privacy policy modal */
#privacyPolicyModal .modal-content {
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto
}

/* Button and category hover effects */
.category-title,
.circle-button,
.soft-button,
button {
  border-radius: 12px;
  transition: background-color .2s,color .2s,transform .2s;
  will-change: background-color,color,transform
}
.category-title:hover,
.circle-button:hover,
.soft-button:hover,
button:hover {
  opacity: .95;
}
.category-title:hover {
  transform: translateX(8px) scale(1.03);
  opacity: .95;
}

/* Theme-specific button backgrounds */
body.dark #languageToggle,
body.dark .circle-button,
body.dark .soft-button {
  background-color: #222;
  color: #fff
}
body.light #languageToggle,
body.light .circle-button,
body.light .soft-button {
  background-color: #e0e0e0;
  color: #000
}

/* Theme toggle hover */
#themeToggle:hover,
.top-buttons .circle-button:hover {
  background-color: transparent;
  color: #888
}

/* Category title padding and background */
.category-title {
  padding: .8rem 1rem;
  border: 1px solid transparent;
  background-color: rgba(255,255,255,.05)
}
body.light .category-title {
  background-color: rgba(0,0,0,.05)
}

/* Modal close button */
.modal-content {
  position: relative
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  background: 0 0;
  border: none;
  cursor: pointer;
  padding: .4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s;
  will-change: transform
}
.modal-close:hover {
  transform: rotate(90deg) scale(1.1)
}
.close-icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  pointer-events: none;
  transition: stroke .2s;
  will-change: stroke
}
body.dark .close-icon {
  stroke: #fff
}
body.light .close-icon {
  stroke: #000
}

/* Theme toggle and top button styles */
#themeToggle,
.top-buttons .circle-button {
  background: 0 0!important;
  border: none;
  color: currentColor;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: color .2s,opacity .2s;
  will-change: color,opacity
}
body.dark #themeToggle,
body.dark .top-buttons .circle-button {
  color: #fff
}
body.light #themeToggle,
body.light .top-buttons .circle-button {
  color: #000
}
#themeToggle:hover,
.top-buttons .circle-button:hover {
  opacity: .8
}

/* Logo wrapper and logo styles */
.logo-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  font-family: 'Courier New',monospace;
  position: relative;
  user-select: none
}
.logo-main {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;
  transition: color .2s;
  will-change: color
}
.logo-abbrev {
  position: absolute;
  left: 0;
  font-size: 1.2rem;
  font-weight: 700;
  padding-left: 1rem;
  transition: color .2s;
  will-change: color
}
body.dark .logo-abbrev,
body.dark .logo-main {
  color: #fff
}
body.light .logo-abbrev,
body.light .logo-main {
  color: #000
}

/* ==== PC (по умолчанию) ==== */
.ad-placeholder {
  border: 2px dashed #666;
  border-radius: 12px;
  padding: 0.25rem;
  margin: 0 auto 0.75rem;

  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;

  box-sizing: border-box;
  width: 100%;
  max-width: inherit;
  aspect-ratio: 987 / 90;  
}

/* link */
.ad-placeholder a {
  display: block;
  width: 100%;
  height: 100%;
}

/* banner pc */
.ad-placeholder img.ad-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ==== Mobile / Tablet (991px) ==== */
@media (max-width: 991px) {
  .ad-placeholder {
    aspect-ratio: 987 / 120;  
    max-height: 140px;        
  }

  .ad-placeholder img.ad-img {
    object-fit: contain;     
  }
}

/* Project info button and content */
.project-info-button-wrapper {
  text-align: center;
  margin: 1.5rem 0
}
.soft-button {
  background-color: #444;
  color: #fff;
  border-radius: 12px;
  padding: .7rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: background-color .2s;
  will-change: background-color
}
.soft-button:hover {
  background-color: #666
}
.project-info-content {
  margin-top: 1rem;
  line-height: 1.5;
  user-select: text
}

/* Button row layout */
.button-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0;
  flex-wrap: wrap
}
.small-button {
  font-size: .9rem;
  padding: .6rem 1.2rem;
  border-radius: .75rem;
  min-width: 200px;
  text-align: center
}

/* Soft button styles */
.soft-button {
  padding: 10px 16px;
  font-size: 14px;
  border: none;
  border-radius: 12px;
  background-color: var(--button-bg);
  color: var(--button-text);
  transition: background-color .2s ease,color .2s ease;
  cursor: pointer;
  white-space: nowrap;
  min-width: 130px;
  text-align: center
}
.soft-button:hover {
  background-color: var(--button-hover-bg);
  color: var(--button-hover-text)
}

/* Footer button styles */
.footer-buttons .footer-button {
  border: 1.5px solid #bbb;
  background-color: #e0e0e0;
  color: #000;
  border-radius: 12px;
  transition: background-color .3s,border-color .3s,color .3s;
  width: 160px;
  height: 45px;
  padding: 0 1rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
body.dark .footer-buttons .footer-button {
  border-color: #444;
  background-color: #333;
  color: #fff;
}
.footer-buttons .footer-button:hover {
  background-color: #d0d0d0;
  border-color: #999;
  color: #000;
  transform: scale(1.02);
}
body.dark .footer-buttons .footer-button:hover {
  background-color: #444;
  border-color: #666;
  color: #fff;
  transform: scale(1.02);
}

/* Category hover and layout */
.category {
  padding: 0;
  background: 0 0;
  border: none;
  border-radius: 12px;
  overflow: hidden;
  transition: transform .2s cubic-bezier(.4,0,.2,1);
  will-change: transform
}
.category:hover {
  transform: scale(1.02)
}
.category-title {
  display: block;
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  background-color: rgba(255,255,255,.07);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color .2s;
  will-change: background-color
}
body.light .category-title {
  background-color: rgba(0,0,0,.07)
}
.category-title:hover {
  background-color: rgba(255,255,255,.12)
}

/* Donate box styles */
.donate-box {
  padding: 1rem;
  background: rgba(255,255,255,.07);
  border-radius: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background .2s;
  user-select: none;
  color: currentColor;
  border: 1.5px solid #999;
}
body.light .donate-box {
  background: #f9f9f9;
  border: 1.5px solid #bbb;
  color: #000;
}
.donate-box:hover {
  background: rgba(255,255,255,.15);
}
body.light .donate-box:hover {
  background: rgba(0,0,0,.15);
}

/* Accordion styles */
.accordion-item {
  border-radius: 12px;
  background-color: rgba(255,255,255,.05);
  margin-bottom: 1rem;
  overflow: hidden;
  transition: background-color .2s;
  will-change: background-color
}
body.light .accordion-item {
  background-color: rgba(0,0,0,.05)
}
.accordion-header {
  background: 0 0;
  border: none;
  padding: 1rem;
  width: 100%;
  text-align: left;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  color: inherit;
  transition: background-color .2s;
  will-change: background-color
}
.accordion-header:hover {
  background-color: rgba(255,255,255,.08)
}
body.light .accordion-header:hover {
  background-color: rgba(0,0,0,.08)
}
.accordion-content {
  padding: 0 1rem 1rem 1rem;
  font-size: .95rem;
  color: inherit;
  animation: fadeIn .2s cubic-bezier(.4,0,.2,1);
  will-change: opacity,transform
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px)
  }
  to {
    opacity: 1;
    transform: translateY(0)
  }
}

/* Footer button theme styles */
body.dark .footer-button {
  background-color: #222;
  color: #fff
}
body.light .footer-button {
  background-color: #e0e0e0;
  color: #000
}
.footer-button:hover {
  opacity: .95
}

/* Copy toast theme styles */
body.dark #copyToast {
  background: #333;
  color: #fff
}
body.light #copyToast {
  background: #e0e0e0;
  color: #000
}

/* Background grid styles */
#bgGrid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  pointer-events: none;
  background-size: 55px 55px;
  opacity: .25;
  will-change: opacity
}
body.dark #bgGrid {
  --grid-color: rgba(255, 255, 255, 0.04);
  background-color: #111;
  background-image: linear-gradient(0deg,transparent 24%,var(--grid-color) 25%,var(--grid-color) 26%,transparent 27%,transparent 74%,var(--grid-color) 75%,var(--grid-color) 76%,transparent 77%,transparent),linear-gradient(90deg,transparent 24%,var(--grid-color) 25%,var(--grid-color) 26%,transparent 27%,transparent 74%,var(--grid-color) 75%,var(--grid-color) 76%,transparent 77%,transparent)
}
body.light #bgGrid {
  --grid-color: rgba(0, 0, 0, 0.14);
  background-color: #fff;
  background-image: linear-gradient(0deg,transparent 24%,var(--grid-color) 25%,var(--grid-color) 26%,transparent 27%,transparent 74%,var(--grid-color) 75%,var(--grid-color) 76%,transparent 77%,transparent),linear-gradient(90deg,transparent 24%,var(--grid-color) 25%,var(--grid-color) 26%,transparent 27%,transparent 74%,var(--grid-color) 75%,var(--grid-color) 76%,transparent 77%,transparent)
}

/* Channel button styles */
#channelButton {
  background: 0 0;
  border: none;
  cursor: pointer;
  color: currentColor;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  transition: color .2s,transform .2s;
  user-select: none;
  will-change: color,transform
}
#channelButton:hover {
  color: #1da1f2;
  transform: translateY(-3px) scale(1.08)
}
#channelButton svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  transition: stroke .2s;
  will-change: stroke
}
body.dark #channelButton {
  color: #fff
}
body.light #channelButton {
  color: #000
}
body.dark #channelButton:hover {
  color: #888
}

/* Responsive styles for mobile */
@media (max-width:600px) {
  .page-content {
    margin: 40px 10px 40px
  }
  .grid-layout {
    grid-template-columns: 1fr
  }
  header {
    flex-direction: column;
    align-items: center;
    padding: .5rem 1rem
  }
  .top-buttons {
    position: static;
    margin-top: .5rem
  }
}
@media (max-width:600px) {
  .logo-wrapper {
    flex-direction: column;
    align-items: center;
    gap: 2px
  }
  .logo-abbrev {
    position: static;
    padding-left: 0;
    font-size: 1rem
  }
  .logo-main {
    font-size: 1.4rem
  }
}

/* Modal copy button styles */
.modal-copy-btn {
  display: inline-block;
  border: none;
  border-radius: 12px;
  background: linear-gradient(90deg,#444 0,#666 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: .7rem 1.5rem;
  margin: 10px 0;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  transition: background .2s,color .2s,transform .2s;
  will-change: background,color,transform;
  text-align: center;
  user-select: none
}
.modal-copy-btn:focus,
.modal-copy-btn:hover {
  background: linear-gradient(90deg,#666 0,#444 100%);
  color: #fff;
  transform: scale(1.04);
  outline: 0
}
body.light .modal-copy-btn {
  background: linear-gradient(90deg,#e0e0e0 0,#bbb 100%);
  color: #fff
}
body.light .modal-copy-btn:focus,
body.light .modal-copy-btn:hover {
  background: linear-gradient(90deg,#bbb 0,#e0e0e0 100%);
  color: #fff
}

/* Modal link button styles */
.modal-link-btn {
  min-width: 70px;
  max-width: 100px;
  padding: .5rem .8rem;
  font-size: .95rem;
  border-radius: 12px;
  margin: 2px 0;
  background-color: rgba(255,255,255,.07);
  font-weight: 700;
  transition: background-color .2s,color .2s,transform .2s;
  text-align: center;
  user-select: none;
  flex: 1 1 0;
  text-decoration: none
}
body.light .modal-link-btn {
  background-color: rgba(0,0,0,.07)
}
.modal-link-btn:focus,
.modal-link-btn:hover {
  background-color: rgba(255,255,255,.12);
  outline: 0;
  transform: scale(1.04)
}

/* Accordion content layout */
.accordion-content > div {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
  margin: 10px 0
}
@media (max-width:600px) {
  .modal-link-btn {
    min-width: 60px;
    max-width: 80px;
    font-size: .85rem;
    padding: .45rem .5rem;
    margin: 2px 0
  }
  .accordion-content > div {
    gap: 6px
  }
  .modal-content {
    padding: 1rem;
    max-width: 99vw;
    width: 99vw
  }
}
@media (max-width:600px) {
  .modal-content {
    max-width: 90vw;
    width: 90vw;
    padding: 1rem;
    min-width: 260px;
    max-height: 70vh;
    margin: auto;
    border-radius: 16px
  }
  .modal-overlay.active {
    align-items: center;
    justify-content: center
  }
}

/* Category icon and open button styles */
.main-category-icon {
  display: inline-flex;
  align-items: center;
  margin-left: .5em;
  vertical-align: middle
}
.accordion-header svg {
  vertical-align: middle;
  margin-left: .2em;
  margin-right: 0;
  width: 1.2em;
  height: 1.2em
}
.modal-link-btn svg {
  display: inline-block;
  vertical-align: middle;
  width: 1.1em;
  height: 1.1em;
  margin: 0;
  stroke: currentColor;
  fill: none;
  pointer-events: none
}

/* Category card styles */
.category {
  background: rgba(255,255,255,.05);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform .2s ease
}
.category:hover {
  transform: translateY(-3px) scale(1.02)
}
body.light .category {
  background: rgba(0,0,0,.05)
}

/* Category header and name styles */
.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center
}
.category-name {
  font-size: 1.1rem;
  font-weight: 700
}
.category-icon svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
  display: block;
  margin-bottom: 8px
}

/* Category open button styles */
.category-open-btn {
  background: rgba(255,255,255,.07);
  border: none;
  border-radius: 12px;
  padding: .5rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background .2s
}
body.light .category-open-btn {
  background: rgba(0,0,0,.07)
}
.category-open-btn:hover {
  background: rgba(255,255,255,.12)
}
body.light .category-open-btn:hover {
  background: rgba(0,0,0,.12)
}
@media (max-width:768px) {
  .grid-layout {
    grid-template-columns: 1fr!important
  }
}

/* Category open button icon styles */
.category-open-btn svg {
  stroke: currentColor;
  color: #fff
}
body.light .category-open-btn svg {
  color: #000
}

/* Donate grid and box styles */
.donate-grid {
  display: flex;
  gap: 2rem;
  justify-content: center
}
.donate-box {
  background: rgba(255,255,255,.07);
  border-radius: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background .2s;
  user-select: none;
  color: currentColor;
  border: 1.5px solid #999;
}
body.light .donate-box {
  background: #f9f9f9;
  border: 1.5px solid #bbb;
  color: #000;
}
.donate-box:hover {
  background: rgba(255,255,255,.15);
}
body.light .donate-box:hover {
  background: rgba(0,0,0,.15);
}
.donate-box svg {
  width: 48px;
  height: 48px;
  fill: currentColor;
  stroke: currentColor
}
@media (min-width:1024px) {
  .page-content {
    max-width: 1200px;
    padding: 0 2rem
  }
  .grid-layout {
    gap: 1.5rem
  }
}

/* Site description styles */
.site-description {
  font-family: 'Courier New',Courier,monospace;
  font-size: 1rem;
  color: #fff;
  text-shadow: 0 0 3px #fff;
  letter-spacing: .05em;
  user-select: none;
  max-width: 600px;
  margin: 1rem auto 2rem;
  text-align: center;
  transition: color .3s,text-shadow .3s
}
body.light .site-description {
  color: #000;
  text-shadow: none
}

/* Stats section and grid */
.stats-section {
  max-width: 2600px;
  margin: 40px auto 30px;
  padding: 0 1rem;
  box-sizing: border-box
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 16px;
  width: 100%;
  max-width: 2600px;
  margin: 0 auto;
  justify-items: center
}
.stat-card {
  width: 160px;
  aspect-ratio: 1/1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  border-radius: 12px;
  background-color: rgba(255,255,255,.07);
  color: var(--card-text,#fff);
  font-family: "Courier New",monospace;
  box-sizing: border-box;
  text-align: center;
  transition: background-color .2s,transform .2s;
  will-change: background-color,transform
}
body.light .stat-card {
  background-color: rgba(0,0,0,.07);
  color: #000
}
.stat-card:hover {
  background-color: rgba(255,255,255,.12);
  transform: scale(1.02)
}
body.light .stat-card:hover {
  background-color: rgba(0,0,0,.12)
}
.stat-icon svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
  display: block;
  margin-bottom: 8px
}
.stat-label {
  font-size: 1.1rem;
  font-weight: 700;
  opacity: .85;
  margin-bottom: 6px;
  font-family: "Courier New",monospace
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: "Courier New",monospace
}
@media (max-width:900px) {
  .stats-grid {
    grid-template-columns: repeat(2,1fr);
    max-width: 600px
  }
  .stat-card {
    width: 260px;
    aspect-ratio: 1/1
  }
}
@media (max-width:600px) {
  .stats-grid {
    grid-template-columns: 1fr;
    max-width: 100%
  }
  .stat-card {
    width: 100%;
    max-width: 320px;
    aspect-ratio: auto;
    min-height: 120px
  }
}

/* Stats and categories title styles */
.stats_title {
  font-family: 'Courier New',monospace;
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: 2px;
  text-align: center;
  color: var(--text-color,#fff);
  margin-bottom: 20px;
  user-select: none;
  transition: color .2s;
  will-change: color
}
body.dark .stats_title {
  color: #fff
}
body.light .stats_title {
  color: #000
}
.categories_title {
  font-family: 'Courier New',monospace;
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: 2px;
  text-align: center;
  color: var(--text-color,#fff);
  margin-bottom: 20px;
  user-select: none;
  transition: color .2s;
  will-change: color
}
body.dark .categories_title {
  color: #fff
}
body.light .categories_title {
  color: #000
}

/* Background grid theme overrides */
body.dark #bgGrid {
  --grid-color: rgba(255, 255, 255, 0.1);
  background-color: #111;
  background-image: linear-gradient(0deg,transparent 24%,var(--grid-color) 25%,var(--grid-color) 26%,transparent 27%,transparent 74%,var(--grid-color) 75%,var(--grid-color) 76%,transparent 77%,transparent),linear-gradient(90deg,transparent 24%,var(--grid-color) 25%,var(--grid-color) 26%,transparent 27%,transparent 74%,var(--grid-color) 75%,var(--grid-color) 76%,transparent 77%,transparent)
}
body.light #bgGrid {
  --grid-color: rgba(0, 0, 0, 0.3);
  background-color: #fff;
  background-image: linear-gradient(0deg,transparent 24%,var(--grid-color) 25%,var(--grid-color) 26%,transparent 27%,transparent 74%,var(--grid-color) 75%,var(--grid-color) 76%,transparent 77%,transparent),linear-gradient(90deg,transparent 24%,var(--grid-color) 25%,var(--grid-color) 26%,transparent 27%,transparent 74%,var(--grid-color) 75%,var(--grid-color) 76%,transparent 77%,transparent)
}

/* Stat card theme variables */
.stat-card {
  background-color: #f0f0f0;
  border: 1.5px solid #bbb;
  border-radius: 12px;
  box-sizing: border-box;
  transition: background-color .3s,border-color .3s;
  color: #000;
}
body.dark .stat-card {
  background-color: #222;
  border: 1.5px solid #555;
  color: #fff;
}

/* Card and modal theme variables */
.accordion-item,
.ad-placeholder,
.category,
.donate-box,
.modal-content {
  border: 1.5px solid var(--border-color,#bbb);
  background-color: var(--bg-color,#f9f9f9);
  border-radius: 12px;
  transition: background-color .3s,border-color .3s;
  color: var(--text-color,#000)
}
body.dark .accordion-item,
body.dark .ad-placeholder,
body.dark .category,
body.dark .donate-box,
body.dark .modal-content {
  border-color: var(--border-color-dark,#444);
  background-color: var(--bg-color-dark,#222);
  color: var(--text-color-dark,#fff)
}

/* Button theme variables */
.footer-button,
.small-button,
.soft-button,
button {
  border: 1.5px solid var(--border-color,#bbb);
  background-color: var(--button-bg,#e0e0e0);
  color: var(--button-text,#000);
  border-radius: 12px;
  transition: background-color .3s,border-color .3s,color .3s
}
body.dark .footer-button,
body.dark .small-button,
body.dark .soft-button,
body.dark button {
  border-color: var(--border-color-dark,#444);
  background-color: var(--button-bg-dark,#333);
  color: var(--button-text-dark,#fff)
}
.footer-button:hover,
.small-button:hover,
.soft-button:hover,
button:hover {
  background-color: var(--button-hover-bg,#d0d0d0);
  border-color: var(--border-hover-color,#999);
  color: var(--button-hover-text,#000)
}
body.dark .footer-button:hover,
body.dark .small-button:hover,
body.dark .soft-button:hover,
body.dark button:hover {
  background-color: var(--button-hover-bg-dark,#444);
  border-color: var(--border-hover-color-dark,#666);
  color: var(--button-hover-text-dark,#fff)
}

/* Footer button theme variables */
.footer-buttons .footer-button {
  border: 1.5px solid #bbb;
  background-color: #e0e0e0;
  color: #000;
  border-radius: 12px;
  transition: background-color .3s,border-color .3s,color .3s;
  width: 160px;
  height: 45px;
  padding: 0 1rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
body.dark .footer-buttons .footer-button {
  border-color: #444;
  background-color: #333;
  color: #fff;
}
.footer-buttons .footer-button:hover {
  background-color: #d0d0d0;
  border-color: #999;
  color: #000;
  transform: scale(1.02);
}
body.dark .footer-buttons .footer-button:hover {
  background-color: #444;
  border-color: #666;
  color: #fff;
  transform: scale(1.02);
}

/* Light theme overrides for category, stat-card, donate-box */
body.light .category {
  background-color: #f9f9f9!important;
  border: 1.5px solid #bbb!important;
  color: #000!important
}
body.light .stat-card {
  background-color: #f0f0f0!important;
  border: 1.5px solid #bbb!important;
  color: #000!important
}
body.light .donate-box {
  background-color: #f9f9f9!important;
  border: 1.5px solid #bbb!important;
  color: #000!important
}
body.light .donate-box img,
body.light .donate-box svg {
  fill: #000!important;
  color: #000!important;
  stroke: #000!important;
  opacity: 1!important;
  filter: none!important;
  visibility: visible!important;
  display: block!important;
  width: 40px!important;
  height: 40px!important
}
body.light .donate-box .soft-button,
body.light .donate-box button {
  background-color: #e0e0e0!important;
  border: 1.5px solid #bbb!important;
  color: #000!important;
  opacity: 1!important
}

/* Flag icons */
.lang-flag {
  display: inline-block;
  width: 22px;
  height: 16px;
  min-width: 22px;
  min-height: 16px;
  max-width: 22px;
  max-height: 16px;
  border-radius: 3px;
  overflow: hidden;
  margin-right: 8px;
  margin-left: 0;
  vertical-align: middle;
  background-size: cover;
  background-position: center;
  object-fit: cover;
  box-shadow: 0 1px 2px rgba(0,0,0,0.10);
  border: 1px solid #bbb;
}
.flag-ru {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="22" height="16" viewBox="0 0 22 16"><rect width="22" height="16" fill="%23fff"/><rect y="5.33" width="22" height="5.34" fill="%23005BBB"/><rect y="10.67" width="22" height="5.33" fill="%23EF3340"/></svg>');
}
.flag-en {
  /* American flag, same aspect as Chinese */
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="22" height="16" viewBox="0 0 22 16"><rect width="22" height="16" fill="%23fff"/><g><rect y="0" width="22" height="2" fill="%23B22234"/><rect y="4" width="22" height="2" fill="%23B22234"/><rect y="8" width="22" height="2" fill="%23B22234"/><rect y="12" width="22" height="2" fill="%23B22234"/></g><rect width="9.5" height="7" fill="%233C3B6E"/><g fill="%23fff" font-size="1.2" font-family="monospace"><text x="1" y="1.5">*</text><text x="2.5" y="2.7">*</text><text x="4" y="1.5">*</text><text x="5.5" y="2.7">*</text><text x="7" y="1.5">*</text><text x="8.5" y="2.7">*</text><text x="1.75" y="3.9">*</text><text x="3.25" y="3.9">*</text><text x="4.75" y="3.9">*</text><text x="6.25" y="3.9">*</text><text x="7.75" y="3.9">*</text></g></svg>');
}
.flag-zh {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="22" height="16" viewBox="0 0 22 16"><rect width="22" height="16" fill="%23DE2910"/><polygon points="4,2 5,6 1,3.5 7,3.5 3,6" fill="%23FFDE00"/></svg>');
}

/* Language button and flag styles */
.lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 90px;
  padding: 0 16px 0 8px;
  font-size: 15px;
  font-weight: 700;
  background: #444;
  color: #fff;
  border-radius: 18px;
  border: none;
  cursor: pointer;
  transition: background .2s, box-shadow .2s;
  user-select: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  height: 36px;
}
body.light .lang-btn {
  background: #e0e0e0;
  color: #000;
}
.lang-btn .lang-flag {
  margin-right: 8px;
  margin-left: 0;
}
.lang-btn .lang-caret {
  margin-left: 4px;
  transition: transform .2s;
}

/* Remove .lang-dropdown, .lang-dropdown-list, .lang-option styles */
/* Keep .lang-btn and .lang-flag as is for button appearance */

/* Responsive: language dropdown */
@media (max-width:600px) {
  .lang-dropdown {
    min-width: 80px;
  }
  .lang-dropdown-list {
    min-width: 100px;
    font-size: 14px;
    padding: 4px 0;
    right: 0;
    left: auto;
    border-radius: 12px;
  }
  .lang-btn {
    font-size: 13px;
    min-width: 60px;
    padding: 0 8px 0 4px;
    height: 32px;
    border-radius: 14px;
    gap: 6px;
  }
  .lang-flag {
    width: 18px;
    height: 13px;
    min-width: 18px;
    min-height: 13px;
    max-width: 18px;
    max-height: 13px;
    margin-right: 6px;
  }
  .lang-option {
    padding: 8px 12px 8px 8px;
    font-size: 13px;
    border-radius: 7px;
    gap: 7px;
  }
}

/* Question button styles */
.top-buttons a.circle-button[aria-label="Question"] {
  background: #444;
  color: #fff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  font-weight: 700;
  border: none;
  font-size: 18px;
  user-select: none;
  transition: background .2s, color .2s, box-shadow .2s, transform .2s;
  will-change: background, color, transform;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
body.light .top-buttons a.circle-button[aria-label="Question"] {
  background: #e0e0e0;
  color: #000;
}
.top-buttons a.circle-button[aria-label="Question"]:hover {
  background: #666;
  color: #ffffff;
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  text-decoration: none;
}
body.light .top-buttons a.circle-button[aria-label="Question"]:hover {
  background: #ccc;
  color: #ffffff;
}
.top-buttons a.circle-button[aria-label="Question"] svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  transition: fill .2s, color .2s;
  will-change: fill, color;
}