:root {
  --bg: #041412;
  --bg-muted: #0b2a1f;
  --panel: rgba(20, 36, 30, 0.6);
  --panel-border: rgba(126, 248, 187, 0.18);
  --text: #e6efe6;
  --muted: #b9d9c5;
  --emphasis: #cfeee0;
  --accent: #22c55e;
  --accent-soft: #9ff3c7;
  --scroll-track: linear-gradient(180deg, rgba(5, 20, 14, 0.92), rgba(2, 13, 9, 0.96));
  --scroll-thumb: linear-gradient(180deg, rgba(78, 224, 139, 0.9), rgba(34, 197, 94, 0.92));
  --scroll-thumb-hover: linear-gradient(180deg, rgba(136, 250, 188, 0.95), rgba(55, 222, 113, 0.95));
  --scroll-thumb-active: linear-gradient(180deg, rgba(178, 255, 216, 0.98), rgba(78, 236, 143, 0.98));
  --btn-border: rgba(141, 255, 202, 0.44);
  --btn-border-strong: rgba(179, 255, 220, 0.78);
  --btn-bg:
    radial-gradient(circle at 12% 18%, rgba(174, 255, 218, 0.18), rgba(174, 255, 218, 0) 40%),
    linear-gradient(135deg, rgba(28, 86, 58, 0.96), rgba(14, 43, 30, 0.96));
  --btn-shadow: 0 12px 26px rgba(4, 14, 9, 0.34), inset 0 1px 0 rgba(217, 255, 235, 0.12);
  --btn-shadow-hover: 0 16px 30px rgba(4, 14, 9, 0.42), 0 0 0 1px rgba(126, 248, 187, 0.22);
  --shadow: 0 10px 28px rgba(7, 15, 10, 0.55);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 90px;
  scrollbar-width: auto;
  scrollbar-color: #51d98f rgba(7, 24, 16, 0.88);
}

/* Site-themed scrollbar for Chromium and Safari browsers. */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: var(--scroll-track);
  border-left: 1px solid rgba(82, 222, 142, 0.2);
  box-shadow: inset 0 0 0 1px rgba(143, 255, 201, 0.06);
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 999px;
  border: 1px solid rgba(7, 24, 16, 0.95);
  min-height: 44px;
  box-shadow: inset 0 0 0 1px rgba(182, 255, 214, 0.18), 0 0 14px rgba(54, 212, 115, 0.24);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
  box-shadow: inset 0 0 0 1px rgba(205, 255, 229, 0.22), 0 0 18px rgba(93, 241, 152, 0.34);
}

html::-webkit-scrollbar-thumb:active,
body::-webkit-scrollbar-thumb:active {
  background: var(--scroll-thumb-active);
}

