/* === PLAYFUL MAXIMALIST OVERLAY (overlay поверх style.css) === */

:root {
  --bg:              #FFF8F0;
  --surface:         #FFFFFF;
  --surface-soft:    #FFE4B5;
  --text-primary:    #2D1B0E;
  --text-secondary:  #6B4A2E;
  --accent-1:        #FF6B6B;
  --accent-3:        #FFE66D;
  --accent-4:        #A78BFA;

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-full: 999px;

  --font-sans:  'Manrope', -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  --font-display: 'Unbounded', 'Manrope', sans-serif;
  --font-accent: 'Source Serif 4', 'Iowan Old Style', serif;
}

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Unbounded:wght@400;600;800;900&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;1,8..60,400&display=swap');

/* === БАЗА === */
html, body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 8% 12%, rgba(167, 139, 250, 0.08) 0, transparent 28%),
    radial-gradient(circle at 92% 80%, rgba(255, 230, 109, 0.14) 0, transparent 32%),
    radial-gradient(circle at 30% 70%, rgba(78, 205, 196, 0.08) 0, transparent 30%);
  background-attachment: fixed;
}
#app { padding: 14px 14px 80px; }

/* === HEADER (3 колонки: ☰ слева | Лента дня 2 строки центр + NEW · ЛЕТO штамп | 📊 справа) === */
header {
  text-align: left;
  padding: 10px 4px 16px;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
header h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 32px;
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin: 0;
  flex: 1;
  position: relative;
}
header h1 .h-text {
  color: var(--accent-1);
  text-transform: uppercase;
  font-size: 36px;
  line-height: 0.95;
  font-weight: 900;
}
header h1 .h-stamp {
  position: absolute;
  top: -8px;
  right: -6px;
  background: var(--accent-3);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  border: 2px solid var(--text-primary);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--text-primary);
  transform: rotate(8deg);
  white-space: nowrap;
}

/* Кнопка-иконка слева (☰ меню) и справа (📊) — единый стиль */
.header-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: var(--surface);
  border: 2px solid var(--text-primary);
  border-radius: 50%;
  box-shadow: 4px 4px 0 var(--text-primary);
  display: grid;
  place-items: center;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  margin-top: 4px;
}
.header-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--text-primary);
}

.stats-icon {
  position: static;
  width: 44px;
  height: 44px;
  background: var(--surface);
  border: 2px solid var(--text-primary);
  border-radius: 50%;
  box-shadow: 4px 4px 0 var(--text-primary);
  display: grid; place-items: center;
  font-size: 20px;
  backdrop-filter: none;
  flex-shrink: 0;
  margin-top: 4px;
  padding: 0;
  cursor: pointer;
}
.stats-icon:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--text-primary);
}

/* === CARD === */
.card {
  background: var(--surface);
  border: 2px solid var(--text-primary);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 5px 5px 0 var(--text-primary);
  margin-bottom: 18px;
}
.card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin-bottom: 10px;
  color: var(--text-primary);
}

/* === INPUTS === */
textarea, input[type="text"], input[type="number"] {
  background: var(--surface);
  border: 2px dashed var(--text-primary);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 16px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}
textarea:focus, input:focus {
  border-style: solid;
  border-color: var(--accent-1);
}
.meta-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 8px 0 10px;
}

/* === EMOTIONS === */
.emotion-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.emotion-grid button {
  background: var(--surface-soft);
  border: 2px solid var(--text-primary);
  border-radius: var(--radius-md);
  font-size: 26px;
  padding: 8px 0;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--text-primary);
  transition: transform 0.08s, box-shadow 0.08s;
  aspect-ratio: 1;
}
.emotion-grid button.selected {
  background: var(--accent-3);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--text-primary);
}
.emotion-grid button:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--text-primary);
}

/* === INPUT BUTTONS (3 в ряд) === */
.input-buttons-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.input-buttons-3 .btn-emoji {
  background: var(--accent-4);
  border: 2px solid var(--text-primary);
  border-radius: var(--radius-md);
  padding: 12px 4px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  min-height: 56px;
  box-shadow: 4px 4px 0 var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.input-buttons-3 .btn-emoji:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--text-primary);
}

