html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #060814;
  font-family: -apple-system, "Segoe UI", system-ui, Roboto, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

#c {
  position: fixed;
  inset: 0;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

#hud {
  position: fixed;
  top: env(safe-area-inset-top, 0);
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  color: #aab4d8;
  font-size: 13px;
  letter-spacing: 0.04em;
  pointer-events: none;
  text-shadow: 0 1px 4px #000;
}

#banner {
  position: fixed;
  top: 12%;
  left: 0;
  right: 0;
  text-align: center;
  color: #e8ecff;
  font-size: 19px;
  letter-spacing: 0.06em;
  opacity: 0;
  transition: opacity 0.45s;
  pointer-events: none;
  text-shadow: 0 2px 10px #000;
}
#banner.show { opacity: 1; }

#hint {
  position: fixed;
  bottom: calc(7% + env(safe-area-inset-bottom, 0));
  left: 0;
  right: 0;
  text-align: center;
  color: #bfe6ff;
  font-size: 15px;
  letter-spacing: 0.05em;
  pointer-events: none;
  animation: hintpulse 1.6s ease-in-out infinite;
  text-shadow: 0 2px 8px #000;
  transition: opacity 0.4s;
}
#hint.gone { opacity: 0; animation: none; }
@keyframes hintpulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

#retry {
  position: fixed;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #2c3560;
  background: rgba(16, 20, 44, 0.7);
  color: #aab4d8;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
#retry:active { background: rgba(40, 48, 92, 0.9); }

#card {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(4, 6, 16, 0.88);
  color: #e8ecff;
  z-index: 5;
}
#card[hidden] { display: none; }
#card h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin: 0 0 18px;
}
#card table {
  border-collapse: collapse;
  font-size: 14px;
}
#card th {
  font-weight: 500;
  color: #8892bb;
  text-align: left;
}
#card td, #card th { padding: 4px 14px; }
#card td:nth-child(n+2), #card th:nth-child(n+2) { text-align: center; }
#card tr.sum td {
  border-top: 1px solid #2c3560;
  font-weight: 600;
  padding-top: 8px;
}
#card .best {
  margin: 16px 0 4px;
  color: #ffd47f;
  font-size: 14px;
  min-height: 18px;
}
#card button {
  margin-top: 14px;
  padding: 12px 34px;
  font-size: 16px;
  border-radius: 24px;
  border: 1px solid #6b54c8;
  background: #2a1860;
  color: #e8ecff;
  cursor: pointer;
  letter-spacing: 0.05em;
}
#card button:active { background: #3b2585; }
