/* ═══════════════════════════════════════════════════
   REGULAMIN — kompaktowa siatka + opis po hover/tap
   ═══════════════════════════════════════════════════ */

.lbn-rules .cmd-hero {
  margin-bottom: 10px;
}

.lbn-rules .cmd-lead {
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.lbn-rules .rul-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 10px;
  margin: 0 0 14px;
  padding: 8px 6px;
  border: 1px solid rgba(138, 106, 26, 0.4);
  background: rgba(0, 0, 0, 0.25);
}

.rul-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: "Cinzel", serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ── Znaki ── */
.rul-sign {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: 2px solid currentColor;
  background: rgba(0, 0, 0, 0.45);
  color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.rul-sign__mark {
  font-family: "Cinzel", Georgia, serif;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.rul-legend .rul-sign {
  width: 20px;
  height: 20px;
}

.rul-legend .rul-sign__mark {
  font-size: 10px;
}

.rul-sign--info {
  border-radius: 50%;
  color: #7eb8d8;
  border-color: #5a9ec4;
  background: radial-gradient(circle at 40% 35%, #2a3a48, #121820);
}

.rul-sign--obowiazek {
  border-radius: 2px;
  color: #8fd49a;
  border-color: #5aab68;
  background: linear-gradient(180deg, #1e3020, #101810);
}

.rul-sign--zakaz {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  color: #f0a0a0;
  border-color: #c04040;
  background: linear-gradient(180deg, #3a1818, #1a0c0c);
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
}

.rul-legend .rul-sign--zakaz {
  width: 22px;
  height: 22px;
}

.rul-sign--ostrzezenie {
  width: 30px;
  height: 26px;
  border: none;
  background: transparent;
  box-shadow: none;
  color: #e8c060;
}

.rul-sign--ostrzezenie::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #1a1408;
  border: 2px solid #c9a030;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.rul-sign--ostrzezenie .rul-sign__mark {
  position: relative;
  z-index: 1;
  margin-top: 6px;
  font-size: 12px;
  color: #ffd76a;
}

.rul-legend .rul-sign--ostrzezenie {
  width: 22px;
  height: 20px;
}

.rul-legend .rul-sign--ostrzezenie .rul-sign__mark {
  margin-top: 4px;
  font-size: 9px;
}

.rul-sign--kara {
  width: 26px;
  height: 26px;
  transform: rotate(45deg);
  border-radius: 2px;
  color: #e07080;
  border-color: #a83848;
  background: linear-gradient(135deg, #3a1820, #180c10);
}

.rul-sign--kara .rul-sign__mark {
  transform: rotate(-45deg);
  font-size: 12px;
}

.rul-legend .rul-sign--kara {
  width: 18px;
  height: 18px;
}

.rul-sign--prawo {
  width: 26px;
  height: 30px;
  border-radius: 3px 3px 12px 12px;
  color: #d0b878;
  border-color: #a08840;
  background: linear-gradient(180deg, #2e2614, #161208);
}

.rul-legend .rul-sign--prawo {
  width: 18px;
  height: 22px;
}

/* ── Animowane wykrzykniki / znaki ── */
@keyframes rul-bang-pulse {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    filter: brightness(1);
  }
  35% {
    transform: scale(1.14) rotate(-4deg);
    filter: brightness(1.25);
  }
  55% {
    transform: scale(1.08) rotate(3deg);
    filter: brightness(1.15);
  }
}

@keyframes rul-bang-glow {
  0%, 100% { box-shadow: 0 0 0 0 transparent, inset 0 0 0 1px rgba(0, 0, 0, 0.35); }
  50% { box-shadow: 0 0 10px 1px rgba(212, 175, 55, 0.35), inset 0 0 0 1px rgba(0, 0, 0, 0.35); }
}

@keyframes rul-bang-mark {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-2px); }
  70% { transform: translateY(1px); }
}

.rul-sign--bang {
  animation:
    rul-bang-pulse 2.4s ease-in-out infinite,
    rul-bang-glow 2.4s ease-in-out infinite;
  animation-delay: var(--bang-delay, 0s);
}

.rul-sign--bang .rul-sign__mark {
  animation: rul-bang-mark 2.4s ease-in-out infinite;
  animation-delay: var(--bang-delay, 0s);
}

.rul-sign--kara.rul-sign--bang {
  animation-name: rul-bang-pulse-dia, rul-bang-glow;
}

@keyframes rul-bang-pulse-dia {
  0%, 100% {
    transform: rotate(45deg) scale(1);
    filter: brightness(1);
  }
  35% {
    transform: rotate(45deg) scale(1.12);
    filter: brightness(1.2);
  }
  55% {
    transform: rotate(45deg) scale(1.06);
    filter: brightness(1.1);
  }
}

.rul-sign--kara.rul-sign--bang .rul-sign__mark {
  animation: none;
  transform: rotate(-45deg);
}

/* ── Siatka kart ── */
.rul-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}

.rul-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 2px solid var(--gold-dark);
  background:
    var(--crack),
    linear-gradient(180deg, #2a2118, #181410);
  background-size: 220px 160px, auto;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
  z-index: 1;
}

.rul-card:hover,
.rul-card:focus-visible,
.rul-card.is-open {
  border-color: var(--gold);
  outline: none;
  z-index: 5;
  transform: translateY(-1px);
}

.rul-card__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.rul-card__label {
  font-family: "Cinzel", serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.rul-sign-label--obowiazek { color: #b8e6b8; }
.rul-sign-label--zakaz { color: #e07080; }
.rul-sign-label--ostrzezenie { color: #f0a070; }
.rul-sign-label--kara { color: #e07080; }
.rul-sign-label--prawo { color: #d0b878; }
.rul-sign-label--info { color: #9ec8e0; }

.rul-card__title {
  font-family: "Cinzel", serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f0e2b8;
  line-height: 1.25;
}

.rul-card__hint {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 50%;
  font-family: "Cinzel", serif;
  font-size: 10px;
  font-weight: 800;
  color: var(--gold);
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.rul-card:hover .rul-card__hint,
.rul-card.is-open .rul-card__hint {
  opacity: 1;
  transform: scale(1.1);
}

/* ── Tooltip / opis ── */
.rul-card__tip {
  position: absolute;
  left: 8px;
  right: 8px;
  top: calc(100% + 4px);
  padding: 0;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px) scale(0.98);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    visibility 0.22s;
  z-index: 20;
}

.rul-card__tip-inner {
  position: relative;
  display: block;
  padding: 10px 12px;
  border: 1px solid rgba(212, 175, 55, 0.55);
  background: linear-gradient(180deg, #2c2418, #15110c);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.55);
  font-family: "Crimson Pro", Georgia, serif;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  text-align: left;
}

.rul-card__tip-inner::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 22px;
  width: 8px;
  height: 8px;
  border-left: 1px solid rgba(212, 175, 55, 0.55);
  border-top: 1px solid rgba(212, 175, 55, 0.55);
  background: #2c2418;
  transform: rotate(45deg);
}

.rul-card:hover .rul-card__tip,
.rul-card:focus-visible .rul-card__tip,
.rul-card.is-open .rul-card__tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* dolny rząd — tooltip w górę, żeby nie wychodził poza arkusz */
.rul-card:nth-last-child(-n+2) .rul-card__tip {
  top: auto;
  bottom: calc(100% + 4px);
}

.rul-card:nth-last-child(-n+2) .rul-card__tip-inner::before {
  top: auto;
  bottom: -5px;
  border-left: none;
  border-top: none;
  border-right: 1px solid rgba(212, 175, 55, 0.55);
  border-bottom: 1px solid rgba(212, 175, 55, 0.55);
}

@media (max-width: 620px) {
  .rul-grid {
    grid-template-columns: 1fr;
  }

  .rul-card__title {
    font-size: 12px;
  }

  .rul-card:nth-last-child(-n+2) .rul-card__tip {
    top: calc(100% + 4px);
    bottom: auto;
  }

  .rul-card:nth-last-child(-n+2) .rul-card__tip-inner::before {
    top: -5px;
    bottom: auto;
    border-right: none;
    border-bottom: none;
    border-left: 1px solid rgba(212, 175, 55, 0.55);
    border-top: 1px solid rgba(212, 175, 55, 0.55);
  }

  .rul-card:last-child .rul-card__tip {
    top: auto;
    bottom: calc(100% + 4px);
  }

  .rul-card:last-child .rul-card__tip-inner::before {
    top: auto;
    bottom: -5px;
    border-left: none;
    border-top: none;
    border-right: 1px solid rgba(212, 175, 55, 0.55);
    border-bottom: 1px solid rgba(212, 175, 55, 0.55);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rul-sign--bang,
  .rul-sign--bang .rul-sign__mark {
    animation: none;
  }

  .rul-card__tip {
    transition: none;
  }
}