/* === BUTTONS === */
.btn-primary {
  background: var(--accent-1);
  color: #fff;
  border: 2px solid var(--text-primary);
  border-radius: var(--radius-full);
  padding: 16px 22px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 5px 5px 0 var(--text-primary);
  transition: transform 0.08s, box-shadow 0.08s;
  width: 100%;
  text-align: center;
}
.btn-primary:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--text-primary);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--surface-soft);
  color: var(--text-primary);
  border: 2px solid var(--text-primary);
  border-radius: var(--radius-full);
  padding: 10px 18px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--text-primary);
}

/* === KBJU === */
.kbju-section-head h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0;
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: var(--text-primary);
  color: var(--text-primary);
}
.kbju-kcal {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--accent-1);
}
.kbju-macros div span {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
}
.kbju-empty {
  background: var(--surface-soft);
  border: 2px dashed var(--text-primary);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
}
.kbju-empty-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.kbju-photo img {
  border-radius: var(--radius-md);
  border: 2px solid var(--text-primary);
}
.kbju-result {
  background: var(--surface-soft);
  border: 2px solid var(--text-primary);
  border-radius: var(--radius-md);
  padding: 12px;
}

/* Вес порции в превью (черновик) */
.kbju-grams-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 6px;
  flex-wrap: wrap;
}
.kbju-grams-row label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}
.kbju-grams-row input[type="number"] {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  background: var(--surface);
  border: 2px solid var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  width: 80px;
  text-align: right;
  font-style: normal;
}
.kbju-grams-unit {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.kbju-grams-hint {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 11px;
  color: var(--text-secondary);
  margin-left: auto;
}

/* === СПИСОК БЛЮД (несколько расчётов) === */
.kbju-list-wrap {
  margin-top: 12px;
}
.kbju-list-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 10px 4px 8px;
}
.kbju-list-head h4 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0;
  color: var(--text-primary);
  letter-spacing: 0.04em;
}
.kbju-totals {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}
.kbju-totals b {
  font-family: var(--font-display);
  color: var(--accent-1);
  font-weight: 800;
  font-size: 15px;
}
.kbju-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.kbju-item-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 2px solid var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  box-shadow: 2px 2px 0 var(--text-primary);
}
.kbju-item-emoji {
  font-size: 20px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  border: 1.5px solid var(--text-primary);
  border-radius: 8px;
  flex-shrink: 0;
}
.kbju-item-body { flex: 1; min-width: 0; }
.kbju-item-name {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kbju-item-kbju {
  display: flex;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 2px;
}
.kbju-item-kbju b {
  font-family: var(--font-display);
  color: var(--accent-1);
  font-weight: 800;
  font-size: 12px;
}
.kbju-item-grams {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}
.kbju-item-grams input[type="number"] {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  background: var(--surface-soft);
  border: 1.5px solid var(--text-primary);
  border-radius: 6px;
  padding: 2px 6px;
  width: 64px;
  text-align: right;
  font-style: normal;
}
.kbju-item-del {
  background: var(--surface-soft);
  color: var(--text-primary);
  border: 2px solid var(--text-primary);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--text-primary);
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}
.kbju-item-del:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--text-primary);
}
.kbju-actions {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 6px;
  align-items: stretch;
}
.kbju-actions .btn-secondary {
  padding: 10px 12px;
  font-size: 13px;
  margin: 0;
}
.kbju-actions .btn-primary {
  padding: 12px 14px;
  font-size: 14px;
}

/* === TODAY LIST === */
#today-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.li-swipe {
  background: var(--surface);
  border: 2px solid var(--text-primary);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: 3px 3px 0 var(--text-primary);
  position: relative;
  overflow: hidden;
}
.li-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* === OBSERVERS / WEIGHT / WORKOUT === */
.observers-head h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0;
  background: none;
  -webkit-text-fill-color: var(--text-primary);
  color: var(--text-primary);
}
.observers-hint {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.invite-code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--surface-soft);
  border: 2px solid var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 12px;
  word-break: break-all;
  margin: 8px 0;
}
.btn-toggle-block {
  background: var(--surface-soft);
  border: 2px solid var(--text-primary);
  border-radius: 50%;
  width: 32px; height: 32px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  color: var(--text-primary);
}

/* === MOTIVATION === */
.motivation {
  background: var(--surface);
  text-align: center;
}
.motivation-text {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 17px;
  line-height: 1.45;
  color: var(--text-primary);
  margin-bottom: 12px;
}

