:root {
  --incognito-border: #e5e7eb;
  --incognito-grid: #f3f4f6;
  --incognito-text: #111827;
  --incognito-muted: #6b7280;
  --page-bg: #000;
  --page-text: #fff;
  --hint-text: #666;
  --panel-bg: #222;
  --wave-idle: #f87171;
  --wave-live: #4ade80;
  --control-border: #333;
  --control-bg: #111;
  --control-text: #fff;
  --label-text: #999;
}

.theme-light {
  --page-bg: #f8fafc;
  --page-text: #0f172a;
  --hint-text: #64748b;
  --panel-bg: #e2e8f0;
  --wave-idle: #f97316;
  --wave-live: #16a34a;
  --control-border: #cbd5f5;
  --control-bg: #e2e8f0;
  --control-text: #0f172a;
  --label-text: #475569;
}

body {
  margin: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--page-bg);
  font-family: monospace;
  color: var(--page-text);
}

.corner-controls {
  position: fixed;
  top: 40px;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: calc(16px + env(safe-area-inset-right, 0px));
  z-index: 10;
}

.emoji {
  font-size: 80px;
  margin-bottom: 20px;
}

.text {
  font-size: 48px;
  font-weight: bold;
  margin-bottom: 30px;
}

.hint {
  font-size: 16px;
  color: var(--hint-text);
}

.status {
  margin-bottom: 20px;
  padding: 20px;
  border-radius: 8px;
  background: var(--panel-bg);
}

.wave-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 40px;
  cursor: pointer;
}

.wave-bar {
  width: 4px;
  background: var(--wave-idle);
  border-radius: 2px;
  transition: background 0.3s;
}

.status.listening .wave-bar {
  background: var(--wave-live);
  animation: wave 0.8s ease-in-out infinite;
}

.wave-bar:nth-child(1) {
  height: 8px;
  animation-delay: 0s;
}
.wave-bar:nth-child(2) {
  height: 12px;
  animation-delay: 0.1s;
}
.wave-bar:nth-child(3) {
  height: 20px;
  animation-delay: 0.2s;
}
.wave-bar:nth-child(4) {
  height: 16px;
  animation-delay: 0.3s;
}
.wave-bar:nth-child(5) {
  height: 24px;
  animation-delay: 0.4s;
}
.wave-bar:nth-child(6) {
  height: 16px;
  animation-delay: 0.5s;
}
.wave-bar:nth-child(7) {
  height: 20px;
  animation-delay: 0.6s;
}
.wave-bar:nth-child(8) {
  height: 12px;
  animation-delay: 0.7s;
}
.wave-bar:nth-child(9) {
  height: 8px;
  animation-delay: 0.8s;
}

@keyframes wave {
  0%,
  100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(1.8);
  }
}

.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  cursor: default;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.slider-label {
  font-size: 16px;
  color: var(--label-text);
}

input[type='range'] {
  width: 200px;
  cursor: pointer;
}

.delay-value {
  font-size: 18px;
  color: var(--page-text);
  min-width: 60px;
}

.incognito-toggle {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  color: var(--control-text);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  color: var(--control-text);
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.theme-toggle:hover {
  border-color: #94a3b8;
}

.theme-toggle .icon {
  width: 20px;
  height: 20px;
}

.theme-toggle .icon-sun {
  display: none;
}

.theme-toggle .icon-moon {
  display: block;
}

.theme-light .theme-toggle .icon-sun {
  display: block;
}

.theme-light .theme-toggle .icon-moon {
  display: none;
}

.incognito {
  background: #f8fafc;
  color: var(--incognito-text);
  cursor: default;
}

.incognito .app {
  display: none;
}

.incognito .sheet {
  display: block;
}

.sheet {
  display: none;
  width: min(1100px, 92vw);
  margin: 32px auto;
  background: #fff;
  border: 1px solid var(--incognito-border);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
  color: var(--incognito-text);
  font-family: 'Times New Roman', serif;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--incognito-border);
}

.sheet-title {
  font-size: 18px;
  font-weight: 600;
}

.sheet-subtitle {
  font-size: 12px;
  color: var(--incognito-muted);
}

.sheet-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.sheet-grid th,
.sheet-grid td {
  border: 1px solid var(--incognito-border);
  padding: 8px 10px;
  text-align: left;
  height: 28px;
}

.sheet-grid thead th {
  background: var(--incognito-grid);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.03em;
}

.sheet-note {
  padding: 12px 20px 18px;
  font-size: 11px;
  color: var(--incognito-muted);
}

.incognito-dismiss {
  border: 1px solid var(--incognito-border);
  background: transparent;
  color: var(--incognito-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 10px;
  border-radius: 999px;
}

.incognito-dismiss:hover {
  color: var(--incognito-text);
  border-color: #cbd5f5;
}

.incognito .incognito-toggle {
  background: #e2e8f0;
  color: #111827;
  border-color: #cbd5f5;
}
