:root {
  --bg: #a8a8a8;
  --header-height: 64px;
  --play-size-desktop: 132px;
  --play-size-mobile: 92px;
  --fullscreen-size-desktop: 68px;
  --fullscreen-size-mobile: 56px;
  --card-radius: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  font-family: system-ui, sans-serif;
  background: url("assets/fondo.png") center / cover no-repeat;
}

/* ================= HEADER ================= */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.site-logo {
  height: 96px;
  max-height: 150%;
  object-fit: contain;
}

/* ================= BACK BUTTON ================= */

.back-button {
  position: absolute;
  left: 16px;
  width: 42px;
  height: 42px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5e5e5e;
  text-decoration: none;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.back-button:hover {
  background: #f2f2f2;
}

.back-button svg {
  width: 20px;
  height: 20px;
}

/* ================= MAIN ================= */

.main-content {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 100%;
  height: calc(100dvh - var(--header-height));
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  width: 96%;
  height: 92%;
  max-height: 100%;
}

.game-frame,
#unity-container,
#unity-content {
  width: 100%;
  height: 100%;
}

#unity-container {
  border-radius: var(--card-radius);
  overflow: hidden;
}

#unity-content {
  background: #000;
  border-radius: var(--card-radius);
  position: relative;
  overflow: hidden;
}

#unity-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #231f20;
}

/* ================= ICONOS ================= */

.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: var(--play-size-desktop);
  height: var(--play-size-desktop);
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  z-index: 10;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.play-btn svg {
  width: 100%;
  height: 100%;
  display: block;
}

.play-btn.hidden {
  display: none;
}

.fullscreen-btn {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  z-index: 10;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fullscreen-btn svg {
  width: var(--fullscreen-size-desktop);
  height: var(--fullscreen-size-desktop);
  display: block;
}

/* ================= UNITY LOADING OVERLAY ================= */

.unity-loading {
  position: absolute;
  inset: 0;
  background: #000;
  border-radius: var(--card-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.unity-loading.hidden {
  display: none;
}

.unity-loading__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 60%;
  max-width: 340px;
}

.unity-loading__logo {
  height: 72px;
  object-fit: contain;
}

.unity-loading__bar-wrap {
  width: 100%;
  height: 6px;
  background: #333;
  border-radius: 999px;
  overflow: hidden;
}

.unity-loading__bar {
  height: 100%;
  width: 0%;
  background: #fff;
  border-radius: 999px;
  transition: width 0.2s ease;
}

.unity-loading__text {
  color: #aaa;
  font-size: 14px;
  margin: 0;
}

/* ================= ORIENTATION SCREEN ================= */

.orientation-warning {
  display: none;
  position: fixed;
  inset: 0;
  background: #000;
  color: #fff;
  z-index: 5000;
}

.orientation-warning__content {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  text-align: center;
  padding: 20px;
}

.orientation-logo {
  height: 120px;
  object-fit: contain;
}

.orientation-warning__text {
  max-width: 340px;
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
}

.orientation-warning__subtext {
  max-width: 340px;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
}

/* ================= PHONE ICON ================= */

.phone {
  width: 70px;
  height: 120px;
  border: 3px solid white;
  border-radius: 16px;
  position: relative;
  animation: rotatePhone 2s ease-in-out infinite;
}

.phone-screen {
  position: absolute;
  inset: 10px;
  background: white;
  border-radius: 10px;
}

@keyframes rotatePhone {
  0% {
    transform: rotate(0deg);
  }

  40% {
    transform: rotate(90deg);
  }

  60% {
    transform: rotate(90deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

/* ================= MOBILE ================= */

@media (max-width: 600px) {
  :root {
    --header-height: 56px;
    --play-size-mobile: 92px;
    --fullscreen-size-mobile: 56px;
  }

  .site-logo {
    height: 72px;
    max-height: 150%;
  }

  .back-button {
    left: 12px;
    width: 38px;
    height: 38px;
  }

  .back-button svg {
    width: 18px;
    height: 18px;
  }

  .play-btn {
    width: var(--play-size-mobile);
    height: var(--play-size-mobile);
  }

  .fullscreen-btn svg {
    width: var(--fullscreen-size-mobile);
    height: var(--fullscreen-size-mobile);
  }

  .unity-loading__logo {
    height: 56px;
  }

  .orientation-logo {
    height: 96px;
  }
}

/* ================= MOBILE VERTICAL ================= */

@media (max-width: 900px) and (orientation: portrait) {
  .orientation-warning {
    display: block;
  }

  .site-header,
  .main-content {
    display: none;
  }
}