html::-webkit-scrollbar-corner,
body::-webkit-scrollbar-corner {
  background: var(--scroll-track);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: radial-gradient(circle at 20% 15%, #103d29 0%, #081712 50%, #020301 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.45;
}

img,
video,
iframe,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

table {
  max-width: 100%;
}

p,
li,
h1,
h2,
h3,
h4 {
  overflow-wrap: anywhere;
}

@keyframes element-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.site-header,
.hero,
.faq-hero,
.subpage-hero,
.rules-hero,
.admin-hero,
.admin-panel,
.faq-section,
.rules-section,
.accordion,
.rule-card,
.cards-grid .card,
.class-panel,
.site-footer {
  animation: element-fade-up 0.72s ease-out both;
}

.site-header {
  animation-delay: 0.04s;
}

.hero,
.faq-hero,
.subpage-hero,
.rules-hero,
.admin-hero,
.admin-panel,
.faq-section,
.rules-section {
  animation-delay: 0.12s;
}

.cards-grid .card:nth-child(1),
.accordion:nth-of-type(1),
.rule-card:nth-of-type(1),
.class-panel:nth-of-type(1) {
  animation-delay: 0.16s;
}

.cards-grid .card:nth-child(2),
.accordion:nth-of-type(2),
.rule-card:nth-of-type(2),
.class-panel:nth-of-type(2) {
  animation-delay: 0.24s;
}

.cards-grid .card:nth-child(3),
.accordion:nth-of-type(3),
.rule-card:nth-of-type(3),
.class-panel:nth-of-type(3) {
  animation-delay: 0.32s;
}

.cards-grid .card:nth-child(4),
.accordion:nth-of-type(4),
.rule-card:nth-of-type(4),
.class-panel:nth-of-type(4) {
  animation-delay: 0.4s;
}

.cards-grid .card:nth-child(5),
.accordion:nth-of-type(5),
.rule-card:nth-of-type(5),
.class-panel:nth-of-type(5) {
  animation-delay: 0.48s;
}

.cards-grid .card:nth-child(6),
.accordion:nth-of-type(6),
.rule-card:nth-of-type(6),
.class-panel:nth-of-type(6),
.cards-grid .card:nth-child(n + 7),
.accordion:nth-of-type(n + 7),
.rule-card:nth-of-type(n + 7),
.class-panel:nth-of-type(n + 7),
.site-footer {
  animation-delay: 0.56s;
}

.container {
  width: min(1180px, 100% - 2rem);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, rgba(3, 12, 8, 0.95), rgba(4, 13, 9, 0.84));
  border-bottom: 1px solid rgba(69, 220, 122, 0.34);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(126, 248, 187, 0.3), transparent);
  pointer-events: none;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  gap: 0.9rem;
}

.logo {
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  color: #46ea86;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  text-shadow: none;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.main-nav a,
.dropbtn {
  color: #d6f7e5;
  text-decoration: none;
  padding: 0.48rem 0.84rem;
  border-radius: 11px;
  border: 1px solid rgba(76, 217, 129, 0.1);
  background: rgba(16, 44, 30, 0.34);
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.22s ease, background 0.22s ease, transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.main-nav > a {
  display: inline-flex;
  align-items: center;
  gap: 0.46rem;
}

.main-nav > a::before,
.main-nav > .dropdown .dropbtn::before {
  display: inline-block;
  margin-right: 0;
  line-height: 1;
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0.78;
  flex-shrink: 0;
  transform: translateY(-0.5px);
}

.main-nav > a[href$="index.html"]::before {
  content: "⌂";
}

.main-nav > a[href$="faq.html"]::before {
  content: "?";
}

.main-nav > a[href$="rules.html"]::before {
  content: "⚖";
}

.main-nav > a[href$="mechanics.html"]::before {
  content: "⚙";
}

.main-nav > a[href$="Admin.html"]::before {
  content: "◇";
}

.main-nav > .dropdown .dropbtn::before {
  content: "◇";
}

.main-nav a:hover,
.dropbtn:hover {
  color: #f3fff4;
  background: rgba(35, 106, 67, 0.48);
  border-color: rgba(98, 236, 156, 0.44);
  box-shadow: 0 0 0 1px rgba(126, 248, 187, 0.12), 0 4px 10px rgba(5, 14, 10, 0.22);
  transform: translateY(-1px);
}

.dropdown {
  position: relative;
}

.dropbtn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid rgba(76, 217, 129, 0.24);
  background: rgba(16, 44, 30, 0.45);
}

.dropdown-content {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  min-width: 240px;
  background: rgba(14, 32, 24, 0.92);
  border: 1px solid rgba(34, 197, 94, 0.36);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(4, 10, 7, 0.55);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: 0.28s ease;
  z-index: 101;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.dropdown-content.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-content a {
  color: var(--text);
  display: block;
  padding: 0.68rem 0.9rem;
  border-bottom: 1px solid rgba(93, 168, 121, 0.2);
  transition: background 0.28s ease;
}


@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-header {
    background: rgba(4, 13, 9, 0.98);
  }

  .dropdown-content {
    background: rgba(14, 32, 24, 0.98);
  }
}

/* Fallback for browsers without :has() support. JS tabs still control active state. */
.no-has .class-content .class-panel {
  display: none;
}

.no-has .class-content .class-panel:first-of-type {
  display: block;
}

.no-has .class-tabs .class-tab-btn:first-of-type {
  background: rgba(34, 197, 94, 0.18);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.45);
  border-color: rgba(34, 197, 94, 0.9);
}
.dropdown-content a:last-child {
  border-bottom: none;
}

