/* «Борзой» (the user's design system): always light, Unbounded 900 lowercase for
   headlines only, Comfortaa for text, small text in ink. */
:root {
  --pink: #fc80be;
  --pink-light: #fd92be;
  --mint: #56f3d1;
  --mint-light: #7df2d1;
  --mint-pale: #a5fbe4;
  --cream: #fef8d6;
  --ink: #272727;
  --line: #000;
  --font-display: "Unbounded", system-ui, sans-serif;
  --font-text: "Comfortaa", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

body {
  /* Bottom room for the fixed tab bar (≈58px) under the last row. */
  padding: 16px 16px calc(84px + env(safe-area-inset-bottom));
  min-height: 100vh;
}

[hidden] { display: none !important; }

.top { margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top-text { min-width: 0; }
.title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 30px;
  line-height: 1;
  text-transform: lowercase;
  color: var(--pink);
}
.mascot {
  flex: none;
  width: 64px;
  height: 64px;
  border: 2px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 3px 0 var(--line);
}
.day { margin: 8px 0 0; font-size: 15px; }

.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--pink-light);
  font-size: 14px;
}

button {
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  background: var(--cream);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
}

.me-line, .no-points {
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--mint-light);
  font-weight: 700;
}
.no-points { background: var(--mint-pale); }

.table {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.row {
  display: grid;
  grid-template-columns: 30px 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid rgba(0, 0, 0, .12);
}
.row:first-child { border-top: 0; }
.row.me { background: var(--mint-pale); cursor: pointer; }
.row.me .name::after { content: " · моя карточка ›"; font-weight: 400; font-size: 12px; }

.place { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--pink);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-weight: 700;
  font-size: 14px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.who { min-width: 0; }
.name {
  display: block;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.marks { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 3px; font-size: 14px; }
.step {
  display: inline-block;
  padding: 1px 7px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--mint);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.points {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.stub { text-align: center; padding-top: 12px; }
.stub-picture { width: 100%; max-width: 420px; border: 2px solid var(--line); border-radius: 18px; display: block; margin: 0 auto 18px; }
.stub-text { margin: 0 0 16px; font-size: 16px; font-weight: 700; }

.sheet {
  position: fixed;
  inset: 0;
  background: rgba(39, 39, 39, .45);
  display: flex;
  align-items: flex-end;
  z-index: 10;
}
.sheet-body {
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--cream);
  border-top: 2px solid var(--line);
  border-radius: 22px 22px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
}
.card-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  text-transform: lowercase;
  color: var(--pink);
}
.card { margin: 0 0 16px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 14px; }
.card dt { font-size: 13px; }
.card dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.days { display: flex; gap: 3px; flex-wrap: wrap; }
.dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; }
.dot.done { background: var(--mint); }
.dot.pending { background: var(--cream); background-image: radial-gradient(var(--ink) 25%, transparent 30%); }
.dot.missed { background: var(--pink); }
.sheet-close { width: 100%; }

/* Tabs: «Рейтинг» · «Моя точка А» · «Правила» — a bar fixed at the bottom,
   within thumb reach and always visible (user 05.11). The card sheet (z 10)
   still covers it. */
.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 6px;
  margin: 0;
  padding: 8px max(12px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-right));
  border-top: 2px solid var(--line);
  background: var(--cream);
}
.tab {
  border: 0;
  border-radius: 999px;
  padding: 10px 4px;
  font-size: 14px;
  background: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tab[aria-selected="true"] { background: var(--pink); box-shadow: inset 0 0 0 2px var(--line); }

.pane-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  text-transform: lowercase;
  color: var(--pink);
}
.pane-text {
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--mint-pale);
  font-weight: 700;
}

.pa-form, .pa-locked, .rules {
  padding: 16px 14px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; margin-bottom: 6px; font-size: 13px; }
.field-input {
  width: 100%;
  font: inherit;
  font-size: 16px; /* below 16px iOS zooms the page on focus */
  font-weight: 700;
  color: var(--ink);
  background: var(--cream);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.field-input:focus { outline: none; background: var(--mint-pale); }
.pa-status { margin: 0 0 12px; font-weight: 700; color: #b0005a; }
.pa-status.ok { color: var(--ink); }
.pa-save { width: 100%; background: var(--mint); box-shadow: 0 3px 0 var(--line); }
.pa-save:disabled { opacity: .6; }
.pa-locked { margin: 0; }

.rules { white-space: pre-line; line-height: 1.5; overflow-wrap: anywhere; }
