/* style.css — Mini Golf 3D */
:root {
  --bg: #0a0f14;
  --panel-bg: rgba(18, 26, 34, 0.85);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #e8eef2;
  --text-dim: #9fb0bd;
  --accent: #4cd964;
  --accent-warm: #f5a623;
  --accent-hot: #ff5a4d;
  --radius: 14px;
  color-scheme: dark;
}

html[data-theme="dark"] {
  --bg: #0a0f14;
  --panel-bg: rgba(18, 26, 34, 0.85);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #e8eef2;
  --text-dim: #9fb0bd;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #e8edf2;
  --panel-bg: rgba(255, 255, 255, 0.88);
  --panel-border: rgba(0, 0, 0, 0.1);
  --text: #1a2330;
  --text-dim: #5a6878;
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #e8edf2;
    --panel-bg: rgba(255, 255, 255, 0.88);
    --panel-border: rgba(0, 0, 0, 0.1);
    --text: #1a2330;
    --text-dim: #5a6878;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

#game {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.panel {
  pointer-events: auto;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  width: fit-content;
}

.panel.top-left { align-self: flex-start; }
.panel.top-right { align-self: flex-end; align-items: flex-end; }

.lvl-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}

.line {
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
}

.line b {
  color: var(--text);
  font-weight: 700;
}

.btns {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s, background 0.12s;
}

html[data-theme="light"] .icon-btn,
:root:not([data-theme="dark"]) .icon-btn {
  background: rgba(0,0,0,0.05);
}

.icon-btn:hover { background: rgba(255,255,255,0.12); transform: translateY(-1px); }
html[data-theme="light"] .icon-btn:hover { background: rgba(0,0,0,0.1); }
.icon-btn:active { transform: translateY(0) scale(0.95); }

.pips {
  display: flex;
  gap: 8px;
  justify-content: center;
  pointer-events: none;
}

.pip {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--panel-border);
  background: var(--panel-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  transition: all 0.2s;
}

.pip.active {
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 3px rgba(76, 217, 100, 0.2);
  transform: scale(1.1);
}

.pip.done { opacity: 0.7; }
.pip.ace { background: #ffd700; color: #1a1a1a; border-color: #ffd700; }
.pip.under { background: var(--accent); color: #0a0f14; border-color: var(--accent); }
.pip.par { background: rgba(76, 217, 100, 0.2); color: var(--accent); border-color: var(--accent); }
.pip.over { background: rgba(255, 90, 77, 0.2); color: var(--accent-hot); border-color: var(--accent-hot); }

.powerbar {
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  max-width: 60vw;
  height: 8px;
  border-radius: 4px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.powerbar.show { opacity: 1; }

.powerbar .fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: var(--accent);
  transition: width 0.05s linear, background 0.1s;
}

.hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: var(--text-dim);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 6px 14px;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.3s;
}

.hint.fade { opacity: 0; }

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  z-index: 10;
  animation: fadeIn 0.25s ease;
}

.overlay.hidden { display: none; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 32px 40px;
  text-align: center;
  max-width: 90vw;
  animation: pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pop {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.score {
  font-size: 16px;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.primary, .ghost {
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s, filter 0.12s;
}

.primary {
  background: var(--accent);
  color: #0a0f14;
}

.primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.primary:active { transform: scale(0.96); }

.ghost {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid var(--panel-border);
}

html[data-theme="light"] .ghost { background: rgba(0,0,0,0.05); }

.ghost:hover { background: rgba(255,255,255,0.14); transform: translateY(-1px); }
html[data-theme="light"] .ghost:hover { background: rgba(0,0,0,0.1); }
.ghost:active { transform: scale(0.96); }

@media (max-width: 480px) {
  .panel { padding: 10px 12px; }
  .lvl-name { font-size: 16px; }
  .line { font-size: 12px; }
  .icon-btn { width: 34px; height: 34px; font-size: 16px; }
  .card { padding: 24px 28px; }
  .title { font-size: 24px; }
  .hint { font-size: 12px; padding: 5px 12px; }
}
