* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b1030;
  touch-action: none;
  overscroll-behavior: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

#game {
  position: absolute;
  inset: 0;
  display: block;
}

#hud {
  position: absolute;
  top: env(safe-area-inset-top, 0);
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  pointer-events: none;
  z-index: 10;
}

#hearts {
  font-size: 22px;
  letter-spacing: 4px;
}

#score {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,.4);
}

#streak {
  font-size: 14px;
  font-weight: 700;
  color: #ffd447;
  text-align: right;
  min-width: 90px;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  color: #fff;
  background: rgba(11, 16, 48, 0.72);
  z-index: 20;
  padding: 24px;
}

.overlay.hidden { display: none; }

.overlay h1 {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffd447;
  text-shadow: 0 3px 10px rgba(0,0,0,.5);
}

.tagline {
  font-size: 16px;
  opacity: .85;
  line-height: 1.4;
}

.hint {
  font-size: 13px;
  opacity: .6;
  margin-top: 4px;
}

.final-score {
  font-size: 56px;
  font-weight: 900;
  color: #fff;
}

.final-best {
  font-size: 14px;
  opacity: .7;
}

button {
  font-family: inherit;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #0b1030;
  background: #ffd447;
  border: none;
  border-radius: 999px;
  padding: 14px 34px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 212, 71, .35);
}

button:active { transform: scale(0.96); }

button.secondary {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,.35);
  box-shadow: none;
  font-size: 13px;
  padding: 10px 24px;
}

.identity-note {
  font-size: 13px;
  opacity: .6;
}

.verify-note {
  font-size: 12px;
  opacity: .65;
}

#periodTabs {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

button.tab {
  background: transparent;
  color: rgba(255,255,255,.55);
  border: none;
  box-shadow: none;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
}

button.tab.active {
  background: rgba(255,255,255,.12);
  color: #ffd447;
}

#leaderboardList {
  width: 100%;
  max-width: 340px;
  max-height: 45vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  font-size: 14px;
}

.lb-row .lb-rank {
  color: #ffd447;
  font-weight: 800;
  width: 28px;
}

.lb-row .lb-name {
  flex: 1;
  text-align: left;
  padding: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-row .lb-score {
  font-weight: 700;
}

.lb-empty {
  opacity: .6;
  font-size: 13px;
  padding: 16px 0;
}

#floatText {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 15;
}

.float-item {
  position: absolute;
  font-weight: 800;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  text-shadow: 0 2px 6px rgba(0,0,0,.4);
  animation: floatUp 700ms ease-out forwards;
}

@keyframes floatUp {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -140%) scale(1.15); }
}
