:root {
  color-scheme: light;
  --ink: #6d2f43;
  --pink: #f35f83;
  --pink-dark: #cf3f67;
  --blue: #2f9fe9;
  --blue-dark: #1976c9;
  --cream: #fff5df;
  --orange: #ec9631;
  --orange-dark: #b96a17;
  --shadow: rgba(61, 43, 43, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #188ed1;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", system-ui, sans-serif;
}

button {
  font: inherit;
}

.game-shell {
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
  background: #188ed1;
}

.menu-scene {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-width: 320px;
  min-height: 180px;
  overflow: hidden;
  isolation: isolate;
  background: #62c8f4;
}

.background,
.sky-glow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.background {
  object-fit: cover;
  z-index: -3;
}

.sky-glow {
  z-index: -2;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.48), transparent 26%),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.08), transparent 46%, rgba(49, 140, 76, 0.12));
  pointer-events: none;
}

.top-bar {
  position: absolute;
  top: clamp(18px, 5.2vh, 34px);
  left: clamp(20px, 3.2vw, 42px);
  right: clamp(20px, 3.2vw, 42px);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.top-actions {
  display: flex;
  gap: clamp(8px, 1.5vw, 16px);
  min-width: 0;
}

.pill-button,
.score-badge,
.tagline {
  border: 3px solid rgba(127, 77, 53, 0.2);
  box-shadow: 0 5px 0 rgba(119, 78, 48, 0.25), 0 9px 18px rgba(37, 70, 84, 0.14);
  background: rgba(255, 247, 230, 0.96);
  color: var(--ink);
}

.pill-button {
  height: clamp(30px, 5.6vh, 54px);
  border-radius: 999px;
  padding: 0 clamp(10px, 1.7vw, 22px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(11px, 1.15vw, 17px);
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.pill-button:hover,
.main-button:hover {
  transform: translateY(-3px) scale(1.02);
}

.pill-button:active,
.main-button:active {
  transform: translateY(2px) scale(0.98);
}

.icon {
  width: clamp(18px, 3vh, 30px);
  height: clamp(18px, 3vh, 30px);
  flex: 0 0 auto;
}

.gear {
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff1dc 0 24%, transparent 25%),
    conic-gradient(from 10deg, #b86b53 0 10%, transparent 10% 18%, #b86b53 18% 28%, transparent 28% 36%, #b86b53 36% 46%, transparent 46% 54%, #b86b53 54% 64%, transparent 64% 72%, #b86b53 72% 82%, transparent 82% 90%, #b86b53 90%);
}

.info {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #6fb4d8;
  color: #fff;
  font-weight: 900;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.score-badge {
  min-width: clamp(82px, 12vw, 148px);
  height: clamp(32px, 6vh, 64px);
  border-radius: 999px;
  padding: 0 clamp(13px, 2vw, 24px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: clamp(16px, 2vw, 29px);
}

.star {
  width: clamp(24px, 4.5vh, 45px);
  aspect-ratio: 1;
  background: #ffc536;
  clip-path: polygon(50% 0, 63% 33%, 98% 35%, 70% 56%, 79% 91%, 50% 70%, 21% 91%, 30% 56%, 2% 35%, 37% 33%);
  filter: drop-shadow(0 3px 0 #d9891b);
}

.brand-menu {
  position: absolute;
  left: 50%;
  top: 51.5%;
  z-index: 4;
  width: clamp(245px, 35vw, 500px);
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: clamp(18px, 5vh, 32px);
}

.logo {
  position: relative;
  width: 100%;
}

.logo-image {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 0 rgba(63, 82, 91, 0.18));
}

.primary-actions {
  display: grid;
  gap: clamp(8px, 1.5vh, 18px);
  width: min(100%, clamp(205px, 32vw, 390px));
}

.main-button {
  height: clamp(42px, 7vh, 74px);
  border: 4px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.6vw, 18px);
  color: white;
  font-size: clamp(18px, 2.4vw, 35px);
  font-weight: 1000;
  text-shadow: 0 3px 0 rgba(42, 68, 84, 0.28);
  cursor: pointer;
  box-shadow: 0 7px 0 rgba(79, 65, 80, 0.3), 0 18px 26px rgba(41, 56, 64, 0.2);
  transition: transform 160ms ease, filter 160ms ease;
}

.play {
  background: linear-gradient(#ff7796, #ee426f);
}

.language {
  background: linear-gradient(#49b6f3, #198fe1);
}

.play-icon,
.globe-icon {
  width: clamp(26px, 4.4vh, 40px);
  aspect-ratio: 1;
  flex: 0 0 auto;
  background: #fff;
}

.play-icon {
  border-radius: 50%;
  clip-path: circle(50%);
  position: relative;
}

.play-icon::after {
  content: "";
  position: absolute;
  left: 39%;
  top: 28%;
  width: 38%;
  height: 44%;
  background: var(--pink);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.globe-icon {
  border-radius: 50%;
  position: relative;
  overflow: hidden;
}

.globe-icon::before,
.globe-icon::after {
  content: "";
  position: absolute;
  inset: 19%;
  border: 3px solid var(--blue);
  border-left-color: transparent;
  border-right-color: transparent;
  border-radius: 50%;
}

.globe-icon::after {
  inset: 0;
  border-left-color: var(--blue);
  border-right-color: var(--blue);
  border-top-color: transparent;
  border-bottom-color: transparent;
}

.character {
  position: absolute;
  z-index: 3;
  bottom: clamp(48px, 12.8vh, 80px);
  width: auto;
  height: clamp(165px, 42vh, 320px);
  pointer-events: none;
  filter: drop-shadow(0 14px 10px rgba(49, 48, 47, 0.24));
  animation: floaty 4.5s ease-in-out infinite;
}

.boy {
  left: clamp(70px, 12vw, 185px);
  height: clamp(165px, 42vh, 320px);
}

.girl {
  right: clamp(72px, 13vw, 185px);
  height: clamp(165px, 42vh, 320px);
  animation-delay: -1.7s;
}

.tagline {
  position: absolute;
  left: clamp(14px, 3vw, 42px);
  bottom: clamp(13px, 3vh, 34px);
  z-index: 4;
  margin: 0;
  border-radius: 999px;
  padding: clamp(8px, 1.6vh, 15px) clamp(14px, 2.5vw, 26px);
  font-size: clamp(12px, 1.3vw, 18px);
  font-weight: 900;
}

.panel {
  width: min(92vw, 460px);
  border: 0;
  padding: 0;
  background: transparent;
}

.panel::backdrop {
  background: rgba(28, 44, 59, 0.45);
  backdrop-filter: blur(4px);
}

.panel-card {
  position: relative;
  border: 4px solid rgba(255, 255, 255, 0.9);
  border-radius: 22px;
  padding: 28px;
  background: #fff6df;
  color: var(--ink);
  box-shadow: 0 18px 0 rgba(118, 83, 46, 0.22), 0 28px 50px rgba(32, 42, 56, 0.28);
}

.panel-card h2 {
  margin: 0 44px 18px 0;
  font-size: 30px;
}

.panel-card p {
  margin: 0 0 14px;
  font-size: 18px;
  line-height: 1.45;
}

.panel-options {
  display: grid;
  gap: 10px;
}

.panel-option {
  min-height: 46px;
  border: 2px solid rgba(109, 47, 67, 0.16);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.close-button {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f25f82;
  color: white;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 #bb3f60;
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0) rotate(-0.5deg);
  }
  50% {
    transform: translateY(-10px) rotate(0.5deg);
  }
}

@media (max-aspect-ratio: 4 / 5) {
  .menu-scene {
    width: 100vw;
    height: 100vh;
  }

  .background {
    object-position: center;
  }

  .top-actions {
    position: absolute;
    left: 0;
    top: 0;
    flex-direction: column;
    gap: 8px;
  }

  .score-badge {
    position: absolute;
    right: max(calc(100vw - 390px), 0px);
    top: 0;
  }

  .pill-button span:last-child {
    display: none;
  }

  .brand-menu {
    left: min(50vw, 195px);
    top: 43%;
    width: calc(min(100vw, 390px) - 48px);
  }

  .primary-actions {
    width: 100%;
  }

  .main-button {
    width: 100%;
    min-width: 0;
    padding-inline: 12px;
  }

  .character {
    height: min(34vh, 185px);
    width: auto;
    bottom: 6vh;
  }

  .boy {
    left: 2vw;
    height: min(34vh, 185px);
  }

  .girl {
    right: 17vw;
    height: min(34vh, 185px);
  }

  .tagline {
    max-width: 55vw;
  }
}

@media (max-width: 560px) {
  .score-badge {
    min-width: 76px;
    height: 54px;
    padding: 0 10px;
    gap: 6px;
    font-size: 22px;
  }

  .star {
    width: 32px;
  }

  .logo-main {
    font-size: clamp(46px, 15vw, 70px);
  }

  .logo-sub {
    font-size: clamp(39px, 13vw, 62px);
  }

  .ribbon {
    font-size: clamp(18px, 6vw, 28px);
  }

  .main-button {
    font-size: clamp(18px, 5.6vw, 26px);
  }
}
