@font-face {
  font-family: "Andika";
  src: url("../fonts/andika-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Andika";
  src: url("../fonts/andika-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/atkinson-hyperlegible-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/atkinson-hyperlegible-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Lexend";
  src: url("../fonts/lexend-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Lexend";
  src: url("../fonts/lexend-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Fredoka";
  src: url("../fonts/fredoka-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Fredoka";
  src: url("../fonts/fredoka-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #302a43;
  --ink-soft: #615977;
  --surface: #fffdfa;
  --surface-soft: #f7f2ff;
  --page: #f7f5ff;
  --lavender: #b8a1f7;
  --lavender-dark: #7357bf;
  --rose: #f3afc5;
  --rose-dark: #a94a6c;
  --sky: #8ccfe8;
  --mint: #8fd8c2;
  --sun: #ffd56c;
  --peach: #f2b58f;
  --white: #ffffff;
  --line: #ded7eb;
  --shadow-color: 48 42 67;
  --shadow-sm: 0 4px 0 rgb(var(--shadow-color) / 0.09), 0 8px 22px rgb(var(--shadow-color) / 0.08);
  --shadow-lg: 0 8px 0 rgb(var(--shadow-color) / 0.08), 0 22px 48px rgb(var(--shadow-color) / 0.12);
  --radius-sm: 18px;
  --radius-md: 28px;
  --radius-lg: 40px;
  --touch-min: 64px;
  --key-size: 80px;
  --card-0: #fff0f4;
  --card-1: #fff5d8;
  --card-2: #e8f7eb;
  --card-3: #e7f5ff;
  --card-4: #eeebff;
  --card-5: #f8eaff;
  --font-andika: "Andika", sans-serif;
  --font-atkinson: "Atkinson Hyperlegible", sans-serif;
  --font-lexend: "Lexend", sans-serif;
  --font-nunito: "Nunito", sans-serif;
  --font-fredoka: "Fredoka", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-lexend);
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 7%, rgb(255 255 255 / 0.95) 0 9%, transparent 27%),
    radial-gradient(circle at 88% 12%, rgb(255 233 244 / 0.75) 0 8%, transparent 24%),
    linear-gradient(145deg, #f7fbff 0%, #faf6ff 52%, #fff8f2 100%);
  color: var(--ink);
}

button {
  color: inherit;
  font: inherit;
}

.big-button {
  min-height: var(--touch-min);
  padding: 16px 30px 18px;
  border: 3px solid #5f489e;
  border-radius: 999px;
  background: linear-gradient(180deg, #c9b8ff 0%, var(--lavender) 100%);
  box-shadow: 0 6px 0 #624c9f, 0 13px 28px rgb(89 65 138 / 0.2);
  color: #2f2546;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
  touch-action: manipulation;
}

.big-button:hover {
  filter: brightness(1.025) saturate(1.04);
  transform: translateY(-2px);
}

.big-button:active,
.big-button[aria-pressed="true"] {
  box-shadow: 0 2px 0 #624c9f, 0 6px 16px rgb(89 65 138 / 0.16);
  transform: translateY(4px);
}

.big-button--secondary {
  border-color: #a7637e;
  background: linear-gradient(180deg, #ffd3df 0%, var(--rose) 100%);
  box-shadow: 0 6px 0 #a7637e, 0 13px 28px rgb(141 71 99 / 0.15);
}

.big-button--sun {
  border-color: #a87124;
  background: linear-gradient(180deg, #ffe89a 0%, var(--sun) 100%);
  box-shadow: 0 6px 0 #a87124, 0 13px 28px rgb(130 89 30 / 0.15);
}

.task-card {
  position: relative;
  display: grid;
  min-height: 230px;
  place-items: center;
  overflow: hidden;
  padding: 34px;
  border: 3px solid rgb(48 42 67 / 0.14);
  border-radius: var(--radius-lg);
  background: var(--card-0);
  box-shadow: var(--shadow-lg);
  color: var(--ink);
  font-size: clamp(56px, 9vw, 84px);
  font-weight: 700;
  line-height: 1;
}

.task-card::before,
.task-card::after {
  position: absolute;
  color: rgb(48 42 67 / 0.1);
  content: "✦";
  font-size: 34px;
}

.task-card::before {
  left: 24px;
  top: 18px;
}

.task-card::after {
  bottom: 18px;
  right: 24px;
}

.task-card[data-color="0"] { background: var(--card-0); }
.task-card[data-color="1"] { background: var(--card-1); }
.task-card[data-color="2"] { background: var(--card-2); }
.task-card[data-color="3"] { background: var(--card-3); }
.task-card[data-color="4"] { background: var(--card-4); }
.task-card[data-color="5"] { background: var(--card-5); }
.font-andika { font-family: var(--font-andika); }
.font-atkinson { font-family: var(--font-atkinson); }
.font-lexend { font-family: var(--font-lexend); }
.font-nunito { font-family: var(--font-nunito); }
.font-fredoka { font-family: var(--font-fredoka); }

.speech-bubble {
  position: relative;
  max-width: 420px;
  padding: 20px 26px;
  border: 3px solid var(--ink);
  border-radius: 30px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
}

.speech-bubble::before,
.speech-bubble::after {
  position: absolute;
  left: 52px;
  border-style: solid;
  content: "";
}

.speech-bubble::before {
  bottom: -23px;
  border-width: 22px 18px 0 0;
  border-color: var(--ink) transparent transparent transparent;
}

.speech-bubble::after {
  bottom: -16px;
  left: 55px;
  border-width: 17px 14px 0 0;
  border-color: var(--white) transparent transparent transparent;
}

.numeric-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(var(--key-size), 1fr));
  gap: 12px;
  width: min(100%, 420px);
}

.keypad-key {
  min-height: var(--key-size);
  border: 3px solid #c9c1dc;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 5px 0 #c9c1dc, 0 10px 20px rgb(var(--shadow-color) / 0.08);
  cursor: pointer;
  font-family: var(--font-atkinson);
  font-size: 36px;
  font-weight: 700;
  touch-action: manipulation;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.keypad-key:active {
  box-shadow: 0 1px 0 #c9c1dc, 0 4px 10px rgb(var(--shadow-color) / 0.06);
  transform: translateY(4px);
}

.keypad-key--confirm {
  border-color: #4d977f;
  background: #b9ead9;
  box-shadow: 0 5px 0 #4d977f, 0 10px 20px rgb(57 121 99 / 0.12);
}

.progress-cells {
  display: grid;
  grid-template-columns: repeat(10, minmax(30px, 1fr));
  gap: 8px;
  width: min(100%, 680px);
}

.progress-cell {
  display: grid;
  min-height: 54px;
  place-items: center;
  border: 3px dashed #c9c1dc;
  border-radius: 17px;
  background: rgb(255 255 255 / 0.72);
  color: transparent;
  font-size: 26px;
}

.progress-cell.is-done {
  border-style: solid;
  border-color: #5fa38d;
  background: #dff7ed;
  color: var(--ink);
}

.progress-cell.is-current {
  border-style: solid;
  border-color: var(--lavender-dark);
  box-shadow: 0 0 0 5px rgb(184 161 247 / 0.26);
}

.rainbow-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(70px, 1fr));
  gap: 10px;
  width: min(100%, 760px);
}

.rainbow-day {
  position: relative;
  display: grid;
  min-height: 102px;
  place-items: end center;
  padding: 8px 6px;
  border-radius: 24px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.rainbow-arc {
  position: absolute;
  left: 50%;
  top: 15px;
  width: 52px;
  height: 31px;
  border: 9px solid var(--rainbow-color, var(--lavender));
  border-bottom: 0;
  border-radius: 52px 52px 0 0;
  box-shadow:
    0 -5px 0 0 #f6b4c8,
    0 -10px 0 0 #ffd46f,
    0 -15px 0 0 #92d9c1;
  transform: translateX(-50%);
}

.rainbow-day.is-today {
  background: #fff;
  box-shadow: inset 0 0 0 3px var(--lavender-dark), var(--shadow-sm);
  color: var(--ink);
}

.rainbow-day.is-missed .rainbow-arc {
  filter: grayscale(1);
  opacity: 0.36;
}

.rainbow-day.is-repaired::after {
  position: absolute;
  left: 50%;
  top: 26px;
  color: #8b5c13;
  content: "★";
  font-size: 16px;
  text-shadow: 0 1px #fff;
  transform: translateX(-50%);
}

.rainbow-day.is-future {
  opacity: 0.44;
}

@media (max-width: 620px) {
  :root {
    --key-size: 72px;
  }

  .progress-cells {
    gap: 4px;
  }

  .progress-cell {
    min-height: 38px;
    border-radius: 12px;
    font-size: 19px;
  }

  .rainbow-week {
    grid-template-columns: repeat(7, minmax(40px, 1fr));
    gap: 3px;
  }

  .rainbow-day {
    min-height: 80px;
    border-radius: 16px;
    font-size: 11px;
  }

  .rainbow-arc {
    width: 36px;
    height: 23px;
    border-width: 6px;
    box-shadow: 0 -4px #f6b4c8, 0 -8px #ffd46f, 0 -12px #92d9c1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
