:root {
  color-scheme: light;
  --ink: #17212b;
  --paper: #f5f0e7;
  --coral: #df6655;
  --coral-dark: #b8493b;
  --sun: #f4c85b;
}

* {
  box-sizing: border-box;
}

body {
  align-items: center;
  background:
    linear-gradient(90deg, rgb(23 33 43 / 5%) 1px, transparent 1px),
    linear-gradient(rgb(23 33 43 / 5%) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  color: var(--ink);
  display: flex;
  font-family: Georgia, "Times New Roman", serif;
  justify-content: center;
  margin: 0;
  min-height: 100vh;
  padding: 24px;
}

main {
  max-width: 720px;
  text-align: center;
  width: 100%;
}

h2 {
  font-family: "Trebuchet MS", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin: 0 0 16px;
  text-transform: uppercase;
}

.name-picker {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: center;
}

.name-list {
  align-items: stretch;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.name-option {
  background: #fffdf8;
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--sun);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 5vw, 3.4rem);
  line-height: 1;
  margin: 0;
  opacity: 0.38;
  padding: 0.22em 0.3em;
  transition: opacity 160ms ease, transform 160ms ease, background 160ms ease;
}

.name-option.selected {
  background: #fffdf8;
  box-shadow: 7px 7px 0 var(--sun);
  opacity: 1;
  transform: translateY(-3px);
}

.name-arrow {
  align-items: center;
  background: var(--coral);
  display: inline-flex;
  font-size: 1.7rem;
  height: 48px;
  justify-content: center;
  margin: 0;
  padding: 0;
  width: 48px;
}

.name-arrow:hover,
.name-option:hover {
  background: #fff4c9;
}

.name-option.selected:hover {
  background: #fffdf8;
}

button {
  background: var(--coral);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  color: #fffdf8;
  cursor: pointer;
  font: 700 1rem/1 "Trebuchet MS", sans-serif;
  letter-spacing: 0.04em;
  margin-top: 32px;
  padding: 15px 24px;
}

button:hover {
  background: var(--coral-dark);
}

button:active {
  box-shadow: 1px 1px 0 var(--ink);
  transform: translate(3px, 3px);
}

button:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

.visits {
  margin-top: 48px;
  text-align: left;
}

.visits h2 {
  margin-bottom: 12px;
}

.visit-grid {
  background: #fffdf8;
  border: 3px solid var(--ink);
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.8fr auto;
}

.visit-grid > div {
  border-bottom: 1px solid var(--ink);
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 12px 14px;
}

.visit-grid > div:nth-last-child(-n + 4) {
  border-bottom: 0;
}

.visit-actions {
  display: flex;
  gap: 8px;
}

.visit-actions button {
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 0.75rem;
  margin-top: 0;
  padding: 6px 10px;
}

.visit-actions button:active {
  box-shadow: 0 0 0 var(--ink);
}

.visit-delete {
  background: var(--ink);
}

.visit-delete:hover {
  background: #000;
}

.visit-grid .table-heading {
  background: var(--sun);
  font: 700 0.8rem/1 "Trebuchet MS", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.visit-grid .empty-state {
  color: #5b6165;
  font-style: italic;
  grid-column: 1 / -1;
  text-align: center;
}

@media (max-width: 480px) {
  .visit-grid {
    grid-template-columns: 1fr 0.7fr 0.7fr auto;
  }

  .visit-grid > div {
    font-size: 0.88rem;
    padding: 10px 8px;
  }
}