/*
pagina: Blanconomicon
Estilo principal para moviles max 750px

***HOJA DE ESTILOS***
LISTA DE CONTENIDOS
01.Colores y estilos
02. General
03. Tablas
04. Barra de Navegacion
05. Superior a tarjetas
06. Tarjetas
07. Footer
08. Cookie
09. Media Tablets
10. Media Escritorio 
11. Media Print  
12. Character Sheet  
*/

/*    TODO Cambiar Fuente    */
@font-face {
  font-family: 'KingsCross';
  src: url(../src/font/DragonHunter-9Ynxj.otf);
}

/******************************/
/*    01.Colores y Estilos    */
/******************************/
:root {
  --granate: #b00000;
  --hueso: #f0ece4;
  --negro: #000000;
  --apoyo: #d9c7a3;
  --fondo-section: #f2e7dc;
  --tarjeta: #b2f5f8;
  --fondo-principal: #f4f4f4;
  --fondo: #ffffffc9;
  --fondo-header: #333;
  --fondo-footer: brown;
  --box-shadow: rgba(0, 0, 0, 0.2);
}

/******************************/
/*    02.General              */
/******************************/
html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas: "header"
    "main"
    "footer";
  background-color: var(--fondo-principal);
  height: 100vh;
  overflow: hidden;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--fondo-header);
  padding: 1em 0;
  height: auto;
}

header h1 {
  color: var(--hueso);
  margin: 0;
  text-align: center;
}

.derecha-header {
  margin-top: 0.5em;
  text-align: center;
}

.derecha-header span {
  padding: 0.3rem 0.6rem;
  border-radius: 0.6rem;
  border: 1px solid #ccc;
  font-size: 1em;
  background: white;
  margin-left: 0.4em;
}


main {
  margin-top: 6em;
  margin-bottom: 3em;
  overflow: auto;
  padding: 1rem;
  height: calc(100vh - 6em - 5em);
}

section {
  overflow: auto;
}

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

select {
  text-align: center;
  width: 100%;
  margin: auto;
}

textarea {
  height: 10em;
}

button,
input[type="submit"] {
  border-radius: 7em;
}

.activo {
  color: var(--negro)
}

.ocupaTodo {
  width: 100%;
}

.contenedor {
  padding: 1em;
  background-color: var(--fondo);
  border-radius: 2em;
}

.modal {
  position: fixed;
  left: 25%;
  top:20%;
  background: #fff;
  padding: 20px;
  border: 1px solid #000;
}

.centrado {
  display: block;
  margin: 20px auto;
  text-align: center;
}

/******************************/
/*    03.Tablas               */
/******************************/
table {
  width: 90%;
  margin: auto;
  border: thin solid #cccccc;
  background: #ffffff;
  border-collapse: collapse;
}

td,
th {
  border: thin solid #cccccc;
  padding: 1em;
}

th {
  text-transform: uppercase;
  text-align: center;
}

.equipo>tr:hover {
  background-color: var(--granate);
  color: var(--hueso);
}

/******************************/
/*    04.Barra de Navegacion  */
/******************************/
.menu {
  font-weight: 500;
  color: var(--granate);
  display: flex;
  align-items: center;
  position: absolute;
  top: 0.8rem;
  left: 1.25rem;
  gap: 0.9rem;
  padding: 0.9375rem;
  background-color: var(--hueso);
  border-radius: 1.25rem;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.menu--logo {
  width: 2.5rem;
  height: auto;
}

@media (max-width: 999px) {

  /* Icono hamburguesa */
  .menu-hamburguesa {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 2rem;
    height: 2rem;
    cursor: pointer;
    position: absolute;
    left: 1rem;
    top: 1.5rem;
    z-index: 1001;
  }

  .menu-hamburguesa .bar {
    width: 100%;
    height: 3px;
    background-color: var(--granate);
    transition: 0.3s;
  }

  .menu-hamburguesa.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .menu-hamburguesa.active .bar:nth-child(2) {
    opacity: 0;
  }

  .menu-hamburguesa.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  /* Menú lateral oculto por defecto */
  .menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 70%;
    height: 100%;
    flex-direction: column;
    background-color: var(--hueso);
    padding-top: 6em;
    /* espacio debajo del header */
    gap: 1em;
    transition: left 0.3s ease;
    z-index: 1000;
    box-shadow: none !important;
    transform: none !important;
  }

  /* Mostrar menú al activarlo */
  .menu.show {
    left: 0;
  }

  /* Items visibles automáticamente, sin desplazamiento ni sombra */
  .menu.show .menu--items {
    display: flex !important;
    flex-direction: column;
    gap: 1em;
    padding-left: 1em;
    opacity: 1 !important;
    transform: none !important;
    justify-content: flex-start;
    align-items: flex-start;
    transition: none !important;
    /* eliminar animación de entrada */
  }

  .menu.show .menu--item {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    /* eliminar animación de entrada */
    text-align: left;
  }

  .menu--item a {
    color: var(--granate);
    font-weight: bold;
    font-size: 1.2em;
    text-decoration: none;
  }
}

