:root {
  font-family: system-ui, sans-serif;
  color: #1a1a1a;
}

body {
  margin: 0 auto;
  padding: 0 1rem 3rem;
  max-width: 480px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid #ddd;
}

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

/* Dashboard: this app is used entirely on a phone, so it's one column of
   big tappable buttons rather than a multi-column grid. */
.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dashboard-card {
  display: block;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  color: inherit;
  background: #fafafa;
}

.dashboard-card:active {
  background: #eee;
}

.dashboard-card h3 {
  margin: 0 0 0.25rem;
}

.dashboard-card .count {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 2rem;
}

form label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  gap: 0.3rem;
}

/* 16px+ inputs avoid iOS Safari auto-zooming on focus. */
form input,
form select {
  font-size: 1rem;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}

form button[type="submit"] {
  font-size: 1rem;
  padding: 0.7rem;
  border: none;
  border-radius: 8px;
  background: #1a1a1a;
  color: #fff;
  cursor: pointer;
}

/* History: stacked cards instead of a wide table, so nothing needs to
   scroll horizontally on a phone. */
.entry-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.entry-card {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
}

.entry-field {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.2rem 0;
  font-size: 0.95rem;
}

.entry-label {
  color: #666;
}

.entry-value {
  text-align: right;
  word-break: break-word;
}

.entry-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.entry-actions button {
  font-size: 0.85rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.rank-picker {
  display: flex;
  gap: 0.4rem;
  justify-content: space-between;
}

.rank-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
}

.rank-box {
  width: 100%;
  max-width: 2.5rem;
  height: 2.5rem;
  font-size: 1.2rem;
  border: 2px solid #999;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.rank-box:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.dnf-toggle {
  font-size: 0.7rem;
  padding: 0.2rem 0.4rem;
  border: 1px solid #999;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.dnf-toggle.active {
  background: #c0392b;
  color: #fff;
  border-color: #c0392b;
}

.position-picker {
  display: flex;
  gap: 0.5rem;
}

.position-toggle {
  flex: 1;
  font-size: 1rem;
  padding: 0.7rem;
  border: 2px solid #999;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.position-toggle.active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}
