:root {
  --navy: #1D428C;
  --navy-deep: #0F5683;
  --petroleum: #005085;
  --blue: #0090C5;
  --blue-hover: #153069;
  --gold: #FAB622;
  --gold-deep: #FF6D00;
  --orange-alt: #FFA500;
  --cream: #FFF1DE;
  --cream-light: #FFF8ED;
  --white: #FFFFFF;
  --text: #444444;
  --success: #25D366;
  --turquoise: #7EB2A9;
  --magnifico-blue: #1E76BC;
  --danger: #FF6D00;
  --shadow: rgba(9, 33, 58, 0.18);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Baloo 2", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  min-height: 100vh;
}

.game-banner {
  position: relative;
  left: 50%;
  width: 100vw;
  margin-left: -50vw;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px 7px;
  margin-top: auto;
  margin-bottom: 0;
  background: var(--navy);
  border-bottom: 2px solid rgba(139, 211, 228, 0.9);
  box-shadow: 0 7px 18px rgba(5, 45, 90, 0.16);
}

.game-banner img {
  width: min(170px, 52vw);
  height: 58px;
  object-fit: contain;
}

img {
  display: block;
  max-width: 100%;
}

button, a {
  font: inherit;
}

.home-page {
  background: var(--petroleum);
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.home-shell {
  width: min(1200px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 40px;
}

.brand-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.brand-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(255,255,255,0.12);
  border-radius: 24px;
  padding: 18px 30px;
  box-shadow: 0 16px 28px rgba(11, 36, 71, 0.15);
}

.brand-logo-image {
  width: min(100%, 960px);
  max-height: 350px;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(0,0,0,0.08));
}

.brand-subtitle {
  margin-top: 18px;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
  font-size: clamp(1.2rem, 1.7vw, 2.2rem);
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.hero {
  color: var(--white);
}

.hero h1 {
  margin: 0;
  font-family: "Baloo 2", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  font-size: clamp(3rem, 5.9vw, 7.4rem);
  line-height: 0.86;
  letter-spacing: -0.06em;
  font-weight: 800;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.hero h1 .highlight {
  color: var(--gold);
  text-shadow: 0 6px 18px rgba(255, 184, 28, 0.2);
}

.hero .copy {
  margin-top: 20px;
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-size: clamp(1rem, 1.45vw, 1.9rem);
  line-height: 1.35;
  color: rgba(255,255,255,0.93);
  max-width: 620px;
  font-weight: 700;
}

.hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 210px;
  min-height: 72px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 900;
  font-size: 1.15rem;
  border: 3px solid var(--gold);
  transition: transform 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn.primary {
  background: var(--gold);
  color: var(--navy-deep);
}

.btn.secondary {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.9);
}

.page-card {
  background: var(--cream-light);
  min-height: 100vh;
  padding: 28px 16px 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  text-decoration: none;
  font-weight: 900;
  font-size: 1.05rem;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.5);
  border: 2px solid rgba(12, 61, 114, 0.2);
  margin-bottom: 18px;
}

.instructions-wrap {
  max-width: 720px;
  margin: 0 auto;
  background: rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 12px 18px 20px;
}

.brand-strip {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.brand-badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: var(--navy);
  color: var(--white);
  padding: 8px 18px;
  border-radius: 16px;
  font-size: clamp(1.2rem, 2vw, 2.3rem);
  font-weight: 900;
  text-align: center;
}

.brand-badge img {
  width: min(112px, 34vw);
  height: 82px;
  object-fit: contain;
}

.instructions-wrap h2 {
  text-align: center;
  margin: 8px 0 14px;
  font-size: clamp(1.9rem, 3.5vw, 3rem);
  color: var(--navy);
}

.step-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.step {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  background: rgba(10, 118, 181, 0.08);
  border-radius: 14px;
  padding: 10px 14px;
}

.step-number {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-weight: 900;
  font-size: 1.2rem;
}

.step h3 {
  margin: 0 0 2px;
  color: var(--navy);
  font-size: clamp(1.05rem, 1.5vw, 1.5rem);
}

.step p {
  margin: 0;
  color: var(--text);
  font-size: clamp(0.9rem, 1.1vw, 1.1rem);
  line-height: 1.3;
}

.instructions-footer {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.instructions-footer .btn {
  min-width: 180px;
  min-height: 54px;
  font-size: 1rem;
}

.levels-page {
  min-height: 100vh;
  padding: 28px 18px 0;
  background: var(--cream-light);
  display: flex;
  flex-direction: column;
  position: relative;
}

.levels-page .home-link {
  position: absolute;
  top: 28px;
  left: 24px;
  margin: 0;
}

.levels-corner-logo {
  position: absolute;
  top: 20px;
  left: 162px;
  width: 78px;
  height: 66px;
  object-fit: contain;
}

.page-card > .home-link {
  align-self: flex-start;
}

.levels-shell {
  width: min(820px, 100%);
  margin: 0 auto;
  padding-top: 58px;
}

.levels-header {
  text-align: center;
  color: var(--navy);
  margin: 4px 0 20px;
}

.levels-header p {
  margin: 0;
  color: var(--blue);
  font-weight: 900;
  font-size: 1.15rem;
}

.levels-header h1 {
  margin: 4px 0 0;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1;
}

.levels-header h1::after {
  content: "";
  display: block;
  width: 82px;
  height: 7px;
  margin: 14px auto 0;
  border-radius: 999px;
  background: var(--gold);
}

.level-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding: 6px 6px 22px;
}

