/* CajaRitmos – integrado con el estilo EduMúsic */

body.cajaritmos-page {
  text-align: left;
}

.cajaritmos-header {
  text-align: center;
  margin: 0 auto 18px;
  max-width: 1100px;
}

.cajaritmos-header img {
  display: block;
  width: 88px;
  height: 88px;
  margin: 0 auto 10px;
}

.cajaritmos-header h1 {
  margin: 0;
}

.cajaritmos-subtitle {
  max-width: 720px;
  margin: 10px auto 14px;
  font-size: 1.05rem;
  color: #475569;
  line-height: 1.4;
}

.cajaritmos {
  max-width: 1400px;
  margin: 0 auto;
}

.cajaritmos-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 18px;
  align-items: start;
}

.cajaritmos-card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.cajaritmos-theory {
  padding: 18px 18px;
  max-height: min(820px, 75vh);
  overflow: auto;
}

.cajaritmos-theory::-webkit-scrollbar {
  width: 10px;
}

.cajaritmos-theory::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.8);
  border-radius: 999px;
}

.cajaritmos-theory::-webkit-scrollbar-thumb {
  background: rgba(37, 99, 235, 0.55);
  border-radius: 999px;
}

.cajaritmos-section {
  margin-bottom: 18px;
}

.cajaritmos-section h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  color: #0f172a;
}

.cajaritmos-section h3 {
  margin: 12px 0 6px;
  font-size: 1.02rem;
  color: #1d4ed8;
}

.cajaritmos-section p,
.cajaritmos-section ul {
  margin: 0.35rem 0;
  color: #334155;
  line-height: 1.55;
  font-size: 0.97rem;
}

.cajaritmos-section ul {
  padding-left: 1.1rem;
}

.cajaritmos-section li {
  margin: 0.35rem 0;
}

.music-notation {
  background: rgba(37, 99, 235, 0.08);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 1.35rem;
  text-align: center;
  color: #0f172a;
  margin: 10px 0;
}

.cajaritmos-panel {
  padding: 18px 18px 22px;
}

.cajaritmos-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-group label {
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
  font-weight: 700;
}

.control-group .value {
  font-size: 1.4rem;
  font-weight: 800;
  color: #1d4ed8;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #2563eb;
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #2563eb;
  border-radius: 50%;
  border: none;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

.signature-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.signature-btns button {
  flex: 1 1 70px;
  min-width: 72px;
  border: 2px solid rgba(236, 72, 153, 0.9);
  background: rgba(236, 72, 153, 0.08);
  color: #9d174d;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.signature-btns button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(236, 72, 153, 0.18);
}

.signature-btns button.active {
  background: rgba(236, 72, 153, 0.95);
  color: #fff;
  box-shadow: 0 14px 24px rgba(236, 72, 153, 0.28);
}

.examples-section {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.18);
}

.examples-section h3 {
  margin: 0 0 10px;
  color: #0f766e;
  font-size: 1.05rem;
}

.example-btns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.example-btn {
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(255, 255, 255, 0.7);
  color: #0f172a;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.example-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(2, 132, 199, 0.10);
}

.sequencer {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.sequencer-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: center;
}

.instrument-label {
  font-weight: 800;
  color: #0f172a;
  font-size: 0.95rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 6px;
}

.cell {
  aspect-ratio: 1 / 1;
  background: #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.08s ease;
  border: 2px solid transparent;
  position: relative;
}

.cell:hover {
  transform: scale(1.04);
  border-color: rgba(37, 99, 235, 0.6);
}

.cell.active {
  background: rgba(37, 99, 235, 0.95);
  box-shadow: 0 12px 20px rgba(37, 99, 235, 0.22);
}

.cell.playing {
  transform: scale(1.10);
  border-color: rgba(15, 23, 42, 0.8);
  z-index: 3;
}

.cell.accent {
  box-shadow: inset 0 -4px 0 rgba(239, 68, 68, 0.85);
}

.cell.disabled {
  opacity: 0.30;
  cursor: not-allowed;
  pointer-events: none;
}

.cajaritmos-metronome {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.beat-indicators {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.beat-indicator {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #fff;
  border: 3px solid rgba(37, 99, 235, 0.55);
  transition: transform 0.08s ease, background 0.08s ease, box-shadow 0.08s ease;
}

.beat-indicator.strong {
  background: rgba(236, 72, 153, 0.9);
  border-color: rgba(236, 72, 153, 1);
  transform: scale(1.12);
  box-shadow: 0 14px 26px rgba(236, 72, 153, 0.25);
}

.beat-indicator.weak {
  background: rgba(37, 99, 235, 0.9);
  border-color: rgba(37, 99, 235, 0.95);
  box-shadow: 0 12px 20px rgba(37, 99, 235, 0.18);
}

.measure-counter {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

.info-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.22);
  color: #0f172a;
  line-height: 1.5;
}

.info-box strong {
  color: #92400e;
}

.transport {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.transport button {
  border: none;
  background: #2563eb;
  color: #fff;
  padding: 14px 22px;
  font-size: 1.05rem;
  font-weight: 800;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.18);
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.transport button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 36px rgba(37, 99, 235, 0.22);
}

.transport button.playing {
  background: #ef4444;
  box-shadow: 0 18px 34px rgba(239, 68, 68, 0.20);
}

.transport .clear-btn {
  background: #475569;
}

.transport .clear-btn:hover {
  background: #334155;
}

.cajaritmos-home {
  margin: 18px auto 0;
}

@media (max-width: 1100px) {
  .cajaritmos-grid {
    grid-template-columns: 1fr;
  }
  .cajaritmos-theory {
    max-height: none;
  }
}

@media (max-width: 760px) {
  .grid {
    gap: 4px;
  }
  .sequencer-row {
    grid-template-columns: 1fr;
  }
  .signature-btns button {
    min-width: 92px;
  }
  .beat-indicator {
    width: 38px;
    height: 38px;
  }
}
