:root {
  --sky: #38bdf8;
  --sky-dark: #0284c7;
  --sky-darker: #0369a1;
  --bg: #f0f9ff;
  --card: #ffffff;
  --ink: #0c4a6e;
  --muted: #5b8299;
  --brown: #8b5a22;
  --gold: #d9a441;
  --danger: #dc2626;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(2, 132, 199, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- nav ---------- */
.nav {
  background: linear-gradient(90deg, var(--sky-dark), var(--sky));
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav .brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.3px;
}
.nav .brand img { width: 42px; height: 42px; }
.nav a.nav-link {
  color: #e0f2fe;
  text-decoration: none;
  font-weight: 600;
  margin-left: 1.1rem;
}
.nav a.nav-link:hover { color: #fff; text-decoration: underline; }

/* ---------- splash ---------- */
#splash {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(160deg, var(--sky) 0%, var(--sky-dark) 70%, var(--sky-darker) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.1rem;
  animation: splash-hide 0.6s ease 2.6s forwards;
}
@keyframes splash-hide { to { opacity: 0; visibility: hidden; } }
.splash-logo {
  width: clamp(150px, 28vh, 230px); height: auto;
  filter: drop-shadow(0 16px 34px rgba(12, 74, 110, 0.45));
  animation: splash-bob 2.6s ease-in-out infinite;
}
@keyframes splash-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.splash-tag {
  color: #fff; font-weight: 800; letter-spacing: 4px; font-size: clamp(1rem, 2.6vw, 1.4rem);
  text-shadow: 0 2px 10px rgba(12, 74, 110, 0.4);
}
.splash-alias {
  background: #fef3c7; color: var(--brown); font-weight: 800; font-size: 1.15rem;
  border-radius: 999px; padding: 0.5rem 1.4rem; min-width: 240px; text-align: center;
  box-shadow: 0 8px 20px rgba(12, 74, 110, 0.35);
  font-variant-numeric: tabular-nums;
}

/* ---------- layout ---------- */
.container { width: min(960px, 92%); margin: 0 auto; flex: 1; padding: 2rem 0 3rem; }

.hero { text-align: center; padding: 2.5rem 0 2rem; }
.hero.fullscreen {
  min-height: calc(100vh - 60px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2rem 5vw 4rem;
  margin: -2rem 0 2rem;
  width: 100vw; position: relative; left: 50%; transform: translateX(-50%);
  background: linear-gradient(180deg, var(--sky) 0%, var(--sky-dark) 75%, var(--sky-darker) 100%);
}
.hero.fullscreen h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); color: #fff; text-shadow: 0 3px 14px rgba(12, 74, 110, 0.35); }
.hero.fullscreen p.sub { font-size: 1.25rem; color: #e0f2fe; }
.hero img.logo-huge {
  width: clamp(180px, 30vh, 300px); height: auto;
  filter: drop-shadow(0 14px 30px rgba(2,132,199,.35));
  animation: float 5s ease-in-out infinite;
}
.hero img.logo-big { width: 130px; height: 130px; filter: drop-shadow(0 8px 18px rgba(2,132,199,.25)); }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.hero h1 { font-size: 2.4rem; margin: 0.8rem 0 0.3rem; color: var(--sky-darker); }
.hero p.sub { color: var(--muted); font-size: 1.1rem; max-width: 560px; margin: 0 auto 1.5rem; }

.searchbar { display: flex; gap: 0.5rem; max-width: 620px; margin: 0 auto; }
.searchbar.jumbo { max-width: 680px; width: 100%; }
.searchbar.jumbo input { padding: 1.15rem 1.5rem; font-size: 1.15rem; }
.searchbar.jumbo .btn { font-size: 1.1rem; padding: 1.15rem 2rem; }

/* landing: search stacked and perfectly centered under the logo */
.hero.fullscreen .searchbar.jumbo {
  flex-direction: column; align-items: stretch; gap: 0.9rem; margin: 0 auto;
}
.hero.fullscreen .searchbar.jumbo input { text-align: center; }
.hero.fullscreen .searchbar.jumbo .btn { align-self: center; padding: 0.9rem 3.2rem; }
.searchbar input {
  flex: 1; padding: 0.9rem 1.1rem; border-radius: 999px;
  border: 2px solid var(--sky); font-size: 1rem; outline: none; background: #fff;
}
.searchbar input:focus { border-color: var(--sky-dark); box-shadow: 0 0 0 4px rgba(56,189,248,.25); }

.badge-row { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin-top: 1.2rem; }
.badge {
  background: #e0f2fe; color: var(--sky-darker); border: 1px solid #bae6fd;
  padding: 0.3rem 0.85rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block; border: none; cursor: pointer; text-decoration: none;
  background: var(--sky-dark); color: #fff; font-weight: 700; font-size: 1rem;
  padding: 0.85rem 1.6rem; border-radius: 999px; transition: background .15s, transform .1s;
}
.btn:hover { background: var(--sky-darker); transform: translateY(-1px); }
.btn.gold { background: var(--brown); }
.btn.gold:hover { background: #6f4719; }
.btn.ghost { background: #e0f2fe; color: var(--sky-darker); }
.btn.ghost:hover { background: #bae6fd; }
.btn.small { padding: 0.45rem 1rem; font-size: 0.85rem; }

/* ---------- cards ---------- */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.4rem 1.6rem; margin-bottom: 1.2rem; border: 1px solid #e0f2fe;
}
.card h2 { color: var(--sky-darker); margin-bottom: 0.8rem; }

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

.place-card { display: block; text-decoration: none; color: inherit; transition: transform .12s; }
.place-card:hover { transform: translateY(-3px); }
.place-card .addr { font-weight: 700; font-size: 1.05rem; color: var(--sky-darker); }
.place-card .meta { color: var(--muted); font-size: 0.9rem; margin-top: 0.25rem; }
.place-card .count {
  display: inline-block; margin-top: 0.6rem; background: #fef3c7; color: #92400e;
  border-radius: 999px; padding: 0.15rem 0.7rem; font-size: 0.8rem; font-weight: 700;
}

/* ---------- stats ---------- */
.overall {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.overall .score {
  font-size: 2.6rem; font-weight: 800; color: var(--brown);
  background: #fef3c7; border-radius: 18px; padding: 0.4rem 1.1rem;
}
.stat-row { display: flex; align-items: center; gap: 0.8rem; margin: 0.45rem 0; }
.stat-row .label { width: 170px; font-weight: 600; color: var(--sky-darker); }
.stat-row .bar { flex: 1; background: #e0f2fe; border-radius: 999px; height: 14px; overflow: hidden; }
.stat-row .bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--brown)); border-radius: 999px; }
.stat-row .val { width: 40px; text-align: right; font-weight: 700; }

/* ---------- landlord tiers ---------- */
.tier-badge {
  display: inline-block; font-weight: 800; border-radius: 999px;
  padding: 0.35rem 1rem; font-size: 1rem; border: 2px solid transparent;
}
.tier-badge.small { font-size: 0.78rem; padding: 0.15rem 0.7rem; margin-left: 0.4rem; }
.tier-gold   { background: #fef3c7; color: #92400e; border-color: #f59e0b; }
.tier-good   { background: #dcfce7; color: #166534; border-color: #22c55e; }
.tier-mid    { background: #e0f2fe; color: #0369a1; border-color: #7dd3fc; }
.tier-bad    { background: #ffedd5; color: #9a3412; border-color: #fb923c; }
.tier-rotten { background: #fee2e2; color: #991b1b; border-color: #ef4444; }
.tier-blurb { color: var(--muted); font-style: italic; margin: 0.25rem 0 0.5rem; }

/* ---------- potato meter ---------- */
.potato-meter { margin: 0.4rem 0 0.8rem; max-width: 420px; }
.meter-track {
  position: relative; height: 16px; border-radius: 999px;
  background: linear-gradient(90deg, #ef4444 0%, #fb923c 32%, #7dd3fc 55%, #22c55e 78%, #f59e0b 100%);
  box-shadow: inset 0 2px 5px rgba(12, 74, 110, 0.25);
}
.meter-fill {
  height: 100%; border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  border-right: 3px solid #fff;
}
.meter-spud {
  position: absolute; top: 50%; transform: translate(-50%, -58%);
  font-size: 26px; filter: drop-shadow(0 2px 4px rgba(12, 74, 110, 0.4));
  transition: left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.meter-labels {
  display: flex; justify-content: space-between; margin-top: 0.3rem;
  font-size: 0.68rem; font-weight: 700; color: var(--muted);
}

/* ---------- reviews ---------- */
.review { border-top: 1px dashed #bae6fd; padding: 1.1rem 0; }
.review:first-of-type { border-top: none; }
.alias-chip {
  display: inline-flex; align-items: center; gap: 0.45rem; background: #e0f2fe;
  color: var(--sky-darker); font-weight: 700; border-radius: 999px; padding: 0.3rem 0.9rem;
}
.alias-chip::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 0 3px rgba(217,164,65,.3);
}
.review .when { color: var(--muted); font-size: 0.85rem; margin-left: 0.6rem; }
.review .mini-ratings { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6rem 0; }
.mini-ratings span {
  background: #fef9e7; border: 1px solid #fde68a; color: #92400e;
  font-size: 0.78rem; font-weight: 600; border-radius: 8px; padding: 0.15rem 0.55rem;
}
.review .comment { margin-top: 0.4rem; white-space: pre-wrap; }
.again-yes { color: #15803d; font-weight: 700; }
.again-no { color: var(--danger); font-weight: 700; }

/* ---------- forms ---------- */
form.stack label { display: block; font-weight: 700; margin: 1rem 0 0.35rem; color: var(--sky-darker); }
form.stack input[type="text"], form.stack textarea, form.stack input[type="month"] {
  width: 100%; padding: 0.75rem 0.9rem; border: 2px solid #bae6fd; border-radius: 12px;
  font-size: 1rem; outline: none; background: #fff; font-family: inherit;
}
form.stack input:focus, form.stack textarea:focus { border-color: var(--sky); box-shadow: 0 0 0 4px rgba(56,189,248,.2); }
form.stack textarea { min-height: 130px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.hint { color: var(--muted); font-size: 0.85rem; margin-top: 0.25rem; }

.username-field { display: flex; align-items: stretch; }
.username-field input { border-radius: 12px 0 0 12px !important; border-right: none !important; }
.potato-suffix {
  display: flex; align-items: center; padding: 0 1rem; font-weight: 800; color: var(--brown);
  background: #fef3c7; border: 2px solid #bae6fd; border-left: none; border-radius: 0 12px 12px 0;
  white-space: nowrap;
}

/* star rating widget */
.stars { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 0.2rem; }
.stars input { display: none; }
.stars label { font-size: 1.9rem; color: #cbd5e1; cursor: pointer; margin: 0; transition: color .1s, transform .1s; }
.stars input:checked ~ label { color: #f59e0b; }
.stars label:hover, .stars label:hover ~ label { color: #fbbf24; transform: scale(1.1); }

.cat-block { background: #f0f9ff; border: 1px solid #e0f2fe; border-radius: 12px; padding: 0.9rem 1.1rem; margin-top: 0.8rem; }
.cat-block .cat-title { font-weight: 700; color: var(--sky-darker); }
.cat-block .cat-desc { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.3rem; }

/* ---------- flash ---------- */
.flash { border-radius: 12px; padding: 0.8rem 1.1rem; margin-bottom: 1rem; font-weight: 600; }
.flash.success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.flash.error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.flash.info { background: #e0f2fe; color: var(--sky-darker); border: 1px solid #7dd3fc; }

/* ---------- misc ---------- */
.section-title { margin: 2rem 0 1rem; color: var(--sky-darker); font-size: 1.35rem; }
.empty { text-align: center; color: var(--muted); padding: 2rem 0; }
.actions { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 1rem; }

footer {
  background: var(--sky-darker); color: #bae6fd; text-align: center;
  padding: 1.2rem; font-size: 0.9rem; margin-top: auto;
}
footer img { width: 26px; vertical-align: middle; margin-right: 6px; }

.privacy-note {
  background: #fef9e7; border: 1px solid #fde68a; border-radius: 12px;
  padding: 0.9rem 1.2rem; color: #92400e; font-size: 0.9rem; margin-bottom: 1.2rem;
}

form.stack select {
  width: 100%; padding: 0.75rem 0.9rem; border: 2px solid #bae6fd; border-radius: 12px;
  font-size: 1rem; outline: none; background: #fff; font-family: inherit;
}

.trust-chip {
  display: inline-block; margin-left: 0.5rem; font-size: 0.75rem; font-weight: 700;
  border-radius: 999px; padding: 0.15rem 0.6rem; vertical-align: middle;
}
.trust-chip.registered { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.trust-chip.guest { background: #f1f5f9; color: #64748b; border: 1px solid #cbd5e1; }

.report-form { display: flex; gap: 0.5rem; margin-top: 0.6rem; align-items: center; }
.report-form input {
  flex: 0 1 240px; padding: 0.35rem 0.7rem; font-size: 0.8rem;
  border: 1px solid #e0f2fe; border-radius: 8px; outline: none;
}
.report-btn {
  background: none; border: none; color: var(--muted); font-size: 0.8rem;
  cursor: pointer; font-weight: 600; padding: 0.3rem 0.5rem;
}
.report-btn:hover { color: var(--danger); }

/* ---------- crash page ---------- */
.crash-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--sky) 0%, var(--sky-dark) 70%, var(--sky-darker) 100%);
}
.crash-card {
  background: var(--card); border-radius: 24px; box-shadow: 0 20px 60px rgba(12, 74, 110, 0.4);
  padding: 3rem 2.5rem; text-align: center; max-width: 480px; width: 92%;
  position: relative;
}
.crash-spud { font-size: 5rem; animation: crash-roll 2.5s ease-in-out infinite; display: inline-block; }
.crash-splat { position: absolute; top: 1.2rem; right: 22%; font-size: 2.2rem; transform: rotate(15deg); }
@keyframes crash-roll {
  0%, 100% { transform: rotate(-12deg) translateY(0); }
  30%      { transform: rotate(10deg) translateY(-10px); }
  60%      { transform: rotate(-6deg) translateY(0); }
}
.crash-card h1 { color: var(--sky-darker); margin: 0.8rem 0 0.2rem; }
.crash-code { color: var(--brown); font-weight: 800; letter-spacing: 2px; font-size: 0.9rem; }
.crash-msg { color: var(--muted); margin: 0.6rem 0 1.4rem; }

/* ---------- admin ---------- */
.admin-table { width: 100%; border-collapse: collapse; margin-top: 0.6rem; }
.admin-table th, .admin-table td { text-align: left; padding: 0.6rem 0.7rem; border-bottom: 1px solid #e0f2fe; }
.admin-table th { color: var(--sky-darker); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #b91c1c; }

/* ---------- potato map ---------- */
#potato-map { height: 65vh; border-radius: var(--radius); border: 2px solid #bae6fd; z-index: 1; }
.potato-marker { font-size: 26px; text-align: center; filter: drop-shadow(0 2px 4px rgba(12,74,110,.4)); }

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .stat-row .label { width: 120px; font-size: 0.9rem; }
  .hero h1 { font-size: 1.9rem; }
}