.level-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  min-height: 0;
  aspect-ratio: 1;
  padding: 22px;
  position: relative;
  border: 5px solid var(--white);
  border-radius: 24px;
  color: var(--white);
  text-decoration: none;
  box-shadow: 0 14px 26px var(--shadow), inset 0 0 0 3px rgba(255, 255, 255, 0.16);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.level-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 28px rgba(9, 33, 58, 0.24), 0 0 0 3px rgba(250, 182, 34, 0.24);
}

.level-card:active {
  transform: translateY(0);
}

.level-card:focus-visible {
  outline: 4px solid var(--gold);
  outline-offset: 3px;
}

.level-card::before {
  display: block;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.level-easy {
  background: rgba(126, 178, 169, 0.82);
}

.level-easy::before {
  content: "★";
}

.level-medium {
  background: rgba(30, 118, 188, 0.86);
}

.level-medium::before {
  content: "★★";
}

.level-hard {
  background: rgba(255, 109, 0, 0.86);
}

.level-hard::before {
  content: "★★★";
}

.level-name {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 900;
}

.level-progress {
  min-width: 88px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.45);
  text-align: center;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 900;
}

.game-page {
  background: var(--cream);
  min-height: 100vh;
  padding: 24px 18px 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.game-shell {
  max-width: 900px;
  margin: 0 auto;
  padding-bottom: 34px;
}

.game-topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 66px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 5px solid var(--gold);
}

.game-topbar .home-link {
  position: absolute;
  top: 24px;
  left: 24px;
  margin: 0;
}

.game-corner-logo {
  position: absolute;
  top: 17px;
  left: 162px;
  width: 78px;
  height: 66px;
  object-fit: contain;
}

.home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  text-decoration: none;
  font-weight: 900;
  font-size: 1.05rem;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.5);
  border: 2px solid rgba(12, 61, 114, 0.2);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  font-weight: 900;
  font-size: clamp(1.1rem, 2vw, 2.1rem);
  background: var(--white);
  border: 3px solid var(--navy);
  border-radius: 999px;
  padding: 8px 22px;
  box-shadow: 0 7px 14px rgba(9, 33, 58, 0.12);
}

.mini-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.score-box {
  background: var(--navy);
  color: var(--white);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 800;
  box-shadow: 0 8px 15px rgba(13, 61, 105, 0.15);
  position: absolute;
  top: 24px;
  right: 24px;
  border: 3px solid var(--gold);
}

.game-title {
  text-align: center;
  margin: 8px 0 22px;
  color: var(--navy);
  font-size: clamp(2.5rem, 5vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.game-area {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-board {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}

.answer-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
  justify-content: center;
}

.answer-column[hidden] {
  display: none;
}

.answer-column::before {
  content: "¡Elige una opción!";
  color: var(--navy);
  font-size: 1.05rem;
  font-weight: 900;
  text-align: center;
  letter-spacing: 0.02em;
}

.card-button {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  perspective: 1200px;
  width: min(58vw, 480px);
  aspect-ratio: 1;
  position: relative;
  border-radius: 50%;
}

.card-scene {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.9s cubic-bezier(0.18, 0.85, 0.22, 1);
  transform-style: preserve-3d;
  border-radius: 50%;
}

.card-button.is-flipped .card-scene {
  transform: rotateY(180deg);
}

.card-button.is-correct .card-face {
  border-color: var(--success);
  box-shadow: 0 0 0 7px rgba(37, 211, 102, 0.24), 0 0 28px rgba(37, 211, 102, 0.8);
}

.card-button.is-incorrect .card-face {
  border-color: #FF2D2D;
  box-shadow: 0 0 0 7px rgba(255, 45, 45, 0.24), 0 0 28px rgba(255, 45, 45, 0.8);
}

.card-button.is-finished {
  width: min(58vw, 380px);
}

.card-button.is-finished .card-face {
  border: 0;
  border-radius: 0;
  background-color: transparent;
  box-shadow: none;
}

.card-button.is-finished .card-back {
  animation: house-glow 1.4s ease-in-out infinite alternate;
}

@keyframes house-glow {
  from {
    filter: drop-shadow(0 0 7px rgba(0, 144, 197, 0.5)) drop-shadow(0 0 10px rgba(250, 182, 34, 0.35));
    transform: scale(1);
  }
  to {
    filter: drop-shadow(0 0 14px rgba(0, 144, 197, 0.85)) drop-shadow(0 0 22px rgba(250, 182, 34, 0.7));
    transform: scale(1.045);
  }
}

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 22px 30px rgba(11, 35, 60, 0.14);
  border: 6px solid rgba(255,255,255,0.8);
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
}

.card-back {
  background-image: url('../images/Logos/Diagramacio╠ün_cajakit-03.png');
  background-color: var(--cream);
  background-size: 108% auto;
  background-position: top center;
}

.card-front {
  transform: rotateY(180deg);
  background-color: var(--cream-light);
  background-size: 105% auto;
  background-position: top center;
}

.answer-btn {
  min-width: 180px;
  min-height: 62px;
  border: none;
  border-radius: 999px;
  color: var(--white);
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
  border: 4px solid var(--white);
  outline: 3px solid transparent;
  box-shadow: 0 10px 18px rgba(9, 32, 55, 0.12);
  transition: transform 0.2s ease, opacity 0.2s ease;
  animation: answer-glow 1.25s ease-in-out infinite alternate;
}

.answer-btn:hover {
  transform: translateY(-4px) scale(1.05);
}

.answer-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  animation: none;
}

