:root {
  --bg: #f2f7f4;
  --card: #ffffff;
  --text: #102127;
  --accent: #0b8f7a;
  --border: #cfe2db;
  --error: #b91c1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at 85% -10%, #f2fff9 0%, transparent 45%),
    linear-gradient(130deg, #e9f9f7 0%, var(--bg) 55%, #edf6ff 100%);
  color: var(--text);
  transition: background 300ms ease, color 300ms ease;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: #ffffffd6;
  backdrop-filter: blur(4px);
}

main {
  max-width: 760px;
  margin: 1.25rem auto;
  padding: 0 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 28px #0b2a2712;
}

label {
  display: block;
  margin-bottom: 0.35rem;
  margin-top: 0.75rem;
}

input,
select,
button {
  width: 100%;
  padding: 0.6rem;
  border-radius: 10px;
  border: 1px solid #bfcadd;
  font-size: 1rem;
}

button,
input[type="submit"] {
  margin-top: 1rem;
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
}

input[type="submit"]:hover,
button:hover {
  filter: brightness(1.08);
}

.clock-card {
  text-align: center;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

.clock-inline-logout {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 25;
}

.clock-inline-logout button {
  width: auto;
  margin-top: 0;
  padding: 0.35rem 0.65rem;
  font-size: 0.86rem;
  border-radius: 999px;
  background: #d6dce3;
  color: #24323f;
}

.clock-inline-logout button:hover {
  filter: brightness(1.02);
}

.clock-shell {
  position: relative;
  padding: 0.5rem 0 0.75rem;
  z-index: 1;
}

.clock-label {
  margin: 0;
  letter-spacing: 0.22rem;
  font-size: 0.92rem;
  font-weight: 700;
}

.clock-number {
  margin: 0.3rem 0;
  font-family: "Impact", "Haettenschweiler", "Arial Narrow Bold", sans-serif;
  font-size: clamp(7rem, 32vw, 16rem);
  line-height: 0.86;
  letter-spacing: 0.04em;
  user-select: none;
}

.clock-message {
  font-weight: 600;
  margin: 0.5rem auto 0.2rem;
  max-width: 60ch;
  position: relative;
  z-index: 1;
}

.meta {
  margin: 0.35rem 0;
  color: #36515e;
}

.clock-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.clock-buttons input[name="submit_plus"] {
  background: linear-gradient(135deg, #0f8d7b 0%, #0fb39a 100%);
}

.clock-buttons input[name="submit_minus"] {
  background: linear-gradient(135deg, #7f1414 0%, #d22121 100%);
}

.minimal-bottom-hint {
  background: transparent;
  border-style: dashed;
}

.coming-soon {
  background: #d2d6dc;
  color: #6b7280;
  border: 1px solid #bcc2ca;
  cursor: not-allowed;
  font-weight: 600;
  opacity: 0.9;
}

.coming-soon:hover {
  filter: none;
}

.action-link {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f3f5f8;
  color: #1f3440;
  text-decoration: none;
  font-weight: 600;
}

.action-link:hover {
  filter: brightness(1.03);
}

.log-table-wrap {
  overflow-x: auto;
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.log-table th,
.log-table td {
  text-align: left;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.log-table th {
  font-weight: 700;
}

body.clock-positive {
  background:
    radial-gradient(circle at 15% 0%, #eefffb 0%, transparent 50%),
    radial-gradient(circle at 85% 100%, #d5fff4 0%, transparent 38%),
    linear-gradient(140deg, #dbf8f5 0%, #f4fffe 48%, #def7f3 100%);
}

.clock-card.clock-positive {
  background: linear-gradient(170deg, #ffffff 0%, #f4fffc 100%);
}

.clock-card.clock-positive .clock-number {
  color: #0d8f74;
  text-shadow: 0 0 22px #84f2d1, 0 0 56px #b2ffe8;
  animation: breathe 2.4s ease-in-out infinite;
}

.clock-card.clock-positive .soothing {
  color: #0a7f6b;
}

body.clock-neutral {
  background:
    radial-gradient(circle at 20% 0%, #f6f8fb 0%, transparent 42%),
    linear-gradient(140deg, #eaf0f6 0%, #f9fbff 55%, #eaf0f7 100%);
}

.clock-card.clock-neutral .clock-number {
  color: #364152;
  text-shadow: 0 0 18px #d3d8e2;
}

.clock-card.clock-neutral .neutral {
  color: #334155;
}

body.clock-negative {
  background:
    radial-gradient(circle at 20% -10%, #500000 0%, transparent 42%),
    radial-gradient(circle at 85% 115%, #2b0000 0%, transparent 46%),
    linear-gradient(140deg, #090909 0%, #180606 55%, #0d0d0d 100%);
  color: #ffe4e4;
}

body.clock-negative .site-header {
  background: #1e0909d9;
  border-bottom-color: #5f1b1b;
}

body.clock-negative .card {
  background: linear-gradient(165deg, #200b0b 0%, #130c0c 100%);
  border-color: #6f1b1b;
  box-shadow: 0 0 18px #ff31314f;
}

body.clock-negative .meta,
body.clock-negative .note,
body.clock-negative a {
  color: #ffd2d2;
}

body.clock-negative .coming-soon {
  background: #3a3a3a;
  color: #a3a3a3;
  border-color: #525252;
}

body.clock-negative .clock-inline-logout button {
  background: #432525;
  color: #f6d7d7;
}

.clock-card.clock-negative .clock-number {
  color: #ff2222;
  text-shadow: 0 0 7px #ff2d2d, 0 0 20px #ff2424, 0 0 55px #ff1f1f;
  animation: alarmPulse 0.8s ease-in-out infinite, jitter 0.16s linear infinite;
}

.clock-card.clock-negative .warning {
  color: #ff9393;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@keyframes breathe {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes alarmPulse {
  0% {
    transform: scale(1);
    opacity: 0.92;
  }
  50% {
    transform: scale(1.04);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.92;
  }
}

@keyframes jitter {
  0% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-1px, 1px);
  }
  50% {
    transform: translate(1px, -1px);
  }
  75% {
    transform: translate(-1px, -1px);
  }
  100% {
    transform: translate(0, 0);
  }
}

.flash-list {
  list-style: none;
  padding-left: 0;
}

.flash-error {
  color: var(--error);
}

.note {
  color: #475569;
}

@media (max-width: 640px) {
  .clock-number {
    font-size: clamp(5.5rem, 34vw, 9rem);
  }
}
