@import url("https://fonts.googleapis.com/css2?family=Rubik+Mono+One&family=Caveat:wght@600;700&family=Neucha&display=swap");

/* «Дудл на поле» — токены. Значения газона, мела, чернил, бумаги и солнца — из demo/index.html. */
:root {
  --fd-pitch: #1F6A42;
  --fd-pitch-2: #1C6340;
  --fd-chalk: #F4F7EC;
  --fd-chalk-soft: rgba(244, 247, 236, 0.4);
  --fd-ink: #1C2A22;
  --fd-ink-soft: #5B6B62;
  --fd-paper: #FBF8EE;
  --fd-white: #FFFFFF;
  --fd-sticker: #F7D23E;
  --fd-sun: #F4A63A;
  --fd-ok: #3FBF7A;

  --fd-font-display: "Rubik Mono One", "Arial Black", sans-serif;
  --fd-font-body: "Neucha", "Comic Sans MS", cursive;
  --fd-font-hand: "Caveat", "Comic Sans MS", cursive;

  --fd-line: 2.5px;
  --fd-shadow: 5px 5px 0 var(--fd-ink);
  --fd-shadow-sm: 3px 3px 0 var(--fd-ink);
  --fd-gap: 16px;
  --fd-tap: 44px;
}

.fd-root, .fd-root * { box-sizing: border-box; }
.fd-root { font-family: var(--fd-font-body); color: var(--fd-ink); }
.fd-root a { color: var(--fd-sticker); }
.fd-root :focus-visible { outline: 3px solid var(--fd-sun); outline-offset: 2px; }

/* Pitch — экран-газон */
.fd-pitch {
  position: relative; overflow: hidden; min-height: 100%;
  background: repeating-linear-gradient(180deg, var(--fd-pitch) 0 72px, var(--fd-pitch-2) 72px 144px);
  color: var(--fd-chalk); font-family: var(--fd-font-body);
  padding: 20px 18px 24px; display: flex; flex-direction: column; gap: var(--fd-gap);
}
.fd-pitch::before {
  content: ""; position: absolute; inset: -10px 14px; pointer-events: none;
  border-left: 2.5px solid rgba(244, 247, 236, 0.35); border-right: 2.5px solid rgba(244, 247, 236, 0.35);
}
.fd-pitch > * { position: relative; }
/* Вложенный газон (экран внутри обёртки-газона) не рисует вторые боковые линии. */
.fd-pitch .fd-pitch::before { display: none; }
.fd-pitch .fd-pitch { min-height: 0; }

/* Title */
.fd-title { display: flex; flex-direction: column; gap: 8px; }
.fd-title__text {
  margin: 0; font-family: var(--fd-font-display); font-weight: 400; font-size: 28px; line-height: 1.1;
  color: var(--fd-chalk); -webkit-text-stroke: 1.5px var(--fd-ink); text-shadow: 3px 3px 0 var(--fd-ink);
}
.fd-title--lg .fd-title__text { font-size: 34px; }
.fd-title__sub { margin: 0; font-size: 19px; color: var(--fd-chalk); }
.fd-title--on-paper .fd-title__sub { color: var(--fd-ink); }

/* Paper */
.fd-paper {
  position: relative; background: var(--fd-paper); color: var(--fd-ink);
  border: var(--fd-line) solid var(--fd-ink); box-shadow: var(--fd-shadow);
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.fd-paper--rings { padding-top: 26px; }
.fd-paper--tilt { transform: rotate(-1deg); }
.fd-paper__rings { position: absolute; top: -10px; left: 16px; right: 16px; display: flex; justify-content: space-between; }
.fd-paper__ring { width: 8px; height: 18px; border-radius: 4px; background: var(--fd-ink); }

/* Sticker */
.fd-sticker {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  border: var(--fd-line) solid var(--fd-ink); box-shadow: var(--fd-shadow-sm);
  padding: 4px 12px; font-family: var(--fd-font-body); font-size: 16px; color: var(--fd-ink);
  transform: rotate(var(--fd-tilt, -2deg));
}
.fd-sticker--sticker { background: var(--fd-sticker); }
.fd-sticker--sun { background: var(--fd-sun); }
.fd-sticker--paper { background: var(--fd-paper); }
.fd-sticker--ink { background: var(--fd-ink); color: var(--fd-sticker); box-shadow: none; }
.fd-sticker__hand { font-family: var(--fd-font-hand); font-weight: 700; font-size: 26px; line-height: 1.05; }

/* Button */
.fd-button {
  appearance: none; border: 0; cursor: pointer; min-height: 60px; padding: 0 18px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--fd-font-display); font-size: 18px; color: var(--fd-ink);
}
.fd-button--cta {
  background: var(--fd-sticker); border: var(--fd-line) solid var(--fd-ink); box-shadow: 4px 4px 0 var(--fd-ink);
  transform: rotate(-1deg); flex-grow: 1;
}
.fd-button--cta:active { transform: rotate(-1deg) translate(3px, 3px); box-shadow: 1px 1px 0 var(--fd-ink); }
.fd-button--ghost {
  background: transparent; color: var(--fd-chalk); font-family: var(--fd-font-body); font-size: 20px;
  text-decoration: underline; text-decoration-style: wavy; text-underline-offset: 6px;
}
.fd-button--on-paper.fd-button--ghost { color: var(--fd-ink); }
.fd-button:disabled { cursor: not-allowed; }
.fd-button--ghost:disabled { opacity: 0.45; }
.fd-button--cta:disabled, .fd-button--cta:disabled:active {
  background: #D5D9C8; color: var(--fd-ink-soft); border-color: var(--fd-ink-soft);
  box-shadow: 4px 4px 0 rgba(28, 42, 34, 0.35); transform: rotate(-1deg);
}
.fd-actions { display: flex; gap: 12px; align-items: center; margin-top: auto; }

