:root {
  --bg-0: #061018;
  --bg-1: linear-gradient(180deg,#041018 0%, #07121a 100%);
  --card: #0f1720;
  --panel: linear-gradient(180deg,#07121a,#081521);
  --accent:  #478abb;
  --muted: #9aa4ad;
  --glass: rgba(255,255,255,0.03);
  --radius: 12px;
  --neon: 0 0 18px rgba(91,43,138,0.08), 0 8px 30px rgba(91,43,138,0.04);
  --card-shadow: 0 10px 36px rgba(2,6,23,0.6);
  --mono: "Source Code Pro", ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}
/* -------- Suspects (poster-card) -------- */
.suspect-card{
  display:grid; grid-template-columns:320px 1fr; gap:24px;
  background:#0f1218; border:1px solid #1d2330; border-radius:14px; padding:18px;
}
.suspect-media{ position:relative; overflow:hidden; border-radius:12px;
  background:#0b0e14; border:1px solid #1b2130;
}
.suspect-media img{ width:100%; height:auto; display:block; filter:saturate(.9) contrast(1.05); }
.suspect-nameplate{
  position:absolute; left:50%; transform:translateX(-50%); bottom:12px;
  background:#e9dfc7; color:#111; font-weight:800; letter-spacing:.08em;
  padding:8px 12px; border-radius:6px; box-shadow:0 6px 24px rgba(0,0,0,.4);
}
.suspect-info h4{ margin:.25rem 0 .5rem; color:var(--accent); }
.suspect-meta{ list-style:none; padding:0; margin:0 0 10px;
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px;
}
.suspect-meta li{
  display:flex; justify-content:space-between; gap:8px;
  background:#0b0e14; border:1px solid #1b2130; border-radius:8px;
  padding:8px 10px; font-size:13px; color:#b9c6d3;
}
.suspect-meta .label{ opacity:.75; }
.pills{ display:flex; flex-wrap:wrap; gap:6px; margin:8px 0 14px; }
.pill{ background:#111827; border:1px solid #253041; border-radius:999px; padding:4px 10px; font-size:12px; }

/* opcional: fila d'imatges equilibrada (per la intro) */
.image-row-balanced{ display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:12px; }
.image-balanced{ width:100%; border-radius:10px; border:1px solid #1b2130; display:block; }
@media (max-width: 960px){ .suspect-card{ grid-template-columns:1fr; } .suspect-meta{ grid-template-columns:1fr; } }

.image-row-clean {
  display: flex;
  justify-content: space-between;  /* una a cada costat */
  align-items: center;
  flex-wrap: wrap;                 /* per adaptar-se en pantalles petites */
  margin: 20px 0;
}

/* Totes les imatges comparteixen mida i estil net */
.image-clean {
  width: 45%;                      /* cadascuna ocupa la meitat de l’amplada */
  max-width: 500px;
  height: auto;
  border-radius: 12px;
  border: none;
}

.image-row-balanced {
  display: flex;
  justify-content: center;          /* centra les imatges */
  align-items: center;
  flex-wrap: wrap;
  gap: 35px;                         /* redueix l’espai entre imatges */
  margin: 15px 0;
}

/* Imatges amb mateixa mida i bord suau */
.image-balanced {
  flex: 1 1 48%;                    /* comparteixen amplada equitativa */
  max-width: 480px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid rgba(90, 130, 200, 0.5);  /* blau-gris suau */
  transition: border-color 0.3s ease;
}

/* Efecte subtil en hover */
.image-balanced:hover {
  border-color: rgba(140, 180, 255, 0.7);
}

/* Mode mòbil — s’apilen */
@media (max-width: 768px) {
  .image-row-balanced {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 25px;                      /* una mica més d’espai en vertical */
  }

  .image-balanced {
    width: 90%;
    max-width: 400px;
  }
}


/* Opcional: assegurar que la primera està ben alineada a l’esquerra i la segona a la dreta */
.image-clean.left {
  align-self: flex-start;
}

.image-clean.right {
  align-self: flex-end;
}

/* Per a pantalles petites: que passin a una columna */
@media (max-width: 768px) {
  .image-row-clean {
    flex-direction: column;
    justify-content: center;
  }
  .image-clean {
    width: 100%;
    max-width: 400px;
    margin-bottom: 15px;
  }
}


/* el contenidor on posarem les capes animades */
.section-image-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  border-radius: 12px;
  margin-bottom: 15px;
  overflow: hidden;
  box-shadow: -20px 0 40px rgba(0, 0, 255, 0.8),
              20px 0 40px rgba(255, 0, 0, 0.6);
}

/* la imatge en si */
.section-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

/* Capa 1: franja blau→vermell que ES MOU lateralment (lenta) */
.section-image-container::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  /* bandes definides amb tall perquè el moviment es noti */
  background: linear-gradient(
    90deg,
    rgba(0, 0, 255, 0.35) 0%,
    rgba(0, 0, 255, 0.0) 35%,
    rgba(255, 0, 0, 0.0) 65%,
    rgba(255, 0, 0, 0.35) 100%
  );
  background-size: 300% 100%;
  background-position: 0% 0%;
  animation: policeSweep 8s ease-in-out infinite;
  /* si el teu fons és fosc, queda molt bé; si no, pots eliminar-ho */
  mix-blend-mode: screen;
  pointer-events: none;
  opacity: 0.7;
animation: policeSweep 10s ease-in-out infinite;
}

/* Capa 2 (opcional): feix de llum estret que travessa (més evident) */
.section-image-container::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 35%;
  left: -35%;
  border-radius: 12px;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 255, 0) 0%,
    rgba(0, 120, 255, 0.35) 50%,
    rgba(255, 0, 0, 0) 100%
  );
  filter: blur(6px);
  animation: beamPass 6s linear infinite;
  pointer-events: none;
  opacity: 0.5;
}

