

.rules-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 100px 24px 64px;
}


.rules-hero {
  text-align: center;
  margin-bottom: 32px;
}

.rules-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 6vw, 48px);
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rules-subtitle {
  margin: 0 auto;
  max-width: 560px;
  color: rgba(255,255,255,.55);
  font-size: 16px;
  line-height: 1.6;
}


.rules-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 32px;
  padding: 4px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(139,92,246,.15);
  border-radius: 14px;
}

.rules-nav-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(255,255,255,.55);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s ease;
}

.rules-nav-btn:hover {
  color: rgba(255,255,255,.8);
  background: rgba(255,255,255,.04);
}

.rules-nav-btn.active {
  background: linear-gradient(135deg, rgba(139,92,246,.25), rgba(59,130,246,.15));
  color: #fff;
  box-shadow: 0 2px 12px var(--border);
}


.first-game-guide {
  display: grid;
  grid-template-columns: minmax(190px, .8fr) minmax(0, 2.2fr);
  gap: 28px;
  align-items: center;
  margin: 0 0 40px;
  padding: 26px 28px;
  overflow: hidden;
  border: 1px solid rgba(167, 139, 250, .3);
  border-radius: 18px;
  background:
    radial-gradient(circle at 0% 100%, rgba(59, 130, 246, .16), transparent 38%),
    linear-gradient(125deg, rgba(76, 29, 149, .22), rgba(15, 23, 42, .44));
  box-shadow: 0 16px 40px rgba(2, 6, 23, .2);
}

.guide-eyebrow {
  margin: 0 0 8px;
  color: var(--accent-soft);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.first-game-guide h2 {
  margin: 0;
  color: #f8fafc;
  font-size: clamp(24px, 4vw, 31px);
  line-height: 1.14;
}

.first-game-checklist {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.first-game-checklist li {
  min-height: 142px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 13px;
  background: rgba(15, 23, 42, .5);
}

.guide-step {
  display: block;
  margin-bottom: 18px;
  color: var(--accent-light);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .1em;
}

.first-game-checklist h3 {
  margin: 0 0 6px;
  color: #f8fafc;
  font-size: 15px;
}

.first-game-checklist p {
  margin: 0;
  color: rgba(226, 232, 240, .63);
  font-size: 13px;
  line-height: 1.52;
}


.rules-section {
  display: none;
}

.rules-section.active {
  display: block;
}


.rules-block {
  margin-bottom: 32px;
}

.rules-block h2 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.rules-block h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.rules-text {
  margin: 0 0 16px;
  color: rgba(255,255,255,.7);
  font-size: 15px;
  line-height: 1.7;
}

.rules-text-muted {
  color: rgba(255,255,255,.4);
  font-size: 13px;
  font-style: italic;
}


.rules-callout {
  display: flex;
  gap: 12px;
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid rgba(239, 68, 68, .35);
  border-radius: 12px;
  background: rgba(127, 29, 29, .18);
}

.rules-callout-icon { font-size: 20px; line-height: 1.4; }
.rules-callout h3 { margin: 0 0 4px; color: #fecdd3; font-size: 15px; }
.rules-callout p { margin: 0; color: rgba(255,255,255,.75); font-size: 14px; line-height: 1.6; }

.team-red,
.team-mafia {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 2px 8px;
  border: 1px solid;
  border-radius: 999px;
  font-size: .9em;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.team-red {
  color: #fecdd3;
  background: rgba(127, 29, 29, .5);
  border-color: rgba(251, 113, 133, .62);
}

.team-mafia {
  color: #f8fafc;
  background: #080d18;
  border-color: rgba(226, 232, 240, .52);
}


.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.role-card {
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 14px;
  padding: 16px;
  background: linear-gradient(145deg, rgba(38, 46, 74, .52), rgba(15, 23, 42, .48));
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.role-card:hover {
  border-color: rgba(255,255,255,.18);
  transform: translateY(-2px);
}

.role-card.role-red {
  border-color: rgba(251,113,133,.28);
  border-left: 3px solid rgba(251,113,133,.72);
  background: linear-gradient(145deg, rgba(88, 28, 43, .42), rgba(30, 24, 39, .64));
}

.role-card.role-black {
  border-color: rgba(148,163,184,.28);
  border-left: 3px solid rgba(226,232,240,.64);
  background: linear-gradient(145deg, rgba(20, 26, 41, .76), rgba(5, 8, 16, .88));
}

.role-card.role-special {
  box-shadow: inset 0 1px 0 rgba(196, 181, 253, .12);
}

.role-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.role-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 12px;
  background: rgba(15, 23, 42, .62);
  padding: 4px;
  flex-shrink: 0;
}

.role-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.role-card.role-red .role-icon {
  background: rgba(127, 29, 29, .25);
  border-color: rgba(251, 113, 133, .4);
}

.role-card.role-black .role-icon {
  background: #080d18;
  border-color: rgba(226, 232, 240, .32);
}

.role-team {
  display: block;
  font-size: 12px;
  color: rgba(255,255,255,.48);
  font-weight: 500;
  letter-spacing: .03em;
}

.role-card .role-team {
  display: inline-flex;
  width: fit-content;
  margin-top: 3px;
}

.role-card p {
  margin: 0;
  color: rgba(255,255,255,.6);
  font-size: 13px;
  line-height: 1.6;
}


.flow-steps {
  display: grid;
  gap: 12px;
}

.flow-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: linear-gradient(110deg, rgba(30, 41, 59, .4), rgba(15, 23, 42, .28));
}

.flow-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-glow), rgba(59,130,246,.2));
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}

