:root {
  color-scheme: dark;
  --bg: #060812;
  --panel: #101626;
  --panel-strong: #18223a;
  --text: #fff9e8;
  --muted: #b8bed5;
  --cyan: #51d8df;
  --orange: #f2a444;
  --red: #f5534e;
  --green: #8dfb62;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(81, 216, 223, 0.18), transparent 30rem),
    radial-gradient(circle at 85% 20%, rgba(245, 83, 78, 0.16), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

button {
  font: inherit;
}

.preview-shell {
  width: min(1100px, calc(100% - 24px));
  margin: 0 auto;
  padding: 32px 0;
}

.preview-shell.arcade-page {
  width: min(1120px, calc(100% - 16px));
  padding: 10px 0 16px;
}

.preview-shell.arcade-page .canvas-wrap {
  width: min(100%, calc((100svh - 172px) * 16 / 9));
}

.preview-header {
  margin-bottom: 18px;
}

.preview-kicker {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  max-width: 780px;
  margin: 0 0 10px;
  font-size: clamp(2rem, 6vw, 4.2rem);
  line-height: 0.96;
}

.preview-header p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.game-frame {
  overflow: hidden;
  border: 1px solid rgba(255, 249, 232, 0.16);
  border-radius: 8px;
  background: rgba(16, 22, 38, 0.88);
  box-shadow: var(--shadow);
}

.game-topbar {
  display: grid;
  grid-template-columns:
    minmax(0, 1.04fr)
    minmax(0, 1.04fr)
    minmax(0, 1.04fr)
    minmax(118px, 0.78fr)
    minmax(110px, 0.72fr)
    minmax(110px, 0.72fr);
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid rgba(255, 249, 232, 0.12);
  background: rgba(6, 8, 18, 0.82);
}

.game-topbar span,
.restart-toggle,
.sound-toggle,
.music-toggle {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(81, 216, 223, 0.24);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.restart-toggle,
.sound-toggle,
.music-toggle {
  background: rgba(6, 8, 18, 0.76);
  cursor: pointer;
}

.restart-toggle {
  border-color: rgba(242, 164, 68, 0.46);
  color: var(--orange);
}

.restart-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.sound-toggle.is-muted,
.music-toggle.is-muted {
  border-color: rgba(245, 83, 78, 0.42);
  color: #f2a444;
}

.restart-toggle:focus-visible,
.sound-toggle:focus-visible,
.music-toggle:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

.canvas-wrap {
  position: relative;
  width: min(100%, calc((100vh - 250px) * 16 / 9));
  max-width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  background: #05070f;
  touch-action: none;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  image-rendering: pixelated;
  outline: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.game-language-switch {
  position: absolute;
  top: auto;
  right: clamp(18px, 2.6vw, 32px);
  bottom: clamp(86px, 13.8%, 126px);
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: clamp(88px, 8vw, 118px);
  gap: clamp(8px, 1.1vw, 14px);
  pointer-events: auto;
}

.preview-shell[data-arcade-mode]:not([data-arcade-mode="title"]) .game-language-switch {
  display: none;
}

.language-flag-link {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1.2;
  border: 1px solid rgba(255, 249, 232, 0.36);
  border-radius: 8px;
  background: rgba(6, 8, 18, 0.18);
  overflow: hidden;
  box-shadow:
    0 9px 22px rgba(0, 0, 0, 0.32),
    inset 0 0 16px rgba(81, 216, 223, 0.12);
  opacity: 0.88;
  transition: transform 0.14s ease, border-color 0.14s ease, opacity 0.14s ease;
}

.language-flag-link:hover,
.language-flag-link:focus-visible,
.language-flag-link.is-active {
  border-color: rgba(141, 251, 98, 0.86);
  opacity: 1;
  transform: translateY(-1px);
}

.language-flag-link:focus-visible {
  outline: 3px solid rgba(141, 251, 98, 0.52);
  outline-offset: 2px;
}

.language-flag-link img {
  display: block;
  width: 98%;
  height: 98%;
  max-width: none;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(81, 216, 223, 0.22));
}

.mobile-play-controls {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 12;
  touch-action: none;
  pointer-events: none;
}

.mobile-touch-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: auto;
  touch-action: none;
}

.mobile-touch-zone-left {
  left: 0;
  width: 52%;
}

.mobile-touch-zone-right {
  right: 0;
  width: 48%;
}

.preview-shell.is-mobile-gesture-mode .mobile-play-controls {
  display: block;
}

.mobile-control-visuals {
  --mobile-control-size: clamp(38px, min(6.4vw, 11svh), 58px);
  --mobile-action-size: clamp(48px, min(8vw, 14svh), 72px);
  --mobile-control-gap: clamp(5px, min(1.1vw, 1.6svh), 8px);
  --mobile-joystick-size: clamp(82px, min(18vw, 21svh), 126px);
  --mobile-joystick-thumb-size: clamp(30px, min(6.4vw, 7.8svh), 44px);
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.mobile-direction-pad {
  position: absolute;
  left: clamp(10px, 2.8vw, 24px);
  bottom: clamp(10px, 2.8vw, 24px);
  display: grid;
  grid-template-columns: repeat(3, var(--mobile-control-size));
  gap: var(--mobile-control-gap);
  pointer-events: auto;
}

.mobile-joystick {
  --joystick-x: 0px;
  --joystick-y: 0px;
  position: absolute;
  left: clamp(12px, 3vw, 28px);
  bottom: clamp(12px, 3vw, 28px);
  width: var(--mobile-joystick-size);
  height: var(--mobile-joystick-size);
  border-radius: 50%;
  opacity: 0.72;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.mobile-joystick-ring {
  position: relative;
  width: 100%;
  height: 100%;
  border: 2px solid rgba(255, 249, 232, 0.52);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(81, 216, 223, 0.24) 0 24%, transparent 25%),
    radial-gradient(circle at 50% 50%, rgba(6, 8, 18, 0.28), rgba(6, 8, 18, 0.58));
  box-shadow:
    0 9px 24px rgba(0, 0, 0, 0.38),
    inset 0 0 22px rgba(81, 216, 223, 0.18);
}

.mobile-joystick-ring::before {
  content: "";
  position: absolute;
  inset: 22%;
  border: 1px solid rgba(141, 251, 98, 0.26);
  border-radius: 50%;
}

.mobile-joystick-arrow {
  position: absolute;
  color: rgba(255, 249, 232, 0.74);
  font-size: clamp(0.66rem, 2.2vw, 0.95rem);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 7px rgba(0, 0, 0, 0.72);
}

.mobile-joystick-arrow-up {
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
}

.mobile-joystick-arrow-right {
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
}

.mobile-joystick-arrow-down {
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%);
}

.mobile-joystick-arrow-left {
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
}

.mobile-joystick-thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--mobile-joystick-thumb-size);
  height: var(--mobile-joystick-thumb-size);
  border: 2px solid rgba(255, 249, 232, 0.72);
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 32%, rgba(255, 249, 232, 0.86), transparent 16%),
    linear-gradient(145deg, rgba(242, 164, 68, 0.82), rgba(81, 216, 223, 0.76));
  box-shadow:
    0 7px 18px rgba(0, 0, 0, 0.42),
    inset 0 0 16px rgba(6, 8, 18, 0.26);
  transform: translate(calc(-50% + var(--joystick-x)), calc(-50% + var(--joystick-y)));
  transition: transform 0.08s linear, border-color 0.12s ease, opacity 0.12s ease;
  will-change: transform;
}

