/* VELOCITY PUTT - Style Rules */

[hidden] {
  display: none !important;
}

body:has(.vpg-game) {
  background-color: #08110e;
  background-image: radial-gradient(circle at 50% 20%, #112821 0%, #060e0b 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: #f1f8f5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  margin: 0;
  overflow: hidden;
}

body:has(.vpg-game) > main {
  padding: 0;
  background: transparent;
  width: 100%;
  height: var(--yz-stage-h, 100vh);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Stage container (16:9 ratio) */
.vpg-game {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: calc(var(--yz-stage-h, 100vh) * 16 / 9);
  max-height: calc(100vw * 9 / 16);
  aspect-ratio: 16 / 9;
  margin: auto;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0d1e17;
}

/* HUD Top Bar */
.vpg-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: linear-gradient(180deg, rgba(5, 14, 11, 0.9) 0%, rgba(5, 14, 11, 0.65) 80%, transparent 100%);
  z-index: 10;
  pointer-events: auto;
}

.vpg-hud-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vpg-hud-badge {
  background: #10b981;
  color: #042f1a;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 9999px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.vpg-hud-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #e2f1ec;
  letter-spacing: 0.03em;
}

.vpg-hud-center {
  display: flex;
  align-items: center;
  gap: 24px;
}

.vpg-stat-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.vpg-stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #8da39b;
}

.vpg-stat-val {
  font-size: 1.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}

.vpg-stat-val.highlight {
  color: #34d399;
}

.vpg-hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Common Buttons */
.vpg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 18px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #f1f8f5;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
}

.vpg-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.vpg-btn:active {
  transform: translateY(1px);
}

.vpg-btn-icon {
  padding: 8px;
  border-radius: 50%;
  background: rgba(18, 38, 30, 0.8);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.vpg-btn-icon:hover {
  background: rgba(52, 211, 153, 0.2);
  border-color: #34d399;
  color: #34d399;
}

.vpg-btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #042517;
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.vpg-btn-primary:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 6px 20px rgba(52, 211, 153, 0.5);
  color: #021a10;
}

.vpg-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.vpg-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
}

.vpg-btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.vpg-btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fee2e2;
}

.vpg-btn-text {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.8;
  border-radius: 4px;
}

.vpg-btn-text:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Canvas Area */
.vpg-canvas-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* Power Gauge Bar (bottom center HUD) */
.vpg-power-gauge-wrap {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(320px, 60vw);
  height: 12px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 9999px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  pointer-events: none;
  z-index: 5;
}

.vpg-power-gauge-bar {
  height: 100%;
  width: 0%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #34d399 0%, #fbbf24 65%, #ef4444 100%);
  transition: width 0.05s linear;
}

/* Hint Banner */
.vpg-hint-banner {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.78rem;
  color: rgba(200, 230, 220, 0.75);
  background: rgba(0, 0, 0, 0.4);
  padding: 3px 14px;
  border-radius: 9999px;
  pointer-events: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Modals & Overlays */
.vpg-modal {
  position: absolute;
  inset: 0;
  background: rgba(4, 12, 9, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
  animation: vpgFadeIn 0.25s ease-out;
}

@keyframes vpgFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.vpg-card {
  background: rgba(13, 29, 23, 0.92);
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(16, 185, 129, 0.15);
  padding: 28px 36px;
  max-width: 520px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.vpg-card-title {
  padding: 32px 40px;
}

.vpg-logo-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: #34d399;
  margin-bottom: 6px;
}

.vpg-title {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #ffffff;
  margin: 0 0 6px 0;
  text-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
}

.vpg-tagline {
  font-size: 0.92rem;
  color: #a7c5ba;
  margin: 0 0 24px 0;
}

.vpg-best-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 24px;
}

.vpg-best-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #92b0a3;
}

.vpg-best-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: #34d399;
}

.vpg-menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.vpg-controls-guide {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  font-size: 0.8rem;
  color: #9dbbb0;
}

.vpg-guide-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vpg-guide-icon {
  font-size: 1rem;
}

/* Clear Hole Modal */
.vpg-card-clear {
  position: relative;
  overflow: hidden;
}

.vpg-clear-badge {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #451a03;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 6px 24px;
  border-radius: 9999px;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
}

.vpg-clear-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 20px 0;
  color: #ffffff;
}

.vpg-clear-stats {
  display: flex;
  gap: 24px;
  justify-content: center;
  width: 100%;
  margin-bottom: 24px;
  background: rgba(0, 0, 0, 0.3);
  padding: 14px 20px;
  border-radius: 14px;
}

.vpg-clear-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vpg-clear-stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #8faea1;
}

.vpg-clear-stat-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
}

.vpg-clear-stat-num.highlight {
  color: #34d399;
}

/* Scorecard Modal */
.vpg-card-scorecard {
  max-width: 600px;
  padding: 24px 28px;
}

.vpg-card-title-text {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0;
  color: #ffffff;
}

.vpg-card-sub {
  font-size: 0.85rem;
  color: #9cbdb0;
  margin: 4px 0 16px 0;
}

.vpg-table-wrap {
  width: 100%;
  max-height: 280px;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 16px;
  background: rgba(0, 0, 0, 0.35);
}

.vpg-score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: center;
}

.vpg-score-table th,
.vpg-score-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.vpg-score-table thead th {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
}

.vpg-score-table tfoot th {
  background: rgba(0, 0, 0, 0.5);
  font-weight: 800;
  font-size: 0.95rem;
  border-top: 2px solid rgba(52, 211, 153, 0.4);
}

.vpg-score-table .highlight {
  color: #34d399;
}

.vpg-final-eval {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

.vpg-eval-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #34d399;
}

.vpg-eval-desc {
  font-size: 0.82rem;
  color: #c0ded3;
}

/* Mobile & Small Screen Adaptation */
@media (max-width: 600px) {
  .vpg-hud {
    height: 44px;
    padding: 0 10px;
  }
  .vpg-hud-name {
    display: none;
  }
  .vpg-stat-item {
    gap: 4px;
  }
  .vpg-stat-val {
    font-size: 1.05rem;
  }
  .vpg-card {
    padding: 20px;
  }
  .vpg-title {
    font-size: 1.7rem;
  }
  .vpg-score-table th,
  .vpg-score-table td {
    padding: 6px 4px;
    font-size: 0.78rem;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .vpg-modal,
  .vpg-btn,
  .vpg-power-gauge-bar {
    animation: none !important;
    transition: none !important;
  }
}
