
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700;800;900&family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #100d12;
  --panel: #1c1720;
  --panel-light: #29202a;
  --orange: #ff6a2b;
  --yellow: #ffc857;
  --text: #fff7ed;
  --muted: #c3b5b9;
  --border: rgba(255, 255, 255, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% 0%, #3b1c20 0%, transparent 48%),
    var(--bg);
  font-family: 'Montserrat', Arial, sans-serif;
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 4px;
}

.hidden {
  display: none !important;
}

.screen {
  width: min(1180px, 94%);
  margin: 0 auto;
}

/* PORTADA PRINCIPAL */

.intro-screen {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  padding: 48px 0 24px;
  overflow: hidden;
}

.intro-glow {
  position: absolute;
  z-index: -1;
  width: 650px;
  height: 650px;
  top: -250px;
  left: 35%;
  border-radius: 50%;
  background: rgba(255, 81, 34, 0.12);
  filter: blur(80px);
  pointer-events: none;
}

.intro-content {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 36px;
  min-height: 430px;
}

.intro-text {
  padding: 18px 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--yellow);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.intro-text h1,
.menu-top h1,
.game-header h1 {
  margin: 0;
  font-family: 'Barlow Condensed', Impact, sans-serif;
  font-weight: 900;
  letter-spacing: 0.025em;
  line-height: 0.95;
}

.intro-text h1 {
  font-size: clamp(3.7rem, 8vw, 6.8rem);
}

.intro-text h1 span,
.menu-top h1 span,
.game-header h1 span {
  color: var(--orange);
}

.intro-text h2 {
  margin: 12px 0 25px;
  color: var(--yellow);
  font-family: 'Barlow Condensed', Impact, sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.intro-quote {
  max-width: 530px;
  margin: 0 0 16px;
  padding-left: 17px;
  border-left: 4px solid var(--orange);
  color: #fff0db;
  font-size: 1.07rem;
  font-weight: 700;
  line-height: 1.65;
}

.intro-description {
  max-width: 540px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.8;
}

.main-button,
.secondary-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 13px 22px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 800;
  letter-spacing: 0.035em;
  transition: transform 0.2s, filter 0.2s, background 0.2s;
}