.mobile-joystick.is-active {
  opacity: 0.96;
}

.mobile-joystick.is-active .mobile-joystick-ring {
  border-color: rgba(141, 251, 98, 0.86);
  background:
    radial-gradient(circle at 50% 50%, rgba(141, 251, 98, 0.22) 0 24%, transparent 25%),
    radial-gradient(circle at 50% 50%, rgba(6, 8, 18, 0.22), rgba(6, 8, 18, 0.58));
}

.mobile-joystick.is-active .mobile-joystick-thumb {
  border-color: rgba(141, 251, 98, 0.9);
}

.mobile-control-button {
  display: grid;
  place-items: center;
  width: var(--mobile-control-size);
  height: var(--mobile-control-size);
  padding: 0;
  border: 2px solid rgba(255, 249, 232, 0.5);
  border-radius: 10px;
  appearance: none;
  background: rgba(6, 8, 18, 0.42);
  color: rgba(255, 249, 232, 0.88);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.36),
    inset 0 0 18px rgba(81, 216, 223, 0.14);
  font-size: clamp(1rem, 3.2vw, 1.55rem);
  font-weight: 900;
  line-height: 1;
  opacity: 0.66;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.mobile-action-button {
  position: absolute;
  right: clamp(12px, 3.1vw, 28px);
  bottom: clamp(18px, 4.8vw, 46px);
  width: var(--mobile-action-size);
  height: var(--mobile-action-size);
  border-color: rgba(242, 164, 68, 0.68);
  border-radius: 50%;
  color: rgba(255, 249, 232, 0.9);
  font-size: clamp(1.18rem, 3.6vw, 1.8rem);
  opacity: 0.7;
}

.mobile-action-button.is-fart-action {
  border-color: rgba(141, 251, 98, 0.76);
  color: #8dfb62;
  font-size: clamp(1.45rem, 4.1vw, 2.15rem);
  text-shadow:
    0 2px 6px rgba(0, 0, 0, 0.68),
    0 0 12px rgba(81, 216, 223, 0.28);
}

