:root {
  --survey-orange: #d35400;
  --survey-orange-dark: #9e3d00;
  --survey-yellow: #f1c40f;
  --survey-cream: #f9e79f;
}
html:has(.survey-page) { background: var(--survey-yellow); }
body.survey-page {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: #281b08;
  background: linear-gradient(to top, var(--survey-yellow), var(--survey-cream));
}
.survey-page a { color: inherit; }
.survey-back {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .65rem .9rem;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px;
  color: #fff !important;
  background: rgba(35, 27, 18, .88);
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(0,0,0,.22);
  backdrop-filter: blur(8px);
}
.survey-back:hover { background: #1f1710; }
.survey-stage {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow: hidden;
  padding: 1rem 1rem 2rem;
}
.bubble-layer { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.survey-bubble {
  position: absolute;
  bottom: -30px;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 50%;
  background: rgba(255,255,255,.34);
  animation: survey-rise linear forwards;
}
@keyframes survey-rise {
  from { transform: translateY(0) scale(1); opacity: .75; }
  to { transform: translateY(-115vh) scale(.35); opacity: 0; }
}

/* Besucher fliegen auf drei festen Bahnen mit berechnetem Sicherheitsabstand. */
.visitor-flight {
  position: relative;
  z-index: 5;
  width: min(1120px, 100%);
  margin: 0 auto 1.2rem;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.58);
  border-radius: 22px;
  background: rgba(255,255,255,.3);
  box-shadow: 0 14px 38px rgba(93,64,10,.13);
  backdrop-filter: blur(12px);
}
.visitor-flight__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1rem .55rem;
  border-bottom: 1px solid rgba(89,57,5,.12);
}
.visitor-flight__heading h1 { margin: .05rem 0 0; font-size: clamp(1rem, 2.5vw, 1.35rem); }
.visitor-flight__eyebrow {
  margin: 0;
  color: rgba(55,37,7,.6);
  font-size: .68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .14em;
}
.concept-badge {
  flex: 0 0 auto;
  padding: .35rem .65rem;
  border-radius: 999px;
  color: #fff;
  background: rgba(41,31,15,.82);
  font-size: .72rem;
  font-weight: 850;
}
.visitor-flight__viewport {
  position: relative;
  height: 140px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255,255,255,.3), transparent 10%, transparent 90%, rgba(255,255,255,.3)),
    repeating-linear-gradient(0deg, transparent 0 43px, rgba(85,56,8,.05) 43px 44px);
}
.visitor-flight__fallback { margin: 0; padding: 2.7rem 1rem; text-align: center; color: rgba(50,33,6,.55); }
.visitor-flyer {
  --flight-top: 12px;
  --flight-start: -400px;
  --flight-end: 1200px;
  --flight-duration: 16s;
  position: absolute;
  top: var(--flight-top);
  left: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  max-width: 330px;
  min-height: 31px;
  padding: .4rem .75rem .4rem .45rem;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, rgba(47,35,17,.95), rgba(88,56,10,.9));
  box-shadow: 0 7px 16px rgba(58,37,5,.22);
  white-space: nowrap;
  opacity: 0;
  animation: visitor-fly-ltr var(--flight-duration) linear forwards;
  will-change: transform, opacity;
  pointer-events: none;
}
.visitor-flyer::after {
  content: '';
  position: absolute;
  right: 100%;
  width: 64px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.65));
}
.visitor-flyer__beer {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: rgba(255,255,255,.14);
  font-size: 1rem;
}
.visitor-flyer strong { overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.visitor-flyer > span:last-child { color: #ffe26a; font-size: .87rem; }
@keyframes visitor-fly-ltr {
  0% { transform: translate3d(var(--flight-start), 0, 0); opacity: 0; }
  4% { opacity: 1; }
  96% { opacity: 1; }
  100% { transform: translate3d(var(--flight-end), 0, 0); opacity: 0; }
}
.visitor-flyer--measuring {
  animation: none;
  visibility: hidden;
}
.visitor-flight__viewport--static {
  display: flex;
  align-items: center;
  gap: .55rem;
  height: auto;
  min-height: 80px;
  padding: 1rem;
  overflow-x: auto;
}
.visitor-static-entry {
  flex: 0 0 auto;
  padding: .45rem .75rem;
  border-radius: 999px;
  color: #fff;
  background: rgba(43,32,15,.9);
  font-weight: 800;
}

.survey-main {
  position: relative;
  z-index: 2;
  width: min(720px, 100%);
  margin: 0 auto;
  text-align: center;
}
.counter-kicker {
  margin: 0;
  font-size: .8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: rgba(58,38,8,.65);
}
.visit-counter {
  min-height: 1em;
  margin: -.1em 0 .05em;
  color: rgba(255,255,255,.72);
  font-size: clamp(6.5rem, 18vw, 12rem);
  font-weight: 950;
  line-height: .95;
  letter-spacing: -.07em;
  text-shadow: 3px 4px 12px rgba(0,0,0,.35);
}
.beer-qr {
  display: inline-grid;
  justify-items: center;
  gap: .3rem;
  margin: .25rem auto 1rem;
  color: #281b08;
  text-decoration: none;
  font-weight: 900;
}
.beer-qr img {
  width: 132px;
  height: 132px;
  border: 8px solid #fff;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(0,0,0,.22);
}
.beer-qr span { font-size: .92rem; }
.survey-form-wrap {
  width: min(620px, 100%);
  margin: 0 auto;
  padding: 1.1rem 1.15rem 1rem;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 22px;
  background: rgba(255,255,255,.27);
  box-shadow: 0 16px 46px rgba(92,61,6,.13);
  backdrop-filter: blur(12px);
}
.beer-emoji { font-size: 2rem; line-height: 1; }
.survey-form-wrap h2 { margin: .25rem 0 0; font-size: clamp(1.8rem, 5vw, 2.6rem); }
.survey-form-wrap > p { margin: .25rem auto .9rem; color: rgba(40,27,8,.76); }
.visit-form { display: grid; gap: .8rem; }
.survey-fields { display: grid; grid-template-columns: 1fr 1.25fr; gap: .75rem; text-align: left; }
.survey-fields label { font-size: .88rem; }
.survey-fields label small { font-weight: 600; }
.survey-fields input {
  border: 2px solid rgba(90,55,0,.18);
  background: rgba(255,255,255,.92);
  box-shadow: 0 4px 14px rgba(70,48,7,.08);
}
.city-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; }
.city-chips button {
  min-height: 36px;
  padding: .35rem .7rem;
  border: 1px solid rgba(87,52,0,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.62);
  color: #432d0d;
  font-weight: 750;
}
.city-chips button:hover { background: #fff; }
.counter-btn {
  justify-self: center;
  min-width: 170px;
  min-height: 50px;
  margin-top: .15rem;
  padding: .8rem 1.4rem;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: var(--survey-orange);
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(145,55,0,.22);
  transition: transform .18s ease, background .18s ease;
}
.counter-btn:hover { transform: translateY(-2px); background: var(--survey-orange-dark); }
.counter-btn:disabled { opacity: .58; cursor: not-allowed; transform: none; }
.survey-status { min-height: 1.4em; margin: 0; font-weight: 850; }
.survey-status.error { color: #8f1919; }
.survey-status.success { color: #175f37; }
.survey-status.review { color: #744b00; }
.pending-note {
  margin: 0;
  padding: .55rem .7rem;
  border: 1px dashed rgba(112,70,0,.35);
  border-radius: 10px;
  background: rgba(255,245,190,.58);
  color: #6c4700;
  font-size: .82rem;
  font-weight: 750;
}
.survey-privacy { margin: 0 !important; font-size: .78rem; color: rgba(40,27,8,.72) !important; }
.reset-demo {
  justify-self: center;
  border: 0;
  border-bottom: 1px solid currentColor;
  padding: .1rem;
  color: rgba(53,35,6,.65);
  background: transparent;
  font-size: .76rem;
}
.reset-demo:hover { color: #281b08; }
.city-ranking {
  position: relative;
  z-index: 2;
  width: min(760px, 100%);
  margin: 1.15rem auto 0;
  padding: 1rem;
  text-align: center;
  color: #fff;
  border-radius: 20px;
  background: linear-gradient(to top, rgba(25,25,25,.91), rgba(25,25,25,.73));
  box-shadow: 0 14px 36px rgba(0,0,0,.18);
}
.city-ranking h2 { margin: 0 0 .8rem; font-size: 1rem; text-transform: uppercase; letter-spacing: .12em; }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.rank-card {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: .7rem .6rem;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  background: rgba(255,255,255,.1);
}
.rank-card .medal { font-size: 1.45rem; }
.rank-card strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.03rem; }
.rank-card span:last-child { color: #ffd84d; font-size: .8rem; }
.survey-noscript { position: fixed; inset: auto 1rem 1rem; z-index: 100; padding: 1rem; background: #fff; border-radius: 12px; }
@media (max-width: 640px) {
  .survey-stage { padding: .6rem .6rem 5rem; overflow: visible; }
  .visitor-flight { border-radius: 16px; }
  .visitor-flight__heading { align-items: flex-start; padding: .65rem .75rem .5rem; }
  .concept-badge { font-size: .63rem; }
  .visitor-flight__viewport { height: 140px; }
  .visitor-flyer { max-width: 290px; font-size: .84rem; }
  .visit-counter { font-size: clamp(6rem, 34vw, 9rem); }
  .beer-qr img { width: 108px; height: 108px; border-width: 6px; }
  .survey-fields { grid-template-columns: 1fr; }
  .survey-form-wrap { padding-inline: .85rem; }
  .podium { gap: .35rem; }
  .rank-card { padding-inline: .25rem; }
  .rank-card strong { font-size: .85rem; }
  .survey-back { left: .75rem; bottom: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
  .survey-bubble, .visitor-flyer { animation: none; }
}
