* {
  box-sizing: border-box;
}

:root {
  --surface: #191b24;
  --card: #20232f;
  --card-border: #1d202c;
  --grid-dot: rgba(50, 52, 62, 0.45);
  --accent: #92d5fe;
  --accent-2: #8f79c9;
  --text: #e8eaf0;
  --muted: #9a9db0;
  --warm: #54ff8a;
  --ok: #6ee7a0;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'SN Pro', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background-color: var(--surface);
  background-image: radial-gradient(var(--grid-dot) 1px, var(--surface) 1px);
  background-size: 20px 20px;
  overflow-x: hidden;
}

/* Свечение на фоне */
.bg-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  animation: float 12s ease-in-out infinite alternate;
}
.bg-glow--a {
  top: -140px;
  left: -120px;
  background: #07c8bb;
}
.bg-glow--b {
  bottom: -160px;
  right: -140px;
  background: #6f36ff;
  animation-delay: -6s;
}
@keyframes float {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(40px, 30px) scale(1.15); }
}

/* Топбар */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--card-border);
  background: rgba(25, 27, 36, 0.8);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
}
.topbar__logo {
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.5px;
}
.topbar__title {
  font-family: 'JetBrains Mono', Menlo, monospace;
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--muted);
}
.topbar__streak {
  font-weight: 700;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 180, 84, 0.15);
  border: 1px solid rgba(255, 180, 84, 0.4);
  color: var(--warm);
}

/* Раскладка */
.page {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 60px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}
.card--hero {
  grid-column: 1 / -1;
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 22px;
  overflow: hidden;
  animation: rise 0.5s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.card__tag {
  font-family: 'JetBrains Mono', Menlo, monospace;
  font-size: 11px;
  letter-spacing: 2.5px;
  color: var(--accent);
  margin-bottom: 14px;
}
.card__title {
  margin: 0 0 16px;
  font-size: 22px;
}

/* Герой-цитата */
.card--hero {
  text-align: center;
  background: linear-gradient(160deg, #232838 0%, #1d2030 60%, #22202f 100%);
  padding: 34px 22px;
}
.quote {
  margin: 0 auto;
  max-width: 720px;
  font-size: clamp(20px, 3.4vw, 32px);
  font-weight: 800;
  line-height: 1.35;
  min-height: 2.6em;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s;
}
.quote__author {
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
  min-height: 1.4em;
}
.hero__actions {
  margin-top: 22px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Кнопки */
.btn {
  font: inherit;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  padding: 12px 20px;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, background 0.15s;
}
.btn:active {
  transform: scale(0.96);
}
.btn--primary {
  background: var(--accent);
  color: #14160b;
  box-shadow: 0 6px 24px rgba(200, 255, 0, 0.25);
}
.btn--primary:hover {
  box-shadow: 0 8px 30px rgba(115, 244, 240, 0.45);
  transform: translateY(-2px);
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--card-border);
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn--big {
  width: 100%;
  font-size: 18px;
  padding: 16px;
  background: linear-gradient(135deg, #6ee7a0, #34c98a);
  color: #08130d;
}
.btn--big:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(110, 231, 160, 0.35);
}
.btn--big:disabled {
  background: #2c3040;
  color: var(--muted);
  cursor: default;
  box-shadow: none;
  transform: none;
}

/* Конфетти */
.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.confetti span {
  position: absolute;
  top: -14px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  animation: fall 1.6s linear forwards;
}
@keyframes fall {
  to {
    transform: translateY(340px) rotate(720deg);
    opacity: 0;
  }
}

/* Таймер */
.timer {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 6px auto 16px;
}
.timer__ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.timer__track {
  fill: none;
  stroke: #2c3040;
  stroke-width: 12;
}
.timer__progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 603;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.4s linear, stroke 0.3s;
}
.timer__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.timer__time {
  font-family: 'JetBrains Mono', Menlo, monospace;
  font-size: 44px;
  font-weight: 600;
}
.timer__mode {
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}
.timer__modes {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.chip {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  background: #191b24;
  border: 1px solid var(--card-border);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover {
  border-color: var(--accent);
  color: var(--text);
}
.chip--active {
  background: rgba(200, 255, 0, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}
.timer__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 18px;
}
.stats {
  display: flex;
  gap: 10px;
}
.stat {
  flex: 1;
  background: #191b24;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 12px 6px;
  text-align: center;
}
.stat b {
  display: block;
  font-family: 'JetBrains Mono', Menlo, monospace;
  font-size: 24px;
  color: var(--accent);
}
.stat span {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
  display: block;
  margin-top: 4px;
}

/* Трекер */
.streak {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
  background: #191b24;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 14px;
}
.streak__days {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.day-dot {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #2c3040;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
}
.day-dot--done {
  background: rgba(200, 255, 0, 0.15);
  border: 1px solid var(--accent);
  color: var(--accent);
}
.day-dot--today {
  outline: 2px solid var(--warm);
  outline-offset: 2px;
}
.streak__label {
  font-size: 12px;
  color: var(--muted);
}
.streak__value {
  font-family: 'JetBrains Mono', Menlo, monospace;
  font-size: 34px;
  font-weight: 600;
  color: var(--warm);
  line-height: 1.1;
}
.streak__best {
  font-size: 12px;
  color: var(--muted);
}
.hint {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* Советы */
.tips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tips li {
  background: #191b24;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 12px 14px 12px 46px;
  position: relative;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 0.15s, transform 0.15s;
}
.tips li:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}
.tips li::before {
  content: attr(data-emoji);
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
}

/* Тост */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 90px);
  background: var(--accent);
  color: #14160b;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 50;
  max-width: 90vw;
  text-align: center;
}
.toast--show {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (max-width: 560px) {
  .topbar__title { display: none; }
  .streak { flex-direction: column; text-align: center; }
  .timer { width: 190px; height: 190px; }
  .timer__time { font-size: 38px; }
}
