:root {
  --bg: #111318;
  --panel: #1b1e26;
  --text: #f2f3f5;
  --muted: #9aa0ad;
  --accent: #ffd23f;
  --p0: #4fc3f7;
  --p1: #ff7043;
  --radius: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Rounded", system-ui, sans-serif;
  -webkit-user-select: none; user-select: none;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
button, input { font: inherit; color: inherit; }
button {
  border: 0; border-radius: 14px; padding: 14px 18px; background: var(--panel);
  font-weight: 600; cursor: pointer; touch-action: manipulation;
}
button:active { transform: scale(.97); }
button.primary { background: var(--accent); color: #111; }

/* Shared game tools (shared/ui.js). */
.tools {
  position: fixed; z-index: 60; display: flex; gap: 8px;
  top: calc(env(safe-area-inset-top) + 8px); right: calc(env(safe-area-inset-right) + 10px);
}
.tool {
  width: 36px; height: 36px; padding: 0; border-radius: 50%; background: rgba(255,255,255,.1);
  font-size: 16px; line-height: 36px; text-align: center;
}
.tips {
  position: fixed; inset: 0; z-index: 110; display: flex; align-items: center; justify-content: center;
  padding: 18px; background: rgba(10,11,15,.7); overflow-y: auto;
}
.tips-card { width: 100%; max-width: 420px; padding: 20px; border-radius: var(--radius); background: var(--panel); }
.tips-card h2 { margin: 0 0 10px; font-size: 20px; }
.tips-card ul { margin: 0 0 16px; padding-left: 20px; color: #d6d9e0; font-size: 15px; }
.tips-card li { margin-bottom: 6px; }
.tips-card button { width: 100%; }
@media (max-height: 500px) {
  .tips-card { max-width: 560px; padding: 14px 18px; }
  .tips-card ul { font-size: 14px; margin-bottom: 10px; }
  .tips-card li { margin-bottom: 3px; }
}
.toast {
  position: fixed; z-index: 120; left: 50%; top: calc(env(safe-area-inset-top) + 56px); transform: translateX(-50%);
  padding: 8px 14px; border-radius: 999px; background: rgba(20,22,30,.9); font-size: 14px; pointer-events: none;
}