.dropdown-content a:hover {
  background: rgba(34, 197, 94, 0.18);
}

.burger-btn {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 34px;
  height: 27px;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.burger-btn span {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: var(--text);
  transition: 0.36s ease;
}

.burger-btn.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.burger-btn.active span:nth-child(2) {
  opacity: 0;
}

.burger-btn.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

.hero {
  padding: 2rem 0 1rem;
  text-align: center;
}

.hero h1 {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: clamp(2rem, 6vw, 3rem);
  text-shadow: 0 0 20px rgba(34, 197, 94, 0.5);
}

.hero p {
  max-width: 760px;
  margin: 0 auto;
  color: var(--muted);
}

.cards-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin: 1.2rem 0 2rem;
}

/* Readability tweaks: softer tones, comfortable line-height and highlights */
.rules-block,
.rule-card,
.note-card,
.rules-hero {
  background-color: rgba(10, 22, 16, 0.88);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}

.rules-block h2,
.rules-block h3,
.rules-block h4,
.rules-hero h1 {
  color: #cfeee0;
}

.rule-card p,
.rule-card li,
.note-card p,
.rules-hero p {
  color: #eaf7ec;
}

.rules-side-nav a {
  color: #e6f6ea;
}
.rules-side-nav a:hover {
  background: rgba(44, 110, 74, 0.78);
}

/* Softer inline highlights to avoid glare */
.hl-yellow {
  background: rgba(255, 236, 153, 0.9);
  color: #211b10;
  padding: 0 0.18rem;
  border-radius: 3px;
  font-weight: 700;
}
.hl-red {
  background: rgba(222, 96, 96, 0.88);
  color: #fff;
  padding: 0 0.18rem;
  border-radius: 3px;
  font-weight: 700;
}

::selection {
  background: rgba(126, 248, 187, 0.16);
  color: #021006;
}

/* Make emphasis noticeable but soft */
strong, b {
  color: var(--emphasis);
  font-weight: 700;
}

.rule-card .rule-key {
  color: var(--emphasis);
  font-weight: 700;
  background: rgba(126, 248, 187, 0.08);
  padding: 0 0.16rem;
  border-radius: 4px;
}

.admin-panel {
  background: rgba(11, 25, 19, 0.75);
  border: 1px solid rgba(34, 197, 94, 0.45);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1.3rem;
}

.admin-panel.hidden {
  display: none;
}

.admin-panel h2 {
  margin: 0;
  color: #9fffc4;
}

.admin-panel p {
  margin: 0.6rem 0 0;
  color: #e8ffe1;
}

.admin-tab {
  display: none;
}

.admin-tab.active {
  display: block;
}

.card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
    max-height: 100vh;
  min-height: 210px;
  background: rgba(12, 30, 23, 0.58);
  border: 1px solid rgba(36, 176, 84, 0.35);
  border-radius: 16px;
  padding: 1.05rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  transition: transform 0.34s ease, box-shadow 0.34s ease, border-color 0.34s ease;
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.34s ease;
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(34, 197, 94, 0.9);
  box-shadow: 0 16px 40px rgba(5, 12, 8, 0.7);
}

.card:hover::before {
  opacity: 1;
}

.card h2 {
  margin: 0 0 0.45rem;
  color: #9fffc4;
}

