@font-face {
  font-family: "Nunito";
  src: url("fonts/Nunito-Variable.ttf") format("truetype");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #17202b;
  --text: #ffffff;
  --muted: #8b95a1;
  --line: #c8d0d8;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
body {
  font-family: "Nunito", "Varela Round", system-ui, sans-serif;
  min-height: 100dvh;
  overflow: hidden;
}
button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
.month-wrap, .month-grid, .main { touch-action: none; }

.app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

.topbar {
  padding: 14px 16px 8px;
}
.app-title {
  margin: 0;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.main {
  flex: 1;
  overflow: auto;
  padding: 0 16px calc(20px + var(--safe-bot));
}

.month-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 2px 12px;
}
.month-title-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.month-name {
  margin: 0;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.year-pill {
  background: #2a3544;
  color: #fff;
  border-radius: 999px;
  padding: 4px 12px;
  font-weight: 800;
  font-size: 13px;
  box-shadow: inset 0 0 0 1px #3b4656;
}
.month-nav { display: flex; gap: 4px; }
.nav-arrow {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
  display: grid;
  place-items: center;
  color: #d5dbe1;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 8px;
}

.month-wrap { position: relative; padding: 5px; }
.month-outline {
  position: absolute;
  left: 5px;
  top: 5px;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  position: relative;
  z-index: 2;
}
.day-spacer { aspect-ratio: 1; }
.day {
  aspect-ratio: 1;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  position: relative;
  color: #e8edf2;
  padding: 0;
}
.day .num {
  position: relative;
  z-index: 1;
  line-height: 1;
}
.day .cross {
  position: absolute;
  inset: 10%;
  width: 80%;
  height: 80%;
  pointer-events: none;
  z-index: 2;
}
.day.future { color: #5c6673; font-weight: 700; }
.day.today {
  box-shadow: inset 0 0 0 2.5px #ffffff;
  color: #fff;
}
.day:active { transform: scale(0.94); }

.stats {
  display: flex;
  justify-content: space-around;
  gap: 16px;
  margin: 28px 4px 8px;
}
.stat { display: flex; align-items: center; gap: 8px; min-width: 0; }
.stat-icon { flex: 0 0 auto; display: grid; place-items: center; }
.stat-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.stat-text strong { font-size: 15px; font-weight: 800; }
.stat-text span { font-size: 12px; color: #d5dbe3; font-weight: 700; }
