/* ==========================================================================
   TAIXU — Manual de Regras
   ========================================================================== */

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 15px;
}

.container {
  width: 100%;
  max-width: 900px;
  background: var(--panel-bg);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), inset 0 0 20px rgba(0, 240, 255, 0.1);
  backdrop-filter: blur(12px);
}

header {
  text-align: center;
  margin-bottom: 25px;
}

h1 {
  font-size: clamp(1.6rem, 6vw, 2.2rem);
}

.search-box {
  margin-top: 15px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 12px 20px;
  border-radius: 25px;
  border: 1px solid rgba(0, 240, 255, 0.4);
  background: rgba(10, 15, 30, 0.8);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-box input:focus {
  border-color: var(--accent-p1);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

/* Navegação por abas */
.tabs-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  font-weight: bold;
  transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--accent-p1);
  background: rgba(0, 240, 255, 0.05);
}

.tab-btn.active {
  color: #fff;
  background: linear-gradient(45deg, rgba(157, 0, 255, 0.4), rgba(0, 240, 255, 0.2));
  border-color: var(--accent-p1);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

/* Conteúdo das abas */
.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

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

/* Acordeões */
.accordion-item {
  background: rgba(15, 20, 35, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.25s ease;
}

.accordion-item:hover {
  border-color: rgba(0, 240, 255, 0.3);
}

.accordion-header {
  padding: 15px 20px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  width: 100%;
  background: transparent;
  border: none;
  text-align: left;
}

.accordion-header::after {
  content: '▲';
  font-size: 0.8rem;
  color: var(--accent-p1);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.accordion-item.collapsed .accordion-header::after {
  transform: rotate(180deg);
}

.accordion-body {
  padding: 0 20px 18px 20px;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.95rem;
  -webkit-user-select: text;
  user-select: text;
}

.accordion-body strong { color: var(--text-color); }

.accordion-item.collapsed .accordion-body {
  display: none;
}

/* Simuladores */
.demo-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed rgba(0, 240, 255, 0.3);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-top: 15px;
  margin-bottom: 20px;
  text-align: center;
}

.demo-box h3 { margin-bottom: 6px; }

.demo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(48px, 55px));
  gap: 8px;
  justify-content: center;
  margin: 15px 0;
}

.demo-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 15px 0;
  flex-wrap: wrap;
}

.demo-cell {
  width: 55px;
  height: 55px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1rem;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.demo-cell span.label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.demo-cell.active {
  background: rgba(157, 0, 255, 0.4);
  border-color: var(--accent-purple);
  color: var(--accent-p1);
  box-shadow: 0 0 10px rgba(157, 0, 255, 0.5);
}

.demo-cell.swapped {
  background: rgba(0, 240, 255, 0.3);
  border-color: var(--accent-p1);
  box-shadow: 0 0 12px var(--accent-p1);
}

.demo-cell.exploded {
  background: rgba(255, 0, 85, 0.5);
  border-color: var(--accent-p2);
  box-shadow: 0 0 15px var(--accent-p2);
}

/* Rodapé de navegação */
.back-nav {
  margin-top: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-back {
  color: var(--accent-p1);
  text-decoration: none;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s ease;
}

.btn-back:hover {
  transform: translateX(-4px);
}

.btn-back.forward { color: var(--accent-purple); }
.btn-back.forward:hover { transform: translateX(4px); }