/* Animació de la capa ampla (blau→vermell) */
@keyframes policeSweep {
  0%   { background-position: 0% 0%;   opacity: 0.45; }
  50%  { background-position: 100% 0%; opacity: 0.75; }
  100% { background-position: 0% 0%;   opacity: 0.45; }
}

/* Animació del feix estret: travessa d’esquerra a dreta i torna */
@keyframes beamPass {
  0%   { left: -35%; opacity: 0.2; }
  25%  { left: 10%;  opacity: 0.5; }
  50%  { left: 50%;  opacity: 0.6; }
  75%  { left: 90%;  opacity: 0.5; }
  100% { left: 130%; opacity: 0.2; }
}



html, body {
  height: 100%;
  margin: 0;
  font-family: var(--sans);
  background: var(--bg-1);
  color: #e6f0ef;
}

.app {
  min-height: 100vh;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.logo {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg,#05121b,#002725);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--neon);
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

.nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav button {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

.nav button.active {
  color: var(--accent);
  box-shadow: inset 0 -2px 0 rgba(91,43,138,0.12);
  transform: translateY(-1px);
}

.title-area {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 10px 6px;
}

.title {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 64px;
  letter-spacing: 2px;
}

.subtitle {
  color: #ef5a08;
  font-size: 23px;
}
/* Aplica-ho a l'element del títol o logo */
#hero-title {
  font-family: var(--mono);
  font-size: 64px;
  letter-spacing: 2px;
  text-shadow: 0 0 10px #fff;
  animation: sirena 4.8s infinite cubic-bezier(0.65, 0, 0.35, 1); /* canvi suau */
}

/* Blau ↔ Vermell amb transició fluida */
@keyframes sirena {
  0% {
    color: #009dff; /* blau suau */
    text-shadow:
      0 0 12px #009dff,
      0 0 24px #009dff,
      0 0 48px #0077ff,
      0 0 96px #00ccff;
  }
  40% {
    color: #00baff; /* blau més intens abans del canvi */
    text-shadow:
      0 0 16px #00baff,
      0 0 32px #00baff,
      0 0 64px #0088ff,
      0 0 128px #00e0ff;
  }
  60% {
    color: #ff0033; /* transició suau cap al vermell */
    text-shadow:
      0 0 16px #ff0033,
      0 0 32px #ff0033,
      0 0 64px #ff3366,
      0 0 128px #ff667f;
  }
  100% {
    color: #009dff; /* torna al blau sense salt */
    text-shadow:
      0 0 12px #009dff,
      0 0 24px #009dff,
      0 0 48px #0077ff,
      0 0 96px #00ccff;
  }
}




.content { display: block; }
.section { display: none; }
.section.active { display: block; }

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 12px 0;
}

.controls .left {
  font-weight: 800;
  color: #c8d3f0;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  margin-top: 6px;
}

.card {
  background: var(--card);
  border-radius: 14px;
  padding: 14px;
  height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--neon), var(--card-shadow);
}

