:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f9fbff;
  --text: #172033;
  --text-soft: #5e6c84;
  --border: #e3e8f3;
  --primary: #3457ff;
  --primary-strong: #2844cf;
  --ok-bg: #eaf8ef;
  --ok-text: #17673c;
  --error-bg: #fdecec;
  --error-text: #9f2323;
  --shadow: 0 8px 24px rgba(19, 35, 89, 0.08);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    sans-serif;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 0% 0%, #dbe5ff 0%, transparent 30%),
    radial-gradient(circle at 100% 0%, #e9f1ff 0%, transparent 28%), var(--bg);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--border);
}

.topbar {
  max-width: 1050px;
  margin: 0 auto;
  padding: 1rem;
}

.title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

h1 {
  font-size: 1.4rem;
  line-height: 1.2;
  margin: 0;
}

.subtitle {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.nav a {
  text-decoration: none;
  color: var(--primary-strong);
  background: #edf1ff;
  border: 1px solid #d8e1ff;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
}

.nav a:hover {
  background: #e2e9ff;
}

.nav a.active,
.nav a[aria-current="page"] {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

main,
.container {
  max-width: 1050px;
  margin: 1.4rem auto;
  padding: 0 1rem 3rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}

h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.muted {
  color: var(--text-soft);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.rankings-section {
  margin-top: 1.5rem;
}

.ranking-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.ranking-card h3 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border-radius: var(--radius);
  padding: 0.95rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 0.5rem;
}

.card p {
  margin: 0.35rem 0;
}

.card a,
.ranking a {
  color: var(--primary-strong);
  text-decoration: none;
}

.card a:hover,
.ranking a:hover {
  text-decoration: underline;
}

.cover {
  width: 100%;
  border-radius: 10px;
  margin-top: 0.7rem;
  border: 1px solid var(--border);
  display: block;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
  margin-top: 0.85rem;
}

.form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.form label {
  display: block;
  margin-bottom: 0.8rem;
  font-weight: 600;
  font-size: 0.93rem;
}

.form input,
.form textarea,
.form button {
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.62rem 0.72rem;
  border: 1px solid #d4dced;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}

.form input:focus,
.form textarea:focus {
  outline: 2px solid #d5ddff;
  border-color: #bccbff;
}

.form button {
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 700;
  margin-top: 0.45rem;
}

.form button:hover {
  background: var(--primary-strong);
}

.inline-form {
  display: inline-block;
  margin-bottom: 1rem;
}

.inline-form button {
  width: auto;
  padding: 0.46rem 0.82rem;
  background: #2b3345;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

.auth-card {
  max-width: 420px;
}

.row {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.ranking {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1rem 1rem 2rem;
}

.ranking li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px dashed var(--border);
}

.ranking li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.score-pill {
  font-weight: 700;
  color: var(--primary-strong);
  background: #edf1ff;
  border: 1px solid #d8e1ff;
  border-radius: 999px;
  padding: 0.22rem 0.62rem;
}

.rank-medal {
  margin-right: 0.3rem;
}

.review-panel h2 {
  margin-top: 1.1rem;
}

.review-top-metrics {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.review-metric {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.review-metric span:first-child {
  color: var(--text-soft);
  font-weight: 600;
}

.review-score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.65rem;
}

.review-score-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 0.7rem 0.75rem;
}

.review-score-label {
  margin: 0;
  color: var(--text-soft);
  font-weight: 600;
  font-size: 0.9rem;
}

.review-score-value {
  margin: 0.35rem 0 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary-strong);
}

#map {
  height: 72vh;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.ok,
.error {
  border-radius: 10px;
  padding: 0.65rem 0.78rem;
  margin-bottom: 0.9rem;
  font-weight: 600;
}

.ok {
  background: var(--ok-bg);
  color: var(--ok-text);
  border: 1px solid #c6ebd3;
}

.error {
  background: var(--error-bg);
  color: var(--error-text);
  border: 1px solid #f4c5c5;
}

.review-admin-list {
  margin-top: 1rem;
}

.admin-review-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.admin-review-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  border-bottom: 1px dashed var(--border);
  padding: 0.75rem 0;
}

.admin-review-list li:last-child {
  border-bottom: none;
}

.admin-review-list p {
  margin: 0.28rem 0 0;
}

.danger-btn {
  border: none;
  background: #be2b2b;
  color: #fff;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-weight: 600;
}

.danger-btn:hover {
  background: #a52222;
}

@media (max-width: 700px) {
  .title-row {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 0.55rem;
  }

  .nav {
    gap: 0.45rem;
  }

  .nav a {
    font-size: 0.86rem;
  }

  .admin-review-list li {
    flex-direction: column;
  }

  .ranking-grid {
    grid-template-columns: 1fr;
  }
}
