:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #e9e7e1;
  color: #31332f;
  -webkit-tap-highlight-color: transparent;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 18%, #f9f8f4, #ddd9d1 90%);
}

button { font: inherit; }

.game-shell {
  position: relative;
  width: min(100vw, 560px);
  height: 100dvh;
  max-height: 980px;
  overflow: hidden;
  background: #f3f1ec;
  box-shadow: 0 28px 80px rgb(54 48 39 / 18%);
  touch-action: none;
  user-select: none;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
}

.hud {
  position: absolute;
  inset: max(18px, env(safe-area-inset-top)) 20px auto;
  display: grid;
  grid-template-columns: 48px 1fr 82px;
  align-items: start;
  pointer-events: none;
}

.score {
  text-align: center;
  color: #353734;
  font-size: clamp(38px, 9vw, 58px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -.05em;
}

.best {
  padding-top: 8px;
  text-align: right;
  color: #888984;
  font-size: 13px;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid rgb(68 70 66 / 14%);
  border-radius: 50%;
  background: rgb(255 255 255 / 42%);
  color: #777974;
  pointer-events: auto;
  cursor: pointer;
}

.panel {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
  background: rgb(243 241 236 / 82%);
  backdrop-filter: blur(10px);
}

.panel[hidden] { display: none; }

.brand-mark {
  position: relative;
  width: 58px;
  height: 86px;
  margin-bottom: 18px;
}

.brand-mark i:first-child {
  position: absolute;
  top: 0;
  left: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #383a37;
}

.brand-mark i:last-child {
  position: absolute;
  bottom: 0;
  left: 19px;
  width: 20px;
  height: 58px;
  border-radius: 12px 12px 6px 6px;
  background: #383a37;
}

.panel h1 {
  margin: 0;
  font-size: 39px;
  font-weight: 500;
  letter-spacing: .16em;
  transform: translateX(.08em);
}

.panel p {
  margin: 12px 0 28px;
  color: #777973;
  font-size: 15px;
}

.primary-button {
  min-width: 180px;
  padding: 14px 30px;
  border: 0;
  border-radius: 999px;
  background: #363835;
  color: white;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgb(42 43 40 / 18%);
}

.game-over-panel .eyebrow {
  margin-bottom: 4px;
  font-size: 13px;
  letter-spacing: .18em;
}

.game-over-panel strong {
  font-size: 82px;
  font-weight: 300;
  line-height: 1;
}

.hint, .toast {
  position: absolute;
  z-index: 2;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  color: #676964;
  font-size: 14px;
  pointer-events: none;
}

.hint {
  bottom: max(46px, env(safe-area-inset-bottom));
  padding: 10px 18px;
  background: rgb(255 255 255 / 62%);
  animation: breathe 1.8s ease-in-out infinite;
}

.toast {
  top: 24%;
  padding: 8px 15px;
  opacity: 0;
  background: rgb(49 51 47 / 84%);
  color: white;
  transition: opacity .18s ease, transform .25s ease;
}

.toast.show { opacity: 1; transform: translate(-50%, -8px); }

@keyframes breathe {
  50% { transform: translateX(-50%) scale(1.035); opacity: .7; }
}

@media (min-width: 600px) {
  .game-shell { height: min(92dvh, 920px); border-radius: 28px; }
}

.qa-jump {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  opacity: .12;
}
