/* 탭탭 아케이드 공통 스타일 */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0d1220;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

canvas#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ── 오버레이 ── */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #eef2ff;
  text-align: center;
  background: rgba(13, 18, 32, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10;
  padding: 24px;
}

.hidden { display: none !important; }

/* ── 버튼 ── */
button {
  border: none;
  border-radius: 14px;
  padding: 15px 26px;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.08s ease;
  color: #eef2ff;
  background: #232c47;
}

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

.buttons { display: flex; gap: 12px; margin-top: 18px; }
.btn-primary { background: #22d3a7; color: #06281f; }

/* ── 허브 복귀 ── */
.back-btn {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 14px;
  z-index: 30;
  padding: 9px 16px;
  font-size: 14px;
  border-radius: 999px;
  background: rgba(35, 44, 71, 0.85);
  text-decoration: none;
  color: #aab4d4;
  font-weight: 700;
}

/* ── 공통 텍스트 ── */
.best { font-size: 15px; color: #7c88ad; }

.tap-to-start {
  font-size: 18px;
  font-weight: 600;
  color: #eef2ff;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.97); }
}

.over-label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.35em;
  color: #ff5d73;
}

.final-score {
  font-size: clamp(64px, 20vw, 110px);
  font-weight: 800;
  line-height: 1;
}

.final-score.new-record { color: #ffd54a; }

/* ── 이어하기 (공통: 추후 보상형 광고 자리) ── */
#btn-revive {
  background: #ffd54a;
  color: #3d2e00;
  font-size: 19px;
  padding: 17px 40px;
  margin-top: 10px;
  box-shadow: 0 0 24px rgba(255, 213, 74, 0.35);
  animation: pulse 1.2s ease-in-out infinite;
}

#revive-count {
  display: inline-block;
  min-width: 22px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  font-size: 15px;
  padding: 2px 6px;
}

/* ── 광고 슬롯 (승인 후 배너 삽입, 320x50) ── */
#ad-slot {
  margin-top: 26px;
  width: min(320px, 90vw);
  min-height: 50px;
}

/* ── 닉네임 모달 ── */
#nick-modal { z-index: 50; }

.nick-title { font-size: 22px; font-weight: 800; }
.nick-sub { font-size: 14px; color: #8b96b8; }

#nick-input {
  width: min(260px, 76vw);
  padding: 14px 18px;
  border: 2px solid #2e3a5e;
  border-radius: 14px;
  background: #1a2238;
  color: #eef2ff;
  font-size: 17px;
  font-family: inherit;
  text-align: center;
  outline: none;
}

#nick-input:focus { border-color: #22d3a7; }

/* ── 토스트 ── */
#toast {
  position: fixed;
  bottom: max(32px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: #232c47;
  color: #eef2ff;
  font-size: 14px;
  padding: 11px 20px;
  border-radius: 999px;
  z-index: 40;
  white-space: nowrap;
}