.flow-body h3 {
  margin-bottom: 4px;
  font-size: 15px;
  color: #fff;
}

.flow-body p {
  margin: 0;
  color: rgba(255,255,255,.6);
  font-size: 14px;
  line-height: 1.6;
}


.concepts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.concept-card {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 16px;
  background: linear-gradient(145deg, rgba(30, 41, 59, .36), rgba(15, 23, 42, .28));
}

.concept-card h3 {
  margin: 0 0 6px;
  
  font-family: var(--font-body);
  letter-spacing: normal;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-soft);
}

.concept-card p {
  margin: 0;
  color: rgba(255,255,255,.55);
  font-size: 13px;
  line-height: 1.6;
}


.profiles-compare {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.profile-card {
  flex: 1;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  padding: 20px;
  background: rgba(255,255,255,.03);
  text-align: center;
}

.profile-card h3 {
  margin-bottom: 8px;
  font-size: 18px;
  color: #fff;
}

.profile-card p {
  margin: 0;
  color: rgba(255,255,255,.55);
  font-size: 13px;
  line-height: 1.5;
}

.profile-card-accent {
  border-color: rgba(139,92,246,.35);
  background: linear-gradient(160deg, var(--accent-bg), rgba(59,130,246,.05));
}

.profile-card-accent h3 {
  color: var(--accent-soft);
}

.profile-vs {
  flex-shrink: 0;
  font-weight: 800;
  font-size: 13px;
  color: rgba(255,255,255,.25);
  letter-spacing: .05em;
}


.rules-search-wrap {
  margin-bottom: 8px;
}

.rules-search-wrap input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  color: #fff;
  font-family: inherit;
  font-size: 16px; 
  outline: none;
  transition: all .2s ease;
}

.rules-search-wrap input::placeholder {
  color: rgba(255,255,255,.3);
}

.rules-search-wrap input:focus {
  border-color: var(--accent-glow-strong);
  box-shadow: 0 0 0 3px rgba(139,92,246,.12);
}


.scoring-group {
  margin-bottom: 28px;
}

.scoring-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.scoring-group-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 16px;
  flex-shrink: 0;
}

.scoring-group-icon.icon-base {
  background: var(--border);
}

.scoring-group-icon.icon-red-penalty {
  background: rgba(251,146,60,.15);
}

.scoring-group-icon.icon-red-bonus {
  background: rgba(96,165,250,.15);
}

.scoring-group-icon.icon-sheriff {
  background: rgba(56,189,248,.18);
}

.scoring-group-icon.icon-don {
  background: rgba(251,146,60,.2);
}

.scoring-group-icon.icon-black-bonus {
  background: rgba(248,113,113,.15);
}

.scoring-group-icon.icon-black-penalty {
  background: rgba(253,224,71,.12);
}

