:root {
  --bg: #0f1216;
  --panel: #151a21;
  --text: #e6e9ef;
  --muted: #b8beca;
  --primary: #f59e0b;
  --primary-700: #d97706;
  --accent: #f97316;
  --danger: #ef4444;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
}

* {
  box-sizing: border-box;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #0c0f13;
  border-left: 1px solid rgba(255,255,255,0.05);
}

::-webkit-scrollbar-thumb {
  background: #333944;
  border-radius: 5px;
  border: 2px solid #0c0f13;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Firefox support */
* {
  scrollbar-width: thin;
  scrollbar-color: #333944 #0c0f13;
}


html, body {
  height: 100%;
}

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 10% 0%, #0c0f13 0%, var(--bg) 40%, #0a0d10 100%);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, sans-serif;
  line-height: 1.6;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.container.narrow {
  max-width: 560px;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 60;
  background: rgba(21, 26, 33, 0.95);
  backdrop-filter: blur(12px);
  color: var(--text);
  display: grid;
  grid-template-columns: 320px 1fr 120px;
  align-items: center;
  gap: 16px;
  padding: 10px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.brand {
  font-weight: 700;
  letter-spacing: .3px;
  display: flex;
  align-items: center;
  font-size: 1.1em;
}

.brand .logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  margin-right: 12px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.search {
  position: relative;
}

.search input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  outline: none;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  transition: all 0.2s ease;
}

.search input:focus {
  background: rgba(0, 0, 0, 0.4);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1a1f27;
  border: 1px solid #202733;
  border-radius: 8px;
  margin-top: 8px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: none;
}

.search-results.active {
  display: block;
}

.search-item {
  padding: 12px 16px;
  border-bottom: 1px solid #202733;
  cursor: pointer;
  transition: background 0.2s;
}

.search-item:last-child {
  border-bottom: none;
}

.search-item:hover {
  background: #222733;
}

.search-item-title {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95em;
  margin-bottom: 4px;
}

.search-item-text {
  color: var(--muted);
  font-size: 0.85em;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.highlight {
  background: rgba(245, 158, 11, 0.3);
  color: #fff;
  border-radius: 2px;
  padding: 0 2px;
}

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

.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--muted);
  background: rgba(255,255,255,0.05);
  transition: all 0.2s;
  border: 1px solid transparent;
}

.action:hover {
  background: rgba(255,255,255,0.1);
  color: var(--primary);
  border-color: rgba(255,255,255,0.1);
  transform: translateY(-1px);
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  padding: 16px;
  margin-top: 70px; /* Offset for fixed header */
}

.sidebar {
  background: #1a1f27;
  border: 1px solid #202733;
  border-radius: 8px;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.sidebar-group + .sidebar-group {
  border-top: 1px solid #202733;
}

.group-title {
  color: var(--muted);
  padding: 12px 14px;
}

.menu {
  display: grid;
  gap: 4px;
  padding: 6px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--text);
  border-radius: 8px;
}

.menu-item:hover {
  background: #222733;
}

.chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  margin-left: 2px;
}

.content {
  min-height: 60vh;
}

.content-header h1 {
  margin: 0 0 10px;
  font-size: 22px;
}

.content-section h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 12px;
  font-size: 20px;
}

.emoji {
  color: var(--accent);
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-right: 8px;
}

.badge.red {
  color: #ffe7e7;
  background: #7f1d1d;
  border: 1px solid #991b1b;
}

.badge.blue {
  color: #e6f0ff;
  background: #0c326e;
  border: 1px solid #0a2971;
}

.badge.white {
  color: #111;
  background: #e5e7eb;
  border: 1px solid #d1d5db;
}

.bullets {
  margin: 8px 0 0;
  padding-left: 18px;
}

.banner {
  background: #0f4aa5;
  border: 1px solid #0e3e8c;
  color: #cfe2ff;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.card {
  background: #232832;
  border: 1px solid #2b3240;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 10px 0;
}

.card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--text);
}

.card-body {
  color: var(--muted);
}

.panel {
  background: #151a21;
  border: 1px solid #202733;
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin: 16px 0;
}

.panel-title {
  padding: 14px 16px;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid #202733;
}

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

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  border-radius: 8px;
}

.row:hover {
  background: #1a2029;
}

.chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  margin-left: 2px;
}

.site-footer {
  margin-top: 40px;
  border-top: 1px solid #1f2530;
  background: #0d1014;
}

.site-footer .container {
  padding: 20px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

@media (max-width: 960px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .layout {
    grid-template-columns: 1fr;
  }
}

/* Active Menu State */
.menu-item.active {
  background: rgba(245, 158, 11, 0.1);
  color: var(--primary);
  border-left: 3px solid var(--primary);
}

.menu-item.active .chevron {
  border-color: var(--primary);
}

/* Illegal Table Styles */
.illegal-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  min-width: 1000px; /* Ensure table doesn't squish too much */
}

.illegal-table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #2b3240;
}

.illegal-table th {
  text-align: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.85em;
  text-transform: uppercase;
  border-bottom: 2px solid #2b3240;
  border-right: 1px solid #2b3240;
}

.illegal-table th:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: #232832; /* Match card bg */
  z-index: 10;
  border-right: 2px solid #2b3240;
}

