* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: #0b1020;
  color: #f3f4f6;
  font-family: Arial, Helvetica, sans-serif;
  min-height: 100%;
}
body {
  display: flex;
  justify-content: center;
  align-items: stretch;
}
.app {
  width: min(100vw, 680px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top, 0px) 12px env(safe-area-inset-bottom, 0px);
}
.hud {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px 0 10px;
}
.stat {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 10px 12px;
  text-align: center;
  backdrop-filter: blur(8px);
}
.stat span {
  display: block;
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 4px;
}
.stat strong {
  display: block;
  font-size: 24px;
}
.tilt-label {
  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;

  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);

  color: #22c55e; /* nice green accent */
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 2px;

  min-height: 70px;
}
.stat-button {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 10px 12px;
  text-align: center;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.08);
  color: #f3f4f6;
  font-weight: 700;
  font-size: 16px;
  min-height: 70px;
  cursor: pointer;
}
.stat-button:active {
  transform: scale(0.98);
}
.game-shell {
  position: relative;
  flex: 1;
  min-height: 60vh;
  background: linear-gradient(180deg, #111827, #0f172a);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(6, 10, 20, 0.62);
}
.panel {
  width: min(100%, 460px);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
.panel h1 {
  margin: 0 0 10px;
  font-size: 30px;
}
.lead {
  margin: 0 0 14px;
  line-height: 1.45;
  opacity: 0.92;
}
.controls-list {
  display: grid;
  gap: 8px;
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 18px;
}
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
button {
  appearance: none;
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  color: white;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.primary { background: #2563eb; }
.accent { background: #16a34a; }
.secondary { background: #475569; }
.hidden { display: none; }
.status {
  margin: 14px 0 0;
  font-size: 14px;
  opacity: 0.92;
}
.footer {
  text-align: center;
  padding: 10px 4px 14px;
  font-size: 13px;
  opacity: 0.72;
}
@media (max-width: 480px) {
  .panel h1 { font-size: 26px; }
  .stat strong { font-size: 20px; }
}
.panel-image {
  width: 100%;
  margin: 10px 0 15px;
  display: flex;
  justify-content: center;
}

.panel-image img {
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow:
    0 10px 30px rgba(0,0,0,0.4),
    0 0 20px rgba(34,197,94,0.15);
}
