:root {
  --bg-start: #dee6ff;
  --bg-end: #ebf0ff;
  --card-color: rgb(255 255 255 / 80%);
  --btn-color: rgb(199 217 254 / 70%);
  --accent-color: #007bff;
  --text-color: #111;
  --secondary-color: #555;
  --radius: 16px;
  --battery-color: #26c281;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-start: #1d2129;
    --bg-end: #181c23;
    --card-color: rgb(31 35 44 / 85%);
    --btn-color: rgb(41 46 56 / 70%);
    --accent-color: #00bcd4;
    --text-color: #d4d4d4;
    --secondary-color: #aaaaaa;
    --radius: 16px;
  }
}

html {
  background: var(--bg-end);
}

body {
  margin: 0;
  padding: 0;
  background: linear-gradient(50deg, var(--bg-start), var(--bg-end));
  font-family: 'Roboto', sans-serif;
  color: var(--text-color);
  display: flex;
  justify-content: center;
  align-items: start;
  padding-top: 20px;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

.status-bar {
  width: 100%;
  max-width: 700px;
  padding: 0 32px;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: absolute;
  top: 12px;
}

.wrapper {
  width: 100%;
  max-width: 700px;
  padding: 0 20px 80px 20px;
  box-sizing: border-box;
  position: relative;
}

.section {
  background-color: var(--card-color);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 20px;
}

.section-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--secondary-color);
  margin: 0 0 11px 0;
  padding-left: 4px;
}

.container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 10px;
}

.app-button {
  background-color: var(--btn-color);
  border: none;
  border-radius: var(--radius);
  padding: 13px;
  text-align: center;
  text-decoration: none;
  color: var(--text-color);
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition:
  transform 0.1s ease,
  background-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.app-button:active {
  transform: scale(1.06);
  background-color: rgb(40 94 231);
}

@media (hover: hover) and (pointer: fine) {
  .app-button:hover {
    transform: scale(1.06);
    background-color: rgb(40 94 231);
  }
}

.app-icon {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  margin-bottom: 10px;
  opacity: 0.8;
}

.settings-toggle {
  height: 40px;
  width: 40px;
  background-color: var(--card-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 101;
  color: var(--secondary-color);
}

.settings-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: none;
}

.settings-overlay.active {
  display: block;
}

.settings-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background-color: var(--card-color);
  border-left: 1px solid #2a2f51;
  padding: 24px 16px 100px 16px;
  box-sizing: border-box;
  transition: right 0.3s ease;
  z-index: 102;
  overflow-y: scroll;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-panel.open {
  right: 0;
}

.setting-item {
  display: flex;
  align-items: center;
}

.settings-panel label {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  padding: 12px;
  margin-right: 6px;
  border-radius: var(--radius);
  background-color: var(--btn-color);
  cursor: pointer;
}

.settings-panel input[type='checkbox'] {
  width: 20px;
  height: 20px;
}

.order-controls {
  opacity: 0.6;
}

.footer {
  display: flex;
  justify-content: space-between;
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px;
}

.links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--btn-color);
  color: var(--text-color);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: var(--radius);
  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
}

.links a:hover {
  background-color: var(--accent-color);
}

/* Clock block */
.info-block {
  display: flex;
  margin-top: 15px;
  margin-bottom: 5px;
  justify-content: space-between;
  align-items: center;
  height: 116px;
  background-color: unset;
}

.clock-time {
  font-size: 56px;
  font-optical-sizing: auto;
  font-weight: 500;
  line-height: 1;
  font-family: 'Space Grotesk', sans-serif;
}

.clock-date {
  font-size: 16px;
  opacity: 0.7;
}

/* Weather block */
.weather-area {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.geo-location {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.weather-location {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.weather-current {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.weather-icon {
  margin: -10px 0;
  width: 48px;
  height: 48px;
  display: none;
}

.weather-temp {
  font-size: 36px;
  font-weight: 600;
}

.weather-forecast {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.weather-forecast .hour {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 9px;
}

.weather-forecast .hour img {
  width: 20px;
  height: 20px;
}

/* Battery badge */
.battery-area {
  display: block;
}

.battery-badge {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.battery-icon {
  width: 42px;
  height: 21px;
  display: block;
}

.bat-bolt {
  width: 32px;
  height: 32px;
  position: absolute;
  left: -26px;
}

.bat-text {
  font-size: 6px;
  fill: #fffffff2;
}

.bat-body {
  fill: none;
  stroke: var(--battery-color);
  stroke-width: 1;
}

.bat-cap,
.bat-fill {
  fill: var(--battery-color);
}

.bat-bolt path {
  fill: #ffb300;
}

/* Blink for critical state */
@keyframes blink {
  50% {
    opacity: 0.25;
  }
}

.battery-badge.blink {
  animation: blink 1s steps(2, start) infinite;
}