.illegal-table td {
  padding: 10px;
  border-bottom: 1px solid #2b3240;
  border-right: 1px solid #2b3240;
  color: var(--muted);
  text-align: center;
}

.illegal-table td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: #232832;
  z-index: 10;
  border-right: 2px solid #2b3240;
  font-weight: 600;
  color: var(--text);
}

.illegal-table tr:last-child td {
  border-bottom: none;
}

.illegal-table tr:hover td {
  background: rgba(255,255,255,0.02);
}
.illegal-table tr:hover td:first-child {
  background: #232832; /* Keep sticky col bg solid */
}

.info-box {
  background: #0056b3; /* Blue background like screenshot */
  color: white;
  padding: 16px;
  border-radius: 8px;
  margin-top: 20px;
  font-size: 0.95em;
  line-height: 1.5;
}

.warning-box {
  background: #d97706; /* Orange background */
  color: white;
  padding: 16px;
  border-left: 5px solid #f59e0b;
  border-radius: 4px;
  margin: 15px 0;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
}

.info-alert {
  background: #0056b3; /* Blue background matching info-box */
  color: white;
  padding: 16px;
  border-left: 5px solid #3b82f6;
  border-radius: 4px;
  margin: 15px 0;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
}

.error-box {
  background: #b91c1c; /* Red background */
  color: white;
  padding: 16px;
  border-left: 5px solid #ef4444;
  border-radius: 4px;
  margin: 15px 0;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
}

.success-box {
  background: #15803d; /* Green background */
  color: white;
  padding: 16px;
  border-left: 5px solid #22c55e;
  border-radius: 4px;
  margin: 15px 0;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
}

.warning-icon, .info-icon, .error-icon, .success-icon {
  font-size: 24px;
  min-width: 24px; /* Ensure icon doesn't shrink */
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.info-item {
  background: #2a2a2a;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #333;
}

.info-item p {
  margin-bottom: 10px;
  color: #e5e7eb;
}

.info-img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid #444;
}

.info-box .legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-weight: 700;
}

.info-box .note {
  margin-top: 8px;
  opacity: 0.9;
  font-size: 0.9em;
}

.check {
  color: #4ade80; /* Brighter Green */
  font-weight: bold;
  font-size: 1.2em;
}

.cross {
  color: #f87171; /* Brighter Red */
  font-weight: bold;
  font-size: 1.2em;
}

.quote-box {
  background: #334155;
  border-left: 4px solid #64748b;
  padding: 20px;
  border-radius: 6px;
  margin: 20px 0;
  display: flex;
  gap: 15px;
}

.quote-icon {
  font-size: 40px;
  color: #94a3b8;
  font-family: serif;
  line-height: 1;
  margin-top: -10px;
}

.no-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
}

.no-bullets li {
  margin-bottom: 5px;
  color: #e2e8f0;
}

.no-bullets strong {
  color: #fff;
  font-weight: 700;
}

.chevron-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.chevron-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  color: var(--text);
}

.chevron-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
}

/* Server Rules Styles */
.info-banner {
  background: #1e40af; /* Blue-800 */
  border-left: 5px solid #3b82f6; /* Blue-500 */
  color: white;
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 25px;
  display: flex;
  gap: 15px;
  align-items: flex-start;
}

.info-banner .info-icon {
  font-size: 24px;
  margin-top: -2px;
}

.rule-box {
  background: #1e293b; /* Slate-800 */
  border-radius: 8px;
  padding: 0;
  margin-bottom: 20px;
  display: flex;
  overflow: hidden;
  border: 1px solid #334155;
}

.rule-box .icon-column {
  background: #334155; /* Slate-700 */
  width: 50px;
  display: flex;
  justify-content: center;
  padding-top: 20px;
  flex-shrink: 0;
}

.rule-box .quote-symbol {
  font-size: 30px;
  color: #94a3b8;
  font-family: serif;
  line-height: 1;
}

.rule-box .content-column {
  padding: 20px;
  flex-grow: 1;
}

.rule-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
  font-size: 1.1em;
}

.rule-name {
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rule-def {
  color: #cbd5e1;
  font-weight: 400;
}

.rule-section {
  margin-bottom: 15px;
}

.rule-section:last-child {
  margin-bottom: 0;
}

.rule-header {
  font-weight: 700;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rule-header.forbidden {
  color: #60a5fa; /* Blue-400 */
}

.rule-header.allowed {
  color: #4ade80; /* Green-400 */
}

.rule-content {
  padding-left: 24px; /* Align with text start */
  color: #e2e8f0;
  font-size: 0.95em;
}

.rule-content p {
  margin: 4px 0;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 200;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #1a1f27;
  border: 1px solid #202733;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #202733;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.2em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.close-modal {
  color: var(--muted);
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.close-modal:hover {
  color: var(--primary);
}

.modal-body {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
}

.tip-item {
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  display: flex;
  gap: 15px;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.tip-item:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.05);
  transform: translateX(4px);
}

.tip-icon {
  font-size: 24px;
  min-width: 24px;
  padding-top: 2px;
}

.tip-text strong {
  display: block;
  color: var(--primary);
  margin-bottom: 4px;
  font-size: 1.05em;
}

.tip-text p {
  margin: 0;
  font-size: 0.9em;
  color: var(--muted);
  line-height: 1.4;
}
