/* GCWBB - GC Winterberg Birdie Book
   Design tokens abgeleitet aus dem Vereinslogo (Grün/Gold/Creme) */

:root{
  --bg: oklch(97% 0.012 95);
  --surface: oklch(99% 0.004 95);
  --ink: oklch(24% 0.03 155);
  --ink-soft: oklch(48% 0.02 155);
  --ink-faint: oklch(70% 0.015 95);
  --green: oklch(33% 0.07 155);
  --green-2: oklch(42% 0.08 155);
  --fairway: oklch(88% 0.07 150);
  --rough: oklch(56% 0.09 150);
  --sand: oklch(85% 0.05 85);
  --gold: oklch(74% 0.11 78);
  --gold-deep: oklch(56% 0.12 74);
  --red: oklch(58% 0.16 27);
  --yellow: oklch(83% 0.14 95);
  --line: oklch(90% 0.012 95);
  --row-alt: oklch(96% 0.01 95);
  --chip: oklch(95% 0.025 150);
  --danger: oklch(55% 0.18 25);
  --water: oklch(72% 0.09 235);
}

*{ box-sizing: border-box; }
html,body{ margin:0; padding:0; height:100%; }
body{
  font-family: 'Manrope', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
h1,h2,h3{ font-family:'Cormorant Garamond', Georgia, serif; margin:0; }
a{ color: var(--green); }
a:hover{ color: var(--green-2); }
button{ font-family: inherit; }

#app{
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}

.screen{ display:none; flex:1; flex-direction:column; min-height:0; }
.screen.active{ display:flex; }

/* ---------- Start screen ---------- */
#screen-start{
  align-items:center;
  padding: 15vh 28px 0 28px;
  position: relative;
}
.start-credit{ margin-top:10px; flex-shrink:0; }
.start-hero-bg{ position:absolute; top:0; left:0; right:0; height:280px; z-index:0; overflow:hidden; }
.start-logo-wrap{
  width:104px; height:104px; border-radius:50%; background:var(--surface);
  display:flex; align-items:center; justify-content:center;
  box-shadow: 0 10px 30px oklch(30% 0.05 155 / 0.18);
  z-index:1;
}
.start-logo-wrap img{ width:84px; height:84px; object-fit:contain; border-radius:50%; }
.start-title{ text-align:center; margin-top:24px; z-index:1; }
.eyebrow{ font-weight:700; letter-spacing:.24em; font-size:11px; color:var(--gold-deep); text-transform:uppercase; }
.start-title h1{ font-size:36px; font-weight:600; color:var(--ink); margin-top:8px; line-height:1.05; }
.start-sub{ margin-top:6px; font-size:14px; color:var(--ink-soft); }
.start-actions{ width:100%; display:flex; flex-direction:column; gap:12px; margin-top:auto; padding: 32px 0 16px 0; z-index:1; }
.btn{
  border:none; cursor:pointer; font-family:inherit; font-size:16px; font-weight:700;
  padding:16px 0; border-radius:16px; display:flex; align-items:center; justify-content:center; gap:10px;
}
.btn-primary{ background:var(--green); color:var(--surface); }
.btn-primary:active{ background:var(--green-2); }
.btn-outline{ background:transparent; color:var(--green); border:1.5px solid var(--green); }
.btn-outline:active{ background: var(--row-alt); }