.ctitle {
  font-weight: 800;
  font-size: 16px;
  color: #f0e8ff;
}

.category {
  margin-top: 8px;
  display: inline-block;
  background: var(--glass);
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.difficulty {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  padding: 6px 8px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
}

.card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 8px;
}

.btn {
  padding: 8px 10px;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  border: 0;
  font-size: 13px;
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(255,255,255,0.04);
}

.solution-btn {
  padding: 6px 10px;
  font-size: 13px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--accent);
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(rgba(2,6,12,0.55), rgba(2,6,12,0.75));
  z-index: 999;
  padding: 24px;
}

.pane {
  width: min(1000px,96%);
  max-height: 88vh;
  overflow: auto;
  background: linear-gradient(180deg,#06121a,#071523);
  padding: 20px;
  border-radius: 16px;
  box-shadow: var(--neon), 0 20px 60px rgba(0,0,0,0.6);
  color: #dff7ef;
}

.flag-area {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.flag-area input {
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  color: #e6e6f2;
  border-radius: 10px;
  min-width: 260px;
  outline: none;
  font-weight: 600;
  caret-color: var(--accent);
}

.flag-area input::placeholder {
  color: rgba(230,230,240,0.35);
}

.flag-area input:focus {
  box-shadow: 0 6px 18px rgba(91,43,138,0.08);
  border-color: rgba(91,43,138,0.28);
  background: rgba(255,255,255,0.03);
}

.learn-wrap {
  display: flex;
  gap: 18px;
  margin-top: 12px;
  align-items: flex-start;
}

.toc {
  width: 260px;
  background: rgba(255,255,255,0.02);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--card-shadow);
  color: #dff7ef;
}

.toc h4 {
  margin: 0 0 8px 0;
  color: var(--accent);
  font-family: var(--mono);
}

.toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toc li {
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
}

.toc li.active {
  background: rgba(0,0,0,0.18);
  color: #e6fff5;
}

.learn-main {
  flex: 1;
  background: var(--panel);
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--card-shadow);
  min-height: 320px;
  color: #e8fff6;
}

@media (max-width:900px) {
  .title { font-size: 40px; }
  .toc { display: none; }
  .learn-wrap { flex-direction: column; }
}

@media (max-width:520px) {
  .title { font-size: 28px; }
  .card { height: 150px; }
  .logo { width: 40px; height: 40px; }
}

.nav button:hover {
  color: var(--accent);
  text-shadow: 0 0 6px rgba(0,230,168,0.6);
  transform: translateY(-1px);
}

.title {
  color: #478abb;
}

.lang-switch {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
  z-index: 1000;
  box-shadow: #478abb;
  transition: background 0.2s ease;
  font-size: 13px;
}

.lang-switch:hover {
   background: #ff2020;
}

/* Roadmap page extra styles */
.roadmap-step {
  background: var(--panel);
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 600;
  color: #e7fff6;
  box-shadow: 0 0 10px #19ffc466;
  transition: transform 0.2s;
}

.roadmap-step:hover {
  transform: scale(1.05);
}

.arrow {
  color: var(--muted);
  font-size: 18px;
}
