:root {
  --dark: #2b2a29;
  --gold: #a07c0a;
  --gold-light: #d4a927;
  --orange: #f57c1f;
  --cream: #fff6ec;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #9fd3f0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--dark);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hidden { display: none !important; }

#hud {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
}

.stat {
  background: rgba(43, 42, 41, 0.82);
  color: #fff;
  border-radius: 14px;
  padding: 6px 14px;
  min-width: 84px;
  text-align: center;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}

.stat .label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-light);
}

.stat span:last-child {
  font-size: 1.25rem;
  font-weight: 800;
}

.banner {
  position: fixed;
  top: 22%;
  left: 50%;
  transform: translate(-50%, -20px) scale(0.9);
  background: var(--dark);
  color: #fff;
  padding: 12px 26px;
  border-radius: 999px;
  font-size: 1.3rem;
  font-weight: 800;
  opacity: 0;
  transition: opacity 0.35s, transform 0.35s;
  pointer-events: none;
  white-space: nowrap;
  border: 3px solid var(--gold);
}

.banner.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(43, 42, 41, 0) 45%, rgba(43, 42, 41, 0.5) 100%);
}

.panel {
  width: min(420px, 100%);
  background: rgba(255, 246, 236, 0.95);
  border-radius: 24px;
  padding: 18px 20px 16px;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  border: 3px solid var(--gold);
}

.logo { width: 110px; margin-bottom: 2px; }

h1 { font-size: 1.6rem; font-weight: 900; line-height: 1.1; }
h1 span, h2 { color: var(--gold); }
h2 { font-size: 1.35rem; font-weight: 900; margin-bottom: 10px; }

.tagline { margin: 6px 0 12px; font-size: 0.85rem; color: #5a4a3a; }

@media (max-height: 700px) {
  .help, .tagline { display: none; }
}

button {
  border: none;
  border-radius: 999px;
  padding: 14px 40px;
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  background: var(--orange);
  color: #fff;
  box-shadow: 0 5px 0 #c45f10;
}

button:active { transform: translateY(4px); box-shadow: 0 1px 0 #c45f10; }
button:disabled { background: #b9a48d; box-shadow: 0 5px 0 #8c7a66; cursor: wait; }

.best { margin-top: 12px; font-size: 0.95rem; }

.help {
  margin-top: 14px;
  font-size: 0.8rem;
  color: #6b5a48;
  display: grid;
  gap: 4px;
}

kbd {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  margin: 0 2px;
  border-radius: 6px;
  background: var(--dark);
  color: #fff;
  font-size: 0.75rem;
}

.results {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 6px;
}

.results .label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.results strong { font-size: 1.6rem; }

.hashtag { margin-top: 12px; color: var(--gold); font-weight: 800; letter-spacing: 0.05em; }
