/* v1.3 2025-10-29T12:05:00Z */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&family=Montserrat:wght@400;600;700&display=swap');

@font-face {
  font-family: 'Cruor';
  src: url('/assets/fonts/cruor-regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Wolpe Pegasus Regular';
  src: url('/assets/fonts/wolpe-pegasus-regular.ttf') format('truetype');
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Wolpe Pegasus Bold';
  src: url('/assets/fonts/wolpe-pegasus-bold.ttf') format('truetype');
  font-style: bold;
  font-display: swap;
}

:root {
  /* Reds */
  --bordeaux: #33030C;
  --bordeaux-2: #660819;
  --red: #a30f2a;

  /* Whites */
  --white: #f5f5f5;
  --white-2: #ccc;

  /* Blacks */
  --black: #000;

  /* Grays */
  --gray: #888;
  --dark-grey: #0a0a0a;

  /* Difficulties */
  --easy: #4b9e60;
  --normal: #afad49;
  --hard: #ac7243;
  --deadly: #b13d3d;

  /* Constant colors */
  --always-black: #000;
  --always-white: #f5f5f5;
  --always-gray: #888;

  /* Specific Colors Variants */
  --bordeaux-to-white: #33030C;

  /* RGBs */
  --bordeaux-rgb: 51, 3, 12;
  --bordeaux-2-rgb: 102, 8, 25;
  --red-rgb: 163, 15, 42;
  --black-rgb: 0, 0, 0;

  --bordeaux-to-white-rgb: 51, 3, 12;
}


html {
  scroll-behavior: smooth;
}
@media (max-width: 700px) {
  html {
    overflow-x: hidden;
  }
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--white);
  background: url("/assets/images/textures/black-paper.png") repeat, linear-gradient(to bottom, var(--black) 0%, #150105 80%, var(--bordeaux) 100%);
  background-blend-mode: soft-light;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Tema leggibile per alta leggibilità */
body.accessible-theme {
  --black: #f5f5f5;
  --white: #0a0a0a;
  --white-2: #222222;
  --gray: #222;
  --bordeaux-to-white: #f5f5f5;
  --black-rgb: 245, 245, 245;
  --white-rgb: 10, 10, 10;
  --gray-rgb: 34, 34, 34;
  --bordeaux-to-white-rgb: 245, 245, 245;
  background: var(--black);
  color: var(--white);
}

/* Header */
header {
  background: var(--bordeaux);
  text-align: center;
  padding: 1.5rem 0;
}

header h1.logo-text {
  font-family: 'Wolpe Pegasus Normal', serif;
  font-size: 3rem;
  letter-spacing: 0.08em;
  margin: 0 0 .25rem 0;
  color: var(--always-white);
  font-weight: 100;
  text-transform: uppercase;
}

header p {
  font-family: Montserrat, Inter, sans-serif;
  color: var(--always-white);
  margin: 0;
  opacity: .9;
}

header .back-btn {
  position: absolute;
  top: 1rem;
  left: 1rem;
  font-family: Montserrat, Inter, sans-serif;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--white);
  background: var(--bordeaux);
  border: 1px solid var(--bordeaux);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  transition: background 0.2s ease, transform 0.1s ease;
}

header .back-btn:hover {
  background: #55061a;
}

header .back-btn:active {
  transform: scale(0.96);
}

/* Banner composto con overlay */
.banner {
  position: relative;
  background: url('assets/images/banners/banner.webp') center center / cover no-repeat;
  height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;          /* blocca l’espansione oltre il viewport */
  max-width: 100vw;     /* previene overflow su mobile */
  box-sizing: border-box;
  overflow: hidden;     /* elimina sporgenze grafiche */
}

.banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
}

.banner-overlay {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
}

.banner-logo {
  width: 200px;
  height: auto;
  margin-bottom: 2rem;
  z-index: 1;
}

.banner-text {
  width: 250px;
}

@media (min-width: 768px) {
  .banner-text {
    width: 650px;
  }
}

.banner-text-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 1rem;
  /* il wrapper resta alla sua larghezza di contenuto */
  width: auto;
  max-width: 650px; /* o quello che usi già nel media query */
  margin: 0 auto;
  z-index: 0;
  isolation: isolate; /* assicura stacking corretto del :before */
}

.banner-text-wrap::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%); /* centra rispetto allo schermo */
  /* fascia a tutta larghezza schermo, senza overflow mobile */
  width: 100svw;                  /* viewport “small” stabile su mobile */
  height: 100%;                   /* alta quanto il wrapper del testo */
  background: var(--bordeaux);
  z-index: -1;                    /* dietro al testo */
  pointer-events: none;
}

.banner-overlay { position: relative; }              /* stacking corretto */
.banner-text-wrap { isolation: isolate; }            /* il ::before resta sotto al testo */

.banner-text { display:block; max-width:100%; }      /* no overflow immagine */
picture { display:block; }                           /* niente spazi inline */