.mobile-control-button.is-active,
.mobile-control-button:active {
  border-color: rgba(141, 251, 98, 0.86);
  background: rgba(81, 216, 223, 0.28);
  color: #fff9e8;
  opacity: 0.95;
}

.level-two-lane-controls {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 18;
  pointer-events: none;
}

.level-two-lane-button {
  --lane-y: 50%;
  position: absolute;
  left: clamp(8px, 2.6vw, 18px);
  top: var(--lane-y);
  width: clamp(44px, 11vw, 58px);
  height: clamp(44px, 11vw, 58px);
  border: 2px solid rgba(141, 251, 98, 0.64);
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 28%, rgba(255, 249, 232, 0.28), transparent 32%),
    rgba(242, 164, 68, 0.88);
  color: #071018;
  font-size: clamp(1rem, 4.2vw, 1.36rem);
  font-weight: 900;
  line-height: 1;
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.38),
    0 0 18px rgba(141, 251, 98, 0.28);
  pointer-events: auto;
  touch-action: none;
  user-select: none;
}

.level-two-lane-button[data-arcade-control="up"] {
  --lane-y: 21.5%;
}

.level-two-lane-button[data-arcade-control="left"] {
  --lane-y: 36.3%;
}

.level-two-lane-button[data-arcade-control="down"] {
  --lane-y: 51.1%;
}

.level-two-lane-button[data-arcade-control="right"] {
  --lane-y: 65.9%;
}

.level-two-lane-button.is-active,
.level-two-lane-button:active {
  border-color: rgba(255, 249, 232, 0.92);
  background: rgba(81, 216, 223, 0.92);
  transform: translateY(-50%) scale(0.96);
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(6, 8, 18, 0.66);
  overflow: hidden;
}

.game-overlay.is-title-menu {
  place-items: stretch;
  padding: 0;
  background: transparent;
  pointer-events: auto;
}

.game-overlay.is-final-credits {
  place-items: start center;
  padding: 14px 18px 76px;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.game-overlay.is-hidden {
  display: none;
}

.game-loading-moon {
  --loading-moon-size: clamp(138px, 23vw, 260px);
  display: none;
  position: absolute;
  top: 34%;
  left: 49%;
  right: auto;
  z-index: 1;
  width: var(--loading-moon-size);
  aspect-ratio: 1;
  background: url("loading-moon-czech-v1.webp") center / contain no-repeat;
  filter:
    drop-shadow(0 0 14px rgba(255, 249, 232, 0.36))
    drop-shadow(0 12px 22px rgba(0, 0, 0, 0.45));
  opacity: 0.9;
  pointer-events: none;
  transform-origin: center;
  transform: translate(-50%, -50%) rotate(0deg);
  animation: loading-moon-spin 11s linear infinite;
  will-change: transform;
}

.game-overlay.is-level-loading > .game-loading-moon,
.game-loading > .game-loading-moon {
  display: block;
}

.game-overlay.is-level-loading {
  background: #060812;
}

.game-overlay.is-level-loading::before,
.game-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(rgba(6, 8, 18, 0.2), rgba(6, 8, 18, 0.58)),
    url("loading-stargazer-v1.webp") center / cover no-repeat;
}

.game-overlay.is-level-loading::after,
.game-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 48%, rgba(81, 216, 223, 0.1), transparent 19rem),
    linear-gradient(rgba(6, 8, 18, 0.08), rgba(6, 8, 18, 0.42));
  pointer-events: none;
}

.game-loading {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow: hidden;
  background: #060812;
}

.game-loading.is-hidden {
  display: none;
}

.game-loading-panel {
  position: relative;
  z-index: 2;
  place-self: start center;
  width: auto;
  margin-top: clamp(18px, 5vh, 40px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
  box-shadow: none;
  pointer-events: none;
}

.game-loading-panel strong {
  display: inline-grid;
  place-items: center;
  position: relative;
  min-height: 30px;
  padding: 6px 13px;
  border: 1px solid rgba(255, 249, 232, 0.42);
  border-radius: 999px;
  background: rgba(6, 8, 18, 0.42);
  color: #fff9e8;
  font-size: clamp(0.72rem, 2vw, 0.92rem);
  text-transform: uppercase;
  text-shadow:
    0 2px 0 rgba(6, 8, 18, 0.95),
    0 0 10px rgba(81, 216, 223, 0.5);
  box-shadow:
    inset 0 0 18px rgba(81, 216, 223, 0.12),
    0 9px 22px rgba(0, 0, 0, 0.3);
  animation: loading-label-bob 1.45s ease-in-out infinite;
}

.game-loading-panel strong::before,
.game-overlay-panel.is-level-loading .start-button::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% - 1px);
  width: 1px;
  height: clamp(14px, 3vh, 24px);
  background: linear-gradient(rgba(255, 249, 232, 0), rgba(255, 249, 232, 0.7));
  transform: translateX(-50%);
}

