/* ─── Variables ─────────────────────────────────────────── */
:root {
  --cream:   #F2EAE0;
  --sky:     #B4D3D9;
  --mint:    #67C090;
  --text:    #2e4040;
  --muted:   #7a9c9c;
  --card-bg: #ffffffcc;
  --radius:  20px;
  --shadow:  0 8px 40px rgba(103, 192, 144, 0.15);
}

/* ─── Reset & base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background-color: var(--cream);
  background-image:
    radial-gradient(ellipse at 20% 10%, #b4d3d940 0%, transparent 55%),
    radial-gradient(ellipse at 80% 80%, #67c09025 0%, transparent 50%);
  font-family: 'Lato', sans-serif;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-x: hidden;
}

/* ─── Decorative leaves ─────────────────────────────────── */
.leaf {
  position: fixed;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

.leaf::before {
  content: '';
  display: block;
  border-radius: 0 60% 0 60%;
  transform: rotate(45deg);
}

.leaf-tl { top: -40px; left: -40px; }
.leaf-tl::before {
  width: 180px; height: 180px;
  background: var(--mint);
}

.leaf-tr { top: -30px; right: -30px; transform: scaleX(-1); }
.leaf-tr::before {
  width: 140px; height: 140px;
  background: var(--sky);
}

.leaf-bl { bottom: -50px; left: -50px; transform: rotate(180deg); }
.leaf-bl::before {
  width: 200px; height: 200px;
  background: var(--sky);
}

.leaf-br { bottom: -40px; right: -40px; transform: rotate(180deg) scaleX(-1); }
.leaf-br::before {
  width: 160px; height: 160px;
  background: var(--mint);
}

/* ─── Main layout ───────────────────────────────────────── */
main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  animation: fadeUp 0.7s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Header ────────────────────────────────────────────── */
header {
  text-align: center;
}

.otter-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.4rem;
  animation: bob 3s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.subtitle {
  margin-top: 0.6rem;
  font-weight: 300;
  font-size: 1rem;
  color: var(--muted);
  max-width: 400px;
  margin-inline: auto;
  line-height: 1.6;
}

/* ─── Card ──────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  border: 1.5px solid rgba(180, 211, 217, 0.5);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ─── Card header row ───────────────────────────────────── */
.card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.25rem;
  border-bottom: 1.5px solid rgba(180, 211, 217, 0.4);
  background: rgba(180, 211, 217, 0.15);
}

.card-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.card-label {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1rem;
  color: var(--muted);
  flex: 1;
}

/* ─── Shared button base ────────────────────────────────── */
#onButton,
#offButton {
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  font-family: 'Lato', sans-serif;
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

#onButton:active,
#offButton:active  { transform: translateY(0); }

#onButton:disabled,
#offButton:disabled {
  background: var(--sky);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ─── Yes / On button ───────────────────────────────────── */
#onButton {
  background: var(--mint);
  color: #fff;
  box-shadow: 0 3px 12px rgba(103, 192, 144, 0.35);
}

#onButton:hover:not(:disabled) {
  background: #52b07e;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(103, 192, 144, 0.4);
}

/* ─── Stop / Off button ─────────────────────────────────── */
#offButton {
  background: transparent;
  color: #c06767;
  border: 1.5px solid #c06767;
  box-shadow: 0 3px 12px rgba(192, 103, 103, 0.12);
}

#offButton:hover:not(:disabled) {
  background: #c06767;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(192, 103, 103, 0.3);
}

.hidden { display: none; }

/* ─── Loading dots ──────────────────────────────────────── */
.loading-dots span {
  display: inline-block;
  width: 7px; height: 7px;
  background: var(--mint);
  border-radius: 50%;
  margin: 0 2px;
  animation: dot-bounce 1.2s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40%            { transform: translateY(-6px); opacity: 1; }
}
