:root {
  --bg-top: #d8ecff;
  --bg-bottom: #f7fbff;
  --panel: rgba(255, 255, 255, 0.68);
  --panel-border: rgba(255, 255, 255, 0.92);
  --text-main: #1b2431;
  --text-soft: rgba(27, 36, 49, 0.72);
  --shadow: 0 24px 70px rgba(50, 80, 120, 0.18);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), transparent 28%),
    radial-gradient(circle at bottom right, rgba(170, 215, 255, 0.4), transparent 30%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent 72%);
}

.app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 24px;
  padding: 32px 20px 40px;
}

.hero {
  width: min(100%, 560px);
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.8rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(42, 79, 118, 0.68);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.6rem, 8vw, 4.6rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
}

.subtitle {
  margin: 14px auto 0;
  max-width: 520px;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-soft);
}

.game-shell {
  position: relative;
  width: min(100%, 430px);
  border: 1px solid var(--panel-border);
  border-radius: 32px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.52));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  user-select: none;
  touch-action: manipulation;
}

.hud {
  position: absolute;
  inset: 18px 18px auto;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  z-index: 3;
  pointer-events: none;
}

.pill {
  min-width: 110px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(72, 103, 144, 0.12);
}

.pill span {
  display: block;
  font-size: 0.76rem;
  color: rgba(27, 36, 49, 0.56);
}

.pill strong {
  display: block;
  margin-top: 4px;
  font-size: 1.35rem;
}

.mode-switch {
  position: absolute;
  inset: 90px 18px auto;
  display: inline-flex;
  gap: 8px;
  z-index: 3;
}

.mode-button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.74);
  color: rgba(27, 36, 49, 0.72);
  font: 600 0.88rem/1 "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 22px rgba(72, 103, 144, 0.1);
  cursor: pointer;
  transition: transform 140ms ease, background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.mode-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.9);
}

.mode-button.is-active {
  background: rgba(33, 76, 126, 0.94);
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(45, 88, 136, 0.22);
}

.game-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  border-radius: 24px;
  background: linear-gradient(180deg, #9fd2ff 0%, #e7f6ff 100%);
}

.overlay {
  position: absolute;
  inset: 16px;
  display: grid;
  place-items: center;
  z-index: 2;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.overlay.hidden {
  opacity: 0;
}

.overlay-card {
  max-width: 260px;
  padding: 18px 20px;
  border-radius: 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 40px rgba(46, 79, 120, 0.14);
  backdrop-filter: blur(10px);
}

.overlay-tag {
  margin: 0 0 8px;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(42, 79, 118, 0.68);
}

.overlay h2 {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1;
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
}

.overlay p:last-child {
  margin: 12px 0 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text-soft);
}

.playtime-badge {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  min-width: 108px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 28px rgba(72, 103, 144, 0.14);
  backdrop-filter: blur(10px);
  pointer-events: none;
  text-align: right;
}

.playtime-badge span {
  display: block;
  font-size: 0.72rem;
  color: rgba(27, 36, 49, 0.56);
}

.playtime-badge strong {
  display: block;
  margin-top: 3px;
  font-size: 1rem;
  color: rgba(27, 36, 49, 0.92);
}

@media (max-width: 560px) {
  .app {
    padding: 18px 14px 24px;
    gap: 18px;
  }

  .hero h1 {
    font-size: clamp(2.35rem, 11vw, 3.4rem);
  }

  .game-shell {
    border-radius: 26px;
    padding: 12px;
  }

  .hud {
    inset: 14px 14px auto;
  }

  .mode-switch {
    inset: 82px 14px auto;
  }

  .pill {
    min-width: 94px;
    padding: 10px 12px;
    border-radius: 16px;
  }

  .mode-button {
    padding: 8px 13px;
    font-size: 0.82rem;
  }

  .playtime-badge {
    right: 14px;
    bottom: 14px;
    min-width: 96px;
    padding: 9px 11px;
  }

  .playtime-badge strong {
    font-size: 0.94rem;
  }

  .pill strong {
    font-size: 1.2rem;
  }
}
