:root { --accent: #ff4fd8; --accent2: #3ce7ff; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; color: #eef;
  background: radial-gradient(ellipse at 50% 20%, #24104a 0%, #0d0820 60%, #07040f 100%) #0d0820;
  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: 6px; padding: 8px 8px 4px; flex: none;
  padding-top: calc(8px + env(safe-area-inset-top));
  padding-left: calc(8px + env(safe-area-inset-left)); padding-right: calc(8px + env(safe-area-inset-right));
}
.stat {
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 79, 216, .25); border-radius: 10px;
  padding: 3px 10px; min-width: 58px; text-align: center; box-shadow: 0 0 12px rgba(255, 79, 216, .08) inset;
}
.stat .label { display: block; font-size: 10px; opacity: .7; text-transform: uppercase; letter-spacing: .5px; }
.stat b { font-size: 16px; color: var(--accent2); text-shadow: 0 0 8px rgba(60, 231, 255, .55); font-variant-numeric: tabular-nums; }
.stat b.lives { display: inline-flex; align-items: center; gap: 3px; min-height: 20px; font-size: 13px; }
.lives i {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, #9ff4ff 45%, #3ce7ff); box-shadow: 0 0 6px #3ce7ff;
}
header button {
  background: rgba(255, 255, 255, .07); 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: 4px 4px calc(6px + env(safe-area-inset-bottom));
  padding-left: calc(4px + env(safe-area-inset-left)); padding-right: calc(4px + env(safe-area-inset-right));
}
#board {
  display: block; border-radius: 10px; touch-action: none; cursor: none;
  box-shadow: 0 0 0 1px rgba(255, 79, 216, .35), 0 0 24px rgba(255, 79, 216, .25), 0 0 60px rgba(60, 231, 255, .12), 0 12px 40px rgba(0, 0, 0, .6);
}

.overlay {
  position: fixed; inset: 0; background: rgba(8, 4, 20, .66); display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 10; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.panel {
  background: linear-gradient(180deg, rgba(30, 14, 60, .96), rgba(14, 8, 32, .96));
  border: 1px solid rgba(255, 79, 216, .35); border-radius: 16px; padding: 20px 22px;
  max-width: 460px; width: 100%; text-align: center; max-height: calc(100% - 8px); overflow-y: auto;
  box-shadow: 0 0 30px rgba(255, 79, 216, .2), 0 20px 60px rgba(0, 0, 0, .6);
}
.panel h1 {
  margin: 0 0 8px; font-size: 28px; color: #fff;
  text-shadow: 0 0 6px var(--accent), 0 0 18px var(--accent);
}
.panel p { line-height: 1.5; opacity: .92; margin: 8px 0; font-size: 15px; }
.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;
}
.pw-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; text-align: left; font-size: 13px; margin: 8px 0 2px; }
.pw-list span { display: flex; align-items: center; gap: 6px; opacity: .92; }
.pw-list em {
  font-style: normal; font-weight: 800; font-size: 11px; color: #10051f; min-width: 26px; height: 16px; line-height: 16px;
  border-radius: 8px; text-align: center; box-shadow: 0 0 8px currentColor;
}
#ov-stats { display: flex; gap: 8px; justify-content: center; margin: 10px 0; flex-wrap: wrap; }
.primary {
  background: linear-gradient(135deg, #ff4fd8, #8a4dff 55%, #3ce7ff); color: #fff; border: none; border-radius: 12px;
  padding: 12px 28px; font-size: 17px; font-weight: 800; margin-top: 6px; text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  box-shadow: 0 0 18px rgba(255, 79, 216, .45);
}
.primary:active { transform: translateY(1px); }
.hidden { display: none !important; }

@media (max-width: 380px) {
  .stat { min-width: 50px; padding: 3px 7px; }
  .stat b { font-size: 15px; }
  header button { padding: 7px 8px; }
}
