@font-face {
  font-family: "Lota Grotesque";
  src: url("/public/fonts/LotaGrotesque-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lota Grotesque";
  src: url("/public/fonts/LotaGrotesque-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lota Grotesque";
  src: url("/public/fonts/LotaGrotesque-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

html {
  font-size: 16px;
  overscroll-behavior: none;
}

body {
  font-family:
    "Lota Grotesque",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #f4f4f5;
  color: #27272a;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  overscroll-behavior: none;
}

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

/* ── Shared layout ───────────────────── */
#app {
  width: 100%;
  max-width: 500px;
  padding: 16px;
}

/* ── Shared header ───────────────────── */
#header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}
.header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header-back {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #71717a;
  text-decoration: none;
  transition: color 200ms ease;
}
.header-back:hover {
  color: #27272a;
}
.header-back svg {
  width: 16px;
  height: 16px;
}
.header-title-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.game-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}
.game-subtitle {
  font-size: 14px;
  color: #71717a;
  line-height: 1.4;
}
.logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  height: 20px;
}

/* ── Shared buttons ──────────────────── */
.btn {
  font-family: inherit;
  background: #27272a;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 200ms ease;
}
.btn:hover {
  background: #3f3f46;
}
.btn-outline {
  background: transparent;
  color: #27272a;
  border: 2px solid #3f3f46;
}
.btn-outline:hover {
  background: #e4e4e7;
}
.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ── Shared hint ─────────────────────── */
.hint {
  text-align: center;
  color: #a1a1aa;
  font-size: 14px;
  margin-top: 12px;
}

/* ── Onboarding / Instructions Dialog ── */
.onboarding-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  opacity: 1;
  transition: opacity 300ms ease;
}
.onboarding-backdrop.hidden { opacity: 0; pointer-events: none; }
.onboarding-dialog {
  background: #27272a;
  border-radius: 16px;
  padding: 32px 28px 24px;
  max-width: 400px;
  width: calc(100% - 32px);
  color: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.onboarding-slides { position: relative; }
.onboarding-slide {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  animation: slideFadeIn 300ms ease;
}
.onboarding-slide.active { display: flex; }
@keyframes slideFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.onboarding-hero-img { height: 64px; object-fit: contain; margin-bottom: 4px; }
.onboarding-slide h2 { font-size: 20px; font-weight: 700; line-height: 1.3; margin: 0; }
.onboarding-slide p { font-size: 14px; color: #a1a1aa; line-height: 1.6; margin: 0; }
.onboarding-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; }
.onboarding-dots { display: flex; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #52525b; transition: background 200ms ease; cursor: pointer; }
.dot.active { background: #fbc73c; }
.btn-instructions {
  font-family: inherit;
  background: transparent;
  color: #27272a;
  border: 2px solid #3f3f46;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 200ms ease;
}
.btn-instructions:hover {
  background: #e4e4e7;
}
.btn-onboarding {
  font-family: inherit;
  background: #3f3f46;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 200ms ease;
}
.btn-onboarding:hover {
  background: #52525b;
}

/* ── Result overlay ─────────────────── */
.result-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(244, 244, 245, 0.9);
  backdrop-filter: blur(6px);
  opacity: 1;
  transition: opacity 300ms ease;
}
.result-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.result-content {
  text-align: center;
  max-width: 400px;
  width: calc(100% - 32px);
}
.result-content h2 {
  font-size: 32px;
  margin-bottom: 8px;
}
.result-msg {
  font-size: 15px;
  color: #71717a;
  margin-bottom: 24px;
  line-height: 1.4;
}
.result-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