/* fallback per browser senza svw */
@supports not (width: 1svw) {
  .banner-text-wrap::before { width: 100vw; }
}

@media (min-width:768px){
  .banner-text-wrap { max-width:650px; margin:0 auto; }
}

/* Slider */
.slider {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 2rem auto;
  overflow: hidden;
  border: 1px solid var(--bordeaux);
  border-radius: 6px;
  background: #111;
}

section.slider {
  padding: 0;
}

.slider-track {
  display: flex;
  transition: transform 0.8s ease;
  width: 100%;
  will-change: transform;
}

.slide {
  flex: 0 0 100%;             /* prende esattamente 100% del track */
  display: flex;
  align-items: stretch;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
}

.slide-image {
  flex: 0 0 40%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-right: 3px solid var(--bordeaux);
  background: #000;
  border-radius: 10px;
}

.slide-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-text {
  flex: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #111;
  color: var(--white);
}

.slide-text h4 {
  font-family: Montserrat, Inter, sans-serif;
  font-size: 1.6rem;
  margin: 0 0 0.5rem 0;
}

.slide-text h5 {
  font-family: Inter, sans-serif;
  font-weight: 400;
  color: #c7ab6d;
  margin: 0 0 1rem 0;
}

.slide-text p {
  line-height: 1.5;
  font-size: 0.95rem;
  opacity: 0.9;
}

/* Bottoni */
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(51, 3, 12, 0.8);
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  z-index: 2;
  transition: background 0.3s;
}

.slider-btn:hover {
  background: rgba(51, 3, 12, 1);
}

.slider-btn.prev {
  left: 10px;
}

.slider-btn.next {
  right: 10px;
}

.slide-btn {
  display: inline-block;
  margin-top: 1.5rem;
  align-self: flex-start;
  padding: 0.6rem 1.4rem;
  background: var(--bordeaux);
  color: var(--white);
  text-decoration: none;
  font-family: Montserrat, Inter, sans-serif;
  font-weight: 600;
  letter-spacing: 0.5px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s, transform 0.1s;
}

.slide-btn:hover {
  background: #55061a;
  border-color: var(--bordeaux);
}

.slide-btn:active {
  transform: scale(0.97);
}

/* Dots */
.slider-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 3;
}

.slider-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--bordeaux);
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}

.slider-dot.active {
  background: var(--bordeaux);
  transform: scale(1.2);
}

/* Responsivo */
@media (max-width: 700px) {
  .slide {
    flex-direction: column;
    height: auto;
  }

  .slide-image {
    flex: none;
    width: 100%;
    aspect-ratio: 4 / 5;
    border-right: none;
    border-bottom: 1px solid var(--bordeaux);
  }

  .slide-text {
    padding: 1.2rem;
  }
}

/* Sezioni */
section {
  padding: .5rem 1rem;
  width: 100%;
  margin: 0 auto;
}

h3 {
  font-family: "Wolpe Pegasus Bold", "Montserrat", sans-serif;
  border-bottom: 1px solid var(--bordeaux);
  padding-bottom: .3rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.col-center {
  max-width: 900px;
  margin: 0 auto;
}

.about p {
  line-height: 1.6;
}

section.about {
  background: rgba(51, 3, 12, 0.3);
  margin-top: 5rem;
  width: 90%;
}

/* Auth */
.auth {
  background: #111;
  border: 1px solid var(--bordeaux);
  border-radius: 6px;
  padding: 2rem;
  text-align: center;
}

.auth button {
  background: var(--bordeaux);
  color: var(--white);
  border: 0;
  padding: .8rem 1.5rem;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  margin-top: 1rem;
  transition: transform .08s ease, opacity .2s ease;
}

.auth button:hover {
  opacity: .9;
}

.auth button:active {
  transform: scale(.98);
}

/* Tooltips */
#tooltip {
  position: absolute;
  display: none;
  opacity: 0;
  pointer-events: none;
  background: #111;
  border: 1px solid var(--white);
  color: var(--white);
  font-size: 0.8rem;
  font-family: "Inter", sans-serif;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(160, 34, 34, 0.4);
  max-width: 240px;
  z-index: 9999;
  transition: opacity 0.15s ease;
}

#tooltip p {
  margin-top: .5rem;
  text-transform: none;
}

#tooltip strong {
  color: var(--gold);
  font-weight: 600;
}

.filter-icon:hover+#tooltip {
  margin-top: -8px;
}

/* Differenziazione visiva */
#tooltip.tag { border-color: #c9c9c9; }
#tooltip.spell { border-color: #c9c9c9; }
#tooltip.item { border-color: #c9c9c9; }
#tooltip.rule { border-color: #c9c9c9; }