.game-loading-panel p,
.game-loading-panel small,
.game-loading-bar {
  display: none;
}

.game-loading-bar {
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 249, 232, 0.28);
  border-radius: 999px;
  background: rgba(6, 8, 18, 0.86);
}

.game-loading-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--green), var(--orange));
  transition: width 0.18s ease;
}

.game-loading-panel small {
  display: block;
  margin-top: 9px;
  color: var(--text);
  font-weight: 800;
}

.game-overlay-panel {
  position: relative;
  z-index: 2;
  width: min(520px, 100%);
  max-height: min(92vh, 620px);
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(255, 249, 232, 0.2);
  border-radius: 8px;
  background: rgba(16, 22, 38, 0.94);
  text-align: center;
}

.game-overlay-panel.is-level-loading {
  place-self: start center;
  width: auto;
  max-height: none;
  margin-top: clamp(18px, 5vh, 40px);
  overflow: visible;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.game-overlay-panel.is-level-loading h2 {
  display: none;
}

.game-overlay-panel.is-level-loading p {
  display: block;
  width: max-content;
  max-width: min(320px, calc(100vw - 48px));
  margin: 8px auto 0;
  padding: 5px 10px;
  border: 1px solid rgba(81, 216, 223, 0.32);
  border-radius: 999px;
  background: rgba(6, 8, 18, 0.46);
  color: rgba(255, 249, 232, 0.86);
  font-size: clamp(0.66rem, 1.8vw, 0.82rem);
  line-height: 1.25;
  text-shadow: 0 2px 0 rgba(6, 8, 18, 0.82);
}

.game-overlay-panel.is-level-loading .menu-actions {
  display: flex;
  justify-content: center;
  gap: 0;
}

.game-overlay-panel.is-level-loading .start-button {
  position: relative;
  min-height: 30px;
  padding: 6px 13px;
  border: 1px solid rgba(255, 249, 232, 0.42);
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(81, 216, 223, 0.3) var(--level-loading-progress, 0%), rgba(6, 8, 18, 0.42) 0),
    rgba(6, 8, 18, 0.42);
  color: #fff9e8;
  font-size: clamp(0.72rem, 2vw, 0.92rem);
  text-shadow:
    0 2px 0 rgba(6, 8, 18, 0.95),
    0 0 10px rgba(81, 216, 223, 0.5);
  box-shadow:
    inset 0 0 18px rgba(81, 216, 223, 0.12),
    0 9px 22px rgba(0, 0, 0, 0.3);
  opacity: 1;
  cursor: progress;
  pointer-events: none;
  animation: loading-label-pulse 1.25s ease-in-out infinite;
}

.game-overlay-panel.is-level-two-setup {
  width: min(820px, calc(100% - 24px));
  max-height: none;
  overflow: visible;
  padding: 18px 20px;
}

.game-overlay-panel.is-final-credits {
  width: min(920px, calc(100% - 20px));
  max-height: none;
  margin: 0 auto;
  padding: 18px;
  background:
    linear-gradient(rgba(6, 8, 18, 0.9), rgba(6, 8, 18, 0.96)),
    radial-gradient(circle at 50% 12%, rgba(242, 164, 68, 0.14), transparent 20rem);
}

.game-overlay-panel.is-final-credits .arcade-credits-window {
  --credits-window-height: clamp(260px, 34vh, 360px);
}

.game-overlay-panel.is-level-two-setup h2 {
  margin-bottom: 6px;
  font-size: clamp(1.28rem, 3.4vw, 1.85rem);
}

.game-overlay-panel.is-level-two-setup p {
  margin-bottom: 10px;
  line-height: 1.35;
}

.game-overlay-panel.is-title {
  position: relative;
  width: 100%;
  max-height: none;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.game-overlay-panel.is-title h2 {
  display: none;
}

@keyframes title-bounce {
  0%,
  100% {
    transform: translate(-50%, 0) rotate(-0.8deg);
  }

  50% {
    transform: translate(-50%, -12px) rotate(0.8deg);
  }
}

.game-overlay-panel.is-title p,
.game-overlay-panel.is-title .player-form,
.game-overlay-panel.is-title .score-form,
.game-overlay-panel.is-title .track-options {
  display: none;
}

.game-overlay-panel.is-title .score-board {
  position: absolute;
  top: 28%;
  left: 50%;
  width: min(430px, 72%);
  max-height: 42%;
  overflow: auto;
  transform: translateX(-50%);
  padding: 16px;
  border: 1px solid rgba(81, 216, 223, 0.4);
  border-radius: 8px;
  background: rgba(6, 8, 18, 0.86);
  pointer-events: auto;
}

.game-overlay-panel h2 {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: clamp(1.35rem, 5vw, 2.2rem);
}

.game-overlay-panel p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.game-overlay-panel p.is-hidden,
.highscore-button.is-hidden,
.repeat-level-button.is-hidden,
.end-game-button.is-hidden,
.share-button.is-hidden,
.share-panel.is-hidden {
  display: none;
}

@keyframes loading-moon-spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes loading-label-bob {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(7px);
  }
}