.btn-truth {
  background: var(--success);
  outline-color: rgba(37, 211, 102, 0.3);
}

.btn-myth {
  background: var(--gold-deep);
  outline-color: rgba(255, 109, 0, 0.3);
  animation-delay: 0.3s;
}

@keyframes answer-glow {
  from {
    box-shadow: 0 8px 16px rgba(9, 32, 55, 0.14), 0 0 0 0 rgba(250, 182, 34, 0.2);
    transform: scale(1);
  }
  to {
    box-shadow: 0 12px 22px rgba(9, 32, 55, 0.2), 0 0 0 9px rgba(250, 182, 34, 0.28);
    transform: scale(1.035);
  }
}

.next-btn {
  margin-top: 24px;
  border: none;
  border-radius: 999px;
  background: var(--navy);
  color: var(--white);
  padding: 14px 26px;
  font-weight: 900;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(9, 32, 55, 0.12);
}

.status-message {
  margin-top: 32px;
  margin-bottom: 18px;
  min-height: 32px;
  width: auto;
  color: var(--navy);
  background: var(--white);
  border: 3px solid var(--gold);
  border-radius: 999px;
  padding: 9px 20px;
  font-size: 1.12rem;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 7px 14px rgba(9, 33, 58, 0.12);
}

.status-message.is-final {
  margin-top: 26px;
  padding: 8px;
  color: var(--navy);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  text-shadow: 0 0 8px rgba(0, 144, 197, 0.65), 0 0 18px rgba(250, 182, 34, 0.55);
  animation: final-score-glow 1.4s ease-in-out infinite alternate;
}

@keyframes final-score-glow {
  from {
    transform: scale(1);
    text-shadow: 0 0 6px rgba(0, 144, 197, 0.5), 0 0 12px rgba(250, 182, 34, 0.4);
  }
  to {
    transform: scale(1.035);
    text-shadow: 0 0 12px rgba(0, 144, 197, 0.85), 0 0 24px rgba(250, 182, 34, 0.75);
  }
}

@media (prefers-reduced-motion: reduce) {
  .answer-btn {
    animation: none;
  }

  .status-message.is-final {
    animation: none;
  }

  .card-button.is-finished .card-back {
    animation: none;
  }
}

@media (max-width: 700px) {
  .levels-page .home-link {
    top: 16px;
    left: 12px;
  }

  .levels-corner-logo {
    top: 11px;
    left: 128px;
    width: 64px;
    height: 58px;
  }

  .levels-shell {
    padding-top: 64px;
  }

  .game-banner {
    min-height: 70px;
    padding: 7px 14px 5px;
  }

  .game-banner img {
    height: 50px;
  }

  .home-shell {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero .actions {
    justify-content: center;
  }

  .game-topbar {
    padding-top: 72px;
    min-height: 128px;
  }

  .game-topbar .home-link {
    top: 16px;
    left: 12px;
  }

  .game-corner-logo {
    top: 10px;
    left: 128px;
    width: 64px;
    height: 58px;
  }

  .score-box {
    top: 18px;
    right: 12px;
    padding: 8px 12px;
    font-size: 0.88rem;
  }

  .answer-btn {
    width: 100%;
  }

  .game-board {
    flex-direction: column;
  }

  .card-button {
    width: min(86vw, 420px);
  }

  .answer-column {
    width: min(86vw, 320px);
  }

  .level-card {
    width: 190px;
    padding: 18px;
  }

  .level-list {
    grid-template-columns: repeat(3, 190px);
    justify-content: start;
    scroll-snap-type: x mandatory;
  }

  .level-card {
    scroll-snap-align: start;
  }
}
