:root {
  --keo-green: #0e6b45;      /* lit bottle glass */
  --keo-green-dark: #084f33; /* deep bottle glass */
  --keo-gold: #e9b949;       /* label trim */
  --keo-red: #c8102e;        /* KEO letter red */
  --keo-red-dark: #a50d26;
  --foam: #fff8e7;
  --lager: #f2a93b;
  --keo-yellow: #efbb03; /* exact background yellow sampled from ilovemykeo.png */
}

* { box-sizing: border-box; }

/* Persistent field labels (placeholder is a hint, never the label) */
.f-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  color: #4f4f4f;
  margin: 2px 0 3px;
}
.f-label .opt { font-weight: 400; color: #6b6b6b; }
.f-row { display: flex; gap: 8px; }
.f-row > div { flex: 1; }

/* Motion is an enhancement, never a requirement */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

a { text-decoration: none; }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--keo-gold);
  outline-offset: 2px;
}
#add-pin-btn, .form-actions button, #ranking-toggle, #keonomics-toggle,
.contact-card button, .auth-pane button, #upload-form button, #phone-form button, #logout-btn {
  transition: background 0.15s ease, transform 0.06s ease;
}
#add-pin-btn:active, .form-actions button:active { transform: translateX(-50%) scale(0.98); }
.form-actions button:active { transform: scale(0.98); }

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
  height: 100vh; /* fallback */
  height: 100dvh;
}

header {
  background: linear-gradient(180deg, #f5c81c, var(--keo-yellow) 55%, #dfa900);
  border-bottom: 3px solid var(--keo-red);
  color: #4a3000;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Brand: pint glass + label-chip wordmark, top left */
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  flex-shrink: 0;
}
.pint-photo {
  display: block;
  height: 56px;
  width: auto;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* Floating country ranking, bottom left over the map (pill + card) */
/* the fixed containers overlap each other (fully on mobile where both
   span the width) — they must be click-transparent, with only their
   visible children catching taps */
#country-ranking, #keonomics { pointer-events: none; }
#country-ranking > *, #keonomics > * { pointer-events: auto; }
/* same base layer for both pills; an OPEN panel rises above the other */
#country-ranking:not(.collapsed), #keonomics:not(.collapsed) { z-index: 1310; }

/* while a pin card is open it owns the screen: the floating controls
   fade out of its way (the popup lives inside the map's stacking layers
   and can never out-z-index fixed elements — so they yield instead) */
#country-ranking, #keonomics, #add-pin-btn {
  transition: opacity 0.2s ease;
}
body.popup-open #country-ranking,
body.popup-open #keonomics,
body.popup-open #add-pin-btn,
body.form-open #country-ranking,
body.form-open #keonomics {
  opacity: 0;
  pointer-events: none !important;
}
body.popup-open #country-ranking > *,
body.popup-open #keonomics > *,
body.form-open #country-ranking > *,
body.form-open #keonomics > * { pointer-events: none; }
#country-ranking {
  position: fixed;
  left: 10px;
  bottom: 46px;
  z-index: 1300;
  max-width: 210px;
  font-size: 0.82rem;
}
#ranking-toggle:hover, #keonomics-toggle:hover { background: #f5c81c; color: var(--keo-red); }
#ranking-toggle {
  display: block;
  margin-right: auto;
  background: linear-gradient(180deg, #f5c81c, var(--keo-yellow));
  border: 1.5px solid #c79a00;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 800;
  color: #7c1220;
  cursor: pointer;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.65), 0 2px 8px rgba(0, 0, 0, 0.3);
}
#ranking-body {
  margin-top: 6px;
  background: var(--foam);
  border: 1.5px solid var(--keo-gold);
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
#country-ranking.collapsed #ranking-body { display: none; }
#country-ranking h2 {
  margin: 0 0 4px;
  font-size: 0.78rem;
  color: var(--keo-green-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
#country-list { margin: 0; padding: 0; list-style: none; }
#country-list li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
#country-list .cname {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
}
#country-list .cname:hover, #hot-list .cname:hover { color: var(--keo-red); }
#country-list .ccount { font-weight: 700; color: var(--keo-red); }