.main-button {
  color: #24100a;
  background: linear-gradient(115deg, #ffb347, #ff642d);
  box-shadow: 0 8px 30px rgba(255, 90, 35, 0.18);
}

.main-button:hover,
.secondary-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.intro-note {
  color: #a99ba3;
  font-size: 0.75rem;
}

.intro-art {
  position: relative;
  height: 365px;
  overflow: hidden;
  border: 1px solid rgba(255, 177, 89, 0.18);
  border-radius: 28px;
  background:
    radial-gradient(ellipse at 50% 73%, rgba(255, 91, 33, 0.24), transparent 45%),
    linear-gradient(165deg, #34202a 0%, #201820 58%, #141116 100%);
  box-shadow: inset 0 0 55px rgba(0, 0, 0, 0.28);
}

.art-sun {
  position: absolute;
  top: 45px;
  right: 75px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd77b, #ff642e);
  box-shadow: 0 0 70px rgba(255, 115, 41, 0.25);
}

.art-volcano {
  position: absolute;
  bottom: 70px;
  left: 50%;
  width: 300px;
  height: 235px;
  transform: translateX(-50%);
  clip-path: polygon(0 100%, 19% 53%, 33% 40%, 43% 12%, 51% 0, 61% 13%, 69% 42%, 83% 57%, 100% 100%);
  background: linear-gradient(90deg, #32242a, #604044 50%, #2b1e26);
}

.volcano-snow {
  position: absolute;
  top: 4px;
  left: 44%;
  width: 50px;
  height: 35px;
  background: #d8c6b9;
  clip-path: polygon(25% 0, 50% 30%, 67% 15%, 100% 100%, 0 100%);
}

.volcano-crater {
  position: absolute;
  top: 9px;
  left: 44%;
  width: 50px;
  height: 13px;
  border-radius: 50%;
  background: #24151c;
}

.lava-stream {
  position: absolute;
  top: 38px;
  left: 49%;
  width: 18px;
  height: 150px;
  border-radius: 40%;
  background: linear-gradient(#ffb63e, #ff542a, transparent);
  transform: rotate(-7deg);
  box-shadow: 0 0 15px rgba(255, 88, 30, 0.65);
}

.art-smoke {
  position: absolute;
  border-radius: 50%;
  background: rgba(105, 87, 98, 0.25);
  filter: blur(8px);
}

.smoke-one {
  width: 85px;
  height: 105px;
  top: 25px;
  left: 35%;
}

.smoke-two {
  width: 65px;
  height: 80px;
  top: 5px;
  left: 49%;
}

.art-ground {
  position: absolute;
  right: -10%;
  bottom: -30px;
  left: -10%;
  height: 120px;
  border-top: 3px solid #a34c2b;
  border-radius: 50% 50% 0 0;
  background: linear-gradient(180deg, #533026, #211719);
}

.art-motorcycle {
  position: absolute;
  z-index: 2;
  right: 10%;
  bottom: 67px;
  font-size: clamp(4rem, 9vw, 6.5rem);
  filter: drop-shadow(0 8px 8px #0c090a);
  transform: scaleX(-1) rotate(-5deg);
  animation: motorcycle-bob 2s ease-in-out infinite;
}

.art-label {
  position: absolute;
  bottom: 20px;
  left: 22px;
  color: #ffd5a1;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

@keyframes motorcycle-bob {
  0%, 100% { transform: scaleX(-1) translateY(0) rotate(-5deg); }
  50% { transform: scaleX(-1) translateY(-6px) rotate(-2deg); }
}

/* DATOS DE LA CREADORA */

.creator-card {
  margin-top: 22px;
  padding: 22px 25px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: rgba(31, 24, 31, 0.9);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.16);
}

.creator-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.creator-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #28120a;
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  font-size: 1.5rem;
}

.creator-heading h3 {
  margin: 0 0 4px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

.creator-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.creator-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 24px;
}

.creator-grid p {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  overflow-wrap: anywhere;
}

.creator-grid p span {
  color: #b9aab2;
  font-size: 0.72rem;
}

.creator-grid p strong {
  color: #fff4e9;
  font-size: 0.87rem;
  font-weight: 700;
}

.institution-row {
  grid-column: 1 / -1;
}

.footer-note {
  margin: 20px 0 0;
  color: #8f8189;
  text-align: center;
  font-size: 0.72rem;
}

/* SELECCIÓN DE MOTOS */

.menu-screen {
  min-height: 100vh;
  padding: 52px 0 35px;
}

.menu-top {
  text-align: center;
}

.menu-top h1 {
  font-size: clamp(2.6rem, 6vw, 4.8rem);
}

.menu-description {
  max-width: 650px;
  margin: 17px auto 30px;
  color: var(--muted);
  font-size: 0.91rem;
  line-height: 1.7;
}

.bike-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.bike-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 23px 20px 18px;
  border: 1px solid var(--border);
  border-radius: 17px;
  color: var(--text);
  background: linear-gradient(160deg, #29212b, #19151c);
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.bike-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 169, 74, 0.55);
}

.bike-card.selected {
  border: 2px solid var(--orange);
  padding: 22px 19px 17px;
  box-shadow: 0 0 28px rgba(255, 94, 38, 0.13);
}

.bike-badge {
  align-self: flex-start;
  padding: 6px 9px;
  border-radius: 5px;
  color: #c8e5ff;
  background: #19384c;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.medium-badge {
  color: #ffe2ae;
  background: #50301c;
}

.hard-badge {
  color: #ffd3c7;
  background: #50221e;
}

.bike-art {
  display: grid;
  place-items: center;
  height: 118px;
  margin: 8px 0;
  border-radius: 12px;
  background: radial-gradient(ellipse, #48303a, transparent 72%);
  font-size: 5.3rem;
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.25));
}

.bike-blue {
  filter: drop-shadow(0 5px 8px rgba(45, 153, 255, 0.23));
}

.bike-red {
  filter: drop-shadow(0 5px 8px rgba(255, 66, 39, 0.3));
}

.bike-gold {
  filter: drop-shadow(0 5px 8px rgba(255, 193, 54, 0.28));
}

.bike-card h2 {
  margin: 7px 0 7px;
  font-family: 'Barlow Condensed', Impact, sans-serif;
  font-size: 1.75rem;
  text-transform: uppercase;
}

.bike-card p {
  min-height: 42px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 9px 0 7px;
  color: #d2c4cc;
  font-size: 0.7rem;
}

.stat-row span:last-child {
  color: var(--yellow);
  font-weight: 700;
}

.stat-track {
  height: 5px;
  overflow: hidden;
  border-radius: 10px;
  background: #40333e;
}

.stat-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--yellow), var(--orange));
}