@keyframes loading-label-pulse {
  0%,
  100% {
    box-shadow:
      inset 0 0 18px rgba(81, 216, 223, 0.12),
      0 9px 22px rgba(0, 0, 0, 0.3);
  }

  50% {
    box-shadow:
      inset 0 0 24px rgba(141, 251, 98, 0.18),
      0 9px 26px rgba(81, 216, 223, 0.24);
  }
}

.player-form,
.score-form {
  margin: 0 0 14px;
  text-align: left;
}

.player-form.is-hidden,
.score-form.is-hidden,
.score-board.is-hidden,
.track-options.is-hidden {
  display: none;
}

.player-form label,
.score-form label {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 800;
}

.score-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.player-form input,
.score-form input {
  min-width: 0;
  height: 42px;
  border: 1px solid rgba(81, 216, 223, 0.42);
  border-radius: 6px;
  padding: 0 11px;
  background: rgba(6, 8, 18, 0.88);
  color: var(--text);
  font: inherit;
}

.player-form input {
  width: min(260px, 100%);
  text-align: center;
  text-transform: uppercase;
}

.player-form input:focus,
.score-form input:focus {
  outline: 3px solid rgba(141, 251, 98, 0.5);
  outline-offset: 2px;
}

.score-form button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 13px;
  background: var(--green);
  color: #061019;
  font-weight: 900;
  cursor: pointer;
}

.score-board {
  margin: 0 0 16px;
  padding: 13px;
  border: 1px solid rgba(81, 216, 223, 0.28);
  border-radius: 8px;
  background: rgba(6, 8, 18, 0.56);
  text-align: left;
}

.score-board h3 {
  margin: 0 0 9px;
  color: var(--cyan);
  font-size: 1rem;
}

.score-board ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 24px;
}

.score-board li {
  color: var(--text);
  font-weight: 800;
}

.arcade-credits {
  margin: 14px 0 16px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(242, 164, 68, 0.32);
  border-radius: 8px;
  background: rgba(3, 5, 12, 0.86);
  text-align: center;
}

.arcade-credits.is-hidden {
  display: none;
}

.arcade-credits-window {
  --credits-window-height: min(48vh, 430px);
  position: relative;
  height: var(--credits-window-height);
  overflow: hidden;
  mask-image: linear-gradient(transparent 0%, #000 13%, #000 87%, transparent 100%);
}

.arcade-credits-roll {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  padding: 0 28px 38px;
  animation: credits-roll 46s linear infinite;
  will-change: transform;
}

.arcade-credit-section {
  margin: 0 auto 34px;
  max-width: 650px;
}

.arcade-credit-section h3 {
  margin: 0 0 14px;
  color: var(--orange);
  font-size: clamp(1rem, 3vw, 1.45rem);
  text-transform: uppercase;
}

.arcade-credit-section p {
  margin: 0 auto 12px;
  color: var(--text);
  font-size: clamp(0.86rem, 2.4vw, 1.05rem);
  line-height: 1.55;
}

.arcade-credit-section.is-message p,
.arcade-credit-section.is-finale p {
  max-width: 560px;
  color: var(--green);
  font-weight: 800;
}

.arcade-credit-section.is-finale {
  margin-top: 52px;
  margin-bottom: 78px;
}

.arcade-credit-person {
  margin-bottom: 18px;
}

.arcade-credit-person strong {
  display: block;
  color: var(--text);
  font-size: clamp(0.95rem, 2.5vw, 1.18rem);
  overflow-wrap: anywhere;
}

.arcade-credit-person span {
  display: block;
  margin-top: 3px;
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 800;
}

.arcade-credit-person p {
  max-width: 520px;
  margin-top: 5px;
  color: var(--muted);
  font-size: clamp(0.74rem, 2vw, 0.9rem);
  line-height: 1.42;
}

@keyframes credits-roll {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(calc(-100% - var(--credits-window-height)));
  }
}

.score-board li span {
  color: var(--orange);
}

.track-options {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
}

.track-options.is-level-two-setup {
  gap: 9px;
  margin-bottom: 12px;
}

