:root {
  font-family: "Segoe UI", Arial, sans-serif;
  color: #111;
  background: #000;
  touch-action: none;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

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

body {
  display: grid;
  place-items: center;
  background: #000;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

#app {
  position: relative;
  width: min(100vw, calc(100vh * .6), 480px);
  aspect-ratio: 3 / 5;
  overflow: hidden;
  background: #a5cbff;
  box-shadow: 0 0 30px rgb(0 0 0 / 60%);
}

#game {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.screen {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.screen[hidden],
.message[hidden],
.toast[hidden] {
  display: none;
}

.canvas-controls {
  pointer-events: none;
}

.canvas-controls button {
  pointer-events: auto;
}

.title-screen {
  overflow: hidden;
}

.title-logo {
  position: absolute;
  top: 56px;
  left: 12px;
  z-index: 2;
  width: 456px;
  height: auto;
}

.panorama {
  position: absolute;
  top: 145px;
  left: 0;
  display: flex;
  width: 100%;
  height: 590px;
  transition: transform .32s cubic-bezier(.2,.75,.2,1);
}

.panorama-page {
  width: 100%;
  flex: 0 0 100%;
  padding: 20px 32px 40px;
}

.panorama-page h1 {
  margin: -4px 0 28px;
  font-size: 52px;
  font-weight: 300;
  text-transform: lowercase;
}

.menu-link {
  display: block;
  width: 100%;
  height: 80px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #111;
  font-size: 56px;
  font-weight: 300;
  line-height: 1;
  text-align: left;
}

.menu-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 64px;
}

.play-button {
  width: min(330px, 100%);
  height: 82px;
  border: 3px solid #fff;
  border-radius: 12px;
  background: transparent;
  color: #fff;
  font-size: 46px;
  font-weight: 300;
  text-align: center;
  text-shadow: none;
  cursor: pointer;
}

.play-button:active {
  background: #fff;
  color: #111;
}

.play-button:focus-visible,
.sound-toggle:focus-visible {
  outline: 4px solid #111;
  outline-offset: 5px;
}

.solid-screen {
  overflow: hidden;
  background: #a5cbff;
}

.dark-screen {
  overflow: hidden;
  background: #1f1f1f;
  color: #fff;
}

.phone-header {
  position: relative;
  height: 150px;
  padding: 25px 20px 0;
}

.phone-header p {
  margin: 0 0 2px;
  font-size: 22px;
}

.phone-header h1 {
  margin: 0;
  font-size: 61px;
  font-weight: 300;
  line-height: 1;
}

.back-button {
  position: absolute;
  top: 16px;
  right: 14px;
  z-index: 8;
  display: grid;
  width: 48px;
  height: 48px;
  padding: 0 0 3px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgb(20 35 52 / 40%);
  color: #fff;
  font: 30px/1 "Segoe UI Symbol", "Segoe UI", sans-serif;
  cursor: pointer;
}

.phone-header .back-button {
  top: 19px;
  right: 14px;
}

.game-back {
  z-index: 30;
}

.back-button:active {
  background: #fff;
  color: #111;
}

.back-button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.level-list {
  height: 650px;
  overflow: auto;
  padding-bottom: 16px;
  scrollbar-width: thin;
}

.level-button {
  position: relative;
  display: grid;
  width: calc(100% - 20px);
  height: 101px;
  margin: 0 10px;
  padding: 8px 15px 8px 125px;
  place-items: center;
  border: 2px solid #1f1f1f;
  background: rgb(255 255 255 / 12%);
  color: #111;
}

.level-button + .level-button {
  margin-top: 3px;
}

.level-button:disabled {
  opacity: .38;
  filter: grayscale(1);
}

.level-button img {
  position: absolute;
  left: 12px;
  top: 8px;
  width: 109px;
  height: 80px;
  object-fit: contain;
}

.level-name {
  font-size: 24px;
  line-height: 1.05;
  text-align: center;
}

.rating {
  display: flex;
  min-height: 18px;
  align-items: center;
  justify-content: center;
  color: #2a5f26;
  font-size: 18px;
  letter-spacing: 2px;
}

.lock-icon {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.lock-icon circle {
  fill: currentColor;
  stroke: none;
}

.ringtone-list {
  height: 545px;
  padding: 5px 31px;
}

.ringtone-list button {
  display: block;
  width: 100%;
  height: 72px;
  padding: 0 8px;
  border: 0;
  border-left: 5px solid transparent;
  background: transparent;
  color: #fff;
  font-size: 36px;
  font-weight: 300;
  text-align: left;
}

.ringtone-list button.selected {
  border-left-color: #a5cbff;
  background: rgb(255 255 255 / 10%);
}

.app-bar {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  height: 88px;
  justify-content: center;
  gap: 40px;
  background: #111;
}

.app-bar button {
  width: 62px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 12px;
  text-align: center;
}

.app-bar span {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 3px auto;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  font-size: 24px;
}

.credits-copy {
  padding: 60px 34px 0;
  text-align: center;
}

.credits-copy h2 {
  margin: 0 0 17px;
  font-size: 27px;
  font-weight: 400;
}

.credits-copy p {
  margin: 0 0 55px;
  font-size: 20px;
}

.message {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.message-card {
  position: absolute;
  top: 151px;
  left: 70px;
  display: grid;
  width: 344px;
  height: 323px;
  padding: 20px 22px 14px;
  grid-template-rows: 91px 107px 70px;
  border: 3px solid rgb(0 0 0 / 68%);
  border-radius: 9px;
  background: rgb(255 255 255 / 77%);
  color: #000;
  text-align: center;
  pointer-events: auto;
}

.message-title {
  align-self: center;
  font-size: 40px;
  line-height: 1.02;
}

.message-copy {
  align-self: center;
  font-size: 24px;
  line-height: 1.2;
}

.message-hint {
  align-self: center;
  font-size: 19px;
  line-height: 1.2;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 95px;
  z-index: 50;
  max-width: 85%;
  padding: 12px 20px;
  transform: translateX(-50%);
  border: 2px solid #fff;
  background: #1f1f1f;
  color: #fff;
  font-size: 18px;
  text-align: center;
}

.sound-toggle {
  position: absolute;
  right: 14px;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 60;
  display: grid;
  width: 50px;
  height: 50px;
  padding: 9px;
  place-items: center;
  border: 2px solid rgb(255 255 255 / 88%);
  border-radius: 50%;
  background: rgb(22 35 50 / 76%);
  color: #fff;
  cursor: pointer;
}

.sound-toggle svg {
  width: 28px;
  height: 28px;
  overflow: visible;
  fill: currentColor;
}

.sound-toggle path.sound-waves,
.sound-toggle path.mute-cross {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.5px;
}

.sound-toggle .sound-off-icon,
.sound-toggle[aria-pressed="true"] .sound-on-icon {
  display: none;
}

.sound-toggle[aria-pressed="true"] .sound-off-icon {
  display: block;
}

@media (max-height: 670px) {
  .message-card {
    top: 105px;
  }
}