.scoring-group-icon.icon-special {
  background: rgba(168,85,247,.15);
}

.scoring-group-title {
  font-size: 16px;
  font-weight: 700;
  color: rgba(255,255,255,.85);
}

.scoring-group-cards {
  display: grid;
  gap: 14px;
}


.scoring-card {
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  background: rgba(255,255,255,.02);
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.scoring-card:hover {
  border-color: rgba(255,255,255,.12);
}

.scoring-card.open {
  border-color: var(--border-strong);
  box-shadow: 0 8px 24px rgba(15,23,42,.35);
  transform: translateY(-1px);
}

.scoring-card-main {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
}

.scoring-card-info {
  min-width: 0;
}

.scoring-card-title {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,.9);
}

.scoring-card-desc {
  margin: 0;
  font-size: 13px;
  color: rgba(255,255,255,.45);
  line-height: 1.5;
}

.scoring-card-values {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  flex-shrink: 0;
}

.scoring-card-maxline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.score-system-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.45);
}

.score-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.score-badge.badge-max {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.88);
}

.score-badge.badge-positive {
  color: #4ade80;
}

.score-badge.badge-negative {
  color: #f87171;
}

.score-compare {
  font-size: 12px;
  color: rgba(255,255,255,.4);
}

.scoring-card-toggle {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.25);
  font-size: 12px;
  transition: transform .2s ease;
}

.scoring-card.open .scoring-card-toggle {
  transform: rotate(180deg);
}

.scoring-card-details {
  display: none;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255,255,255,.07);
  background: rgba(6,10,22,.55);
}

.scoring-card.open .scoring-card-details {
  display: block;
}

.scoring-detail-row {
  padding: 10px 0;
}

.scoring-detail-row:not(:last-child) {
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.scoring-detail-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.35);
  margin-bottom: 2px;
}

.scoring-detail-value {
  font-size: 13px;
  color: rgba(255,255,255,.7);
  line-height: 1.5;
}

.scoring-value-list {
  margin: 0;
  padding-left: 16px;
  color: rgba(255,255,255,.75);
  font-size: 13px;
  line-height: 1.6;
}

.scoring-value-list li + li {
  margin-top: 4px;
}

.scoring-rule-table {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 12px;
  background: rgba(255,255,255,.02);
}

.scoring-rule-table-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,.85);
}

.scoring-rule-table-desc {
  margin: 0 0 10px;
  font-size: 12px;
  color: rgba(255,255,255,.5);
  line-height: 1.5;
}

.scoring-table-wrap {
  margin-bottom: 0;
}


.table-responsive {
  overflow-x: auto;
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
}

.rules-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.rules-data-table th,
.rules-data-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.rules-data-table thead th {
  background: rgba(139,92,246,.08);
  color: rgba(255,255,255,.6);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

.rules-data-table tbody tr:last-child td {
  border-bottom: none;
}

.rules-data-table tbody tr:hover {
  background: rgba(255,255,255,.02);
}

.rules-data-table .corner-cell {
  min-width: 180px;
}

.rules-data-table .row-header {
  color: rgba(255,255,255,.7);
  font-weight: 600;
  white-space: nowrap;
}

.rules-data-table .val {
  text-align: center;
  font-weight: 600;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.rules-data-table .val.pos {
  color: #4ade80;
}

.rules-data-table .val.great {
  color: #4ade80;
}

.rules-data-table .val.neg {
  color: #f87171;
}

.rules-data-table .val.bad {
  color: #f87171;
}

.rules-data-table .val.zero {
  color: rgba(255,255,255,.25);
}

.table-subtitle {
  margin: 12px 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,.6);
}


.pu-table th:not(.corner-cell),
.pu-table td:not(.row-header) {
  text-align: center;
  min-width: 56px;
}


.mafia-cost-table th:last-child,
.mafia-cost-table td:last-child {
  text-align: center;
}


.lh-slots-table th:not(:first-child),
.lh-slots-table td:not(.row-header) {
  text-align: center;
  min-width: 56px;
}


.early-shot-table thead th {
  text-align: center;
}

.early-shot-table td:not(.row-header) {
  text-align: center;
  min-width: 56px;
}


.lift-share-table thead th,
.lift-share-table td {
  text-align: center;
}


.no-results {
  text-align: center;
  padding: 40px 20px;
  color: rgba(255,255,255,.35);
  font-size: 14px;
}


@media (max-width: 640px) {
  .rules-page {
    padding: 90px 16px 48px;
  }

  .rules-nav {
    flex-direction: column;
  }

  .first-game-guide {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 22px;
  }

  .first-game-checklist {
    grid-template-columns: 1fr;
  }

  .first-game-checklist li {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 12px;
    min-height: 0;
  }

  .guide-step { margin: 2px 0 0; }

  .profiles-compare {
    flex-direction: column;
  }

  .profile-vs {
    display: none;
  }

  .scoring-card-main {
    grid-template-columns: 1fr;
    gap: 8px;
    position: relative;
    padding-right: 40px;
  }

  .scoring-card-values {
    align-items: flex-start;
  }

  .scoring-card-maxline {
    flex-wrap: wrap;
  }

  .scoring-card-toggle {
    position: absolute;
    top: 14px;
    right: 14px;
  }

  .roles-grid {
    grid-template-columns: 1fr;
  }

  .concepts-grid {
    grid-template-columns: 1fr;
  }
}



.gestures-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 4px;
}



