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

:root {
  --bg: #0a0b0f;
  --surface: #14161f;
  --border: #2a2d3a;
  --text: #f4f4f5;
  --muted: #9ca3af;
  --accent: #0052ff;
  --accent-hover: #1a66ff;
  --danger: #ef4444;
  --radius: 16px;
  --touch: 56px;
}

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

body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}

.app {
  width: 100%;
  max-width: 420px;
  padding: 24px 0 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.header {
  text-align: center;
}

.header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.wallet-panel,
.counter-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.wallet-status {
  font-size: 0.85rem;
  color: var(--muted);
  word-break: break-all;
  margin-bottom: 12px;
  min-height: 1.25rem;
}

.wallet-status.connected {
  color: #86efac;
}

.counter-label {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.counter-value {
  text-align: center;
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.1;
  margin: 8px 0 20px;
  font-variant-numeric: tabular-nums;
}

.counter-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 12px;
}

.btn {
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  user-select: none;
  -webkit-user-select: none;
}

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

.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--muted);
}

.btn-touch {
  width: var(--touch);
  height: var(--touch);
  min-width: var(--touch);
  font-size: 1.75rem;
  background: var(--accent);
  color: #fff;
  line-height: 1;
}

.btn-touch#btn-minus {
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text);
}

.chain-hint {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

@media (min-width: 480px) {
  .counter-value {
    font-size: 5rem;
  }
}
