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

:root {
  --bg: #0a0a0e;
  --surface: #141418;
  --surface-2: #1e1e26;
  --text: #e8e8f0;
  --text-muted: #8888a0;
  --accent: #4a7dff;
  --success: #00e878;
  --warning: #f0a030;
  --danger: #ff4060;
  --radius: 16px;
  --radius-sm: 10px;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100dvh;
  padding: 20px;
  background: radial-gradient(ellipse at 50% 0%, #14142a 0%, var(--bg) 60%);
}

.container {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.version {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  position: relative;
}

.phone-icon {
  position: relative;
  width: 80px;
  height: 80px;
  color: var(--text-muted);
  transition: color 0.3s;
  z-index: 1;
}

.phone-icon svg {
  width: 100%;
  height: 100%;
}

.waves {
  position: absolute;
  width: 200px;
  height: 200px;
  pointer-events: none;
}

.waves span {
  position: absolute;
  inset: 0;
  border: 2px solid var(--success);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.3);
}

.waves.active span {
  animation: wave-pulse 1.2s ease-out infinite;
}

.waves.active span:nth-child(2) {
  animation-delay: 0.4s;
}

.waves.active span:nth-child(3) {
  animation-delay: 0.8s;
}

@keyframes wave-pulse {
  0% {
    transform: scale(0.3);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

.status-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border-radius: 100px;
  background: var(--surface);
  border: 1px solid var(--surface-2);
  font-size: 0.95rem;
  font-weight: 500;
  transition: border-color 0.4s, background 0.4s, box-shadow 0.4s;
  min-width: 200px;
  justify-content: center;
}

.status-card p {
  flex: 1;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.3s, box-shadow 0.3s;
}

.status-card.listening {
  border-color: var(--accent);
}

.status-card.listening .status-dot {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse-dot 1.5s ease-in-out infinite;
}

.status-card.shake {
  border-color: var(--success);
  background: rgba(0, 232, 120, 0.08);
  box-shadow: 0 0 30px rgba(0, 232, 120, 0.15);
}

.status-card.shake .status-dot {
  background: var(--success);
  box-shadow: 0 0 14px var(--success);
}

.status-card.no-support {
  border-color: var(--danger);
  background: rgba(255, 64, 96, 0.08);
}

.status-card.no-support .status-dot {
  background: var(--danger);
  box-shadow: 0 0 10px var(--danger);
}

.status-card.waiting-permission {
  border-color: var(--warning);
}

.status-card.waiting-permission .status-dot {
  background: var(--warning);
  box-shadow: 0 0 10px var(--warning);
  animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.values {
  width: 100%;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--surface-2);
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.value-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.value-item.highlight {
  background: rgba(74, 125, 255, 0.12);
  border: 1px solid rgba(74, 125, 255, 0.2);
}

.value-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.value-number {
  font-size: 1.1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-family: "SF Mono", "Cascadia Code", "Fira Code", monospace;
  transition: color 0.3s;
}

.value-item.highlight .value-number {
  color: var(--accent);
}

.btn {
  padding: 14px 32px;
  border: none;
  border-radius: 100px;
  background: linear-gradient(135deg, var(--accent), #6a5bf0);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(74, 125, 255, 0.3);
}

.btn:active {
  transform: scale(0.97);
}

.shake-count {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: var(--surface);
  border-radius: 100px;
  border: 1px solid var(--surface-2);
  font-size: 0.85rem;
}

.count-label {
  color: var(--text-muted);
}

.count-number {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--success);
  font-variant-numeric: tabular-nums;
}

footer {
  margin-top: 8px;
}

.footer-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.6;
}

.hidden {
  display: none !important;
}

@media (max-width: 380px) {
  h1 { font-size: 1.4rem; }
  .value-grid { grid-template-columns: repeat(2, 1fr); }
}
