:root {
  --bg: #0f1720;
  --panel: #16212e;
  --card: #1d2b3a;
  --text: #e6edf3;
  --muted: #8b9bb0;
  --accent: #2ec3a6;
  --accent-2: #f5a623;
  --border: #263547;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: rgba(15, 23, 32, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.brand { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.brand span { color: var(--accent); }

.search { display: flex; flex: 1; max-width: 480px; gap: 6px; }
.search input {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  outline: none;
}
.search button, #review-form button {
  background: var(--accent);
  color: #06231d;
  border: 0;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

.auth { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.auth button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.auth .who { color: var(--muted); }
.auth .google-btn {
  background: #fff;
  color: #1f2328;
  border: 0;
  font-weight: 700;
}

.icon-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn.hidden { display: none; }

main { position: fixed; top: 56px; bottom: 0; left: 0; right: 0; }
#map { position: absolute; inset: 0; }

.panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 100%);
  background: var(--panel);
  border-left: 1px solid var(--border);
  padding: 20px;
  overflow-y: auto;
  transition: transform 0.2s ease;
}
.panel.hidden { transform: translateX(100%); }

.panel-close {
  position: absolute; top: 12px; right: 12px;
  background: transparent; border: 0; color: var(--muted);
  font-size: 26px; line-height: 1; cursor: pointer;
}

.panel h2 { margin: 0 30px 4px 0; font-size: 22px; }
.place-meta { color: var(--muted); font-size: 13px; margin-bottom: 16px; }

.score-summary {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; margin-bottom: 18px;
}
.avg-score { font-size: 34px; font-weight: 800; color: var(--accent-2); min-width: 56px; text-align: center; }
.score-label { color: var(--muted); font-size: 13px; line-height: 1.4; }
.score-label span { color: var(--text); }

h3 { font-size: 15px; margin: 18px 0 8px; }

#review-form { display: flex; flex-direction: column; gap: 8px; }
#review-form label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
#review-form select, #review-form input, #review-form textarea {
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  padding: 8px 10px; border-radius: 8px; outline: none; font: inherit;
}
#review-form textarea { min-height: 72px; resize: vertical; }
.status { font-size: 13px; color: var(--muted); min-height: 16px; margin: 4px 0 0; }

.review-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.review-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px;
}
.review-item .head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.review-item .rating { color: var(--accent-2); font-weight: 800; }
.review-item .title { font-weight: 600; margin: 4px 0; }
.review-item .body { color: var(--muted); font-size: 14px; white-space: pre-wrap; }
.review-item .meta { color: var(--muted); font-size: 12px; margin-top: 6px; }

.empty { color: var(--muted); font-size: 14px; }

/* Rating pin for reviewed towns */
.town-badge {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  background: var(--accent);
  color: #06231d;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  border-radius: 999px;
  border: 2px solid #06231d;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  white-space: nowrap;
  transform: translateY(-4px);
}
.town-badge .star { font-size: 12px; }
.town-badge:hover { filter: brightness(1.08); }

@media (max-width: 640px) {
  .brand { font-size: 17px; }
  .panel { width: 100%; }
}
