:root {
  --bg-top: #07111a;
  --bg-bottom: #10263a;
  --panel: rgba(7, 18, 28, 0.78);
  --panel-strong: rgba(6, 16, 27, 0.9);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 184, 97, 0.34);
  --text-main: #f6efe4;
  --text-soft: #b9c8d2;
  --accent: #ff7c44;
  --accent-strong: #ffb34f;
  --ice: #8fe5ff;
}

* {
  box-sizing: border-box;
}

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

body {
  color: var(--text-main);
  font-family: "Avenir Next", "Segoe UI", "Trebuchet MS", sans-serif;
  background:
    linear-gradient(180deg, rgba(5, 11, 19, 0.72), rgba(5, 11, 19, 0.9)),
    radial-gradient(circle at top, rgba(255, 170, 90, 0.14), transparent 26%),
    radial-gradient(circle at 82% 18%, rgba(143, 229, 255, 0.12), transparent 18%),
    url("assets/background_space.png") center top / cover no-repeat,
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 22%, rgba(255, 255, 255, 0.82) 0 1px, transparent 1.4px),
    radial-gradient(circle at 62% 18%, rgba(255, 255, 255, 0.72) 0 1px, transparent 1.6px),
    radial-gradient(circle at 82% 64%, rgba(255, 255, 255, 0.55) 0 1px, transparent 1.5px),
    radial-gradient(circle at 36% 78%, rgba(255, 255, 255, 0.6) 0 1px, transparent 1.5px);
  opacity: 0.48;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.page {
  width: min(calc(100% - 48px), 1180px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 40px 0 48px;
  display: flex;
  align-items: center;
}

.hero {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(340px, 420px);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.hero-copy {
  max-width: 560px;
}

.brand {
  display: grid;
  gap: 18px;
}

.brand__studio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: fit-content;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 18, 28, 0.56);
  backdrop-filter: blur(10px);
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand__mark {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  box-shadow: 0 0 24px rgba(255, 124, 68, 0.24);
}

.brand__logo {
  width: min(100%, 390px);
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.28));
}

.hero-copy__lead {
  margin: 22px 0 0;
  max-width: 32rem;
  color: var(--text-soft);
  font-size: clamp(1.05rem, 1.4vw, 1.22rem);
  line-height: 1.65;
}

.action-dock {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: center;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.cta:hover,
.cta:focus-visible {
  transform: translateY(-1px);
}

.cta--primary {
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #fff8ef;
  box-shadow: 0 18px 34px rgba(255, 123, 68, 0.26);
}

.cta--secondary {
  border-color: var(--line);
  background: rgba(7, 18, 28, 0.72);
  color: var(--text-main);
}

.play-area {
  display: flex;
  justify-content: center;
}

.phone-frame {
  position: relative;
  width: min(100%, 408px, calc((100vh - 120px) * 0.4615));
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 40px;
  background: linear-gradient(180deg, rgba(28, 39, 49, 0.96), rgba(8, 13, 18, 0.98));
  box-shadow:
    0 28px 60px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.phone-frame::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  width: 34%;
  height: 28px;
  transform: translateX(-50%);
  border-radius: 0 0 18px 18px;
  background: rgba(5, 8, 12, 0.92);
  z-index: 3;
}

.phone-screen {
  position: relative;
  overflow: hidden;
  border-radius: 31px;
  aspect-ratio: 540 / 1170;
  background: #06111a;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.game-shell {
  position: relative;
  width: 100%;
  height: 100%;
}

.game-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 540 / 1170;
  background: #06111a;
  touch-action: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.game-ui {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  pointer-events: none;
}

.hud-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.hud-chip,
.hud-lives {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(7, 18, 28, 0.68);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
}

.hud-chip {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 18px;
}

.hud-label {
  color: #93afbc;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hud-chip strong {
  font-size: 1.12rem;
  line-height: 1;
}

.hud-lives {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 999px;
}

.game-heart {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 0 8px rgba(255, 123, 68, 0.26));
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.game-heart.is-empty {
  opacity: 0.22;
  transform: scale(0.92);
}

.game-tip {
  align-self: center;
  max-width: 78%;
  padding: 10px 14px;
  border: 1px solid rgba(143, 229, 255, 0.22);
  border-radius: 999px;
  background: rgba(6, 16, 27, 0.76);
  backdrop-filter: blur(10px);
  color: #d9f5ff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.game-tip.is-hidden {
  opacity: 0;
  transform: translateY(8px);
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: linear-gradient(180deg, rgba(6, 16, 27, 0.54), rgba(6, 16, 27, 0.8));
  pointer-events: auto;
}

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

.overlay-card {
  width: min(100%, 300px);
  padding: 22px 20px 20px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(6, 16, 27, 0.84);
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.32);
  text-align: center;
  backdrop-filter: blur(14px);
}

.overlay-kicker {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.overlay-title,
.overlay-score,
.overlay-best {
  margin: 0;
}

.overlay-title {
  font-size: 1.7rem;
  line-height: 1.05;
}

.overlay-copy {
  margin: 10px 0 18px;
  color: var(--text-soft);
  line-height: 1.45;
}

.overlay-score {
  font-size: 1.24rem;
  font-weight: 800;
}

.overlay-best {
  margin-top: 8px;
  color: var(--text-soft);
}

.game-button {
  min-width: 156px;
  margin-top: 18px;
  padding: 13px 20px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #fff8ee;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 16px 32px rgba(255, 123, 68, 0.3);
}

.game-button:disabled {
  opacity: 0.72;
  cursor: default;
  box-shadow: none;
}

@media (max-width: 860px) {
  .page {
    width: 100%;
    min-height: auto;
    padding: 16px 12px calc(104px + env(safe-area-inset-bottom));
    display: block;
  }

  .hero {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .play-area {
    order: 1;
    width: 100%;
  }

  .hero-copy {
    order: 2;
    width: 100%;
    max-width: none;
    display: grid;
    justify-items: center;
    text-align: center;
  }

  .brand {
    gap: 12px;
  }

  .brand__studio {
    padding: 9px 12px;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
  }

  .brand__logo {
    width: min(100%, 260px);
  }

  .hero-copy__lead {
    margin-top: 14px;
    font-size: 0.94rem;
  }

  .phone-frame {
    width: min(100%, 420px);
    padding: 8px;
    border-radius: 32px;
  }

  .phone-frame::before {
    top: 8px;
    height: 24px;
    border-radius: 0 0 15px 15px;
  }

  .phone-screen {
    border-radius: 24px;
  }

  .game-ui {
    padding: 12px;
  }

  .hud-row {
    gap: 8px;
  }

  .hud-chip {
    padding: 9px 10px;
  }

  .hud-lives {
    padding: 9px 10px;
  }

  .game-heart {
    width: 22px;
    height: 22px;
  }

  .game-tip {
    max-width: 82%;
    font-size: 0.74rem;
    padding: 9px 12px;
  }

  .overlay-card {
    width: min(100%, 278px);
    padding: 20px 18px 18px;
  }

  .action-dock {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: auto;
    margin-top: 0;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    background: rgba(6, 16, 27, 0.8);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.3);
  }

  .cta {
    min-height: 50px;
    padding: 0 14px;
    font-size: 0.92rem;
  }
}