.choose-label {
  margin-top: 19px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: #ffbd70;
  font-size: 0.71rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-align: center;
}

.menu-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 27px 0 18px;
}

.secondary-button {
  border: 1px solid var(--border);
  color: #f1e6ed;
  background: #2a222c;
}

.controls-summary {
  color: #9f919b;
  font-size: 0.75rem;
  line-height: 1.8;
  text-align: center;
}

/* PANTALLA DEL JUEGO */

.game-screen {
  padding: 25px 0 35px;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.game-header h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.game-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.game-stats div {
  min-width: 85px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #211a24;
}

.game-stats div span,
.game-stats div strong {
  display: block;
}

.game-stats div span {
  margin-bottom: 4px;
  color: #b8a9b2;
  font-size: 0.65rem;
}

.game-stats div strong {
  color: var(--yellow);
  font-size: 1rem;
}

.game-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 140, 62, 0.35);
  border-radius: 15px;
  background: #241a21;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.3);
}

#gameCanvas {
  display: block;
  width: 100%;
  height: auto;
  background: #29212a;
}

.message-panel {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(13, 10, 15, 0.76);
  backdrop-filter: blur(5px);
}

.message-box {
  width: min(440px, 100%);
  padding: 30px;
  border: 1px solid rgba(255, 157, 73, 0.4);
  border-radius: 17px;
  background: #211922;
  text-align: center;
  box-shadow: 0 20px 60px #09070a80;
}

.message-box h2 {
  margin: 5px 0 12px;
  font-family: 'Barlow Condensed', Impact, sans-serif;
  font-size: 2.5rem;
  text-transform: uppercase;
}

.message-box p:not(.eyebrow) {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.7;
}

.message-box .main-button {
  margin-top: 12px;
}

.game-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 15px 2px 0;
}

.game-bottom > p {
  flex: 1;
  min-width: 180px;
  color: #d4c3cb;
  font-size: 0.78rem;
  line-height: 1.6;
}

.game-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.game-buttons .secondary-button {
  min-height: 38px;
  padding: 9px 12px;
  font-size: 0.68rem;
}

.touch-controls {
  display: none;
  justify-content: center;
  gap: 12px;
  margin-top: 15px;
}

.touch-controls button {
  min-width: 66px;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: #2a222c;
  font-weight: 800;
}

/* ADAPTACIÓN A DIFERENTES PANTALLAS */

@media (max-width: 820px) {
  .intro-content {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .intro-text {
    padding-bottom: 0;
  }

  .intro-art {
    height: 300px;
  }

  .bike-grid {
    grid-template-columns: 1fr;
  }

  .bike-card {
    display: grid;
    grid-template-columns: 90px 1fr;
    column-gap: 16px;
    align-items: center;
  }

  .bike-card .bike-badge {
    grid-column: 1 / -1;
  }

  .bike-art {
    grid-column: 1;
    grid-row: 2 / span 4;
    height: 110px;
    font-size: 4rem;
  }

  .bike-card h2,
  .bike-card p,
  .bike-card .stat-row,
  .bike-card .stat-track,
  .bike-card .choose-label {
    grid-column: 2;
  }

  .bike-card h2 {
    margin-top: 8px;
  }

  .bike-card p {
    min-height: 0;
    margin-bottom: 8px;
  }

  .bike-card .choose-label {
    margin-top: 12px;
  }

  .game-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .game-stats {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .intro-screen,
  .menu-screen {
    padding-top: 28px;
  }

  .intro-text h1 {
    font-size: 3.5rem;
  }

  .intro-art {
    height: 250px;
  }

  .art-volcano {
    width: 240px;
    height: 190px;
  }

  .creator-card {
    padding: 18px;
  }

  .creator-grid {
    grid-template-columns: 1fr;
  }

  .institution-row {
    grid-column: auto;
  }

  .menu-actions {
    flex-direction: column;
  }

  .menu-actions button {
    width: 100%;
  }

  .game-stats {
    width: 100%;
    gap: 6px;
  }

  .game-stats div {
    flex: 1;
    min-width: 0;
    padding: 8px;
  }

  .game-bottom {
    align-items: stretch;
    flex-direction: column;
  }

  .game-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .game-buttons button:last-child {
    grid-column: 1 / -1;
  }

  .touch-controls {
    display: flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}