:root {
  --teal: #0f7f79;
  --teal-light: #12a099;
  --ink: #0f172a;
  --muted: #475569;
  --bg: #f4f7f6;
  --card: #ffffff;
  --border: #e2e8f0;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgb(15 127 121 / 0.12), transparent),
    var(--bg);
  overflow-x: hidden;
}

/* Floating background rocks */
.bg-scene {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.rock {
  position: absolute;
  border-radius: 40% 60% 55% 45% / 55% 45% 60% 40%;
  background: linear-gradient(135deg, rgb(15 127 121 / 0.14), rgb(18 160 153 / 0.06));
  border: 1px solid rgb(15 127 121 / 0.08);
}

.rock--1 {
  width: 7rem;
  height: 5.5rem;
  top: 12%;
  left: 8%;
  animation: drift-a 18s ease-in-out infinite;
}

.rock--2 {
  width: 4.5rem;
  height: 3.5rem;
  top: 22%;
  right: 12%;
  border-radius: 50% 40% 45% 55% / 45% 55% 40% 50%;
  animation: drift-b 14s ease-in-out infinite;
  animation-delay: -4s;
}

.rock--3 {
  width: 9rem;
  height: 6rem;
  bottom: 18%;
  left: 6%;
  animation: drift-c 22s ease-in-out infinite;
  animation-delay: -8s;
}

.rock--4 {
  width: 3.5rem;
  height: 2.75rem;
  bottom: 28%;
  right: 10%;
  animation: drift-a 16s ease-in-out infinite reverse;
  animation-delay: -2s;
}

.rock--5 {
  width: 5rem;
  height: 4rem;
  top: 55%;
  right: 22%;
  opacity: 0.7;
  animation: drift-b 20s ease-in-out infinite;
  animation-delay: -11s;
}

@keyframes drift-a {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(12px, -18px) rotate(6deg);
  }
  66% {
    transform: translate(-8px, 10px) rotate(-4deg);
  }
}

@keyframes drift-b {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(-16px, 14px) rotate(-8deg);
  }
}

@keyframes drift-c {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  40% {
    transform: translate(20px, 8px) rotate(5deg);
  }
  80% {
    transform: translate(-12px, -16px) rotate(-6deg);
  }
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.25rem 1.5rem;
}

.top {
  width: min(32rem, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.logo {
  display: block;
  animation: logo-bob 4s ease-in-out infinite;
}

@keyframes logo-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.lang {
  display: flex;
  gap: 0.25rem;
  padding: 0.2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.lang-btn.is-active {
  background: var(--teal);
  color: #fff;
}

.card {
  width: min(32rem, 100%);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 2rem 1.75rem 2.25rem;
  box-shadow: 0 12px 40px rgb(15 23 42 / 0.06);
}

/* Hero: orbiting dots around logo */
.hero-visual {
  position: relative;
  width: 5.5rem;
  height: 5.5rem;
  margin-bottom: 1.25rem;
}

.hero-logo {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 3.5rem;
  height: 3.5rem;
  animation: hero-pulse 3s ease-in-out infinite;
}

@keyframes hero-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.04);
    opacity: 0.92;
  }
}

.orbit {
  position: absolute;
  inset: 0;
  animation: orbit-spin 12s linear infinite;
}

.orbit-dot {
  position: absolute;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--teal-light);
  box-shadow: 0 0 8px rgb(18 160 153 / 0.45);
}

.orbit-dot--1 {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.orbit-dot--2 {
  bottom: 12%;
  left: 4%;
}

.orbit-dot--3 {
  bottom: 12%;
  right: 4%;
}

@keyframes orbit-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.badge {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal);
  background: rgb(15 127 121 / 0.1);
  border-radius: 999px;
  animation: badge-glow 2.5s ease-in-out infinite;
}

@keyframes badge-glow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgb(15 127 121 / 0);
  }
  50% {
    box-shadow: 0 0 0 4px rgb(15 127 121 / 0.12);
  }
}

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  line-height: 1.2;
  font-weight: 700;
}

.lead {
  margin: 0 0 1.25rem;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 26rem;
}

.status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding: 0.5rem 1rem;
  background: rgb(15 127 121 / 0.06);
  border-radius: 999px;
}

.dots {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--teal);
  animation: dot-bounce 1.2s ease-in-out infinite;
}

.dot:nth-child(2) {
  animation-delay: 0.15s;
}

.dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes dot-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  40% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

.status-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--teal);
}

.hint {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--muted);
}

.foot {
  margin-top: 2rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* Extras: facts + game */
.extras {
  width: min(32rem, 100%);
  margin-top: 1.25rem;
}

.extras-title {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem 1.35rem 1.35rem;
  box-shadow: 0 8px 28px rgb(15 23 42 / 0.05);
}

.panel-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
}

.panel-lead {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted);
}

.btn {
  border: 0;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn--ghost {
  background: transparent;
  color: var(--teal);
  border: 1px solid rgb(15 127 121 / 0.35);
}

.btn--ghost:hover:not(:disabled) {
  background: rgb(15 127 121 / 0.08);
}

.btn--primary {
  background: var(--teal);
  color: #fff;
}

.btn--primary:hover:not(:disabled) {
  background: var(--teal-light);
}

.game-hud {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

#game-score-label {
  font-weight: 600;
}

.game-hud strong {
  font-size: 1.25rem;
  color: var(--teal);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.game-arena {
  position: relative;
  height: 12.5rem;
  margin-bottom: 0;
  background: linear-gradient(180deg, rgb(15 127 121 / 0.04), rgb(15 127 121 / 0.1));
  border: 1px dashed rgb(15 127 121 / 0.25);
  border-radius: 0.65rem;
  overflow: hidden;
  touch-action: manipulation;
}

.game-rock {
  position: absolute;
  top: 0;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 40% 60% 50% 45% / 55% 42% 58% 48%;
  background: linear-gradient(145deg, var(--teal-light), var(--teal));
  box-shadow: 0 2px 8px rgb(15 127 121 / 0.35);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.08s ease, filter 0.08s ease;
}

.game-rock::before {
  content: '';
  position: absolute;
  inset: -0.65rem;
}

.game-rock:hover,
.game-rock:active {
  filter: brightness(1.1);
  transform: scale(1.06);
}

.game-rock:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.online-banner {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  width: min(22rem, calc(100% - 2rem));
  padding: 1rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--teal);
  border-radius: 0.75rem;
  box-shadow: 0 16px 48px rgb(15 127 121 / 0.22);
  transform: translateX(-50%);
  animation: banner-in 0.35s ease-out;
}

.online-banner[hidden] {
  display: none;
}

.online-banner__text {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
  text-align: center;
}

@keyframes banner-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(0.75rem);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.page:has(.online-banner:not([hidden])) {
  padding-bottom: 6.5rem;
}

@media (prefers-reduced-motion: reduce) {
  .rock,
  .logo,
  .hero-logo,
  .orbit,
  .badge,
  .dot {
    animation: none !important;
  }

  .game-rock {
    transition: none;
  }

  .online-banner {
    animation: none;
  }
}