.card p,
.card a:not(.action-btn) {
  color: #d5fde8;
}

.card a:not(.action-btn) {
  text-decoration: none;
  border-bottom: 1px dashed rgba(34, 197, 94, 0.65);
}

.card a:not(.action-btn):hover {
  color: #efffee;
}

.class-tab-btn.is-active {
  background: linear-gradient(135deg, rgba(42, 128, 85, 0.98), rgba(18, 56, 38, 0.98)) !important;
  box-shadow: 0 0 0 1px rgba(126, 248, 187, 0.24), 0 14px 28px rgba(7, 22, 14, 0.5) !important;
  border-color: rgba(191, 255, 226, 0.9) !important;
}

.action-btn {
  display: block;
  width: 100%;
  margin-top: 0.85rem;
  padding: 0.92rem 0;
  border-radius: 12px;
  border: 1px solid rgba(126, 248, 187, 0.45);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.82), rgba(16, 152, 82, 0.86));
  box-shadow: 0 10px 18px rgba(10, 35, 22, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: #f4fff6;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(8, 28, 18, 0.62), 0 0 14px rgba(126, 248, 187, 0.45);
  filter: brightness(1.05);
}

.action-btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 12px rgba(8, 28, 18, 0.5);
}

.action-btn:focus-visible {
  outline: 2px solid #d5ffe7;
  outline-offset: 2px;
}

/* Unified premium style for primary buttons and button-like links across pages. */
:is(
  button:not(.burger-btn):not(.dropbtn):not(.video-overlay-btn):not(.notice-close-btn):not([aria-label="Закрыть титры"]),
  .action-btn,
  .class-tab-btn,
  .rules-docs-link,
  .rules-nav-toggle,
  .video-play-btn,
  .credits-audio-btn,
  .notice-confirm-btn
) {
  border: 1px solid var(--btn-border) !important;
  border-radius: 14px !important;
  background: var(--btn-bg) !important;
  color: #effff4 !important;
  box-shadow: var(--btn-shadow) !important;
  text-decoration: none;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-weight: 800;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, filter 0.2s ease;
}

:is(
  button:not(.burger-btn):not(.dropbtn):not(.video-overlay-btn):not(.notice-close-btn):not([aria-label="Закрыть титры"]),
  .action-btn,
  .class-tab-btn,
  .rules-docs-link,
  .rules-nav-toggle,
  .video-play-btn,
  .credits-audio-btn,
  .notice-confirm-btn
)::before {
  content: "";
  position: absolute;
  top: -120%;
  left: -35%;
  width: 38%;
  height: 300%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(220, 255, 238, 0.45), rgba(255, 255, 255, 0));
  transform: rotate(18deg);
  transition: left 0.35s ease;
  pointer-events: none;
}

:is(
  button:not(.burger-btn):not(.dropbtn):not(.video-overlay-btn):not(.notice-close-btn):not([aria-label="Закрыть титры"]),
  .action-btn,
  .class-tab-btn,
  .rules-docs-link,
  .rules-nav-toggle,
  .video-play-btn,
  .credits-audio-btn,
  .notice-confirm-btn
):hover {
  transform: translateY(-2px);
  border-color: var(--btn-border-strong) !important;
  box-shadow: var(--btn-shadow-hover) !important;
  filter: brightness(1.04);
}

:is(
  button:not(.burger-btn):not(.dropbtn):not(.video-overlay-btn):not(.notice-close-btn):not([aria-label="Закрыть титры"]),
  .action-btn,
  .class-tab-btn,
  .rules-docs-link,
  .rules-nav-toggle,
  .video-play-btn,
  .credits-audio-btn,
  .notice-confirm-btn
):hover::before {
  left: 112%;
}

