* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Georgia', serif;
  color: #f5f5f5;
  background: #0a0f0c; 
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0; 
  left: 0;
  width: 100%; 
  height: 100%;
  background-image: url("fondodelcastillo.jpg");
  background-size: cover;
  background-position: center;
  opacity: 0.15;
  z-index: -1; /* Esto lo hace estar detrás de todo */
}

header {
  text-align: center;
  padding-top: 40px;
  margin-bottom: 30px;
}

header h1 {
  font-size: 42px;
  color: #c6a96b;
}

header p {
  font-size: 18px;
  color: #d7d3c8;
  margin-top: 10px;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px;
  gap: 40px;
}

.intro-cuadro {
  background: rgba(10, 20, 14, 0.5); 
  border-radius: 15px;
  border: 2px solid #3a613f;
  padding: 25px;
  max-width: 950px;
  text-align: justify;
}

.intro-cuadro h2 {
  color: #c6a96b;
  font-size: 28px;
  margin-bottom: 12px;
  text-align: center;
}

.intro-cuadro p {
  margin-bottom: 14px;
  color: #e1e5df;
  line-height: 1.6;
}

.cite {
  display: block;
  color: #b7b9b3;
  font-size: 0.9rem;
  margin-top: 4px;
  text-align: right;
}

.audio-centro {
  width: 100%;
  display: flex;
  justify-content: center;
}

audio {
  width: 300px;
}

.tabla-casas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  width: 100%;
  max-width: 1000px;
}

.caja {
  position: relative;
  padding: 20px;
  border-radius: 15px;
  border: 2px solid #3a613f;
  background: rgba(15, 30, 20, 0.5);
  overflow: hidden;
}

.caja::before {
  content: "";
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.15;
  z-index: 0;
}

.gryffindor::before { background-image: url('gryffindor.jpg'); }
.slytherin::before { background-image: url('slytherin.jpg'); }
.ravenclaw::before { background-image: url('ravenclaw.jpg'); }
.hufflepuff::before { background-image: url('hufflepuff.jpg'); }

.caja h3 {
  font-size: 24px;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
  color: #f5f5f5;
}

.caja p {
  position: relative;
  z-index: 1;
  color: #e1e5df;
  font-size: 15px;
  line-height: 1.6;
}

.caja .cite {
  text-align: right;
  font-style: italic;
  margin-top: 6px;
}

footer {
  text-align: center;
  padding: 25px;
  background: rgba(5, 10, 8, 0.8);
  border-top: 2px solid #3a613f;
}

.buttons {
  text-align: center;
  margin: 30px 0;
}

.boton-caja,
.buttons a {
  display: inline-block;
  text-decoration: none;
  color: #e9e4d6;
  background: rgba(20, 50, 25, 0.7);
  border: 2px solid #3a613f;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: bold;
  margin: 8px;
  transition: 0.3s ease;
}

.boton-caja:hover,
.buttons a:hover {
  background: rgba(20, 50, 25, 0.9);
  border-color: #c6a96b;
}
