:root {
  --bg: #0b1220;
  --bg2: #111a2b;
  --card: rgba(255,255,255,0.06);
  --card-strong: rgba(255,255,255,0.09);
  --line: rgba(255,255,255,0.10);
  --text: #eef3fb;
  --muted: #a9b4c7;
  --accent: #5ad58d;
  --accent-2: #2f9f66;
  --accent-soft: rgba(90,213,141,0.14);
  --danger: #ff8585;
  --warn: #ffc66d;
  --shadow: 0 18px 40px rgba(0,0,0,.28);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(90,213,141,.10), transparent 26%),
    radial-gradient(circle at top right, rgba(90,213,141,.06), transparent 24%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  min-height: 100vh;
}
.page-shell {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0));
}
.wrap {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 18px 70px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.hero {
  padding: 30px;
  margin-bottom: 20px;
}
.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
h1 {
  margin: 0 0 10px;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1;
}
.subline {
  margin: 0 0 10px;
  color: var(--accent);
  font-weight: 700;
}
.hero-copy {
  max-width: 900px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}
.btn {
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #07110c;
}
.btn-secondary {
  background: rgba(255,255,255,.08);
  color: var(--text);
  border: 1px solid var(--line);
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.section-head h2 {
  margin: 0;
  font-size: 24px;
}
.section-meta {
  color: var(--muted);
  font-size: 13px;
}
.rule-card,
.settings-card,
.table-card,
.summary-card,
.leaderboard-card,
.payout-card { padding: 24px; }
.rule-card,
.settings-card,
.table-card,
.summary-card { margin-bottom: 20px; }
.rule-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.rule-box {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}
.rule-box span {
  display: block;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}
.rule-box strong {
  font-size: 18px;
}
.settings-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
}
.players-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.player-card,
.option-card {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}
.options-group {
  display: grid;
  gap: 14px;
}
.compact-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}
label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
input, select {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  color: var(--text);
  font-size: 16px;
  outline: none;
}
input:focus, select:focus {
  border-color: rgba(90,213,141,.65);
  box-shadow: 0 0 0 3px rgba(90,213,141,.15);
}
.help-text {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
thead th {
  text-align: left;
  padding: 14px 12px;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
tbody td, tfoot td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  vertical-align: middle;
}
tbody tr:hover { background: rgba(255,255,255,.03); }
tfoot td {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  font-weight: 800;
}
.hole-cell {
  font-weight: 800;
  color: var(--accent);
}
.score-input {
  width: 86px;
  text-align: center;
  font-weight: 800;
}
.value-chip {
  display: inline-block;
  min-width: 70px;
  text-align: center;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  font-weight: 800;
}
.points-chip {
  min-width: 128px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.leaderboard,
.payout-grid {
  display: grid;
  gap: 14px;
}
.leader-card,
.payout-box {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}
.leader-card.top {
  border-color: rgba(90,213,141,.45);
  box-shadow: 0 0 0 1px rgba(90,213,141,.18) inset;
}
.place-line,
.payout-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
}
.player-line {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 10px;
}
.stats-line,
.payout-sub {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}
.money {
  font-size: 28px;
  font-weight: 900;
}
.money.win { color: var(--accent); }
.money.lose { color: var(--danger); }
.money.flat { color: var(--muted); }
.summary-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
}
.hidden { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(5px);
}
.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 520px);
  margin: 16vh auto 0;
  padding: 24px;
}
.small-modal h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 28px;
}
.small-modal p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}
@media (max-width: 1100px) {
  .settings-grid,
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .rule-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .wrap { padding: 18px 12px 40px; }
  .hero,
  .rule-card,
  .settings-card,
  .table-card,
  .summary-card,
  .leaderboard-card,
  .payout-card { padding: 18px; }
  .hero-copy { font-size: 16px; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .hero-actions,
  .modal-actions { flex-direction: column; }
  .btn { width: 100%; }
}
@media print {
  body {
    background: #fff;
    color: #111;
  }
  .page-shell,
  .hero-actions,
  .compact-actions,
  .btn,
  .modal { display: none !important; }
  .card {
    background: #fff;
    border: 1px solid #d8d8d8;
    box-shadow: none;
    backdrop-filter: none;
  }
  .wrap {
    max-width: none;
    padding: 0;
  }
  .table-wrap { overflow: visible; }
  table { min-width: 0; }
}


.course-subgrid{display:grid;grid-template-columns:1fr 110px;gap:12px;}
.course-wide{grid-column:1/-1;}
.course-hint{margin:10px 0 0;color:var(--muted);font-size:13px;line-height:1.45;}
.label-chip{display:inline-block;min-width:60px;text-align:center;padding:9px 10px;border-radius:12px;background:rgba(255,255,255,.05);border:1px solid var(--line);font-weight:800;}
.par-chip{min-width:48px;}
@media (max-width: 920px){.course-subgrid{grid-template-columns:1fr;}}


.rules-toggle-wrap {
  margin-top: 18px;
}
.toggle-btn {
  width: 100%;
  border: 1px solid rgba(90,213,141,.28);
  background: linear-gradient(180deg, rgba(90,213,141,.18), rgba(47,159,102,.12));
  color: #eafff2;
  border-radius: 18px;
  padding: 16px 18px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
}
.toggle-btn:hover {
  border-color: rgba(90,213,141,.42);
  background: linear-gradient(180deg, rgba(90,213,141,.24), rgba(47,159,102,.16));
}
.toggle-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.toggle-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.08);
  font-size: 18px;
  flex: 0 0 auto;
}
.toggle-copy { min-width: 0; }
.toggle-title {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: #f0fdf4;
  margin-bottom: 2px;
}
.toggle-subtitle {
  display: block;
  color: #d8ffe6;
  font-size: 13px;
  opacity: .92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toggle-chevron {
  font-size: 20px;
  line-height: 1;
  transition: transform .18s ease;
  flex: 0 0 auto;
}
.toggle-btn.is-open .toggle-chevron {
  transform: rotate(180deg);
}
.rules-panel.hidden { display: none; }
.rules-panel {
  margin-top: 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}
.rules-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.rule-detail-card {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}
.rule-detail-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}
.rule-detail-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}
.rule-badge {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(56,189,248,.14);
  color: #bae6fd;
  border: 1px solid rgba(56,189,248,.28);
  font-weight: 800;
  margin-bottom: 10px;
}
@media (max-width: 820px) {
  .rules-panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .players-group { grid-template-columns: 1fr; }
}

.compact-head h2 { font-size: 20px; }
.money-input-wrap { position: relative; }
.money-input-wrap input { padding-right: 40px; }
.money-suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 700;
  pointer-events: none;
}
.hole-meta-chip {
  display: inline-block;
  min-width: 118px;
  text-align: center;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  font-weight: 800;
  letter-spacing: .01em;
}
.bottom-actions-card { padding: 24px; margin-top: 20px; }
.bottom-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.bottom-actions .btn { flex: 1 1 220px; }
@media (max-width: 900px) { .bottom-actions { flex-direction: column; } }
