:root {
  --font-mono: 'JetBrains Mono', monospace;
  --color-bg: #fafafa;
  --color-text: #111111;
  --color-muted: #888888;
  --color-border: #e0e0e0;
  --color-success: #22c55e;
  --color-found: #6366f1;
  --max-width: 640px;
}

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

html,
body {
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  color: var(--color-text);
  background: var(--color-bg);
  font-family: var(--font-mono), monospace;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.header {
  padding: 40px 0 0;
}

.header-title {
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.header-nav {
  display: flex;
  gap: 24px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--color-muted);
}

.header-nav a:hover {
  color: var(--color-text);
}

.header-nav a.active {
  color: var(--color-text);
}

/* Home page */
.home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}

.number-input-wrapper {
  display: flex;
  align-items: center;
  border-bottom: 2px solid var(--color-border);
  transition: border-color 0.2s;
}

.number-input-wrapper:focus-within {
  border-color: var(--color-text);
}

.number-input {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
  font-family: var(--font-mono), monospace;
  font-size: 1.5rem;
  text-align: center;
  border: none;
  background: transparent;
  color: var(--color-text);
  outline: none;
}

.number-input::placeholder {
  color: var(--color-muted);
  font-size: 1rem;
}

.number-submit {
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 1.25rem;
  background: transparent;
  color: var(--color-text);
  border: none;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.number-submit:hover:not(:disabled) {
  opacity: 1;
}

.number-submit:disabled {
  opacity: 0.2;
  cursor: default;
}

.input-hint {
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--color-muted);
}

/* Result */
.result {
  margin-top: 32px;
  font-size: 0.875rem;
  animation: fadeIn 0.3s ease-in;
  max-width: 100%;
}

.result-new {
  color: var(--color-success);
}

.result-found {
  color: var(--color-found);
}

.result-error {
  color: #ef4444;
}

.result-number {
  font-weight: 600;
  overflow-wrap: break-word;
  word-break: break-all;
}

/* Truncatable numbers */
.truncatable {
  cursor: pointer;
  transition: opacity 0.15s;
}

.truncatable:hover {
  opacity: 0.7;
}

.truncatable-expanded {
  word-break: break-all;
}

.result-meta {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--color-muted);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Personal stats */
.personal-stats {
  margin-top: 48px;
  font-size: 0.75rem;
  color: var(--color-muted);
}

.personal-count {
  color: var(--color-text);
  font-weight: 600;
}

/* Info / Stats page */
.info {
  padding: 48px 0 80px;
}

.info-description {
  font-size: 0.875rem;
  color: var(--color-muted);
  max-width: 480px;
  margin-bottom: 48px;
  line-height: 1.8;
}

.info-description p {
  margin-bottom: 16px;
}

.info-description p:last-child {
  margin-bottom: 0;
}

.info-footnote {
  font-size: 0.75rem;
  font-style: italic;
}

.info-asterisk {
  vertical-align: super;
  font-size: 0.65em;
}

.stats-section {
  margin-bottom: 40px;
}

.stats-label {
  font-size: 0.75rem;
  color: var(--color-muted);
  text-transform: lowercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.stats-value {
  font-size: 2rem;
  font-weight: 600;
}

.stats-notd {
  font-size: 1.5rem;
  font-weight: 600;
}

/* Top numbers list */
.top-list {
  list-style: none;
  font-size: 0.875rem;
}

.top-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.top-list li:last-child {
  border-bottom: none;
}

.top-number {
  font-weight: 600;
}

.top-count {
  color: var(--color-muted);
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* Your contributions */
.contributions {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--color-border);
}

.finds-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.finds-toggle {
  font-family: var(--font-mono), monospace;
  font-size: 0.75rem;
  color: var(--color-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.finds-toggle:hover {
  color: var(--color-text);
}

.recent-finds {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.recent-find {
  padding: 4px 10px;
  font-size: 0.75rem;
  border: 1px solid var(--color-border);
}

/* Daily chart */
.chart-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 8px;
}

.chart-hover-info {
  font-size: 0.75rem;
  color: var(--color-muted);
}

.chart-hover-count {
  color: var(--color-text);
  font-weight: 600;
}

.chart-container {
  position: relative;
  width: 100%;
}

.daily-chart {
  width: 100%;
  height: auto;
  display: block;
  cursor: crosshair;
}

/* Loading */
.loading {
  color: var(--color-muted);
  font-size: 0.875rem;
}

/* Skeleton */
.skeleton {
  background: var(--color-border);
  border-radius: 2px;
  height: 1em;
  animation: pulse 1.5s ease-in-out infinite;
}

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