* { box-sizing: border-box; }

body {
  margin: 0;
  /* Disable double-tap-to-zoom so rapid taps are clicks; pinch zoom still works. */
  touch-action: manipulation;
  font-family: system-ui, sans-serif;
  background: #f5f5f5;
  color: #222;
}

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px;
  text-align: center;
}

h1 { margin: 0 0 8px; }

.description { margin: 0 0 24px; color: #555; }

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

.grid-footer {
  margin-top: 8px;
  text-align: right;
}

button {
  -webkit-user-select: none;
  user-select: none;
}

.cell {
  padding: 0;
  border: 0;
  overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
  background: #ddd;
  -webkit-tap-highlight-color: transparent;
}

.cell:focus-visible { outline: 3px solid #264653; outline-offset: 2px; }
.cell:active { transform: scale(0.97); }

.cell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.status-area {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  margin: 8px 0;
}

.status {
  margin: 0;
  color: #555;
}
.status.ok { color: #1f7a4d; }
.status.taken { color: #b3261e; }

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid #ccc;
  border-top-color: #264653;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner[hidden] { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

.button {
  padding: 12px 20px;
  border: 2px solid #264653;
  background: #264653;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.button[data-state="available"] {
  border-color: #1f7a4d;
  background: #1f7a4d;
}
.button:disabled {
  border-color: #bbb;
  background: #ccc;
  color: #888;
  cursor: not-allowed;
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: #264653;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}
.link span { text-decoration: underline; }
.link .icon {
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