/* top 20 by default; expanded shows everything in a scrollable list */
#country-ranking:not(.expanded) #country-list li:nth-child(n+21) { display: none; }
#country-ranking.expanded #country-list {
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 4px;
}
#ranking-more {
  margin-top: 6px;
  width: 100%;
  border: none;
  background: none;
  color: var(--keo-red);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}
#ranking-more:hover { color: var(--keo-red-dark); }
#hot-wrap h2, #spotters-wrap h2 { margin-top: 8px; }
#hot-list, #spotter-list { margin: 0 0 4px; padding: 0; list-style: none; }
#hot-list li, #spotter-list li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }

/* KEOnomics: floating price index, bottom right */
#keonomics {
  position: fixed;
  right: 10px;
  bottom: 46px;
  z-index: 1300;
  max-width: 320px;
  font-size: 0.82rem;
}
#keonomics-toggle {
  display: block;
  margin-left: auto;
  background: linear-gradient(180deg, #f5c81c, var(--keo-yellow));
  border: 1.5px solid #c79a00;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 800;
  color: #7c1220;
  cursor: pointer;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.65), 0 2px 8px rgba(0, 0, 0, 0.3);
}
#keonomics-body {
  margin-top: 6px;
  background: var(--foam);
  border: 1.5px solid var(--keo-gold);
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
#keonomics.collapsed #keonomics-body { display: none; }
#keonomics-body h2 {
  margin: 0;
  font-size: 0.78rem;
  color: var(--keo-green-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.keonomics-sub { margin: 0 0 6px; font-size: 0.72rem; color: #5f5b50; }
#keonomics-body table { border-collapse: collapse; width: 100%; }
#keonomics-body th {
  text-align: left;
  font-size: 0.7rem;
  color: #6b675c;
  font-weight: 600;
  padding: 0 4px 2px 0;
}
#keonomics-body td { padding: 3px 4px 3px 0; }
#keonomics-body tbody { display: table-row-group; }
#keonomics-body tbody tr { cursor: pointer; }
#keonomics-body tbody tr:hover td { background: #fbf0c8; }
#keonomics-body td.kplace {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#keonomics-body td.kprice { font-weight: 700; color: var(--keo-red); text-align: center; font-variant-numeric: tabular-nums; }
#keonomics-body th.sortable {
  text-align: center;
  cursor: pointer;
  padding: 3px 4px;
  border-radius: 6px;
  transition: background 0.15s ease;
}
#keonomics-body th.sortable:hover { background: #f5e7b0; }
#keonomics-body th.sortable.active {
  background: linear-gradient(180deg, #f5c81c, var(--keo-yellow));
  box-shadow: inset 0 0 0 1px #c79a00;
}
#keonomics-body td.ksort { background: #fbf0c8; }
#keonomics-body td.ksort:not(.kempty) { font-weight: 800; }
#keonomics-body td.kempty { color: #c9c2b2; font-weight: 400; }
#keonomics-body tbody { max-height: none; }
#keonomics-scroll { max-height: 45vh; overflow-y: auto; }
.keonomics-note { margin: 6px 0 0; font-size: 0.68rem; color: #6b675c; }
.ktabs { display: flex; gap: 4px; margin: 6px 0 8px; }
.ktab {
  flex: 1;
  border: none;
  background: #f3edda;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 0.74rem;
  font-weight: 800;
  color: #6b5b20;
  cursor: pointer;
  transition: background 0.15s ease;
}
.ktab.active {
  background: linear-gradient(180deg, #f5c81c, var(--keo-yellow));
  color: #7c1220;
  box-shadow: inset 0 0 0 1px #c79a00;
}
#kphoto-list { margin: 0; padding: 0; list-style: none; max-height: 45vh; overflow-y: auto; }
.kphoto { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.kphoto img { width: 52px; height: 38px; object-fit: cover; border-radius: 6px; display: block; }
.kphoto-cheers { font-weight: 800; color: var(--keo-red); font-size: 0.8rem; }
.kphoto-gold { font-size: 0.9rem; }
.kphoto-jump {
  margin-left: auto;
  border: 1px solid var(--keo-gold);
  background: var(--foam);
  border-radius: 999px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.kphoto-jump:hover { background: var(--keo-yellow); }
.kphoto-empty { font-size: 0.78rem; color: #6b675c; list-style: none; }
.klink { display: block; margin-top: 6px; font-size: 0.74rem; font-weight: 700; color: #7c1220; }
.klink:hover { color: var(--keo-red); }
@media (max-width: 430px) {
  /* corner pill stays put; the expanded body floats as its own
     full-width sheet above the pill row */
  #keonomics { bottom: 40px; font-size: 0.8rem; }
  #keonomics-body {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 92px;
    max-height: 58vh;
    overflow-y: auto;
  }
  #keonomics-scroll { max-height: none; }
  #keonomics-body td.kplace { max-width: none; }
}

/* ---- The Wall page ---- */
.head-link { color: #7c1220; font-size: 0.85rem; font-weight: 700; }
.head-link:hover { color: var(--keo-red); }
.head-text p { margin: 2px 0 0; }

.wall-page { height: auto; min-height: 100vh; min-height: 100dvh; }
.wall-flow {
  flex: 1;
  padding: 16px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
.wall-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
#post-toggle {
  background: var(--keo-red);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: background 0.15s ease;
}
#post-toggle:hover { background: var(--keo-red-dark); }
#wall-count { font-size: 0.85rem; font-weight: 700; color: var(--keo-red); }
#account-drawer { max-width: 430px; margin: 0 auto 18px; }
.golden-badge {
  background: linear-gradient(180deg, #f5c81c, var(--keo-yellow));
  color: #5a3c00;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 8px;
  text-align: center;
  letter-spacing: 0.02em;
}
#wall-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  background: var(--keo-green-dark);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  font-size: 0.9rem;
}

#account-box {
  background: var(--foam);
  border: 1.5px solid var(--keo-gold);
  border-radius: 10px;
  padding: 14px;
  align-self: start;
  font-size: 0.9rem;
}
.auth-tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.auth-tab {
  flex: 1;
  border: none;
  background: none;
  padding: 6px 2px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #666;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.auth-tab.active { color: var(--keo-green-dark); border-bottom-color: var(--keo-red); }
.auth-pane input, #phone-form input, #upload-form input[type="file"] {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
  background: #fff;
}
.auth-pane button, #upload-form button, #phone-form button, #logout-btn {
  width: 100%;
  padding: 9px;
  border: none;
  border-radius: 6px;
  background: var(--keo-red);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
}
#phone-form button { background: var(--keo-green); }
#logout-btn { background: #888; }
.auth-note { font-size: 0.75rem; color: #575757; margin: 0 0 8px; }
#account-email { font-weight: 700; color: var(--keo-green-dark); word-break: break-all; margin: 0 0 4px; }
.badge-v {
  background: var(--keo-green);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
#account-badges { margin: 0 0 10px; }
#phone-form { border-top: 1px dashed #ddd; padding-top: 10px; margin-top: 6px; }
#account-msg {
  margin: 10px 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--keo-green-dark);
}
#account-msg.error { color: var(--keo-red); }

#wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  align-content: start;
}
.wall-item {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  margin: 0;
  background: #fff;
  border: 1px solid #e5e0d5;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.wall-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18); }
.wall-item img { width: 100%; height: 180px; object-fit: cover; display: block; }
.wall-item figcaption { font-size: 0.72rem; color: #626262; padding: 6px 8px; }
#wall-empty { color: #5f5f5f; }
.wall-cheers {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px 8px;
}
.cheer-btn {
  border: 1px solid var(--keo-gold);
  background: var(--foam);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--keo-green-dark);
  cursor: pointer;
  transition: background 0.15s ease;
}
.cheer-btn:hover { background: var(--keo-yellow); }
.wall-cheer-count { font-size: 0.78rem; font-weight: 700; color: var(--keo-red); }

/* contact page */
.contact-main { flex: 1; display: grid; place-items: start center; padding: 24px 16px; }
.contact-card {
  background: var(--foam);
  border: 1.5px solid var(--keo-gold);
  border-radius: 12px;
  padding: 20px;
  width: min(94vw, 460px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}
.contact-card input, .contact-card textarea {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 9px;
  border: 1px solid #d5cfc0;
  border-radius: 7px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  resize: vertical;
}
.contact-card button {
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: 7px;
  background: var(--keo-red);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}
.contact-card button:hover { background: var(--keo-red-dark); }
#contact-msg { margin: 10px 0 0; font-size: 0.85rem; font-weight: 600; color: var(--keo-green-dark); }
#contact-msg.error { color: var(--keo-red); }

/* photos inside map popups */
.popup-photos { display: flex; gap: 4px; margin-top: 6px; }
.popup-photos img { width: 70px; height: 52px; object-fit: cover; border-radius: 4px; }

/* per-size price inputs */
.price-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.price-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: 1px solid #ccc;
  border-radius: 7px;
  padding: 6px 4px 5px;
  background: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  color: #4f4f4f;
}
.price-cell input {
  width: 100%;
  border: none;
  border-top: 1px dashed #e2dccb;
  text-align: center;
  font-size: 16px;
  padding: 3px 0 0;
  margin-top: 2px;
}
.price-cell input:focus { outline: none; }
.price-cell:focus-within { border-color: var(--keo-red); background: var(--foam); }

/* serving type picker + vector icons */
.serving-pick { display: flex; gap: 6px; margin-bottom: 8px; }
.serving-pick label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 6px 4px;
  font-size: 0.8rem;
  cursor: pointer;
  background: #fff;
  position: relative;
}
.serving-pick input { position: absolute; opacity: 0; pointer-events: none; }
.serving-pick label:has(input:checked) {
  border-color: var(--keo-red);
  background: var(--foam);
  font-weight: 700;
}
.ic { width: 15px; height: 21px; vertical-align: -4px; }
#keonomics-body th .ic { width: 14px; height: 19px; }

.coldness-pick label { font-size: 0.72rem; padding: 5px 2px; }
.cold-bad { color: var(--keo-red); font-weight: 700; }
.cold-ok { color: #2471a3; }
.cold-best { color: #148f77; font-weight: 700; }

/* Google Maps InfoWindow — replace the stock chrome with the house card */
.gm-style .gm-style-iw-c {
  border-radius: 12px;
  border: 1.5px solid var(--keo-gold);
  background: #fffdf4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  padding: 0 !important;
  max-width: min(86vw, 300px) !important;
}
.gm-style .gm-style-iw-d {
  overflow: auto !important;
  padding: 12px 14px 12px !important;
}
.gm-style .gm-style-iw-tc::after { background: #fffdf4; }
.gm-style .gm-ui-hover-effect { display: none !important; } /* we render our own ✕ */

.iw {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.85rem;
  line-height: 1.45;
  width: 248px;
  max-width: 78vw;
}
.iw-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 1rem;
  padding-bottom: 7px;
  border-bottom: 1.5px solid var(--keo-yellow);
}
.iw-close {
  margin-left: auto;
  border: none;
  background: none;
  color: #7c1220;
  font-size: 1rem;
  font-weight: 800;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.iw-close:hover { background: #fdeaea; color: var(--keo-red); }
.iw-beer { font-size: 1.2rem; }
.iw-title strong { color: #1e1e1e; }
.iw-note { color: #4a4a4a; margin: 7px 0 0; }

.iw-pricegrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
  gap: 4px;
  background: #fdf3cf;
  border: 1px solid #f0dfa4;
  border-radius: 8px;
  padding: 7px 6px;
  margin: 9px 0 0;
}
.iw-pricegrid .pcell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.iw-pricegrid .pcell b { color: var(--keo-red); font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.iw-conf { color: #148f77; font-size: 0.72rem; font-weight: 700; margin-top: 3px; }

.iw-badges { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 0; }
.iw-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3efe2;
}
.iw-badge.cold-bad { background: #fdeaea; }
.iw-badge.cold-best { background: #e2f4ef; }
.iw-badge.streak { background: #fdeedd; color: #b3541e; }
.iw-badge.open-status:empty { display: none; }
.iw-badge.open-yes { background: #e2f4ef; }
.iw-badge.open-no { background: #fdeaea; }

.iw-meta { color: #5d5d5d; font-size: 0.74rem; margin: 6px 0 0; }

.iw-primary { display: flex; gap: 6px; margin-top: 10px; }
.iw-btn {
  flex: 1;
  text-align: center;
  border: none;
  border-radius: 8px;
  padding: 8px 4px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s ease;
}
.iw-btn:hover { filter: brightness(0.94); }
.iw-btn-red { background: var(--keo-red); color: #fff; }
.iw-btn-yellow { background: linear-gradient(180deg, #f5c81c, var(--keo-yellow)); color: #5a3000; }
.iw-btn-plain { background: #f1ecdd; color: #333; }

.iw-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dashed #e5d9b5;
}
.iw-link {
  border: none;
  background: none;
  padding: 3px 0;
  font-size: 0.74rem;
  font-weight: 700;
  color: #7c1220;
  cursor: pointer;
}
.iw-link:hover { color: var(--keo-red); }

/* photo strip that slides in beside an open pin */
#photo-strip {
  position: fixed;
  top: 92px;
  right: 10px;
  width: 150px;
  z-index: 1100;
  background: var(--foam);
  border: 1.5px solid var(--keo-gold);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateX(26px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: none;
}
#photo-strip.show { opacity: 1; transform: none; pointer-events: auto; }
#photo-strip h2 {
  margin: 0 0 6px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--keo-green-dark);
}
#photo-strip-imgs { display: flex; flex-direction: column; gap: 6px; }
#photo-strip-imgs img {
  width: 100%;
  height: 88px;
  object-fit: cover;
  border-radius: 7px;
  display: block;
}
@media (max-width: 430px) {
  #photo-strip { width: 104px; top: 72px; }
  #photo-strip-imgs img { height: 66px; }
}

/* fresh pins clink their glasses */
/* left mug is the mirrored one, so both handles face OUTWARD and the
   glass bodies meet in the middle (values pre-mirrored for scaleX(-1)) */
@keyframes clink-left {
  0%, 100% { transform: scaleX(-1) rotate(18deg) translateX(4px); }
  45%, 55% { transform: scaleX(-1) rotate(-7deg) translateX(-3px); }
}
@keyframes clink-right {
  0%, 100% { transform: rotate(18deg) translateX(4px); }
  45%, 55% { transform: rotate(-7deg) translateX(-3px); }
}
@keyframes clink-pop {
  0%, 40%, 100% { text-shadow: none; }
  50% { text-shadow: 0 0 10px rgba(245, 200, 28, 0.95); }
}
.cheers-anim {
  position: absolute;
  display: flex;
  font-size: 21px;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
  animation: clink-pop 1.6s ease-in-out infinite;
}
.cheers-anim .b1 { display: inline-block; transform-origin: 50% 88%; animation: clink-left 1.6s ease-in-out infinite; }
.cheers-anim .b2 { display: inline-block; transform-origin: 50% 88%; animation: clink-right 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .cheers-anim { display: none; }
}
.open-status { font-size: 0.78rem; font-weight: 700; }
.conf-ok { color: #148f77; font-size: 0.75rem; font-weight: 700; }
.streak { color: #b3541e; font-weight: 700; }
.open-status.open-yes { color: #148f77; }
.open-status.open-no { color: var(--keo-red); }

/* Places search floats at the top of the map while picking, so its
   suggestion dropdown has the whole screen to open into (bottom-sheet
   placement pushed it off-screen on phones). */
#place-search-box {
  position: fixed;
  top: 84px;
  left: 12px;
  right: 12px;
  max-width: 440px;
  margin: 0 auto;
  z-index: 1250;
}
#place-search-box gmp-place-autocomplete {
  display: block;
  width: 100%;
  border: 1.5px solid var(--keo-gold);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.28);
  font-size: 16px; /* keeps iOS from zoom-jumping the page */
  --gmp-mat-color-surface: #fff;
}
@media (max-width: 430px) {
  #place-search-box { top: 66px; }
}

/* popup + toast action buttons as chips */
.popup-action {
  display: inline-block;
  margin: 7px 4px 0 0;
  padding: 6px 12px;
  border: 1px solid var(--keo-gold);
  border-radius: 999px;
  background: var(--foam);
  color: var(--keo-green-dark);
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}
.popup-action:hover { background: var(--keo-yellow); }
.popup-del, .popup-report { color: var(--keo-red); }
#undo-btn {
  margin-left: 10px;
  background: var(--foam);
  color: var(--keo-green-dark);
  border: none;
  border-radius: 5px;
  padding: 3px 12px;
  font-weight: 700;
  cursor: pointer;
}
@media (max-width: 430px) {
  #country-ranking { bottom: 40px; font-size: 0.8rem; }
  #ranking-body {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 92px;
    max-height: 58vh;
    overflow-y: auto;
  }
  #country-ranking.expanded #country-list { max-height: none; }
}
.wordmark {
  margin: 0;
  background: var(--keo-yellow);
  border: 1.5px solid #c79a00;
  border-radius: 6px;
  padding: 2px 9px 3px;
  font-family: 'Anton', 'Arial Narrow', system-ui, sans-serif;
  font-weight: 400;
  font-size: 1.25rem;
  letter-spacing: 0.03em;
  line-height: 1.15;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.65), 0 1px 3px rgba(0, 0, 0, 0.3);
}
.wordmark .keo { color: var(--keo-red); }
.wordmark .tld { color: #f8f8f8; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35); }

.head-text { margin-left: auto; text-align: right; min-width: 0; }
.tagline { margin: 0; font-size: 0.8rem; color: #5a3c00; }
#stats { margin: 2px 0 0; font-size: 0.9rem; color: var(--keo-red); font-weight: 700; }

@media (max-width: 430px) {
  .tagline { display: none; }
  #stats { font-size: 0.8rem; }
  .pint-photo { height: 44px; }
  .wordmark { font-size: 1.05rem; }
}

#map { flex: 1; }

#add-pin-btn {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: var(--keo-red);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
#add-pin-btn:hover { background: var(--keo-red-dark); }

#pin-form {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  background: #fff;
  border-top: 3px solid var(--keo-green);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.25);
}
#pin-form-hint { margin: 0 0 8px; font-weight: 600; color: var(--keo-green-dark); }
#pin-details input {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px; /* prevents iOS zoom */
}
.form-actions { display: flex; gap: 8px; }
.form-actions button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}
.form-actions button[type="submit"] { background: var(--keo-red); color: #fff; font-weight: 600; }
#pin-cancel { background: #eee; }

/* Honeypot: hidden from humans, visible to naive bots */
.hp { position: absolute !important; left: -9999px !important; }

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
#toast {
  animation: toast-in 0.22s ease;
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  background: var(--keo-green-dark);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

footer {
  background: #f5f5f5;
  font-size: 0.72rem;
  color: #555;
  text-align: center;
  padding: 6px 8px;
}
footer a { color: var(--keo-red); font-weight: 600; }

.hidden { display: none !important; }