:is(
  button:not(.burger-btn):not(.dropbtn):not(.video-overlay-btn):not(.notice-close-btn):not([aria-label="Закрыть титры"]),
  .action-btn,
  .class-tab-btn,
  .rules-docs-link,
  .rules-nav-toggle,
  .video-play-btn,
  .credits-audio-btn,
  .notice-confirm-btn
):active {
  transform: translateY(0);
  box-shadow: 0 9px 18px rgba(4, 14, 9, 0.4) !important;
}

:is(
  .action-btn,
  .class-tab-btn,
  .rules-docs-link,
  .rules-nav-toggle,
  .video-play-btn,
  .credits-audio-btn,
  .notice-confirm-btn
):focus-visible {
  outline: 2px solid rgba(178, 255, 210, 0.95);
  outline-offset: 3px;
}

.faq-section,
.rules-section {
  margin: 2rem 0 2.3rem;
}

.accordion {
  background: rgba(12, 28, 20, 0.6);
  border: 1px solid rgba(33, 182, 103, 0.3);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0.7rem;
}

.accordion-btn {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0.9rem 1rem;
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  border-radius: 10px;
  transition: background-color 0.36s ease, transform 0.3s ease, box-shadow 0.36s ease;
}

.accordion-btn:hover {
  background: rgba(34, 197, 94, 0.14);
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.25);
}

.accordion-btn:active {
  transform: scale(0.997);
}

.accordion-btn:focus-visible {
  outline: 2px solid rgba(126, 248, 187, 0.9);
  outline-offset: 2px;
}

.accordion-btn::-webkit-details-marker {
  display: none;
}

.accordion-btn::after {
  content: '▾';
  color: var(--accent-soft);
  transition: transform 0.36s ease;
}

.accordion-btn.active::after {
  transform: rotate(-180deg);
}

.accordion[open] .accordion-btn::after {
  transform: rotate(-180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-2px);
  transition: max-height 0.46s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease, transform 0.4s ease;
  padding: 0 1rem;
}

.accordion[open] .accordion-content {
  max-height: 500px;
  opacity: 1;
  transform: translateY(0);
}

.faq-section .accordion-content {
  max-height: none;
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(-3px);
  padding: 0 1rem;
  transition: grid-template-rows 0.56s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.46s ease, transform 0.46s ease;
}

.faq-section .accordion-content > * {
  overflow: hidden;
}

.faq-section .accordion-content-inner {
  min-height: 0;
}

.faq-section .accordion-content p {
  margin: 0.65rem 0 1rem;
  transform: translateY(-5px);
  transition: transform 0.46s ease;
}

.faq-section .accordion[open] .accordion-content {
  max-height: none;
  grid-template-rows: 1fr;
  opacity: 1;
  transform: translateY(0);
}

.faq-section .accordion[open] .accordion-content p {
  transform: translateY(0);
}

.accordion-content p {
  margin: 0.65rem 0 1rem;
  color: var(--muted);
}

.rule-card {
  background: rgba(10, 26, 18, 0.72);
  border: 1px solid rgba(36, 180, 88, 0.35);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 0.8rem;
  box-shadow: var(--shadow);
}

.rule-card h2 {
  margin: 0 0 0.55rem;
  color: #8efdab;
}

.rule-card ol {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
}

.rule-card li {
  margin-bottom: 0.45rem;
}

.site-footer {
  padding: 1.2rem 0 1.4rem;
  text-align: center;
  color: #97bfa4;
  border-top: 1px solid rgba(40, 190, 101, 0.24);
}