/******************************/
/*  05.Superior a tarjetas    */
/******************************/
.superior {
  grid-area: gastado;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.animacionError {
  opacity: 0;
  font-size: 2em;
  animation: animacionError 5s ease-in-out infinite;
}

@keyframes animacionError {
  0% {
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

/******************************/
/*    06.Tarjetas             */
/******************************/
.contenedorTarjetas {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas: "gastado";
}

.tarjeta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-areas: "tipo tags cantidad"
    "estadisticas habilidades habilidades"
    "estadisticas habilidades habilidades"
    "estadisticas precio precio"
    "aniadir nada eliminar";
  background-color: var(--tarjeta);
  margin: 1em;
  padding: 0.5em;
  gap: 0.5em;
}

/******************************/
/*    07.Footer               */
/******************************/
footer {
  grid-area: footer;
  display: grid;
  gap: 3%;
  grid-template-columns: 1fr;
  grid-template-areas: "img";
  align-items: center;
  text-align: center;
  background-color: var(--granate);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3em;
  z-index: 10;
}

footer>p {
  color: var(--hueso);
}

/******************************/
/*           08.Cookie        */
/******************************/
.aviso-cookies {
  position: fixed;
  bottom: 50%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--granate);
  color: var(--hueso);
  padding: 1.5em;
  border-radius: 0.5em;
  display: none;
  box-shadow: 0 0.4em 1em rgba(0, 0, 0, 0.3);
  max-width: 90%;
  z-index: 1000;
  font-size: 1em;
}

.aviso-cookies p {
  text-align: center;
}

.aviso-cookies button {
  margin: 0.5em;
  padding: 0.5em 1em;
  border: none;
  border-radius: 0.3em;
  cursor: pointer;
  font-size: 1em;
}

#aceptar-btn {
  background-color: var(--apoyo);
  color: var(--hueso);
}

#rechazar-btn {
  background-color: var(--negro);
  color: var(--hueso);
}

/******************************/
/*    09.Media Tablets        */
/******************************/
@media (min-width: 750px) {
  main {
    margin-top: 4.3em;
    height: calc(100vh - 4.3em - 5em);
  }

  body {
    font-size: 1.1em;
  }

  h1 {
    font-size: 2em;
  }

  .menu {
    top: 1rem;
  }

  .derecha-header {
    position: absolute;
    right: 1rem;
    top: 30%;
  }

  .derecha-header span {
    padding: 0.3rem 0.6rem;
    border-radius: 0.6rem;
    border: 1px solid #ccc;
    font-size: 1em;
    background: white;
    margin-left: 0.4em;
  }

  .contenedorTarjetas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "gastado gastado";
  }

  .tarjeta {
    border-radius: 1em;
    box-shadow: 0 0.3em 0.6em var(--box-shadow);
    padding: 1em;
  }

  table {
    width: 80%;
  }

  input,
  select,
  textarea,
  button {
    font-size: 1em;
  }
}

