/* ConeCadence — Cone-Ladder Practice Board */

:root {
  --turf: #1f6f4a;
  --turf-deep: #17553a;
  --turf-line: #2c8759;
  --mist: #eaf4e7;
  --cone: #f28c28;
  --cone-deep: #d9741a;
  --sky: #7fc4e8;
  --chalk: #f2e394;
  --ink: #123527;
  --ink-soft: #3c5a4b;
  --paper: #f7fbf4;
  --danger: #b23b2e;
  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 22px;
  --band-green: #2c8759;
  --band-orange: #f28c28;
  --band-sky: #7fc4e8;
  --band-chalk: #f2e394;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { height: 100%; }

body {
  font-family: "Trebuchet MS", "Segoe UI", Verdana, sans-serif;
  background: var(--turf);
  color: var(--ink);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}

.board { max-width: 520px; margin: 0 auto; padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

/* ---------- bottom tab bar ---------- */
.tab-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: var(--turf-deep);
  border-top: 3px solid var(--turf-line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
}

.whistle-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--mist);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 2px 4px;
  min-height: 56px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s ease;
}

.whistle-body {
  width: 26px; height: 16px;
  background: currentColor;
  opacity: 0.55;
  border-radius: 3px 9px 9px 3px;
  position: relative;
  display: block;
}
.whistle-hole {
  position: absolute;
  left: 5px; top: 4px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--turf-deep);
  opacity: 1;
}
.tab-word {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}

.whistle-tab.active {
  color: var(--cone);
  transform: rotate(-6deg);
  text-shadow: 0 3px 4px rgba(0, 0, 0, 0.45);
}
.whistle-tab.active .whistle-body { opacity: 1; }
.whistle-tab.active .tab-word { opacity: 1; font-weight: bold; }
.whistle-tab:focus-visible { outline: 2px solid var(--chalk); outline-offset: 2px; }

/* ---------- panes ---------- */
.tab-pane { padding: 18px 16px 24px; }
.tab-pane[hidden] { display: none; }

.pane-title { font-size: 24px; color: var(--mist); letter-spacing: 0.02em; }
.pane-sub { font-size: 13px; color: var(--chalk); margin-top: 2px; }

/* ---------- Session: ladder header ---------- */
.ladder-head { padding-top: 6px; }
.ladder-strip {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 34px;
  margin-bottom: 12px;
  border-bottom: 2px dashed rgba(234, 244, 231, 0.35);
  padding-bottom: 2px;
}
.cone {
  width: 0; height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-bottom: 26px solid var(--cone);
  display: block;
}
.cone-a { height: 0; }
.cone-b { border-bottom-color: var(--cone-deep); }
.cone-c { border-bottom-width: 34px; border-bottom-color: var(--mist); border-left-width: 17px; border-right-width: 17px; }
.cone-d { border-bottom-color: var(--cone); }
.cone-e { border-bottom-color: var(--cone-deep); }

.app-title { font-size: 30px; color: var(--mist); letter-spacing: 0.03em; }
.app-sub { color: var(--chalk); font-size: 13px; margin: 2px 0 0; }

/* count disc */
.count-disc-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0 16px;
}
.count-disc {
  flex: 0 0 auto;
  width: 118px; height: 118px;
  border-radius: 50%;
  background: var(--cone);
  border: 6px solid var(--mist);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.count-numeral { font-size: 40px; font-weight: bold; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.count-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(18, 53, 39, 0.75); margin-top: 4px; }
.count-side { flex: 1; }
.count-line { color: var(--mist); font-size: 14px; line-height: 1.5; }

/* wide quick action */
.quick-add {
  width: 100%;
  min-height: 62px;
  border: 0;
  border-radius: var(--radius-m);
  background: var(--cone);
  color: var(--ink);
  font-family: inherit;
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 0 var(--cone-deep);
  cursor: pointer;
  padding: 14px 18px;
}
.quick-add:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--cone-deep); }

/* recent */
.recent-block { margin-top: 26px; }
.block-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--chalk);
  margin-bottom: 10px;
}
.recent-slot:empty::after {
  content: "No drills clipped yet — use the orange strip above.";
  display: block;
  color: var(--mist);
  opacity: 0.75;
  font-size: 13px;
  padding: 12px 0;
}

/* ---------- cone-tag cards ---------- */
.cone-tag {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  border-radius: var(--radius-s);
  overflow: hidden;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
  min-height: 64px;
}
.cone-tag + .cone-tag { margin-top: 10px; }
.band { flex: 0 0 10px; align-self: stretch; }
.band-green { background: var(--band-green); }
.band-orange { background: var(--band-orange); }
.band-sky { background: var(--band-sky); }
.band-chalk { background: var(--band-chalk); }