/* ---------- Top bar (in-app) ---------- */
.topbar{
  display:flex; align-items:center; gap:10px; padding: max(env(safe-area-inset-top,0px),18px) 18px 8px 18px;
}
.topbar .logo-sm{ width:28px; height:28px; border-radius:50%; overflow:hidden; flex-shrink:0; box-shadow:0 2px 8px oklch(30% 0.05 155 / .18); }
.topbar .logo-sm img{ width:100%; height:100%; object-fit:contain; }
.topbar .title-block{ flex:1; min-width:0; }
.topbar .club{ font-size:9px; font-weight:700; letter-spacing:.2em; color:var(--gold-deep); text-transform:uppercase; }
.topbar .context{ font-size:12px; color:var(--ink-soft); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.icon-btn{ background:none; border:none; padding:6px; color:var(--ink-soft); display:flex; }

/* ---------- Hole screen: Löcher-Liste als "Buchregister" + Pager ----------
   Reiter sollen wie physische Register-/Karteikarten-Reiter am Rand eines Buchs wirken:
   je Reiter eine eigene, an der Außenkante abgerundete Karte mit leichtem Schatten,
   die im aktiven Zustand etwas herausragt ("plastisch"). */
.hole-body{ flex:1; display:flex; align-items:stretch; padding: 6px 2px 0 2px; gap:3px; min-height:0; }
.hole-col{
  display:flex; flex-direction:column; width:34px; flex-shrink:0; padding:2px 0; gap:3px;
}
.hole-col.hidden-col{ display:none; }
.hole-list-item{
  flex:1; display:flex; align-items:center; justify-content:center; min-height:0;
  font-size:12px; font-weight:800; color:var(--ink-soft); border:1px solid oklch(87% 0.015 95);
  cursor:pointer; padding:0; font-family:inherit; position:relative;
  background:linear-gradient(160deg, oklch(99.5% 0.003 95) 0%, oklch(93% 0.012 95) 100%);
  transition: transform .12s ease, box-shadow .12s ease;
}
#col-front .hole-list-item{
  border-radius: 9px 3px 3px 9px; border-right-width:0;
  box-shadow: -2px 1px 4px oklch(30% 0.05 155 / .14), inset 0 1px 0 oklch(100% 0 0 / .7);
}
#col-back .hole-list-item{
  border-radius: 3px 9px 9px 3px; border-left-width:0;
  box-shadow: 2px 1px 4px oklch(30% 0.05 155 / .14), inset 0 1px 0 oklch(100% 0 0 / .7);
}
.hole-list-item.tab-icon{ color:var(--green); }
.hole-list-item.active{
  color:var(--green); font-weight:800; z-index:2;
  background:linear-gradient(160deg, var(--gold) 0%, var(--gold-deep) 100%);
  border-color:var(--gold-deep);
  box-shadow: 0 3px 9px oklch(56% 0.12 74 / .38), inset 0 1px 0 oklch(100% 0.05 95 / .8);
}
#col-front .hole-list-item.active{ transform: translateX(-4px); }
#col-back .hole-list-item.active{ transform: translateX(4px); }

.pager-wrap{ flex:1; min-width:0; overflow:hidden; }
.pager{
  height:100%; display:flex; overflow-x:auto; scroll-snap-type:x mandatory;
  scrollbar-width:none; -webkit-overflow-scrolling:touch;
}
.pager::-webkit-scrollbar{ display:none; }
.pager-page{
  flex:0 0 100%; scroll-snap-align:start; min-width:0; min-height:0;
  display:flex; flex-direction:column; overflow-y:auto; padding:0 4px;
}

/* ---------- Rundeneinstellungen-Seite (im Pager) ---------- */
.settings-page{ padding:16px 12px; }
.settings-page h2{ font-size:24px; font-weight:700; color:var(--ink); }
.settings-page .sub{ font-size:12px; color:var(--ink-soft); margin-top:2px; }
.settings-row{ margin-top:22px; }
.settings-label{ font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; color:var(--ink-soft); margin-bottom:8px; }

.hole-card{
  flex:1; background:var(--surface); border-radius:20px; padding:16px; box-shadow:0 8px 24px oklch(30% 0.05 155 / .10);
  display:flex; flex-direction:column; min-width:0;
}
.hole-card-head{ display:flex; align-items:baseline; justify-content:space-between; }
.hole-num-label{ font-size:10px; font-weight:700; letter-spacing:.2em; color:var(--ink-soft); text-transform:uppercase; }
.hole-num{ font-family:'Cormorant Garamond',serif; font-size:40px; font-weight:700; color:var(--ink); line-height:.95; }
.hole-meta{ text-align:right; font-size:12px; color:var(--ink-soft); }
.hole-meta strong{ color:var(--ink); }
.hole-sketch{ margin-top:8px; border-radius:14px; overflow:hidden; background:oklch(96% 0.02 150); flex:1; display:flex; align-items:center; justify-content:center; min-height:180px; }
.hole-desc{ margin-top:10px; font-size:12px; line-height:1.5; color:var(--ink-soft); max-height:64px; overflow:auto; }
.tee-row{ display:flex; gap:8px; margin-top:12px; }
.tee-chip{ flex:1; background:oklch(96% 0.03 95); border-radius:10px; padding:8px 10px; }
.tee-chip .tee-label{ font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; }
.tee-chip .tee-val{ font-size:16px; font-weight:700; color:var(--ink); }
.tee-chip.herren .tee-label{ color:var(--gold-deep); }
.tee-chip.damen .tee-label{ color:var(--red); }

