/* Pocket Golf Odyssey — 16-Bit Pixel-Art Mini-Golf Stylesheet */
:root {
  --bg-deep: #0a1f16;
  --bg-panel: #102a20;
  --bg-card: #153428;
  --border: #255340;
  --border-hi: #3f8a68;
  --text: #eefbf3;
  --text-dim: #9ec8b2;
  --emerald: #22c55e;
  --emerald-dark: #15803d;
  --gold: #facc15;
  --gold-dark: #b45309;
  --cyan: #22d3ee;
  --magenta: #e879f9;
  --danger: #f87171;
  --radius: 10px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100vw;
  min-height: 100%;
  overflow-x: hidden;
  background: radial-gradient(circle at 50% 0%, #143928 0%, #091a12 70%);
  color: var(--text);
  font-family: 'Trebuchet MS', 'Segoe UI', system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.hidden {
  display: none !important;
}

/* Cover demo capture mode: zero HUD, zero Studio Bar, pure 630x500 canvas */
body.cover-demo {
  background: #0d2a1b;
  overflow: hidden;
}
body.cover-demo .hud-bar,
body.cover-demo .hint-strip,
body.cover-demo .title-overlay,
body.cover-demo .callout-overlay,
body.cover-demo .power-hud,
body.cover-demo #studio-bar-root,
body.cover-demo [id*="studio-bar"],
body.cover-demo .sb-bar {
  display: none !important;
}
body.cover-demo .app-shell {
  padding: 0 !important;
  max-width: none !important;
  height: 100vh !important;
}
body.cover-demo .stage-wrap,
body.cover-demo .canvas-frame {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
}
body.cover-demo #game-canvas {
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
}

.app-shell {
  width: 100%;
  max-width: 1020px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 8px 12px 58px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Top HUD Bar */
.hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  background: linear-gradient(180deg, #163a2a 0%, #0f291e 100%);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  flex-wrap: wrap;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, #4ade80, #16a34a);
  color: #052e16;
  border-radius: 6px;
  border: 1px solid #bbf7d0;
  flex-shrink: 0;
}

.hole-meta {
  min-width: 0;
}

.hole-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hole-sub {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: rgba(7, 20, 14, 0.72);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}

.stat-lbl {
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.stat-val {
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.stat-coins {
  border-color: rgba(250, 204, 21, 0.45);
}
.stat-coins .stat-lbl,
.stat-coins .stat-val {
  color: var(--gold);
}

.stat-streak {
  border-color: rgba(251, 146, 60, 0.5);
}
.stat-streak .stat-val {
  color: #fdba74;
}

.hud-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.hud-btn {
  width: 34px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #173f2e;
  border: 1px solid var(--border-hi);
  border-radius: 7px;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
}

.hud-btn:hover {
  background: #215942;
  transform: translateY(-1px);
}
.hud-btn:active {
  transform: scale(0.95);
}

/* Main Stage */
.stage-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 0;
}

.canvas-frame {
  position: relative;
  width: 100%;
  max-width: 920px;
  aspect-ratio: 8 / 5;
  max-height: calc(100vh - 156px);
  background: #0d2b1c;
  border: 3px solid #2b6048;
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
  cursor: crosshair;
}

/* Floating Stage Pills */
.challenge-pill,
.mode-pill {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  pointer-events: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
}

.challenge-pill {
  background: linear-gradient(90deg, #b45309, #d97706);
  color: #fffbeb;
  border: 1px solid #fde047;
}

.mode-pill {
  left: auto;
  right: 10px;
  background: linear-gradient(90deg, #0e7490, #0284c7);
  color: #ecfeff;
  border: 1px solid #67e8f9;
}

/* Power HUD while dragging */
.power-hud {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  background: rgba(7, 20, 14, 0.88);
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.power-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  min-width: 78px;
  text-align: center;
}

.power-track {
  width: 110px;
  height: 8px;
  background: #142c21;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #2b5441;
}

.power-fill {
  height: 100%;
  width: 0%;
  background: #22c55e;
  border-radius: 999px;
  transition: background-color 0.08s linear;
}

/* Title Overlay */
.title-overlay,
.callout-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(7, 22, 15, 0.56);
  backdrop-filter: blur(2px);
}

.title-card,
.callout-card {
  width: 100%;
  max-width: 440px;
  padding: 18px 20px;
  text-align: center;
  background: linear-gradient(180deg, rgba(19, 51, 37, 0.96) 0%, rgba(11, 31, 22, 0.97) 100%);
  border: 2px solid #4ade80;
  border-radius: 14px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.65);
}

.title-eyebrow {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--gold);
  margin-bottom: 4px;
}

.title-heading {
  margin: 0 0 6px;
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #ffffff;
  text-shadow: 0 3px 0 #072615;
}

.title-tagline {
  margin: 0 0 14px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-dim);
}

.title-primary-row,
.title-secondary-row,
.callout-btns {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.title-secondary-row {
  margin-top: 8px;
}

.title-controls-note {
  margin-top: 12px;
  font-size: 11px;
  color: #86efac;
  opacity: 0.9;
}

/* Hole Callout Card */
.callout-card {
  max-width: 340px;
  border-color: var(--gold);
}

.callout-badge {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--gold);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.5);
  margin-bottom: 4px;
}