.tag-body { flex: 1; min-width: 0; padding: 10px 0; }
.tag-name {
  font-weight: bold;
  font-size: 15px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag-skill { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.tag-note { font-size: 11px; color: var(--ink-soft); opacity: 0.8; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.duration-badge {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--turf);
  color: var(--mist);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.duration-badge strong { font-size: 14px; line-height: 1; }
.duration-badge span { font-size: 8px; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 1px; }

.tag-actions { flex: 0 0 auto; display: flex; gap: 6px; padding-right: 8px; }
.icon-btn {
  appearance: none;
  border: 0;
  border-radius: var(--radius-s);
  min-width: 40px;
  min-height: 40px;
  font-family: inherit;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  background: var(--mist);
  color: var(--turf-deep);
}
.icon-btn.delete { background: #f6d9d4; color: var(--danger); }
.icon-btn:active { transform: scale(0.94); }

/* ---------- Drills ladder ---------- */
.pane-head { padding: 8px 0 16px; }
.pane-head-drills { border-left: 8px solid var(--cone); padding-left: 12px; }

.skill-group { margin-bottom: 22px; }
.skill-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}
.skill-chip {
  font-size: 13px;
  font-weight: bold;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--mist);
  color: var(--turf-deep);
}
.skill-count { font-size: 12px; color: var(--chalk); }

#drills-list.empty-state::after {
  content: "The ladder is bare. Clip your first drill from the Add tab.";
  display: block;
  background: var(--mist);
  color: var(--turf-deep);
  border-radius: var(--radius-m);
  padding: 22px 18px;
  font-size: 14px;
  text-align: center;
}

/* ---------- Add form: whistle-clip panel ---------- */
.pane-head-add { padding-bottom: 10px; }
.whistle-clip { display: inline-block; position: relative; width: 34px; height: 34px; margin-bottom: 6px; }
.clip-ring {
  position: absolute; inset: 0;
  border: 4px solid var(--cone);
  border-radius: 50%;
}
.clip-bar {
  position: absolute;
  top: 50%; left: 60%;
  width: 26px; height: 4px;
  background: var(--cone);
  transform: rotate(35deg);
  transform-origin: left center;
  border-radius: 2px;
}

.clip-form {
  background: var(--paper);
  border-radius: var(--radius-l);
  padding: 18px 16px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.22);
}
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--turf-deep);
  margin-bottom: 6px;
}
.field label em { font-style: normal; font-weight: normal; opacity: 0.6; text-transform: none; letter-spacing: 0; margin-left: 4px; }
.field input,
.field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px; /* keeps iOS from zooming */
  color: var(--ink);
  background: var(--mist);
  border: 2px solid transparent;
  border-radius: var(--radius-s);
  padding: 12px 12px;
  min-height: 48px;
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus,
.field textarea:focus { outline: none; border-color: var(--cone); background: #fff; }

.form-error {
  background: #f6d9d4;
  color: var(--danger);
  border-radius: var(--radius-s);
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}
.form-error[hidden] { display: none; }

.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-primary {
  flex: 1;
  min-height: 52px;
  border: 0;
  border-radius: var(--radius-m);
  background: var(--turf);
  color: var(--mist);
  font-family: inherit;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--turf-deep);
  padding: 12px;
}
.btn-primary:active { transform: translateY(1px); }
.btn-ghost {
  min-height: 52px;
  border: 2px solid var(--turf);
  border-radius: var(--radius-m);
  background: transparent;
  color: var(--turf);
  font-family: inherit;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  padding: 12px 16px;
}
.btn-ghost.wide { width: 100%; margin-top: 10px; background: var(--paper); }
.btn-danger {
  min-height: 52px;
  border: 0;
  border-radius: var(--radius-m);
  background: var(--danger);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  width: 100%;
  margin-top: 10px;
  padding: 12px;
}

/* ---------- Find ---------- */
.pane-head-find { padding-bottom: 8px; }
.search-rail { position: relative; margin-bottom: 8px; }
.search-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--chalk);
  margin-bottom: 6px;
}
#find-input {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--mist);
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 13px 88px 13px 16px;
  min-height: 50px;
}
#find-input:focus { outline: none; border-color: var(--cone); background: #fff; }
.find-clear {
  position: absolute;
  right: 6px; bottom: 6px;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: var(--cone);
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  font-weight: bold;
  padding: 8px 14px;
  cursor: pointer;
}
.find-clear[hidden] { display: none; }
.find-status { color: var(--chalk); font-size: 12px; min-height: 16px; margin-bottom: 10px; }
.find-results:empty::before {
  content: "No matches yet. Try a drill name like “ladder” or a skill like “passing”.";
  display: block;
  color: var(--mist);
  opacity: 0.75;
  font-size: 13px;
  padding: 8px 0 14px;
}
#find-status.no-hits { color: var(--cone); }

/* about panel */
.about-panel {
  margin-top: 28px;
  background: rgba(18, 53, 39, 0.35);
  border: 1px solid var(--turf-line);
  border-radius: var(--radius-m);
  padding: 16px 16px 18px;
}
.about-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--chalk);
  margin-bottom: 10px;
}
.about-facts { display: grid; grid-template-columns: 84px 1fr; gap: 6px 10px; font-size: 13px; color: var(--mist); }
.about-facts dt { font-weight: bold; color: var(--chalk); }
