:root {
  color-scheme: light;
  --ink: #173024;
  --green: #1f7a45;
  --green-deep: #155c34;
  --card: rgba(255, 250, 242, 0.94);
  --line: rgba(23, 48, 36, 0.08);
  --shadow: 0 10px 28px rgba(40, 70, 40, 0.12);
  font-family: "Segoe UI", "Avenir Next", "Trebuchet MS", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #93c274;
  color: var(--ink);
}

body.is-aiming { cursor: grabbing; }

#game {
  position: fixed;
  inset: 0;
}

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

.card {
  position: absolute;
  z-index: 2;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  box-shadow: var(--shadow);
  user-select: none;
}

.card-hole {
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 14px 12px 16px;
  max-width: calc(100% - 250px);
}

.eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: #4e7a5c;
}

h1 {
  margin: 1px 0 2px;
  font-size: 26px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.meta, .status, .hitting {
  margin: 0;
  font-size: 14px;
  color: #3d5c48;
}

.score-block {
  min-width: 220px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.score-label {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: #4e7a5c;
}

.score {
  margin: 0;
  font-size: 42px;
  line-height: 0.95;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

.status { margin-top: 4px; }

.ghost, .primary, .club {
  font: inherit;
  cursor: pointer;
}

.ghost {
  border: 0;
  background: #e7f3ea;
  color: var(--green-deep);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
}

.ghost:hover { background: #d8eedd; }

.card-clubs {
  top: 16px;
  right: 16px;
  width: 196px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.aside-label {
  margin: 0 4px 4px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: #4e7a5c;
}

.club {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  border-radius: 12px;
  padding: 8px 8px;
  text-align: left;
}

.club .k {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(23, 48, 36, 0.08);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  flex: 0 0 auto;
}

.club .n { flex: 1; font-weight: 700; }
.club .y { font-variant-numeric: tabular-nums; color: #5d7566; font-size: 13px; font-weight: 700; }

.club:hover:not(.is-selected) { background: #e7f6ea; }

.club.is-selected {
  background: var(--green);
  color: white;
}

.club.is-selected .k { background: rgba(255, 255, 255, 0.22); }
.club.is-selected .y { color: rgba(255, 255, 255, 0.82); }

.meter {
  margin-top: 8px;
  padding: 8px 8px 4px;
  border-top: 1px solid var(--line);
}

.power-track {
  height: 8px;
  border-radius: 99px;
  background: #e3eee6;
  overflow: hidden;
}

#power-fill {
  height: 100%;
  width: 0;
  background: var(--green);
  border-radius: inherit;
}

#power-detail {
  margin: 8px 2px 2px;
  font-size: 13px;
  line-height: 1.35;
  color: #3d5c48;
  min-height: 2.6em;
}

.card-hint {
  left: 16px;
  bottom: 16px;
  max-width: min(540px, calc(100% - 250px));
  padding: 12px 14px;
}

.card-hint p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.4;
}

.card-hint.warn {
  background: #fff4f2;
  color: #8d2f26;
}

.modal {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(22, 40, 28, 0.4);
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal[hidden] { display: none; }

.modal-card {
  width: min(480px, 100%);
  background: white;
  border-radius: 22px;
  padding: 26px 28px 22px;
  box-shadow: 0 24px 70px rgba(20, 40, 24, 0.28);
}

.modal-card h2 {
  margin: 4px 0 10px;
  font-size: 32px;
  letter-spacing: -0.03em;
}

.modal-card p { margin: 0 0 10px; line-height: 1.45; }

.rules-list {
  margin: 0 0 18px;
  padding-left: 18px;
}

.rules-list li { margin: 0 0 8px; line-height: 1.4; }
.rules-list kbd {
  font-family: inherit;
  font-weight: 800;
  background: #eef5ef;
  border-radius: 5px;
  padding: 0 5px;
}

.result-name {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.result-name.good { color: var(--green); }
.result-name.even { color: #1d6a8a; }
.result-name.over { color: #9a6230; }

#done-score {
  font-size: 18px;
  margin-bottom: 18px;
}

.primary {
  width: 100%;
  border: 0;
  background: var(--green);
  color: white;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 800;
  font-size: 16px;
}

.primary:hover { background: var(--green-deep); }

button:focus-visible {
  outline: 3px solid #1f7a45;
  outline-offset: 2px;
}

@media (max-width: 1180px) {
  .card-clubs { width: 164px; }
  .card-hole { max-width: calc(100% - 200px); gap: 12px; }
  h1 { font-size: 22px; }
  .score { font-size: 34px; }
  .score-block { min-width: 160px; }
}
