:root {
  --bg: #0b1020;
  --bg-soft: #121935;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-border: rgba(255, 255, 255, 0.14);
  --text: #eef2ff;
  --muted: #aeb8d3;
  --primary: #6ea8fe;
  --primary-strong: #4f8cff;
  --success: #2ecc71;
  --danger: #ff6b6b;
  --warning: #f5b041;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, #1f2b5a 0%, transparent 30%),
    radial-gradient(circle at top right, #13254b 0%, transparent 28%),
    linear-gradient(180deg, #0b1020 0%, #0a0f1c 100%);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 10, 25, 0.45);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-row {
  min-height: 84px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
}

.site-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.site-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.nav-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-link {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(110, 168, 254, 0.18);
  color: #fff;
}

.main-layout {
  padding: 28px 0 48px;
}

.panel,
.hero-card,
.stat-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.panel,
.hero-card {
  padding: 22px;
  margin-bottom: 22px;
}

.section-head {
  margin-bottom: 18px;
}

.section-head-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
  font-size: 24px;
}

.nearest-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nearest-title {
  margin: 0;
  font-size: 28px;
}

.nearest-date {
  margin: 0;
  color: var(--muted);
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.countdown-large .time-box {
  min-height: 110px;
}

.time-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 12px;
}

.time-box__value {
  font-size: 34px;
  font-weight: 700;
}

.time-box__label {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.stat-card {
  padding: 20px;
}

.stat-label {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
}

.toolbar {
  display: grid;
  grid-template-columns: 1.5fr 240px;
  gap: 12px;
}

.toolbar-wrap {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted);
  font-size: 14px;
}

.input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 15px;
  outline: none;
}

.input::placeholder {
  color: #94a1c6;
}

.input:focus {
  border-color: rgba(110, 168, 254, 0.7);
  box-shadow: 0 0 0 3px rgba(110, 168, 254, 0.16);
}

.textarea {
  resize: vertical;
  min-height: 120px;
}
.actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  color: #fff;
  transition: 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(180deg, var(--primary), var(--primary-strong));
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
  background: linear-gradient(180deg, #ff7f7f, #ff5a5a);
}

.file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.timers-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.timer-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.timer-card__title {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.timer-card__meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge--category {
  background: rgba(110, 168, 254, 0.15);
  color: #dce9ff;
}

.badge--active {
  background: rgba(46, 204, 113, 0.18);
  color: #caffdf;
}

.badge--expired {
  background: rgba(255, 107, 107, 0.16);
  color: #ffd2d2;
}

.timer-card__date,
.timer-card__desc {
  color: var(--muted);
  line-height: 1.5;
}

.timer-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.mini-btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}

.mini-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 38px 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
}

.empty-state h3 {
  color: #fff;
  margin-top: 0;
}

.info-text {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
}

.info-text.error {
  color: #ff9d9d;
}

.info-text.success {
  color: #8ff0b5;
}

.auth-panel {
  max-width: 560px;
  margin: 0 auto 22px;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  .timers-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar-wrap {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .header-row,
  .section-head-between {
    flex-direction: column;
    align-items: flex-start;
  }

  .countdown,
  .stats-grid,
  .timers-grid,
  .form-grid,
  .toolbar,
  .toolbar-wrap {
    grid-template-columns: 1fr;
  }

  .site-title {
    font-size: 26px;
  }

  .nearest-title {
    font-size: 24px;
  }

  .time-box__value {
    font-size: 30px;
  }
}