/******************************/
/*    10.Media Escritorio     */
/******************************/
@media (min-width: 1000px) {

  main {
    margin-top: 4.8em;
    height: calc(100vh - 4.8em - 5em);
  }

  body {
    font-size: 1.15em;
  }

  h1 {
    font-size: 2.3em;
  }

  main {
    padding: 1rem;
  }

  .menu {
    font-weight: 500;
    color: var(--granate);
    display: flex;
    align-items: center;
    position: absolute;
    /* AJUSTE */
    top: 0.8rem;
    left: 1.25rem;
    gap: 0.9rem;
    padding: 0.9375rem;
    background-color: var(--hueso);
    border-radius: 1.25rem;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
  }

  .menu:hover {
    box-shadow: 0 0.375rem 0.75rem rgba(0, 0, 0, 0.2);
    transform: translateY(-0.1875rem);
  }

  .menu--etiqueta {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    max-width: 2.5rem;
  }

  .menu--logo {
    width: 2.5rem;
    height: auto;
  }

  .menu--items {
    padding-left: 0.1em;
    text-align: center;
    display: none;
    cursor: pointer;
    flex-direction: row;
    align-items: center;
    gap: 0.9375rem;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: translateY(0.625rem);
  }

  .menu:hover .menu--items {
    padding-right: 0.9375rem;
    display: flex;
    opacity: 1;
    transform: translateY(0);
  }

  .menu--item {
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: translateY(0.625rem);
  }

  .menu--item a {
    color: var(--granate);
    text-decoration: none;
    transition: color 0.5s ease;
  }

  .menu--item:hover a {
    color: var(--negro);
  }

  .menu:hover .menu--item {
    opacity: 1;
    transform: translateY(0);
  }

  .contenedorTarjetas {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-areas: "gastado gastado gastado";
  }

  .tarjeta {
    padding: 1.5em;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  .contenedor {
    margin: auto;
  }

  form {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  table {
    width: 70%;
    font-size: 1em;
  }
}

/******************************/
/*        11.Media Print      */
/******************************/
@media print {

  header,
  nav,
  footer,
  .menu,
  .aviso-cookies,
  button,
  input[type="submit"],
  input[type="button"] {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
    font-size: 12pt;
    line-height: 1.5;
    margin: 1cm;
  }

  main {
    margin: 0;
    padding: 0;
    height: auto;
    overflow: visible;
  }

  section,
  .contenedor {
    background: none !important;
    border: none;
    box-shadow: none;
    color: black;
    padding: 0;
  }

  h1,
  h2,
  h3 {
    color: black !important;
    text-align: center;
  }

  a {
    color: black;
    text-decoration: none;
  }

  a::after {
    content: " (" attr(href) ")";
    font-size: 0.9em;
  }

  table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #000;
  }

  th,
  td {
    border: 1px solid #000;
    padding: 0.5em;
  }

  th {
    background-color: #e0e0e0 !important;
    color: black !important;
  }

  td {
    background-color: white !important;
  }

  form {
    display: block;
  }

  input,
  select,
  textarea {
    border: 1px solid #000;
    color: black;
    background: white !important;
  }

  .contenedorTarjetas {
    display: block;
  }

  .tarjeta {
    border: 1px solid #000;
    margin-bottom: 1em;
    padding: 1em;
    background: white !important;
  }

  .tarjeta * {
    color: black !important;
  }

  img {
    max-width: 100%;
    height: auto;
  }

  .menu--logo {
    display: none !important;
  }

  @page {
    margin: 1.5cm;
  }

  table,
  tr,
  img,
  section,
  .tarjeta {
    page-break-inside: avoid;
  }

  h2 {
    page-break-after: avoid;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/******************************/
/*     12.Character Sheet     */
/******************************/
.dnd {
  --bg: #2b2b2b;
  --paper: #f4ecd8;
  --ink: #2a1a0a;
  --border: #5a3e1b;
  --accent: #7a5528;

  background: var(--bg);
  font-family: "Garamond", serif;
  color: var(--ink);
  padding: 30px 0;
}

.dnd__sheet {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
  background: var(--paper);
  border: 8px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 0 25px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* HEADER */
.dnd__header {
  border-bottom: 2px solid var(--border);
  padding-bottom: 10px;
}

.dnd__title {
  font-family: "Cinzel", serif;
  font-size: 22px;
  text-transform: uppercase;
}

.dnd__text {
  font-size: 14px;
}

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

/* STATS */
.dnd__stats {
  display: flex;
  gap: 10px;
}

.dnd__stat-box {
  flex: 1;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: #fff8dc;
  font-weight: bold;
}

/* COLUMNAS */
.dnd__columns {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 15px;
}

/* ATRIBUTOS */
.dnd__attributes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.dnd__attribute {
  border: 2px solid var(--border);
  border-radius: 8px;
  background: #fff8dc;
  padding: 10px;
  text-align: center;
}

.dnd__attr-name {
  font-size: 12px;
  text-transform: uppercase;
}

.dnd__attr-mod {
  font-size: 28px;
  font-weight: bold;
}

.dnd__attr-score {
  font-size: 12px;
  color: var(--accent);
}

/* SKILLS */
.dnd__skills {
  border: 2px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 248, 220, 0.6);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 300px;
  overflow-y: auto;
}

.dnd__skill {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.dnd__skill-mod {
  font-weight: bold;
}

/* BLOQUES */
.dnd__bottom {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 15px;
}

.dnd__block {
  border: 2px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 248, 220, 0.6);
  padding: 10px;
}

.dnd__block-title {
  font-family: "Cinzel", serif;
  border-bottom: 1px solid var(--border);
  margin-bottom: 5px;
}

.dnd__block-content {
  min-height: 120px;
}