@media (max-width: 940px) {
  body.menu-open {
    overflow: hidden;
  }

  .main-nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 90;
    background: rgba(6, 14, 9, 0.98);
    flex-direction: column;
    align-items: flex-start;
    padding: 0.85rem 0.8rem 1rem;
    padding: max(0.85rem, env(safe-area-inset-top)) 0.8rem max(1rem, env(safe-area-inset-bottom));
    gap: 0.3rem;
    transform: translateX(-106%);
    transition: transform 0.34s ease;
    width: min(320px, 92vw);
    max-height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-right: 1px solid rgba(34, 197, 94, 0.3);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  }

  .main-nav.active {
    transform: translateX(0);
  }

  .main-nav a,
  .dropbtn {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    padding: 0.65rem 0.78rem;
    white-space: normal;
  }

  .dropdown-content {
    position: static;
    width: 100%;
    min-width: 0;
    margin-top: 0.15rem;
    box-shadow: none;
    border-radius: 10px;
  }

  .burger-btn {
    display: flex;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(1180px, 100% - 1.2rem);
  }

  .header-inner {
    padding: 0.65rem 0;
  }

  .hero h1 {
    font-size: clamp(1.8rem, 7.5vw, 2.7rem);
  }

  .hero p {
    font-size: 0.95rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .card {
    min-height: auto;
    padding: 0.9rem;
  }

  .action-btn {
    font-size: 0.95rem;
    padding: 0.8rem 0;
  }

  .rel-table {
    font-size: 11px;
  }

  .rel-table th,
  .rel-table td {
    padding: 6px 8px;
  }
}

@media (max-width: 760px) {
  .hero,
  .index-hero,
  .mechanics-hero,
  .rules-hero,
  .admin-hero,
  .subpage-hero {
    border-radius: 14px !important;
    padding: 0.95rem !important;
  }

  .cards-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem;
    margin: 1rem 0 1.5rem;
  }

  .card {
    border-radius: 14px;
  }

  .class-page,
  .items-wrap,
  .rules-layout {
    grid-template-columns: 1fr !important;
  }

  .class-tabs,
  .items-menu,
  .rules-side-nav,
  .memorial-tabs {
    position: static !important;
    top: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .class-tab-btn,
  .memorial-tab-btn {
    width: 100% !important;
    text-align: left !important;
  }

  .class-tab-btn,
  .rules-side-nav a,
  .items-menu a,
  .memorial-tab-btn,
  .accordion-btn,
  .action-btn {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .rel-table {
    display: block !important;
    overflow-x: auto !important;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .cmd,
  code {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

@media (max-width: 420px) {
  .main-nav {
    width: min(320px, 94vw);
    gap: 0.2rem;
  }

  .logo {
    font-size: 1.3rem;
  }

  .hero h1 {
    font-size: clamp(1.5rem, 5.5vw, 2.2rem);
  }

  .hero p {
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .card {
    min-height: 155px;
    padding: 0.75rem;
  }

  .card h2 {
    font-size: 1.1rem;
  }

  .card p {
    font-size: 0.92rem;
  }

  .action-btn {
    font-size: 0.88rem;
    padding: 0.75rem 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .main-nav a,
  .dropbtn {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0.45rem 0.68rem;
    font-size: 0.92rem;
  }

  .dropdown-content {
    width: 100%;
    max-width: 100%;
  }

  .container {
    width: min(1180px, 100% - 0.85rem);
  }

  .header-inner {
    padding: 0.6rem 0;
    gap: 0.6rem;
  }

  .rel-table {
    font-size: 10.5px;
  }

  .rel-table th,
  .rel-table td {
    padding: 6px 7px;
  }
}

@media (max-width: 360px) {
  .logo {
    font-size: 1.1rem;
  }

  .hero h1 {
    font-size: clamp(1.3rem, 5vw, 1.8rem);
  }

  .main-nav > a::before,
  .main-nav > .dropdown .dropbtn::before {
    margin-right: 0.25rem;
  }

  .card {
    min-height: 145px;
    padding: 0.6rem;
  }

  .action-btn {
    font-size: 0.85rem;
    padding: 0.65rem 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .hero,
  .admin-panel,
  .faq-section,
  .rules-section,
  .cards-grid .card,
  .accordion,
  .rule-card,
  .site-footer {
    animation: none !important;
  }

  .accordion-btn,
  .accordion-content {
    transition: none !important;
    animation: none !important;
  }
}