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

:root {
  --bg:           #0f0f1a;
  --surface:      #1a1a2e;
  --accent:       #7eb8f7;
  --text:         #dde8f8;
  --text-muted:   #7a8baa;
  --playing-bg:   #7eb8f7;
  --playing-text: #0f0f1a;
  --ok:           #7fd8a0;
  --error:        #f77e7e;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.screen {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding:
    env(safe-area-inset-top, 2rem)
    1.5rem
    env(safe-area-inset-bottom, 2rem);
}

main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.whistle-btn {
  width:  clamp(180px, 55vw, 260px);
  height: clamp(180px, 55vw, 260px);
  border-radius: 50%;
  border: 3px solid var(--accent);
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  touch-action: none;
  transition:
    background   0.08s ease,
    transform    0.08s ease,
    border-color 0.08s ease,
    color        0.08s ease,
    box-shadow   0.08s ease;
  box-shadow: 0 0 0 0 transparent;
  -webkit-tap-highlight-color: transparent;
}

.whistle-btn:disabled {
  border-color: var(--text-muted);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.55;
  filter: grayscale(1);
  box-shadow: none;
}

.whistle-btn:disabled img {
  filter: grayscale(1);
}

.whistle-btn.playing {
  background:   var(--playing-bg);
  color:        var(--playing-text);
  border-color: #fff;
  transform:    scale(0.96);
  box-shadow:   0 0 40px 8px rgba(126, 184, 247, 0.45);
}

.btn-icon {
  font-size: clamp(2.5rem, 10vw, 3.5rem);
  line-height: 1;
  pointer-events: none;
}

.btn-label {
  font-size: clamp(0.85rem, 3.5vw, 1.05rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: none;
}

footer {
  padding-bottom: 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.status {
  font-size: 0.82rem;
  min-height: 1.2em;
  color: var(--text-muted);
}

.status.ok    { color: var(--ok); }
.status.error { color: var(--error); }

.perm-btn {
  margin-top: 0.5rem;
  padding: 0.65rem 1.8rem;
  border-radius: 2rem;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.1s, color 0.1s;
}

.perm-btn:active {
  background: var(--accent);
  color: var(--bg);
}
