:root { --accent: #7ee8a2; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #0b1410; color: #eef;
  font-family: system-ui, "Segoe UI", Roboto, sans-serif; touch-action: none; user-select: none; -webkit-user-select: none;
}
button { font-family: inherit; cursor: pointer; }
body { display: flex; flex-direction: column; }

header {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 10px; flex: none;
  padding-top: calc(8px + env(safe-area-inset-top));
}
.stat { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); border-radius: 10px; padding: 4px 12px; min-width: 70px; text-align: center; }
.stat .label { display: block; font-size: 10px; opacity: .7; text-transform: uppercase; letter-spacing: .5px; }
.stat b { font-size: 16px; color: var(--accent); }
header button { background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid rgba(255, 255, 255, .15); border-radius: 10px; padding: 8px 10px; font-size: 14px; }

#wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 6px; }
#board { border-radius: 10px; box-shadow: 0 0 0 2px rgba(126, 232, 162, .25), 0 10px 40px rgba(0, 0, 0, .5); touch-action: none; }

#pad { display: none; flex: none; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0 calc(10px + env(safe-area-inset-bottom)); }
#pad .row { display: flex; gap: 6px; }
#pad button {
  width: 64px; height: 50px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08); color: #fff; font-size: 20px;
}
#pad button:active { background: rgba(126, 232, 162, .35); }
@media (pointer: coarse) { #pad { display: flex; } }

.overlay { position: fixed; inset: 0; background: rgba(4, 10, 6, .72); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.panel {
  background: rgba(12, 22, 16, .95); border: 1px solid rgba(255, 255, 255, .14); border-radius: 16px; padding: 22px 24px;
  max-width: 460px; width: 100%; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}
.panel h1 { margin: 0 0 8px; font-size: 28px; color: var(--accent); }
.panel p { line-height: 1.5; opacity: .9; margin: 8px 0; }
.panel kbd { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; font-size: 12px; font-family: inherit; }
#ov-stats { display: flex; gap: 8px; justify-content: center; margin: 10px 0; }
.primary { background: linear-gradient(135deg, #7ee8a2, #3fc46f); color: #04200f; border: none; border-radius: 12px; padding: 12px 28px; font-size: 17px; font-weight: 800; margin-top: 6px; }
.hidden { display: none !important; }
