body { overflow: hidden; }
main.container { padding: 0; max-width: none; }

#game-root {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #02030a;
  display: flex;
  flex-direction: column;
}

#kb-hint {
  display: none;
  font-size: 11px;
  color: rgba(167,177,204,0.5);
  font-family: monospace;
  letter-spacing: 0.05em;
  margin-right: auto;
}

/* ── Desktop layout ── */
@media (min-width: 640px) {
  #kb-hint { display: inline; }
  body { background: #02030a; }
  .topbar {
    background: rgba(11,15,26,0.95);
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .brand { color: #fb9d33; }
  #game-root {
    left: 50%;
    right: auto;
    width: 420px;
    transform: translateX(-50%);
    border-left: 1px solid rgba(255,255,255,0.1);
    border-right: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    border-radius: 0 0 16px 16px;
    box-shadow: 0 8px 48px rgba(0,0,0,0.7);
  }
}

#game-hud-top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 6px 12px;
  font-size: 14px;
  color: #a7b1cc;
  flex-shrink: 0;
  background: #0b0f1a;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

#canvas-wrap {
  flex: 1;
  position: relative;
  min-height: 0;
  display: flex;
}

#c {
  flex: 1;
  display: block;
  width: 100%;
  min-height: 0;
  touch-action: none;
  background: #0b0f1a;
}

#restart {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  padding: 14px 40px;
  font-family: 'Montserrat', ui-sans-serif, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #0b0f1a;
  background: #fb9d33;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  letter-spacing: 0.5px;
}
#restart:active { opacity: 0.85; }

#gameover {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(11,15,26,0.88);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 24px;
}
#gameover.visible { display: flex; }

.go-title {
  font-size: 26px;
  font-weight: 700;
  color: #e9eefc;
}
.go-cause {
  font-size: 17px;
  color: #a7b1cc;
}
.go-score {
  font-size: 22px;
  font-weight: 700;
  color: #fb9d33;
}
.go-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 260px;
  margin-top: 8px;
}
.go-prize-hint {
  background: #1e2e1e;
  border: 1px solid #4caf50;
  border-radius: 8px;
  color: #cde8cd;
  font-size: 13px;
  line-height: 1.4;
  padding: 10px 14px;
  margin: 6px 0 4px;
  max-width: 260px;
  text-align: center;
}
.go-prize-hint a { color: #fb9d33; font-weight: 700; }
.go-prize-won {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #1a2b1a, #1e3420);
  border: 2px solid #4caf50;
  border-radius: 14px;
  padding: 16px 20px;
  max-width: 280px;
  text-align: center;
}
.go-prize-won img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 10px;
}
.go-prize-won .prize-congrats {
  font-size: 18px;
  font-weight: 700;
  color: #fb9d33;
}
.go-prize-won .prize-sub {
  font-size: 13px;
  color: #a8d5a8;
  line-height: 1.5;
}
.go-btn-primary {
  padding: 14px 40px;
  font-family: 'Montserrat', ui-sans-serif, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #0b0f1a;
  background: #fb9d33;
  border: none;
  border-radius: 12px;
  cursor: pointer;
}
.go-btn-primary:active { opacity: 0.85; }
.go-btn-secondary {
  padding: 12px 40px;
  font-size: 16px;
  font-weight: 600;
  color: #e9eefc;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  cursor: pointer;
}
.go-btn-secondary:active { background: rgba(255,255,255,0.14); }

#game-hud-bottom { display: none; }

#status-top {
  font-size: 12px;
  color: #fb9d33;
  font-weight: 700;
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity 0.3s;
  margin-right: 4px;
}
#status-top.visible { opacity: 1; }

#ad-banner {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b0f1a;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
#ad-banner-inner {
  width: 320px;
  height: 100px;
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.25);
  font-size: 11px;
  letter-spacing: 0.05em;
}

.game-btn {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #e9eefc;
  padding: 5px 10px;
  border-radius: 12px;
  cursor: pointer;
}

.hud-boxes {
  display: flex;
  gap: 8px;
  align-self: stretch;
  align-items: stretch;
}
.hud-box {
  background: #ffffff;
  border-radius: 6px;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  width: 100px;
  white-space: nowrap;
}
.hud-label {
  font-size: 9px;
  font-weight: 800;
  color: #0b0f1a;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.hud-value {
  font-size: 15px;
  font-weight: 900;
  color: #0b0f1a;
}
