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

html {
  min-height: 100%;
  background: radial-gradient(circle at top, #1c1c1e 0%, #0f0f10 60%, #08080a 100%);
  background-color: #08080a;
  color-scheme: dark;
}

html[data-theme="light"] {
  background: radial-gradient(circle at top, #f3f6ff 0%, #e6ecf7 55%, #d8deee 100%);
  background-color: #d8deee;
  color-scheme: light;
}

body {
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  background: radial-gradient(circle at top, #1c1c1e 0%, #0f0f10 60%, #08080a 100%);
  color: #e5e5e7;
  min-height: 100vh;
  min-height: 100dvh;
}

@media (min-width: 960px) {
  body {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(2rem, 5vw, 4rem);
  }
}

main {
  --main-block-padding: clamp(1.5rem, 6vw, 3rem);
  --main-inline-padding: clamp(1rem, 5vw, 2.75rem);
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--main-block-padding) var(--main-inline-padding);
  padding-block-start: var(--main-block-padding);
  padding-block-end: var(--main-block-padding);
  padding-block-start: calc(var(--main-block-padding) + env(safe-area-inset-top));
  padding-block-end: calc(var(--main-block-padding) + env(safe-area-inset-bottom));
  display: grid;
  gap: clamp(1.1rem, 3vw, 1.75rem);
  background: rgba(22, 22, 26, 0.88);
  border-radius: clamp(0px, 5vw, 22px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 28px 48px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  appearance: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

input {
  font: inherit;
  color: inherit;
  appearance: none;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  outline: none;
  transition:
    border 0.2s ease,
    box-shadow 0.2s ease;
}

input:focus-visible {
  border-color: #00b8d9;
  box-shadow: 0 0 0 3px rgba(0, 184, 217, 0.25);
}

input[type="number"] {
  -moz-appearance: textfield;
  text-align: right;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.app-header {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
}

.header-actions > * {
  flex: 1 1 10rem;
}

.header-actions button {
  width: 100%;
}

h1 {
  margin: 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #00b8d9;
}

.theme-toggle {
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition:
    transform 0.15s ease,
    background 0.15s ease;
}

.theme-toggle:hover {
  background: rgba(0, 184, 217, 0.18);
}

.theme-toggle:active {
  transform: scale(0.96);
}

.add-timer-btn {
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #00b8d9, #0077ff);
  color: #050506;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.add-timer-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0, 123, 255, 0.35);
}

.add-timer-btn:active {
  transform: scale(0.96);
}

.timer-list {
  display: grid;
  gap: clamp(1.1rem, 3vw, 1.5rem);
  grid-template-columns: 1fr;
}

@media (min-width: 960px) {
  main {
    --main-block-padding: clamp(2rem, 3vw, 3rem);
    --main-inline-padding: clamp(2rem, 4vw, 3.25rem);
    min-height: auto;
    margin: 0;
  }

  .app-header {
    gap: 1.5rem;
  }
}

body[data-theme="light"] {
  background: radial-gradient(circle at top, #f3f6ff 0%, #e6ecf7 55%, #d8deee 100%);
  color: #0b1424;
}

body[data-theme="light"] main {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 24px 44px rgba(15, 23, 42, 0.18);
}

body[data-theme="light"] .theme-toggle {
  background: rgba(15, 23, 42, 0.08);
  color: #1e2330;
}

body[data-theme="light"] .theme-toggle:hover {
  background: rgba(15, 23, 42, 0.14);
}

body[data-theme="light"] .add-timer-btn {
  box-shadow: 0 10px 18px rgba(0, 123, 255, 0.24);
}

body[data-theme="light"] input {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: inherit;
}

body[data-theme="light"] input:focus-visible {
  border-color: #0077ff;
  box-shadow: 0 0 0 3px rgba(0, 119, 255, 0.2);
}