.callout-sub {
  font-size: 13px;
  color: #e2f8ec;
  margin-bottom: 10px;
}

.callout-unlock {
  margin: 0 0 12px;
  padding: 6px 10px;
  background: rgba(250, 204, 21, 0.14);
  border: 1px solid rgba(250, 204, 21, 0.45);
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: #fef08a;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: 8px;
  border: 2px solid transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.12s ease;
}

.btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.btn:active {
  transform: scale(0.97);
}
.btn-lg {
  padding: 10px 18px;
  font-size: 14px;
}
.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
}

.btn-primary {
  background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
  color: #052e16;
  border-color: #bbf7d0;
}

.btn-accent {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  color: #042133;
  border-color: #bae6fd;
}

.btn-gold {
  background: linear-gradient(180deg, #fde047 0%, #d97706 100%);
  color: #3b1803;
  border-color: #fef08a;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #eefbf3;
  border-color: var(--border-hi);
}

/* Hint Strip */
.hint-strip {
  width: 100%;
  max-width: 920px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(12, 34, 24, 0.85);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

.hint-tag {
  padding: 2px 6px;
  border-radius: 4px;
  background: #1f4f3a;
  color: #86efac;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.07em;
  flex-shrink: 0;
}

.hint-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Fixed Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: rgba(4, 13, 9, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 12px 60px;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 84px);
  overflow-y: auto;
  background: linear-gradient(180deg, #143627 0%, #0c2319 100%);
  border: 2px solid var(--border-hi);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.modal-wide {
  max-width: 680px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.modal-header h2 {
  margin: 0;
  font-size: 17px;
  color: #ffffff;
}

.modal-sub {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--text-dim);
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-hi);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
}
.modal-close:hover {
  background: rgba(248, 113, 113, 0.25);
}

/* Course Selector Modal */
.tour-quick-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.course-section {
  margin-bottom: 14px;
}

.course-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #86efac;
  margin-bottom: 7px;
}

.best-pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.16);
  color: var(--gold);
  font-size: 11px;
}

.holes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.hole-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 8px 9px;
  background: rgba(9, 25, 18, 0.78);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease, transform 0.1s ease;
}

.hole-tile:hover {
  border-color: #4ade80;
  transform: translateY(-1px);
}

.hole-tile.active-hole {
  border-color: var(--gold);
  background: rgba(250, 204, 21, 0.1);
}

.hole-tile-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 800;
  color: #86efac;
}

.hole-tile-name {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.hole-tile-meta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-dim);
}

/* Pro Shop / Ball Locker */
.shop-balance {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.55);
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.shop-section-title {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #86efac;
  margin: 10px 0 7px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.shop-grid-tints {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.shop-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  background: rgba(9, 25, 18, 0.82);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  text-align: center;
}

.shop-card.equipped {
  border-color: #4ade80;
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.35);
}