/* === ARCHIVES PORTAL (final responsive + visual parity) === */
.archives-portal {
  --portal-size: min(92vw, 400px);
  --base-scale: 1.125;      /* ring-base leggermente più grande */
  --ring-scale: 0.75;       /* diametro dell'anello icone */
  --ring-size: calc(var(--portal-size) * var(--ring-scale));
  --ring-radius: calc(var(--portal-size) * 0.5 * 0.95); /* distanza reale dal centro */
  --icon-size: 80px;
  --pulse-duration: 6s;

  position: relative;
  width: var(--portal-size);
  height: var(--portal-size);
  margin: 4rem auto;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* === ANELLO STATICO === */
.ring-base {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(var(--portal-size) * var(--base-scale));
  height: calc(var(--portal-size) * var(--base-scale));
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,180,180,.12) 0%, transparent 70%),
    url('/assets/images/portal/portal-2.webp') center/contain no-repeat;
  mix-blend-mode: overlay;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 0 25px rgba(255,180,180,.15)) brightness(1);
  animation: pulse-base 10s ease-in-out infinite;
}

/* === ANELLO ORBITANTE === */
.ring-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--portal-size);
  height: var(--portal-size);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(255,190,190,.08);
  box-shadow:
    0 0 20px rgba(255,180,180,.15),
    inset 0 0 25px rgba(255,180,180,.08);
  animation: spin 120s linear infinite;
  mix-blend-mode: screen;
  z-index: 2;
  opacity: .25;
  pointer-events: none;
}

/* === ICONE ORBITANTI === */
.ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--ring-size);
  height: var(--ring-size);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  animation: spin 120s linear infinite;
  --start-angle: 0deg;
  z-index: 3;
}

.slot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform-origin: 0 0;
  transform: rotate(var(--angle)) translateY(calc(-1 * var(--ring-radius)));
  filter: drop-shadow(0 0 10px black);
}

/* === CONTRO-ROT. === */
.icon-rotor {
  display: inline-block;
  transform: rotate(calc(-1 * var(--angle)));
  animation: counterspin 120s linear infinite;
}

/* === ICONE === */
.icon {
  --shadow-blur: 4px;
  --shadow-color: rgba(255,255,255,.15);
  width: var(--icon-size);
  height: var(--icon-size);
  object-fit: contain;
  display: block;
  opacity: 0.4;
  filter: brightness(.9) drop-shadow(0 0 var(--shadow-blur) var(--shadow-color));
  animation:
    pulse-icon var(--pulse-duration, 5s) ease-in-out infinite;
  animation-delay: var(--pulse-delay, 0s);
  will-change: filter, opacity, transform;
}

/* === PULSANTE CENTRALE === */
.portal-core {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: center;
  width: calc(var(--portal-size) * 0.45);
  height: calc(var(--portal-size) * 0.45);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #33030C 0%, #120205 85%);
  border: 2px solid #5b1720;
  color: #fff;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 0 25px rgba(255,190,190,.15);
  transition: all .4s ease;
}

.portal-core:hover {
  transform: scale(1.05);
  border-color: #e0b0b0;
  box-shadow: 0 0 25px rgba(255,190,190,.35),
              0 0 80px rgba(255,200,200,.15) inset;
}

/* === TESTO === */
.sigil {
  font-family: "IM Fell English", serif;
  font-size: 1.2rem;
  line-height: 1.4;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(255,200,200,.35);
}

/* === ANIMAZIONI === */
@keyframes spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes counterspin {
  from { transform: rotate(calc(-1 * var(--angle))) rotate(0deg); }
  to   { transform: rotate(calc(-1 * var(--angle))) rotate(-360deg); }
}

/* base “respiro” con glow */
@keyframes pulse-base {
  0%,100% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(0.6);
    filter: drop-shadow(0 0 20px rgba(255,180,180,.15));
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    filter: drop-shadow(0 0 60px rgba(255,180,180,.4));
  }
}

/* icone “respiro” e bagliore */
@keyframes pulse-icon {
  0%,100% { opacity: 0.4; transform: scale(1); }
  50%     { opacity: 1;   transform: scale(1.1); }
}

@keyframes shadowPulse {
  0%,100% { --shadow-blur: 4px;  --shadow-color: rgba(255,255,255,.15); }
  50%     { --shadow-blur: 12px; --shadow-color: rgba(255,180,180,.45); }
}

/* === MOBILE === */
@media (max-width: 700px) {
  .archives-portal {
    --icon-size: 60px;
    --ring-radius: calc(var(--portal-size) * 0.5 * 0.9);
  }
}

.inline-icon {
  width: 1em;
  height: 1em;
  vertical-align: middle;
  margin-right: 0.25em;
}

/* Footer */
footer {
  text-align: center;
  font-size: .9rem;
  color: #aaa;
  padding: 1rem;
  border-top: 1px solid var(--bordeaux);
}

/* Page Transition */
#page-transition {
  position: fixed;
  inset: 0;
  background: var(--black, #000);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* fade-in all’apertura */
#page-transition.visible {
  opacity: 1;
}