/* Practice log page. Loads after ../style.css and reuses its tokens.
   Everything is tennis-coloured: the page sets --c to the Tennis topic colour. */
.pl { --c: var(--tennis); padding-block: 32px 80px; display: grid; gap: 20px; }
.pl-card {
  background: color-mix(in srgb, var(--night-2) 88%, transparent);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(18px, 3vw, 26px); min-width: 0; display: grid; gap: 14px; align-content: start;
}
.pl-card h3 { font-size: 1.15rem; }
.pl-card .sub { color: var(--muted); font-size: 0.92rem; margin-top: -8px; }
.pl-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; }
.pl-head h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -0.02em; }
.pl-head h1 em { font-style: normal; color: var(--tennis); }

.pl-row { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pl-row.wide-left { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
@media (max-width: 900px) { .pl-row, .pl-row.wide-left { grid-template-columns: minmax(0, 1fr); } }

/* Stat tiles */
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { background: var(--night-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 2px; min-width: 0; }
.tile .label { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tile .value { font: 800 clamp(1.6rem, 4vw, 2.2rem)/1.15 var(--f-display); color: var(--ink); }
.tile .value small { font-size: 0.55em; font-weight: 700; color: var(--muted); margin-left: 2px; }
.tile .note { font-size: 0.85rem; color: var(--muted); }
.tile .note b { color: var(--tennis); font-weight: 700; }

/* Lock screen */
.lock { min-height: calc(100vh - 140px); display: grid; place-items: center; padding: 40px var(--gutter); }
.lock-card { width: min(100%, 400px); text-align: center; gap: 18px; padding: 32px 28px; }
.lock-ball {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto; position: relative; overflow: hidden;
  background: radial-gradient(circle at 35% 30%, #f4ffb0, var(--tennis) 55%, #9bb22a);
  box-shadow: 0 0 30px #d4f04c55;
}
.lock-ball::before, .lock-ball::after {
  content: ""; position: absolute; width: 64px; height: 64px; border-radius: 50%;
  border: 3px solid #fffbe8; top: 0;
}
.lock-ball::before { left: -44px; } .lock-ball::after { right: -44px; }
.lock h1 { font: 800 1.5rem var(--f-sign); letter-spacing: 0.04em; }
.lock form { display: grid; gap: 12px; text-align: left; }
.lock .err { color: #ff9b9b; min-height: 1.4em; font-size: 0.92rem; text-align: center; }
.lock .hint { font: 0.82rem var(--f-mono); color: var(--muted); }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) { .shake { animation: none; } }

/* Form */
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.field input, .field textarea, .field select {
  font: 1rem var(--f-body); color: var(--ink); background: var(--night);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; min-width: 0;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--tennis); box-shadow: 0 0 0 3px #d4f04c33; }
.field textarea { resize: vertical; min-height: 96px; }
.field .count { justify-self: end; margin-top: -2px; font: 0.78rem var(--f-mono); color: var(--muted); }
.field .count.near, .field .count.full { color: var(--gold); }
.field .count.full { font-weight: 600; }
.log-form { display: grid; gap: 14px; }
.log-form .row3 { display: grid; gap: 12px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: 600 0.82rem var(--f-body); color: var(--muted); background: transparent; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px;
}
.chip:hover, .chip[aria-pressed="true"] { color: var(--night); background: var(--tennis); border-color: var(--tennis); }
/* Mood: three line-drawn faces as radio cards (no colour on the faces themselves) */
.mood { border: 0; margin: 0; padding: 0; min-width: 0; }
.mood legend { font-size: 0.85rem; font-weight: 700; color: var(--muted); padding: 0; margin-bottom: 8px; }
.mood legend .muted { font-weight: 400; }
.mood-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mood-opt { position: relative; }
.mood-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mood-opt label {
  display: grid; justify-items: center; gap: 4px; text-align: center; cursor: pointer; height: 100%;
  padding: 12px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--night);
  transition: border-color .15s, background .15s;
}
.mood-opt .face { width: 40px; height: 40px; color: var(--ink); stroke-width: 2.4; }
.mood-opt .name { font-weight: 700; font-size: 0.92rem; color: var(--ink); }
.mood-opt .range { font: 0.75rem var(--f-mono); color: var(--muted); }
.mood-opt label:hover { border-color: var(--tennis); }
.mood-opt input:checked + label { border-color: var(--tennis); background: color-mix(in srgb, var(--tennis) 14%, var(--night)); }
.mood-opt input:focus-visible + label { box-shadow: 0 0 0 3px #d4f04c55; }
@media (max-width: 420px) { .mood-opt .face { width: 36px; height: 36px; } .mood-opt .name { font-size: 0.82rem; } }
.sessions .face { width: 18px; height: 18px; vertical-align: -4px; margin-right: 6px; color: var(--ink); stroke-width: 3; }
.form-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.saved { color: var(--tennis); font-size: 0.92rem; }
.form-err { color: #ff9b9b; font-size: 0.92rem; }

/* Fun facts */
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.facts li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; }
.facts .ico { font-size: 1.5rem; line-height: 1.3; text-align: center; }
.facts b { color: var(--ink); }
.facts p { color: var(--muted); font-size: 0.95rem; line-height: 1.5; }

/* Charts */
.chart { position: relative; min-width: 0; }
.chart svg { display: block; width: 100%; overflow: visible; stroke: none; stroke-width: 0; }
.chart text { font: 12px var(--f-body); fill: var(--muted); }
.chart .val { fill: var(--ink); font-weight: 700; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .goal { stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .goal-label { fill: var(--gold); font-weight: 700; }
.chart [data-tip] { cursor: default; }
.chart .bar { fill: var(--tennis); transition: opacity .15s; }
.chart .bar.dim { fill: color-mix(in srgb, var(--tennis) 45%, var(--night-2)); }
.chart:hover .bar:not(:hover) { opacity: 0.7; }
.legend { display: flex; align-items: center; gap: 4px; font-size: 0.8rem; color: var(--muted); justify-content: end; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.tip {
  position: fixed; z-index: 50; pointer-events: none; max-width: 240px;
  background: var(--night-3); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 11px; font-size: 0.85rem; line-height: 1.45; color: var(--ink);
  box-shadow: 0 10px 30px -10px #000a;
}
.tip b { color: var(--tennis); }

/* Records + session list */
.records { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.records div { border-left: 3px solid var(--tennis); padding: 2px 0 2px 12px; }
.records dt { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.records dd { margin: 0; font: 700 1.1rem var(--f-display); }
.records dd span { display: block; font: 0.85rem var(--f-body); color: var(--muted); }
.sessions { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.sessions th { text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; padding: 0 10px 8px 0; border-bottom: 1px solid var(--line); }
.sessions td { padding: 10px 10px 10px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); vertical-align: top; }
.sessions td.num { font-family: var(--f-mono); white-space: nowrap; }
.sessions .cmt { display: block; color: var(--muted); font-size: 0.86rem; font-style: italic; overflow-wrap: anywhere; }
/* All-time practices: month picker beside the heading, summary line under it */
.all-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; }
.all-month { width: auto; min-width: 200px; }
.all-sum { color: var(--muted); font-size: 0.92rem; margin-top: -4px; }
.all-sum b { color: var(--ink); }
.sessions tr.month-row td { padding-top: 18px; font: 700 0.8rem var(--f-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--tennis); border-bottom: 1px solid var(--line); }
/* No room for five nav items on a phone; All time sits right under Sessions anyway */
@media (max-width: 480px) { .nav a[href="#all-card"] { display: none; } }
.all-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.all-pager span { font-size: 0.82rem; color: var(--muted); text-align: center; flex: 1; }
.all-pager button:disabled { opacity: 0.35; cursor: default; pointer-events: none; }
@media (max-width: 600px) { .sessions tr.month-row { display: block; } .all-month { width: 100%; } }
.del { background: none; border: 1px solid transparent; color: var(--muted); cursor: pointer; border-radius: 8px; padding: 4px 8px; font: 0.82rem var(--f-body); }
.del:hover { color: #ff9b9b; border-color: #ff9b9b66; }
@media (max-width: 600px) {
  .sessions thead { display: none; }
  .sessions tr { display: grid; grid-template-columns: 1fr auto; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .sessions td { border: 0; padding: 2px 0; }
  .sessions td:nth-child(3) { grid-column: 1 / -1; }
  .log-form .row3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .log-form .row3 .field:first-child { grid-column: 1 / -1; }
}

/* Calendar levels: tennis colour mixed into the night, 4 steps */
.l0 { fill: var(--night-3); } .chart .l1, .legend .l1 { fill: color-mix(in srgb, var(--tennis) 28%, var(--night-3)); background: color-mix(in srgb, var(--tennis) 28%, var(--night-3)); }
.chart .l2, .legend .l2 { fill: color-mix(in srgb, var(--tennis) 52%, var(--night-3)); background: color-mix(in srgb, var(--tennis) 52%, var(--night-3)); }
.chart .l3, .legend .l3 { fill: color-mix(in srgb, var(--tennis) 76%, var(--night-3)); background: color-mix(in srgb, var(--tennis) 76%, var(--night-3)); }
.chart .l4, .legend .l4 { fill: var(--tennis); background: var(--tennis); }
#ch-cal rect[data-tip]:hover { stroke: var(--ink); stroke-width: 1.5; }
.btn[disabled] { opacity: 0.6; cursor: progress; transform: none; }
.empty { color: var(--muted); }
.pl-stack { display: grid; gap: 20px; }
.goal-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.goal-form .field { width: auto; min-width: 140px; }
.saved:empty, .form-err:empty { display: none; }