/* IconButton */
.fd-icon-button {
  appearance: none; cursor: pointer; width: var(--fd-tap); height: var(--fd-tap); flex-shrink: 0;
  border: var(--fd-line) solid var(--fd-ink); border-radius: 50%; background: var(--fd-paper);
  display: inline-flex; align-items: center; justify-content: center; color: var(--fd-ink); padding: 0;
}

/* ProgressDots */
.fd-dots { display: flex; gap: 6px; align-items: center; }
.fd-dots__dot { width: 10px; height: 10px; border: 2px solid var(--fd-ink); border-radius: 5px; background: var(--fd-chalk-soft); }
.fd-dots__dot--done { background: var(--fd-chalk); }
.fd-dots__dot--on { width: 26px; background: var(--fd-sticker); }
.fd-header { display: flex; align-items: center; gap: 14px; }

/* Mood */
.fd-mood { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.fd-mood__faces { display: flex; justify-content: space-between; align-self: stretch; gap: 4px; }
.fd-mood__face {
  appearance: none; cursor: pointer; padding: 0; width: 60px; height: 60px; border-radius: 50%;
  border: var(--fd-line) solid var(--fd-ink); background: var(--fd-white);
  display: inline-flex; align-items: center; justify-content: center;
}
.fd-mood__face--on { background: var(--fd-sticker); transform: translateY(-6px) rotate(-6deg); box-shadow: var(--fd-shadow-sm); }
.fd-mood__face svg { width: 44px; height: 44px; }
.fd-mood__name { min-height: 40px; font-family: var(--fd-font-hand); font-weight: 700; font-size: 38px; line-height: 1; }
.fd-mood__name:not(:empty) { background: linear-gradient(transparent 55%, var(--fd-sticker) 55%); padding: 0 8px; }

/* Battery */
.fd-battery { display: flex; flex-direction: column; gap: 10px; }
.fd-battery__head { display: flex; justify-content: space-between; align-items: baseline; font-size: 20px; }
.fd-battery__value { font-family: var(--fd-font-display); font-size: 20px; }
.fd-battery__body { display: flex; align-items: center; }
.fd-battery__cells { flex-grow: 1; border: 3px solid var(--fd-ink); padding: 5px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.fd-battery__cell { appearance: none; cursor: pointer; height: var(--fd-tap); padding: 0; border: 2px solid var(--fd-ink); background: var(--fd-white); }
.fd-battery__cell--on { background: var(--fd-ok); }
.fd-battery__cell--low { background: var(--fd-sun); }
.fd-battery__tip { width: 8px; height: 22px; background: var(--fd-ink); }
.fd-battery--mini .fd-battery__cells { border-width: 0; padding: 0; gap: 3px; grid-template-columns: repeat(5, 16px); }
.fd-battery--mini .fd-battery__cell { height: 12px; border-width: 1.5px; cursor: default; }
.fd-battery--mini .fd-battery__tip { display: none; }
.fd-battery--mini { flex-direction: row; align-items: center; gap: 8px; font-size: 15px; }
.fd-battery--mini .fd-battery__head { font-size: 15px; min-width: 74px; }
.fd-battery--mini .fd-battery__value { display: none; }

/* Stepper */
.fd-stepper { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.fd-stepper__label { font-size: 18px; }
.fd-stepper__value { font-family: var(--fd-font-display); font-size: 72px; line-height: 1; }
.fd-stepper__controls { display: flex; gap: 10px; }
.fd-step {
  appearance: none; cursor: pointer; padding: 0; width: 52px; height: 52px;
  border: var(--fd-line) solid var(--fd-ink); background: var(--fd-white); color: var(--fd-ink);
  display: inline-flex; align-items: center; justify-content: center;
}
.fd-step--plus { background: var(--fd-sticker); }
.fd-score { display: flex; align-items: center; justify-content: space-between; }
.fd-score__colon { font-family: var(--fd-font-display); font-size: 48px; padding-bottom: 50px; }

/* Counter */
.fd-counter { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 0; }
.fd-counter + .fd-counter { border-top: 2px dashed var(--fd-ink); }
.fd-counter__name { font-size: 21px; }
.fd-counter__hint { font-size: 15px; color: var(--fd-ink-soft); }
.fd-counter__controls { display: flex; align-items: center; gap: 6px; }
.fd-counter .fd-step { width: var(--fd-tap); height: var(--fd-tap); }
.fd-counter__value { width: 40px; text-align: center; font-family: var(--fd-font-display); font-size: 26px; }
.fd-counter__value--none { font-family: var(--fd-font-body); color: #9AA79F; }

/* Chips */
.fd-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.fd-chips--grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fd-chip {
  appearance: none; cursor: pointer; min-height: var(--fd-tap); padding: 8px 14px; text-align: left;
  border: var(--fd-line) solid var(--fd-ink); background: var(--fd-paper); color: var(--fd-ink);
  font-family: var(--fd-font-body); font-size: 18px; line-height: 1.15;
}
.fd-chip--on { background: var(--fd-sticker); box-shadow: var(--fd-shadow-sm); transform: rotate(-1.5deg); }

/* TextField */
.fd-field { display: flex; flex-direction: column; gap: 6px; }
.fd-field__label { font-size: 18px; color: var(--fd-chalk); }
.fd-field--on-paper .fd-field__label { color: var(--fd-ink); }
.fd-field__input {
  width: 100%; min-height: 56px; padding: 0 14px; border: var(--fd-line) solid var(--fd-ink); border-radius: 0;
  background: var(--fd-paper); color: var(--fd-ink); font-family: var(--fd-font-hand); font-weight: 700; font-size: 28px;
}
.fd-field__input::placeholder { color: #9AA79F; font-weight: 600; }
textarea.fd-field__input { min-height: 120px; padding: 10px 14px; line-height: 1.2; resize: vertical; }

/* MatchCard */
.fd-card__meta { display: flex; justify-content: space-between; font-size: 16px; color: var(--fd-ink-soft); }
.fd-card__score { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.fd-card__nums { font-family: var(--fd-font-display); font-size: 52px; line-height: 1; }
.fd-card--small .fd-card__nums { font-size: 36px; }
.fd-card__opp { font-family: var(--fd-font-hand); font-weight: 700; font-size: 30px; }
.fd-card--small .fd-card__opp { font-size: 26px; }
.fd-card__state { display: flex; align-items: center; gap: 12px; border-top: 2px dashed var(--fd-ink); border-bottom: 2px dashed var(--fd-ink); padding: 10px 0; }
.fd-card__face { width: 52px; height: 52px; border-radius: 50%; border: var(--fd-line) solid var(--fd-ink); background: var(--fd-sticker); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fd-card__face svg { width: 40px; height: 40px; }
.fd-card__mood { font-size: 20px; }
.fd-card__events { display: flex; flex-wrap: wrap; gap: 6px; }
.fd-card__event { border: 2px solid var(--fd-ink); padding: 2px 8px; font-size: 16px; }
.fd-card__label { font-size: 15px; color: var(--fd-ink-soft); }
.fd-card__moment { font-family: var(--fd-font-hand); font-weight: 700; font-size: 30px; line-height: 1.05; }
.fd-card__moment span { background: linear-gradient(transparent 55%, var(--fd-sticker) 55%); padding: 0 4px; }
.fd-card__mission { background: var(--fd-ink); color: var(--fd-chalk); padding: 8px 12px; font-size: 19px; display: flex; flex-direction: column; }
.fd-card__mission small { color: var(--fd-sticker); font-size: 16px; }
.fd-card__badge { position: absolute; bottom: -12px; right: -8px; --fd-tilt: 6deg; box-shadow: none; padding: 2px 10px; font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  .fd-mood__face--on, .fd-chip--on, .fd-button--cta, .fd-paper--tilt, .fd-sticker { transform: none; }
}
