* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
}
#canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #ffffff;
  touch-action: none;
}

#top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 54px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 2px solid #00aa00;
  touch-action: auto;
  overflow-x: auto;
}
.ui-btn {
  touch-action: manipulation;
  background: #fff;
  border: 2px solid #00aa00;
  color: #008800;
  font-weight: 900;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  text-transform: uppercase;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.ui-btn:active { background: #00aa00; color: #fff; }
.ui-btn.danger { border-color: #cc0000; color: #cc0000; }
.ui-btn.danger:active { background: #cc0000; color: #fff; }
.ui-btn.tool-active { background: #00aa00; color: #fff; }
.ui-btn.restart-btn { background: #fff5cc; border-color: #e69500; color: #a66a00; }
.ui-btn:disabled { border-color: #ccc; color: #ccc; background: #eee; box-shadow: none; }

.stats-badge {
  font-size: 11px;
  font-weight: 900;
  color: #007700;
  background: #f0faf0;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #b2e0b2;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Овалы управления под пальцы с отступом 4% от краев */
.touch-oval-pod {
  position: absolute;
  top: 22%;
  bottom: 8%;
  width: 17%;
  max-width: 140px;
  min-width: 90px;
  border-radius: 55px;
  border: 1.5px dashed rgba(0, 170, 0, 0.25);
  background: rgba(0, 170, 0, 0.015);
  display: none;
  flex-direction: column;
  z-index: 40;
  overflow: hidden;
  pointer-events: none;
}
#pod-left { left: 4%; }
#pod-right { right: 4%; }

.pod-half {
  flex: 1;
  pointer-events: auto;
  touch-action: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(0, 120, 0, 0.35);
  font-weight: 900;
  transition: background 0.08s, color 0.08s;
}
.pod-half.top-half {
  border-bottom: 1.5px dashed rgba(0, 170, 0, 0.25);
}
.pod-half .icon { font-size: 24px; }
.pod-half .lbl { font-size: 10px; margin-top: 2px; }
.pod-half.pressed {
  background: rgba(0, 170, 0, 0.18) !important;
  color: #007700 !important;
}
.pod-half.rev.pressed {
  background: rgba(230, 126, 34, 0.22) !important;
  color: #d35400 !important;
}

#badge {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: bold;
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 12px;
  background: rgba(0,0,0,0.06);
  color: #444;
  pointer-events: none;
  z-index: 20;
  white-space: nowrap;
}
#badge.verified { background: #00aa00; color: #fff; }