.level-two-choice-title {
  color: var(--cyan);
  font-size: 0.86rem;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
}

.track-option-list,
.difficulty-options {
  display: grid;
  gap: 6px;
}

.track-option-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.difficulty-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.track-option {
  min-height: 42px;
  border: 1px solid rgba(81, 216, 223, 0.32);
  border-radius: 6px;
  background: rgba(7, 16, 24, 0.8);
  color: var(--text);
  font-weight: 800;
  text-align: left;
  padding: 9px 12px;
  cursor: pointer;
}

.track-options.is-level-two-setup .track-option {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.86rem;
}

.difficulty-option {
  text-align: center;
}

.difficulty-option strong,
.difficulty-option span {
  display: block;
}

.difficulty-option span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.74rem;
}

.track-option.is-selected {
  border-color: var(--green);
  background: rgba(141, 251, 98, 0.16);
  color: #ffffff;
}

.track-option:focus-visible {
  outline: 3px solid rgba(141, 251, 98, 0.5);
  outline-offset: 2px;
}

.menu-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.start-button,
.repeat-level-button,
.end-game-button,
.highscore-button,
.share-button,
.touch-controls button {
  border: 0;
  border-radius: 6px;
  color: #061019;
  background: var(--orange);
  font-weight: 900;
  cursor: pointer;
}

.start-button {
  min-height: 46px;
  padding: 0 20px;
}

.repeat-level-button {
  min-height: 46px;
  padding: 0 20px;
  background: #8dfb62;
}

.end-game-button {
  min-height: 46px;
  padding: 0 20px;
  background: var(--red);
  color: #fff9e8;
}

.highscore-button {
  min-height: 46px;
  padding: 0 20px;
  background: var(--cyan);
}

.share-button {
  min-height: 46px;
  padding: 0 20px;
  background: #8dfb62;
}

.share-panel {
  position: relative;
  margin: 12px auto 16px;
  padding: 18px 44px 16px;
  border: 1px solid rgba(81, 216, 223, 0.42);
  border-radius: 8px;
  background: rgba(3, 5, 12, 0.88);
  text-align: center;
}

.share-link-grid {
  display: grid;
  grid-template-columns: repeat(4, 56px);
  justify-content: center;
  gap: 12px;
}

.share-icon-button,
.share-close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.share-icon-button {
  width: 56px;
  height: 56px;
  border: 1px solid rgba(255, 249, 232, 0.32);
  border-radius: 50%;
  padding: 0;
  color: #fff;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.34);
}

.share-icon-button svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
  stroke: currentColor;
}

.share-icon-button[data-share-kind="facebook"] {
  background: #1877f2;
}

.share-icon-button[data-share-kind="instagram"] {
  background:
    radial-gradient(circle at 30% 105%, #fdf497 0 18%, transparent 19%),
    radial-gradient(circle at 22% 86%, #fdf497 0 15%, transparent 16%),
    linear-gradient(135deg, #405de6 0%, #833ab4 28%, #c13584 52%, #e1306c 72%, #fd1d1d 88%, #f77737 100%);
}

.share-icon-button[data-share-kind="tiktok"] {
  background: #05070f;
}

.share-icon-button[data-share-kind="twitter"] {
  background: #0f1419;
}

.share-close-button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 249, 232, 0.12);
  color: var(--text);
  font-size: 1rem;
  font-weight: 900;
}

.game-overlay-panel.is-title .menu-actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6.1%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12.4%;
  height: 6.8%;
  padding: 0 14.4%;
  pointer-events: none;
}

.game-overlay-panel.is-title .start-button,
.game-overlay-panel.is-title .highscore-button {
  min-height: 0;
  width: 72%;
  height: 76%;
  justify-self: center;
  align-self: center;
  padding: 0 8px;
  border: 2px solid rgba(255, 249, 232, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 249, 232, 0.08), rgba(6, 8, 18, 0.3)),
    rgba(6, 8, 18, 0.18);
  color: var(--text);
  font-size: clamp(0.86rem, 1.7vw, 1.42rem);
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow:
    0 2px 0 rgba(6, 8, 18, 0.95),
    -1px 0 0 rgba(81, 216, 223, 0.95),
    1px 0 0 rgba(242, 164, 68, 0.9),
    0 0 12px rgba(141, 251, 98, 0.42);
  box-shadow:
    inset 0 0 22px rgba(81, 216, 223, 0.18),
    0 0 16px rgba(242, 164, 68, 0.18);
  animation: title-action-pulse 1.8s ease-in-out infinite;
  transform-origin: center;
  pointer-events: auto;
}

.game-overlay-panel.is-title .highscore-button {
  animation-delay: 0.18s;
}