.gestures-group-title {
    grid-column: 1 / -1;
    font-size: 16px;
    font-weight: 800;
    color: #a78bfa;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 14px 0 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.25);
}

.gestures-group-title:first-child {
    margin-top: 0;
}

.gestures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.gesture-card {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(38, 46, 74, .52), rgba(15, 23, 42, .48));
  transition: border-color .2s ease, transform .2s ease;
}

.gesture-card:hover {
  border-color: rgba(255, 255, 255, .18);
  transform: translateY(-2px);
}

.gesture-media {
  
  aspect-ratio: 16 / 10;
  background: radial-gradient(circle at 50% 42%, rgba(139, 92, 246, .14), transparent 55%), #10142c;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.gesture-media img,
.gesture-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gesture-body {
  padding: 12px 14px 14px;
}

.gesture-name {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
}

.gesture-desc {
  margin: 0;
  color: rgba(255, 255, 255, .6);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-line;
}

.gestures-error {
  color: #fca5a5;
}


.gesture-admin-row {
  display: flex;
  gap: 8px;
  padding: 0 14px 12px;
}

.gesture-admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 14px;
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 9px;
  background: rgba(30, 41, 59, .7);
  color: var(--text, #e5e7eb);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}

.gesture-admin-btn:hover {
  background: rgba(71, 85, 105, .8);
  border-color: rgba(167, 139, 250, .5);
}

.gesture-admin-btn.primary {
  background: var(--accent, #8b5cf6);
  border-color: transparent;
  color: #fff;
}

.gesture-admin-btn.danger {
  background: rgba(127, 29, 29, .6);
  border-color: rgba(248, 113, 113, .4);
  color: #fecaca;
}


.gesture-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .72);
}

.gesture-editor {
  width: min(440px, 94vw);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 16px;
  background: #131a30;
}

.gesture-editor h3 {
  margin: 0;
}

.gesture-editor label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, .7);
  font-weight: 600;
}

.gesture-editor input[type="text"],
.gesture-editor textarea {
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  padding: 10px 12px;
  color: #fff;
  font-size: 15px;
  resize: vertical;
}

.gesture-editor-hint {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, .45);
}

.gesture-editor-preview img,
.gesture-editor-preview video {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 10px;
  background: #10142c;
}

.gesture-editor-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}


.conduct-subhead {
  font-family: var(--font-body);
  letter-spacing: normal;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-soft);
  margin: 18px 0 8px;
}

.conduct-list {
  list-style: none;
  padding: 0;
  margin: 0 0 6px;
}

.conduct-list li {
  position: relative;
  padding: 6px 0 6px 26px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14.5px;
  line-height: 1.55;
}

.conduct-list li::before {
  content: '•';
  position: absolute;
  left: 8px;
  color: var(--accent-soft);
}


.conduct-list-ban li::before {
  content: '✕';
  left: 4px;
  font-size: 12px;
  top: 8px;
  color: #f87171;
}
