@font-face {
  font-family: "Inter";
  src: url("../common/fonts/Inter-VariableFont_opsz,wght.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../common/fonts/Inter-Italic-VariableFont_opsz,wght.ttf") format("truetype");
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --yellow: #FFCD00;
  --black: #050505;
  --white: #ffffff;
  --muted: #aaa;
  --gray-primary: #2D2926;
  --selected-anchor-x: clamp(100px, 23%, 132px);
  --selected-anchor-y: 49svh;
  --flag-width: clamp(75px, 16vw, 110px);
  --arc-width: calc(var(--flag-width) * 9.12);
  --detail-height: clamp(52px, 8.5vw, 72px);
  color-scheme: dark;
  font-family: "Inter", Arial, Helvetica, sans-serif;
  font-synthesis: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--black);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100svh;
  /* overflow: hidden; */
  color: var(--white);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.app {
  width: 100%;
  max-width: 1024px;
  min-height: 100svh;
  margin-inline: auto;
  /* overflow: hidden; */
  position: relative;
  background: var(--black);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.65);
}

.screen {
  width: 100%;
  min-height: 100svh;
}

.screen[hidden] {
  display: none;
}

.app--loading .screen {
  visibility: hidden;
}

.cover-screen {
  display: grid;
  place-items: center;
  overflow: hidden;
  background-color: #020202;
  background-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.22)),
    url("assets/fondos/fondo-portada.png");
  background-position: center;
  background-size: cover;
}

.cover-screen__content {
  display: flex;
  /* width: min(100%, 720px); */
  min-height: 100svh;
  padding: min(40px, 10svh) 24px 10px;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.cover-screen__logo {
  display: block;
  width: min(68vw, 310px);
  height: auto;
}

.cover-screen__copy {
  margin: clamp(40px, 9svh, 60px) 0 0;
}

.cover-screen__title {
  margin: 0;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.3;
}

.cover-screen__title span,
.cover-screen__title strong {
  /* display: block; */
}

.cover-screen__title span {
  color: var(--yellow);
}

.cover-screen__title strong {
  color: var(--white);
  font-weight: 700;
}

.cover-screen__subtitle {
  margin-top: 40px;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
}

.cover-screen__subtitle--lg {
  font-size: 20px;
}

.primary-button {
  width: min(100%, 220px);
  min-height: 42px;
  margin-top: 20px;
  border: 0;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--gray-primary);
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease;
  padding: 8px 40px;
}

.primary-button:hover {
  box-shadow: 0 0 32px rgba(255, 205, 0, 0.25);
  transform: translateY(-2px);
}

.primary-button:active {
  transform: translateY(1px) scale(0.99);
}

.primary-button:focus-visible,
.orbit-control:focus-visible,
.game-node:focus-visible,
.play-button:focus-visible,
.rally-stage:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 4px;
}

.cover-screen__message {
  min-height: 1.2em;
  margin: 14px 0 0;
  color: #d9d9d9;
  font-size: 0.82rem;
}

.menu-screen {
  position: relative;
  height: 100svh;
  overflow: hidden;
  background: #444444 url("assets/fondos/fondo-menu.png") center / cover no-repeat;
}

.menu-header {
  position: relative;
  z-index: 10;
  display: flex;
  padding: 24px 20px 18px;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  background-color: #020202;
  border-bottom: 1px solid #FFCD00;
  box-shadow: 0px 0px 10px 0px #FFCD00;
}

.menu-header__logo {
  width: 122px;
  height: auto;
}