@keyframes title-action-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow:
      inset 0 0 22px rgba(81, 216, 223, 0.18),
      0 0 16px rgba(242, 164, 68, 0.18);
  }

  50% {
    transform: scale(1.045);
    box-shadow:
      inset 0 0 28px rgba(81, 216, 223, 0.3),
      0 0 24px rgba(141, 251, 98, 0.32);
  }
}

.game-overlay-panel.is-title .start-button:hover,
.game-overlay-panel.is-title .highscore-button:hover {
  background: rgba(81, 216, 223, 0.14);
}

.start-button:focus-visible,
.repeat-level-button:focus-visible,
.end-game-button:focus-visible,
.highscore-button:focus-visible,
.share-button:focus-visible,
.share-panel a:focus-visible,
.share-panel button:focus-visible,
.touch-controls button:focus-visible,
.level-two-lane-button:focus-visible,
.mobile-control-button:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}

.touch-controls {
  display: none;
  grid-template-columns: repeat(3, 64px);
  gap: 10px;
  justify-content: center;
  padding: 14px;
  border-top: 1px solid rgba(255, 249, 232, 0.12);
  touch-action: none;
}

.touch-controls button {
  width: 64px;
  height: 54px;
  font-size: 1.2rem;
  user-select: none;
}

.touch-controls button.is-active {
  background: var(--cyan);
}

