/* «Как считаются очки» (rules.js): кнопка на стартовом экране игры и панель с таблицей */
.rules-btn {
  display: inline-flex; align-items: center; gap: 8px; margin: 10px auto 0; padding: 10px 16px; min-height: 44px; border-radius: 12px; border: 0;
  background: var(--surface); color: var(--text); font: inherit; font-size: 15px; font-weight: 700; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer;
}
.rules-btn:active { transform: scale(.97); }
.rules-q {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-style: normal; font-weight: 900; font-size: 15px;
  background: var(--gold); color: var(--gold-ink);
}
.rules-ov {
  position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .66);
  padding: 0 0 var(--safe-b);
}
.rules-box {
  width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg2); color: var(--text); border-radius: 18px 18px 0 0; padding: 16px 16px 16px; box-shadow: var(--shadow);
}
.rules-h { margin: 0; font-size: 20px; line-height: 1.2; font-weight: 800; }
.rules-sub { margin: 2px 0 10px; font-size: 14px; color: var(--muted); font-weight: 600; }
.rules-list { display: flex; flex-direction: column; gap: 6px; }
.rules-row { padding: 8px 10px; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.rules-line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.rules-what { font-size: 15px; font-weight: 700; line-height: 1.25; }
.rules-val { flex: none; font-size: 17px; font-weight: 900; color: var(--gold); white-space: nowrap; }
.rules-note { margin-top: 2px; font-size: 13px; line-height: 1.3; color: var(--muted); }
.rules-row.prac .rules-val { color: #3ecf6a; }
.rules-ok { width: 100%; margin-top: 12px; min-height: 46px; font-size: 16px; }
:root[data-theme="light"] .rules-ov { background: rgba(14, 18, 32, .5); }
:root[data-theme="light"] .rules-val { color: #b45f00; }
:root[data-theme="light"] .rules-row.prac .rules-val { color: #168a3c; }
body.rules-on { overflow: hidden; }
.rline { margin-top: 4px; font-size: 13.5px; font-weight: 700; color: var(--text); }
.cbreak { margin-top: 3px; font-size: 13px; font-weight: 700; color: var(--text); }

/* кнопка «?» в верхней строке раунда: класс .rules-top делят строка панели (flex, baseline) и эта кнопка, поэтому здесь всё задано явно:
   тот же размер и рамка, что у соседней кнопки паузы (44x44), значок строго по центру */
.rules-btn.rules-top {
  display: inline-flex; align-items: center; justify-content: center; align-self: center; gap: 0;
  width: 44px; height: 44px; min-height: 44px; margin: 0; padding: 0; border-radius: 10px;
}
.rules-btn.rules-top .rules-q { width: 26px; height: 26px; font-size: 16px; line-height: 1; padding-bottom: 1px; box-sizing: border-box; flex: none; }
.rules-btn { transition: transform .15s var(--ease, ease), box-shadow .2s; }
.rules-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.rules-q { transition: transform .25s var(--ease, ease); }
.rules-btn:active .rules-q { transform: rotate(-12deg) scale(1.08); }

/* Ритм-бот: правила разделами (details) и пометка «Правила обновлены» с коротким списком */
.rules-sec { margin-top: 8px; }
.rules-sech {
  position: relative; display: flex; align-items: center; min-height: 48px; padding: 8px 40px 8px 12px; border-radius: 12px; cursor: pointer; list-style: none;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 16px; font-weight: 800; line-height: 1.2;
}
.rules-sech::-webkit-details-marker { display: none; }
.rules-sech::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform .2s ease; opacity: .7;
}
.rules-sec[open] > .rules-sech::after { transform: rotate(-135deg); margin-top: -2px; }
.rules-sech:focus-visible { outline: 2px solid var(--acc, var(--gold)); outline-offset: 2px; }
.rules-big { margin-top: 8px; padding: 12px; border-radius: var(--ui-radius, 16px); background: color-mix(in srgb, var(--acc, var(--gold)) 16%, transparent); box-shadow: inset 0 0 0 1px var(--acc, var(--gold)); font-size: 20px; line-height: 1.25; font-weight: 800; text-align: center; }
.rules-sec .rules-list { margin-top: 6px; }
.rules-new {
  margin: 10px 0 2px; padding: 12px; border-radius: 14px; background: var(--surface2, var(--surface)); box-shadow: inset 0 0 0 2px var(--acc, var(--gold));
}
.rules-newh { display: block; font-size: 15px; font-weight: 800; color: var(--acc, var(--gold)); }
.rules-chg { margin: 6px 0 0; padding: 0 0 0 18px; font-size: 15px; line-height: 1.35; font-weight: 600; }
.rules-chg li + li { margin-top: 4px; }
.rules-upd .rules-h { font-size: 22px; }
html[data-brand] .rules-ok { position: sticky; bottom: 0; box-shadow: 0 0 0 10px var(--bg2); }
@media (prefers-reduced-motion: no-preference) { .rules-upd { animation: rules-in .35s ease both; } }
@keyframes rules-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