.menu-header__title {
  margin: 16px 0 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

.menu-header__title span {
  color: var(--yellow);
}

.rally-stage {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.rally-stage__arc {
  position: absolute;
  z-index: 1;
  width: var(--arc-width);
  height: auto;
  max-width: none;
  transform: rotate(var(--arc-rotation, 0deg));
  transform-origin: 49.74% 25.17%;
  transition: transform 560ms cubic-bezier(0.2, 0.85, 0.28, 1);
  pointer-events: none;
}

.game-orbit {
  position: absolute;
  z-index: 3;
  inset: 0;
}

.game-node {
  position: absolute;
  z-index: 2;
  display: block;
  width: var(--flag-width);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition:
    left 560ms cubic-bezier(0.2, 0.85, 0.28, 1),
    top 560ms cubic-bezier(0.2, 0.85, 0.28, 1),
    opacity 380ms ease,
    filter 380ms ease,
    transform 560ms cubic-bezier(0.2, 0.85, 0.28, 1);
  transform-origin: left bottom;
  will-change: left, top, transform;
}

.game-node__flag {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.game-node__check {
  position: absolute;
  top: -8%;
  right: -15%;
  display: grid;
  width: clamp(24px, 5vw, 32px);
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid #111;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 3px var(--yellow);
  transform: rotate(calc(-1 * var(--flag-rotation, 0deg)));
}

.game-node__check img {
  width: 58%;
  height: 58%;
}

.game-node__check[hidden] {
  display: none;
}

.game-node__locked-indicator {
  position: absolute;
  right: auto;
  left: calc(100% + clamp(7px, 1.5vw, 12px));
  top: 52%;
  display: grid;
  width: clamp(16px, 3.5vw, 24px);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 205, 0, 0.82);
  transform: translateY(-50%);
}

.game-node__locked-indicator svg {
  width: 58%;
  height: 58%;
  fill: none;
  stroke: #111;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.6;
}

.game-node__locked-indicator[hidden] {
  display: none;
}

.game-node.is-locked {
  cursor: not-allowed;
}

.game-node.is-locked .game-node__flag {
  filter: brightness(0.44) saturate(0.6);
  opacity: 0.72;
}

.game-node.is-selected {
  z-index: 4;
  filter: brightness(1.06);
}

.game-node.is-outside {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.game-details {
  position: absolute;
  z-index: 5;
  top: var(--selected-anchor-y);
  right: clamp(18px, 8%, 70px);
  left: 0;
  height: var(--detail-height);
  transform: translateY(-50%);
  transition: opacity 180ms ease, transform 560ms cubic-bezier(0.2, 0.85, 0.28, 1);
}

.game-details__line {
  position: absolute;
  z-index: 0;
  right: calc(var(--detail-height) * 0.5);
  left: 0;
  inset-block: 0;
}

.game-details__line::before,
.game-details__line::after {
  position: absolute;
  right: 0;
  height: 2px;
  background: var(--white);
  content: "";
}

.game-details__line::before {
  top: 22%;
  left: var(--top-line-left, 0px);
}

.game-details__line::after {
  bottom: 22%;
  left: var(--bottom-line-left, 0px);
}

.game-details__title {
  position: absolute;
  z-index: 1;
  right: var(--detail-height);
  left: var(--title-left, 0px);
  top: 50%;
  min-width: 0;
  margin: 0;
  padding: 2px 8px;
  overflow: hidden;
  color: var(--white);
  font-size: clamp(9.5px, 2.1vw, 1.15rem);
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  transform: translateY(-50%);
  white-space: nowrap;
}

.play-button {
  position: absolute;
  right: 0;
  top: 0;
  display: grid;
  height: 100%;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: #101010;
  font-size: clamp(11px, 2.1vw, 1.15rem);
  font-weight: 600;
  text-decoration: none;
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.play-button:hover {
  box-shadow: 0 0 28px rgba(255, 205, 0, 0.38);
  transform: scale(1.04);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

noscript {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: #000;
  color: #fff;
  text-align: center;
}

@media (max-width: 520px) {
  :root {
    --selected-anchor-x: clamp(96px, 23%, 116px);
    --flag-width: 75px;
    --detail-height: clamp(50px, 13vw, 60px);
  }

  .cover-screen {
    background-position: 53% center;
  }

  /* .cover-screen__content {
    padding-top: max(42px, 16svh);
  } */

  .game-details {
    right: 20px;
  }

  .game-details__title {
    max-width: none;
    padding-right: 7px;
    padding-left: 7px;
  }

}

@media (min-width: 900px) {
  :root {
    --flag-width: 110px;
  }

  .menu-header {
    padding-top: 36px;
  }

  .game-details {
    right: 70px;
  }
}

@media (max-height: 680px) {
  .cover-screen__content {
    /* padding-top: 100px; */
    padding-bottom: 28px;
  }

  .cover-screen__copy {
    margin-top: 30px;
  }

  .cover-screen__subtitle {
    margin-top: 30px;
  }

  .util-break {
    display: none;
  }

  .primary-button {
    margin-top: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media screen and (min-width: 768px) {
  .mobile-break {
    display: none;
  }
}

/* LOADER */
.loader {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background-color: #000;
}

.loader svg {
  width: 52px;
  height: 52px;
  border: 5px solid rgb(255 205 0 / 25%);
  border-top-color: #ffcd00;
  border-radius: 50%;
  animation: loader-spin 800ms linear infinite;
}

.loader svg>* {
  display: none;
}

@keyframes loader-spin {
  to {
    transform: rotate(360deg);
  }
}

.loader.hidden {
  display: none !important;
}