/* --- CORE STYLES --- */
:root {
  --bg-color: #1a1a1a;
  --card-bg: #252525;
  --text-color: #e0e0e0;
  --accent-color: #3498db;
  --highlight-color: #ca2627;
  --border-color: #3498db;
}

h1 {
  color: #fff;
  border-bottom: 1px solid var(--border-color);
  margin-top: 30px;
  font-size: 2em;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background: var(--bg-color);
  color: var(--text-color);
}

/* --- LAYOUT --- */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--accent-color);
}

header img {
  width: 100%;
  height: auto;
  max-height: 250px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin-bottom: 0px;
}

header h1 {
  color: #fff;
  border-bottom: 1px solid var(--border-color);
  font-size: 2em;
  border-bottom: none;
  padding-bottom: 0;
  margin-top: 15px;
}

.nav-container {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.nav-label {
  font-weight: bold;
  color: var(--accent-color);
}

select#chapter-select {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  background: #333;
  color: #fff;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
}

select#chapter-select:focus {
  outline: 2px solid var(--accent-color);
}

#rules-container {
  background: var(--card-bg);
  padding: 40px;
  border-radius: 8px;
  min-height: 400px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

h2 {
  color: var(--accent-color);
  margin-top: 40px;
  margin-bottom: 15px;
  font-size: 1.6em;
  border-left: 4px solid var(--accent-color);
  padding-left: 15px;
}

h3 {
  margin-top: 30px;
  margin-bottom: 10px;
  font-size: 1.3em;
}

p {
  margin-bottom: 15px;
  color: #ccc;
}

ul {
  background: rgba(0, 0, 0, 0.2);
  padding: 15px 15px 15px 40px;
  border-radius: 4px;
  margin-bottom: 20px;
}

li {
  margin-bottom: 5px;
}

strong {
  color: #fff;
}

#loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #333;
  border-top: 5px solid var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none !important;
}

footer {
  margin-top: 50px;
  text-align: center;
  padding: 20px;
  font-size: 0.9em;
  color: #777;
  border-top: 1px solid #333;
}

footer a {
  color: var(--accent-color);
  text-decoration: none;
}

.rule-indent {
    margin-left: 30px; 
    display: block;
}

ul.rule-indent {
    list-style-position: outside;
    padding-left: 20px; 
}

.highlight {
  color: var(--highlight-color);
font-weight: bold;
}

.rules-table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
}

.rules-table th, .rules-table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}

.rules-table th {
    color: var(--text-color);
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #3498db; 
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top:hover {
    background-color: #2980b9;
    transform: scale(1.1);
}

.back-to-top.hidden {
    display: none;
    opacity: 0;
}