.keyboard-hint {
  margin: 0;
  padding: 0 14px 14px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

.preview-note {
  margin-top: 16px;
  padding: 14px 16px;
  border-left: 4px solid var(--cyan);
  color: var(--muted);
  background: rgba(16, 22, 38, 0.78);
  line-height: 1.55;
}

.preview-note strong {
  color: var(--text);
}

@media (max-width: 720px) {
  .preview-shell {
    width: 100%;
    padding: 0;
  }

  .preview-header,
  .preview-note {
    display: none;
  }

  .game-frame {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    height: 100vh;
    height: 100svh;
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .game-topbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
  }

  .game-topbar span,
  .restart-toggle,
  .sound-toggle,
  .music-toggle {
    padding: 5px 6px;
    font-size: clamp(0.64rem, 3vw, 0.84rem);
    line-height: 1.12;
  }

  .canvas-wrap {
    grid-row: 2;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    aspect-ratio: auto;
  }

  canvas {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    object-fit: cover;
    object-position: center center;
    aspect-ratio: auto;
  }

  .game-overlay:not(.is-title-menu) {
    position: fixed;
    z-index: 40;
    padding: 10px;
  }

  .game-overlay:not(.is-title-menu) .game-overlay-panel {
    max-height: calc(100vh - 20px);
    max-height: calc(100svh - 20px);
    overflow: auto;
  }

  .touch-controls {
    display: none;
    grid-row: 3;
    grid-template-columns: repeat(3, minmax(48px, 64px));
    gap: 8px;
    padding: 10px;
  }

  .preview-shell.is-mobile-gesture-mode .mobile-play-controls {
    display: block;
  }

  .preview-shell[data-arcade-mode="dance"] .level-two-lane-controls {
    display: block;
  }

  .preview-shell[data-arcade-mode="dance"] .touch-controls {
    display: none;
  }

  .touch-controls button {
    width: 100%;
    height: 48px;
  }

  .level-two-lane-button {
    left: max(8px, env(safe-area-inset-left));
    width: clamp(46px, 12vw, 58px);
    height: clamp(46px, 12vw, 58px);
  }

  .keyboard-hint {
    grid-row: 4;
    padding: 0 10px 10px;
    font-size: 0.78rem;
  }

  .menu-actions {
    grid-template-columns: 1fr;
  }

  .share-link-grid {
    grid-template-columns: repeat(4, 48px);
    gap: 10px;
  }

  .share-icon-button {
    width: 48px;
    height: 48px;
  }

  .share-icon-button svg {
    width: 24px;
    height: 24px;
  }

  .game-overlay-panel {
    padding: 18px;
  }

  .game-language-switch {
    top: auto;
    right: max(10px, env(safe-area-inset-right));
    bottom: calc(4% + 44px);
    left: max(10px, env(safe-area-inset-left));
    width: auto;
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    gap: 8px;
  }

  .language-flag-link {
    flex: 1 1 0;
    width: auto;
    height: clamp(92px, 26vw, 122px);
    aspect-ratio: auto;
    border-radius: 7px;
  }

  .language-flag-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .game-loading-moon {
    --loading-moon-size: clamp(118px, 38vw, 190px);
  }

  .mobile-control-visuals {
    --mobile-joystick-size: clamp(78px, 25vw, 112px);
    --mobile-joystick-thumb-size: clamp(30px, 9vw, 40px);
  }

  .game-overlay-panel.is-title .menu-actions {
    bottom: 4%;
    height: auto;
    gap: 8%;
    padding: 0 10%;
  }

  .game-overlay-panel.is-title .start-button,
  .game-overlay-panel.is-title .highscore-button {
    width: 86%;
    height: 34px;
    font-size: clamp(0.72rem, 3vw, 0.95rem);
  }

  .game-overlay-panel.is-level-two-setup {
    width: min(100%, 680px);
    max-height: calc(100vh - 20px);
    max-height: calc(100svh - 20px);
    overflow: auto;
    padding: 10px;
  }

  .game-overlay-panel.is-level-two-setup h2 {
    margin-bottom: 4px;
    font-size: clamp(1rem, 4.8vw, 1.32rem);
  }

  .game-overlay-panel.is-level-two-setup p {
    margin-bottom: 7px;
    font-size: 0.82rem;
    line-height: 1.25;
  }

  .track-options.is-level-two-setup {
    gap: 5px;
    margin-bottom: 8px;
  }

  .track-option-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .difficulty-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .track-options.is-level-two-setup .track-option {
    min-height: 30px;
    padding: 5px 6px;
    font-size: 0.72rem;
    line-height: 1.12;
  }

  .track-options.is-level-two-setup .difficulty-option span {
    font-size: 0.62rem;
    line-height: 1.15;
  }

  .arcade-credits-window {
    --credits-window-height: min(42vh, 300px);
  }

  .arcade-credits-roll {
    padding: 0 16px 30px;
    animation-duration: 52s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .arcade-credits-window {
    overflow: auto;
    mask-image: none;
  }

  .arcade-credits-roll {
    position: static;
    transform: none;
    animation: none;
    padding-top: 18px;
  }

  .game-loading-moon {
    animation: none;
  }

  .game-loading-panel strong,
  .game-overlay-panel.is-level-loading .start-button {
    animation: none;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .preview-shell {
    width: 100%;
    padding: 0;
  }

  .preview-header,
  .preview-note {
    display: none;
  }

  .game-frame {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 132px;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 100vh;
    min-height: 100svh;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .game-topbar {
    grid-column: 1 / -1;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
  }

  .game-topbar span,
  .restart-toggle,
  .sound-toggle,
  .music-toggle {
    padding: 4px 5px;
    border-radius: 4px;
    font-size: clamp(0.56rem, 1.55vw, 0.74rem);
    line-height: 1.1;
  }

  .canvas-wrap {
    grid-column: 1;
    grid-row: 2;
    align-self: center;
    justify-self: center;
    width: min(calc(100vw - 148px), calc((100vh - 74px) * 16 / 9));
    width: min(calc(100vw - 148px), calc((100svh - 74px) * 16 / 9));
    height: auto;
    min-height: 0;
    overflow: visible;
    aspect-ratio: 16 / 9;
  }

  canvas {
    min-height: 0;
    object-fit: fill;
    aspect-ratio: 16 / 9;
  }

  .game-loading-moon {
    --loading-moon-size: clamp(104px, 28svh, 160px);
  }

  .game-language-switch {
    top: auto;
    right: max(8px, env(safe-area-inset-right));
    bottom: clamp(48px, 10svh, 70px);
    left: max(8px, env(safe-area-inset-left));
    width: auto;
    flex-direction: row;
    gap: 7px;
  }

  .language-flag-link {
    flex: 1 1 0;
    width: auto;
    height: clamp(58px, 18svh, 78px);
    aspect-ratio: auto;
  }

  .mobile-control-visuals {
    --mobile-joystick-size: clamp(70px, 19svh, 98px);
    --mobile-joystick-thumb-size: clamp(28px, 7svh, 38px);
  }

  .touch-controls {
    display: none;
    grid-column: 2;
    grid-row: 2 / 4;
    align-self: center;
    justify-self: center;
    grid-template-columns: repeat(3, 38px);
    gap: 6px;
    padding: 6px;
    border-top: 0;
    border-left: 1px solid rgba(255, 249, 232, 0.12);
  }

  .preview-shell[data-arcade-mode="dance"] .level-two-lane-controls {
    display: block;
  }

  .preview-shell[data-arcade-mode="dance"] .touch-controls {
    display: none;
  }

  .touch-controls button {
    width: 38px;
    height: 42px;
    font-size: 1rem;
  }

  .level-two-lane-button {
    left: max(8px, env(safe-area-inset-left));
    width: clamp(40px, 10svh, 48px);
    height: clamp(40px, 10svh, 48px);
    font-size: clamp(0.9rem, 3.4svh, 1.08rem);
  }

  .keyboard-hint {
    grid-column: 1;
    grid-row: 3;
    padding: 0 6px 6px;
    font-size: 0.66rem;
    line-height: 1.2;
  }
}