.shop-preview-canvas {
  width: 44px;
  height: 44px;
  image-rendering: pixelated;
}

.tint-swatch {
  width: 44px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.shop-item-name {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}

.shop-item-desc {
  font-size: 10.5px;
  color: var(--text-dim);
  line-height: 1.25;
}

/* Daily Championship Modal */
.daily-meta-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.daily-stat {
  padding: 8px;
  background: rgba(8, 22, 16, 0.78);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
}

.daily-stat-k {
  display: block;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 3px;
}

.daily-stat-v {
  font-size: 13px;
  font-weight: 900;
  color: #fff;
}

.daily-action-row {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.leaderboard-wrap {
  background: rgba(8, 22, 16, 0.72);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}

.lb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 8px;
}

.lb-sub {
  font-weight: 600;
  color: var(--text-dim);
}

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

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

.lb-rank {
  font-weight: 900;
  color: var(--gold);
  width: 24px;
}

.lb-name {
  flex: 1;
  font-weight: 700;
  color: #fff;
}

.lb-score {
  font-weight: 800;
  color: #86efac;
  font-variant-numeric: tabular-nums;
}

.lb-empty {
  text-align: center;
  padding: 12px 6px;
  font-size: 12px;
  color: var(--text-dim);
}

/* Round Summary & Share */
.summary-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px;
  background: rgba(8, 22, 16, 0.8);
  border: 1px solid var(--border-hi);
  border-radius: 10px;
  margin-bottom: 10px;
}

.summary-big-score {
  font-size: 36px;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
}

.summary-details {
  font-size: 13px;
  line-height: 1.5;
  color: #e2f8ec;
}

.summary-emoji-strip {
  text-align: center;
  font-size: 20px;
  letter-spacing: 3px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  margin-bottom: 10px;
  word-break: break-all;
}

.summary-next-unlock {
  padding: 8px 10px;
  background: rgba(250, 204, 21, 0.14);
  border: 1px solid rgba(250, 204, 21, 0.45);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #fef08a;
  text-align: center;
  margin-bottom: 10px;
}

.lb-submit-box {
  padding: 10px;
  background: rgba(56, 189, 248, 0.09);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 9px;
  margin-bottom: 12px;
}

.lb-label {
  display: block;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #7dd3fc;
  margin-bottom: 6px;
}

.lb-submit-row {
  display: flex;
  gap: 7px;
}

#callsign-input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid var(--border-hi);
  background: #081a12;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
}

.lb-status {
  margin-top: 6px;
  font-size: 11.5px;
  color: #86efac;
}

.summary-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.share-toast {
  margin-top: 9px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #4ade80;
}

/* Mobile Responsive (390x844 and narrow screens — strict 0px horizontal overflow) */
@media (max-width: 640px) {
  .app-shell {
    padding: 6px 8px 60px;
    gap: 6px;
  }

  .hud-bar {
    padding: 6px 8px;
    gap: 6px;
  }

  .hud-left {
    flex: 1 1 100%;
  }

  .hole-title {
    font-size: 13px;
  }

  .hud-stats {
    flex: 1;
    gap: 4px;
  }

  .stat-pill {
    padding: 3px 6px;
    font-size: 11px;
  }

  .hud-btn {
    width: 31px;
    height: 30px;
    font-size: 14px;
  }

  .canvas-frame {
    border-width: 2px;
    border-radius: 9px;
  }

  .title-card {
    padding: 13px 14px;
  }
  .title-heading {
    font-size: 20px;
  }
  .title-tagline {
    font-size: 11.5px;
    margin-bottom: 10px;
  }
  .btn-lg {
    padding: 8px 13px;
    font-size: 12.5px;
  }
  .title-controls-note {
    font-size: 10px;
    margin-top: 8px;
  }

  .holes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .daily-meta-row {
    grid-template-columns: 1fr;
  }

  .hint-strip {
    font-size: 11px;
  }
}
