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

:root {
  --bg-primary: #fff;
  --bg-secondary: #f8f9fa;
  --text-primary: #1a1a1a;
  --text-secondary: #666;
  --border-color: #e0e0e0;
  --accent-color: #0066cc;
  --accent-hover: #0052a3;
  --success-color: #28a745;
  --error-color: #dc3545;
  --shadow: 0 2px 8px rgba(0, 0, 0, .1);
}

body {
  min-height: 100vh;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}

header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
  box-shadow: var(--shadow);
}

.header-content {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
}

.logo { color: var(--accent-color); font-size: 1.5rem; font-weight: 700; }
.user-section { display: flex; align-items: center; gap: 1rem; }
.user-label { color: var(--text-secondary); font-size: .875rem; font-weight: 500; }
.user-avatar {
  display: flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #0066cc, #00a8e8);
  color: white;
  font-size: .875rem;
  font-weight: 700;
}

main { max-width: 1200px; margin: 3rem auto; padding: 0 2rem; }
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem;
  border-radius: 8px;
  background: var(--bg-primary);
  box-shadow: var(--shadow);
}

h1 { margin-bottom: 2rem; color: var(--text-primary); font-size: 2rem; text-align: center; }
.counter-display { margin-bottom: 3rem; text-align: center; }
.counter-value {
  overflow-wrap: anywhere;
  margin-bottom: 1rem;
  color: var(--accent-color);
  font-size: clamp(3.5rem, 14vw, 5rem);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.2;
}
.counter-label {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.button-group { display: flex; margin-bottom: 2rem; gap: 1rem; flex-wrap: wrap; justify-content: center; }
button {
  min-height: 44px;
  padding: .875rem 2rem;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  transition: background-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.increment-btn { min-width: 200px; flex: 1; background: var(--accent-color); color: white; }
.increment-btn:hover { background: var(--accent-hover); box-shadow: 0 4px 12px rgba(0, 102, 204, .3); }
.increment-btn:active { transform: scale(.98); }
.increment-btn:focus-visible { outline: 3px solid rgba(0, 102, 204, .35); outline-offset: 3px; }
.increment-btn:disabled { cursor: not-allowed; background: #ccc; opacity: .6; }
.status-section { padding: 1.5rem; border: 1px solid var(--border-color); border-radius: 6px; background: var(--bg-secondary); }
.status-label { margin-bottom: .75rem; color: var(--text-secondary); font-size: .875rem; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; }
.status-indicator { display: flex; align-items: center; gap: .75rem; font-size: 1.125rem; font-weight: 600; }
.status-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; animation: pulse 2s infinite; }
.status-dot.connected { background: var(--success-color); }
.status-dot.error { background: var(--error-color); }
.status-text.connected { color: var(--success-color); }
.status-text.error { color: var(--error-color); }
.info-section { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--border-color); color: var(--text-secondary); font-size: .875rem; text-align: center; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
@media (max-width: 720px) {
  header { padding: 1rem 1.5rem; }
  .header-content { flex-direction: column; gap: 1rem; }
  main { margin: 1.5rem auto; padding: 0 1rem; }
  .container { padding: 1.5rem; }
  h1 { margin-bottom: 1.5rem; font-size: 1.5rem; }
  .button-group { flex-direction: column; }
  .increment-btn { min-width: auto; }
}
