/* style.css */
:root {
  --bg: #07110d;
  --panel: rgba(14, 28, 20, 0.92);
  --text: #e7f6ea;
  --muted: #9bb3a2;
  --accent: #7dff9a;
  --line: rgba(255, 255, 255, 0.08);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

html[data-theme="light"] {
  --bg: #d7e7d4;
  --panel: rgba(247, 252, 246, 0.94);
  --text: #16301c;
  --muted: #4d6756;
  --accent: #1f7a3a;
  --line: rgba(20, 40, 24, 0.1);
  --shadow: 0 12px 32px rgba(40, 70, 50, 0.15);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Nunito", sans-serif;
  overflow: hidden;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
}

#view {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

#mini {
  position: absolute;
  left: max(10px, env(safe-area-inset-left));
  bottom: max(92px, env(safe-area-inset-bottom));
  width: 112px;
  height: 112px;
  border-radius: 14px;
  pointer-events: none;
  box-shadow: var(--shadow);
  z-index: 3;
}

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.hud-top,
.hud-bottom,
.hud-mid {
  pointer-events: none;
}

.hud-top {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: max(10px, env(safe-area-inset-top)) 10px 0;
  flex-wrap: wrap;
}

.hud-card {
  pointer-events: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px 10px;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 58px;
}

.hud-card .k {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hud-card strong {
  font-size: 16px;
  font-weight: 800;
}

.hud-mid {
  text-align: center;
  padding: 8px 16px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

#hole-name {
  font-weight: 800;
  font-size: 18px;
}

#status-line {
  color: var(--muted);
  font-size: 13px;
}

.hud-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: 10px max(10px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  pointer-events: none;
}

.hud-bottom .btn,
.hud-top .icon-btn {
  pointer-events: auto;
}

.icon-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--panel) url("https://assets.popchat.com/assets/kenney/ui-pack/PNG/Blue/Default/button_square_depth_border.png") center / 100% 100% no-repeat;
  display: grid;
  place-items: center;
  position: relative;
  cursor: pointer;
  pointer-events: auto;
}

.icon-btn img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.icon-black {
  filter: invert(1);
}

html[data-theme="light"] .icon-black {
  filter: none;
}

#mute-slash {
  position: absolute;
  width: 22px;
  height: 3px;
  background: #ef4444;
  transform: rotate(-45deg);
  border-radius: 2px;
}

.btn {
  min-height: 44px;
  min-width: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 12px;
  color: #14301a;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  background-color: #3aaa58;
  box-shadow: var(--shadow);
}

.btn-green {
  background: #3aaa58 url("https://assets.popchat.com/assets/kenney/ui-pack/PNG/Green/Default/button_rectangle_depth_gloss.png") center / 100% 100% no-repeat;
  color: #102410;
}

.btn-blue {
  background: #3d6db3 url("https://assets.popchat.com/assets/kenney/ui-pack/PNG/Blue/Default/button_rectangle_depth_border.png") center / 100% 100% no-repeat;
  color: #f4fbff;
}

.btn-wide {
  width: 100%;
}

.btn-green:active,
.btn-blue:active,
.icon-btn:active {
  transform: translateY(1px);
}

#power-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

#power-track {
  width: 22px;
  height: 88px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

#power-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40%;
  background: linear-gradient(180deg, #d7ff7a, #3aaa58);
}

#power-lbl {
  font-size: 11px;
  color: var(--muted);
  font-weight: 800;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: rgba(4, 10, 8, 0.55);
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px 24px;
}

.overlay[hidden],
#hud[hidden] {
  display: none !important;
}

.panel {
  width: min(460px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px 18px 18px;
  box-shadow: var(--shadow);
  margin-top: 8vh;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  color: var(--accent);
  font-weight: 800;
  margin: 0 0 6px;
}

h1 {
  margin: 0 0 8px;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 800;
}

h2 {
  margin: 18px 0 8px;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.lede {
  color: var(--muted);
  margin: 0 0 16px;
}

.row {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}

.row.wrap {
  flex-wrap: wrap;
}

.inline-icon {
  width: 16px;
  height: 16px;
  vertical-align: -2px;
  margin-right: 6px;
}

.bar {
  height: 10px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 12px;
}

#load-bar {
  width: 8%;
  height: 100%;
  background: var(--accent);
}

.ball-picks {
  display: flex;
  gap: 10px;
}

.ball-pick {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  background: #3b82f6 url("https://assets.popchat.com/assets/kenney/ui-pack/PNG/Green/Default/button_round_depth_gloss.png") center / 100% 100% no-repeat;
}

.ball-pick[data-color="green"] {
  background-color: #22c55e;
}

.ball-pick[data-color="red"] {
  background-color: #ef4444;
}

.ball-pick.on {
  border-color: var(--text);
}

.hole-list {
  display: grid;
  gap: 8px;
}

.hole-btn {
  text-align: left;
  width: 100%;
}

.best-card {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.help-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.help-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 12px;
  line-height: 1.35;
}

.tick {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 2px;
}

@media (min-width: 720px) {
  #mini {
    width: 148px;
    height: 148px;
    bottom: max(24px, env(safe-area-inset-bottom));
    left: max(16px, env(safe-area-inset-left));
  }

  .hud-bottom {
    justify-content: flex-end;
    padding-right: 24px;
  }

  h1 {
    font-size: 40px;
  }
}

@media (max-width: 360px) {
  .hud-card {
    min-width: 48px;
    padding: 4px 7px;
  }

  #mini {
    width: 88px;
    height: 88px;
  }
}
