:root {
  --background: #ffffff;
  --foreground: #171717;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #0a0a0a;
    --foreground: #444444;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1152px;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 24px 0;
}

.source-link {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.3);
  margin: 0 0 16px 0;
}

.source-link a {
  color: rgba(255, 255, 255, 0.3);
  text-decoration: underline;
}

.source-link a:hover {
  color: #2563eb;
}

.progress {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tag-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  background: #e5e7eb;
  color: #1f2937;
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
}

.tag-btn:hover {
  background: #d1d5db;
}

.tag-btn.active {
  background: #2563eb;
  color: #ffffff;
}

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

.cell {
  cursor: pointer;
  border: 0 solid transparent;
}

.cell.done {
  border: 2px solid #22c55e;
}

.cell img {
  display: block;
  width: 124px;
  height: 124px;
  max-width: 100%;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-box {
  background: #ffffff;
  padding: 24px;
  border-radius: 4px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  max-width: 448px;
  width: 100%;
}

.modal-box h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 16px 0;
}

.modal-box img.champ-icon {
  display: block;
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
}

.modal-box label {
  display: block;
  margin-bottom: 8px;
}

.modal-box input[type="number"] {
  border: 1px solid currentColor;
  padding: 4px;
  width: 80px;
  font-family: inherit;
  font-size: 16px;
}

.modal-box .games-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-box .step-btn {
  padding: 4px 8px;
  border: none;
  background: #e5e7eb;
  color: #1f2937;
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
}

.modal-box textarea {
  border: 1px solid currentColor;
  padding: 8px;
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  resize: vertical;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.btn-cancel {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  background: #d1d5db;
  color: inherit;
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
}

.btn-save {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  background: #2563eb;
  color: #ffffff;
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
}
