/* ══════════════════════════════════════════════
   魔法保齡球 - Main Stylesheet
   ══════════════════════════════════════════════ */

/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: #080812;
}

body {
  color: #fff;
  font-family: 'Segoe UI', Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100dvh;
}

/* ── Header ── */
#hdr {
  width: 100%;
  flex-shrink: 0;
  height: 52px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0c0c1a;
  border-bottom: 1px solid #1a1a30;
}

.badge {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 20px;
}
.badge-daily   { background: #5b21b6; }
.badge-endless { background: #065f46; }

#frame-info {
  font-size: .85rem;
  color: #777;
}
#frame-info b { color: #ccc; }

#score-box { text-align: right; }
#score-label { font-size: .6rem; color: #444; letter-spacing: 1px; }
#score-val   { font-size: 1.5rem; font-weight: 700; line-height: 1; }

/* ── Ad Slots ── */
#ad-top, #ad-bottom {
  width: 100%;
  flex-shrink: 0;
  min-height: 0;           /* collapses when empty */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ── Canvas ── */
#canvas-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  min-height: 0;
}

canvas {
  display: block;
  touch-action: none;
  width: 100%;
  height: 100%;
}

/* ── Controls ── */
#controls {
  width: 100%;
  flex-shrink: 0;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0c0c1a;
  border-top: 1px solid #1a1a30;
}

#throw-hint {
  font-size: .7rem;
  color: #383858;
  letter-spacing: 0.5px;
}

/* ── Overlays ── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 5, 14, .96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 28px;
}
.overlay.hidden { display: none; }

/* Menu */
#overlay-menu h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #a855f7, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
#overlay-menu p {
  color: #555;
  font-size: .82rem;
  margin-top: -8px;
}

.menu-btn {
  width: 100%;
  max-width: 260px;
  padding: 15px;
  border-radius: 14px;
  border: none;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
}
.menu-btn:active { opacity: .8; }
.btn-daily   { background: linear-gradient(135deg, #7c3aed, #5b21b6); color: #fff; }
.btn-endless { background: linear-gradient(135deg, #059669, #065f46); color: #fff; }

/* Result */
#res-title {
  font-size: 2rem;
  font-weight: 800;
}
#res-score {
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
}

#res-scorecard {
  width: 100%;
  max-width: 320px;
  background: #0f0f20;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}

.frame-chip {
  width: 46px;
  padding: 4px 2px;
  border-radius: 6px;
  background: #191930;
  text-align: center;
}
.chip-rolls {
  font-size: .78rem;
  color: #fff;
  font-weight: 600;
  min-height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.chip-score {
  color: #a78bfa;
  font-size: .88rem;
  font-weight: 700;
  margin-top: 1px;
}
.roll-strike { color: #f59e0b !important; }
.roll-spare  { color: #22d3ee !important; }

.action-btn {
  width: 100%;
  max-width: 260px;
  padding: 13px;
  border-radius: 12px;
  border: none;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
}
.action-btn:active { opacity: .8; }
.btn-share { background: linear-gradient(135deg, #7c3aed, #3b82f6); color: #fff; }
.btn-again { background: #1a1a30; color: #aaa; border: 1px solid #333; }

.text-btn {
  background: transparent;
  border: none;
  color: #444;
  font-size: .82rem;
  padding: 6px;
  cursor: pointer;
}
