:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.4;
  color: #1f2937;
  background: #eef3ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: #0d47a1;
  color: #fff;
}

.title-group h1 {
  margin: 0;
  font-size: 1.2rem;
}

.title-group p {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

.actions {
  display: flex;
  gap: 0.6rem;
}

button {
  border: none;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  background: #2563eb;
  color: white;
}

button:hover {
  filter: brightness(1.08);
}

.layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) 1fr;
  gap: 0.8rem;
  padding: 0.8rem;
  height: calc(100vh - 82px);
}

.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgb(0 0 0 / 8%);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-height: 0;
}

.sidebar .card {
  padding: 0.8rem;
}

.sidebar h2 {
  margin: 0 0 0.7rem;
  font-size: 1rem;
}

.field {
  display: block;
  margin-bottom: 0.7rem;
  font-size: 0.9rem;
}

.row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

#radiusInput {
  flex: 1;
}

.field input[type="text"] {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
}

.hint {
  margin: 0;
  color: #4b5563;
  font-size: 0.8rem;
}

.status {
  color: #4b5563;
  font-size: 0.9rem;
}

.court-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  max-height: calc(100vh - 300px);
  overflow: auto;
}

.court-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.6rem;
  margin-bottom: 0.55rem;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

.court-item.is-favorite {
  border-color: #f59e0b;
  background: #fffbeb;
}

.favorite-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  padding: 0;
  background: #e5e7eb;
  color: #111827;
  font-size: 1rem;
}

.favorite-btn.active {
  background: #f59e0b;
  color: white;
}

.court-info h3 {
  margin: 0;
  font-size: 0.95rem;
}

.court-meta,
.court-status {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: #4b5563;
}

.court-actions {
  display: flex;
  gap: 0.4rem;
}

.court-actions button {
  font-size: 0.74rem;
  padding: 0.35rem 0.5rem;
}

.map-wrap {
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
}

.popup-name {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.popup-meta,
.popup-status {
  margin: 0 0 0.25rem;
  color: #4b5563;
  font-size: 0.82rem;
}

.popup-actions {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.popup-actions a,
.popup-actions button {
  font-size: 0.78rem;
  text-decoration: none;
  border-radius: 6px;
  padding: 0.3rem 0.45rem;
  color: white;
  background: #2563eb;
}

.popup-actions button {
  border: none;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .map-wrap {
    min-height: 420px;
  }

  .court-list {
    max-height: 320px;
  }
}