/* ---------- Lists (Schläger / Sonstiges) ---------- */
.page-head{ padding: max(env(safe-area-inset-top,0px),22px) 20px 6px 20px; }
.page-head h1{ font-size:30px; font-weight:700; color:var(--ink); margin-top:4px; }
.page-head .sub{ font-size:12px; color:var(--ink-soft); margin-top:2px; }
.clubs-head{ display:flex; align-items:flex-end; justify-content:space-between; gap:12px; }
.btn-edit-toggle{
  background:none; border:1.5px solid var(--green); color:var(--green); font-weight:700; font-size:12.5px;
  padding:8px 14px; border-radius:10px; cursor:pointer; white-space:nowrap; flex-shrink:0; margin-bottom:2px;
}
.btn-edit-toggle:active{ background:var(--row-alt); }
.list{ flex:1; overflow-y:auto; padding: 10px 16px 12px 16px; -webkit-overflow-scrolling:touch; }
.list-item{
  display:flex; align-items:center; gap:12px; background:var(--surface); border-radius:14px; padding:12px 14px;
  margin-bottom:8px; box-shadow:0 2px 8px oklch(30% 0.05 155 / .06); cursor:pointer; border:none; width:100%; text-align:left;
}
.list-item .ico{ width:36px; height:36px; border-radius:10px; background:var(--chip); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.list-item .body{ flex:1; min-width:0; }
.list-item .name{ font-size:14.5px; font-weight:700; color:var(--ink); }
.list-item .meta{ font-size:11px; color:var(--ink-soft); }
.list-item .chev{ color:var(--ink-soft); flex-shrink:0; }
.list-item.selected{
  box-shadow: 0 0 0 2px var(--gold-deep), 0 2px 8px oklch(30% 0.05 155 / .06);
  background: oklch(97% 0.03 90);
}
.list-item.selected .chev{ color:var(--gold-deep); }
.add-btn{
  display:flex; align-items:center; justify-content:center; gap:8px; width:100%; padding:12px;
  border-radius:14px; border:1.5px dashed var(--line); background:none; color:var(--ink-soft); font-weight:700; font-size:13.5px; cursor:pointer;
}

/* ---------- Schläger-Bearbeitungsmodus (inline, ganze Liste) ---------- */
.club-edit-row{
  background:var(--surface); border-radius:14px; padding:12px 14px; margin-bottom:8px;
  box-shadow:0 2px 8px oklch(30% 0.05 155 / .06);
}
.club-edit-row .field{ margin-bottom:8px; }
.club-edit-row .field label{
  display:block; font-size:10px; font-weight:700; color:var(--ink-soft); text-transform:uppercase; letter-spacing:.05em; margin-bottom:4px;
}
.club-edit-row .field input{
  width:100%; padding:9px 10px; border-radius:9px; border:1.5px solid var(--line); font-size:14px; font-family:inherit; background:var(--bg); color:var(--ink);
}
.club-edit-row .field-row{ display:flex; gap:8px; align-items:flex-end; }
.club-edit-row .field-row .field{ flex:1; margin-bottom:0; }
.btn-remove-row{
  flex-shrink:0; width:38px; height:38px; border-radius:9px; border:1.5px solid var(--danger); background:none;
  color:var(--danger); display:flex; align-items:center; justify-content:center; cursor:pointer; padding:0;
}
.edit-actionbar{
  display:flex; gap:10px; padding: 10px 16px max(env(safe-area-inset-bottom,0px),12px) 16px;
  background:var(--surface); border-top:1px solid var(--line);
}
.edit-actionbar[hidden]{ display:none; }
.edit-actionbar .btn{ flex:1; font-size:14px; padding:13px 0; }

/* ---------- Modal (Problem melden) ---------- */
.modal-backdrop{
  position:fixed; inset:0; background:oklch(20% 0.02 155 / 0.55); display:none;
  align-items:flex-end; justify-content:center; z-index:50;
}
.modal-backdrop.open{ display:flex; }
.modal-sheet{
  background:var(--surface); width:100%; max-width:480px; border-radius:24px 24px 0 0;
  padding:24px 20px max(env(safe-area-inset-bottom,0px),20px) 20px; max-height:88vh; overflow-y:auto;
}
.modal-sheet h2{ font-size:21px; font-weight:700; color:var(--ink); margin-bottom:16px; }
.field{ margin-bottom:14px; }
.field label{
  display:block; font-size:10px; font-weight:700; color:var(--ink-soft); text-transform:uppercase; letter-spacing:.05em; margin-bottom:4px;
}
.field input, .field textarea{
  width:100%; padding:10px 12px; border-radius:10px; border:1.5px solid var(--line); font-size:14px;
  font-family:inherit; background:var(--bg); color:var(--ink); resize:vertical;
}
.field-row{ display:flex; gap:8px; align-items:flex-end; }
.field-row .field{ flex:1; margin-bottom:0; }
.modal-actions{ display:flex; gap:10px; margin-top:6px; }
.modal-actions .btn{ flex:1; font-size:14px; padding:13px 0; }

/* ---------- Scorecard ---------- */
.card-table{ margin:10px 16px 0 16px; background:var(--surface); border-radius:16px; overflow:hidden; box-shadow:0 4px 16px oklch(30% 0.05 155 / .08); }
.card-row{ display:grid; grid-template-columns: .9fr .8fr .8fr 1fr 1fr .9fr; padding:8px 4px; align-items:center; }
.card-row.head{ background:var(--green); }
.card-row.head .cell{ color:var(--surface); font-weight:700; }
.card-row:not(.head){ border-bottom:1px solid var(--line); }
.card-row:not(.head):nth-child(even){ background:var(--row-alt); }
.cell{ display:flex; align-items:center; justify-content:center; font-size:12px; text-align:center; }
.score-input{
  width:30px; height:30px; text-align:center; border-radius:7px; border:1.5px solid var(--line); background:var(--surface);
  font-size:13px; font-weight:700; color:var(--ink); font-family:inherit;
}
.score-input::placeholder{ color: var(--ink-faint); }
.note{ margin:10px 20px 0 20px; font-size:10.5px; line-height:1.5; color:var(--ink-soft); }
.nine-toggle{ display:flex; gap:6px; padding: 0 20px; margin-top: 8px; }
.nine-toggle button{
  flex:1; padding:8px 0; border-radius:10px; border:1px solid var(--line); background:var(--surface);
  color:var(--ink-soft); font-weight:700; font-size:12.5px; cursor:pointer;
}
.nine-toggle button.active{ background:var(--green); color:var(--surface); border-color:var(--green); }

/* ---------- Sonstiges detail ---------- */
.detail-body{ flex:1; overflow-y:auto; padding: 0 20px 20px 20px; font-size:13.5px; line-height:1.6; color:var(--ink-soft); }
.detail-body p{ margin: 0 0 12px 0; }
.detail-body strong{ color: var(--ink); }
.lang-row{ display:flex; gap:10px; padding: 6px 20px 16px 20px; }
.lang-btn{
  flex:1; display:flex; flex-direction:column; align-items:center; gap:4px; padding:12px 0; border-radius:12px;
  border:1.5px solid var(--line); background:var(--surface); cursor:pointer; font-weight:700; font-size:11px; color:var(--ink-soft);
}
.lang-btn .flag{ font-size:22px; line-height:1; }
.lang-btn.active{ border-color:var(--gold-deep); background:oklch(96% 0.03 90); color:var(--ink); }

/* Kompakte Sprachauswahl auf der Startseite (oben rechts) */
.start-lang-row{
  position:absolute; top:max(env(safe-area-inset-top,0px), 14px); right:14px; z-index:2;
  display:flex; gap:6px;
}
.start-lang-row .lang-btn{
  flex:none; flex-direction:row; width:30px; height:30px; padding:0; border-radius:50%;
  justify-content:center; align-items:center; background:oklch(99% 0.004 95 / .8);
}
.start-lang-row .lang-btn .flag{ font-size:15px; }
.start-lang-row .lang-btn span:last-child{ display:none; }

.credit{ text-align:center; font-size:9px; color:var(--ink-soft); padding: 6px 0 max(env(safe-area-inset-bottom,0px),8px) 0; flex-shrink:0; }

/* ---------- Round history (Bestehende Runden) ---------- */
.round-item .name{ font-size:14.5px; }
.round-item .meta{ font-size:11px; }
.empty-state{ padding: 40px 24px; text-align:center; color:var(--ink-soft); font-size:13.5px; }

@media (max-width:360px){
  .hole-col{ width:28px; }
  .hole-list-item{ font-size:11px; }
}