/* === BOTTOM NAV (Лента / + / Календарь / Меню) === */
.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  width: calc(100% - 24px);
  max-width: 456px;
  background: var(--surface);
  border: 2px solid var(--text-primary);
  border-radius: 22px;
  box-shadow: 5px 5px 0 var(--text-primary);
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr 1fr;
  padding: 8px 6px;
  gap: 2px;
  z-index: 50;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: 14px;
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}
.nav-item .ico { font-size: 22px; line-height: 1; }
.nav-item.active { background: var(--accent-3); color: var(--text-primary); }
.nav-item.fab {
  background: var(--accent-1);
  color: #fff;
  border: 2px solid var(--text-primary);
  border-radius: 18px;
  box-shadow: 3px 3px 0 var(--text-primary);
  margin-top: -14px;
  padding-top: 10px;
  font-weight: 800;
}
.nav-item.fab .ico { font-size: 26px; }
body { padding-bottom: 100px; }  /* место под fixed-nav */

/* === МЕНЮ-ОВЕРЛЕЙ === */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 27, 14, 0.4);
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.menu-overlay.open { display: flex; }
.menu-sheet {
  background: var(--surface);
  border: 2px solid var(--text-primary);
  border-radius: 28px 28px 0 0;
  border-bottom: none;
  box-shadow: 0 -6px 0 var(--text-primary);
  width: 100%;
  max-width: 456px;
  padding: 12px 14px 100px;
  max-height: 75vh;
  overflow-y: auto;
  animation: slideUp 0.2s ease-out;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.menu-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 6px 12px;
  border-bottom: 1.5px dashed var(--text-primary);
  margin-bottom: 8px;
}
.menu-sheet-head h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0;
}
.menu-sheet-head .close {
  background: var(--accent-1);
  color: #fff;
  border: 2px solid var(--text-primary);
  border-radius: 50%;
  width: 36px; height: 36px;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 3px 3px 0 var(--text-primary);
  cursor: pointer;
}
.menu-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 12px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}
.menu-row:hover, .menu-row:active { background: var(--surface-soft); }
.menu-row .ico {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 12px;
  font-size: 20px;
  background: var(--surface-soft);
  border: 1.5px solid var(--text-primary);
}
.menu-row .meta { margin-left: auto; font-size: 12px; color: var(--text-secondary); font-weight: 500; }

/* === MODAL === */
.modal-content {
  background: var(--surface);
  border: 2px solid var(--text-primary);
  border-radius: var(--radius-lg);
  box-shadow: 6px 6px 0 var(--text-primary);
  padding: 22px;
}
.modal-content h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  text-transform: uppercase;
}
.modal-overlay {
  background: rgba(45, 27, 14, 0.4);
}
.modal-close {
  background: var(--accent-1);
  color: #fff;
  border: 2px solid var(--text-primary);
  border-radius: 50%;
  width: 36px; height: 36px;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 3px 3px 0 var(--text-primary);
}
.calendar-weekday {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
}
.cal-day {
  background: var(--surface);
  border: 1.5px solid var(--text-primary);
  border-radius: 12px;
}
.cal-day-count {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-1);
}

/* === ВЕС: объёмы (грудь/талия/бёдра) — overlay поверх style.css === */
.weight-measures {
  margin-top: 10px;
}
.weight-measures-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.weight-measures-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}
.weight-measure {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.weight-measure input[type="number"] {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  background: var(--surface);
  border: 2px dashed var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  text-align: right;
  font-style: normal;
  width: 100%;
}
.weight-measure input:focus {
  border-style: solid;
  border-color: var(--accent-1);
}
.weight-measure label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  text-transform: lowercase;
  color: var(--text-secondary);
  text-align: center;
  letter-spacing: 0.02em;
}
.weight-current-measures {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
  font-weight: 600;
}
.weight-current-measures b {
  color: var(--accent-1);
  font-family: var(--font-display);
  font-weight: 800;
}
.weight-current-measures span {
  margin: 0 4px;
}
.weight-last-ms {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-left: 6px;
  letter-spacing: 0.02em;
}

/* === РЕАКЦИИ НАБЛЮДАТЕЛЕЙ (❤️ Мама в 14:32) — видно в ленте дня === */
.li-reactions {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--accent-1);
  font-weight: 700;
  margin-top: 4px;
  line-height: 1.4;
}
.li-reactions span + span {
  margin-left: 0;
}
