@font-face {
  font-family: 'Yanone Kaffeesatz';
  font-style: normal;
  font-weight: 500;
  src: url('../popp_feinkost_website/files/popp-feinkost/fonts/yanone-kaffeesatz-v24-latin-500.woff2') format('woff2'),
       url('../popp_feinkost_website/files/popp-feinkost/fonts/yanone-kaffeesatz-v24-latin-500.woff') format('woff');
  font-display: swap;
}

:root {
  --popp-red: #c8102e;
  --popp-red-dark: #a00d24;
  --gold: #f5c542;
  --gold-dark: #b6862a;
  --sky-top: #cfe9f5;
  --sky-bot: #f3e3c6;
  --ink: #2c1810;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  height: 100%;
  width: 100%;
  background: #111;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
  touch-action: none;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage {
  position: relative;
  width: 100vw;
  height: 100dvh;
  height: 100vh;
  max-width: 540px;
  margin: 0 auto;
  background: url('background.webp') center / cover no-repeat, linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bot) 100%);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

/* ---------------- HUD ---------------- */

.hud {
  position: absolute;
  top: calc(12px + var(--safe-top));
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 10;
  font-family: "Yanone Kaffeesatz", Helvetica, Arial, sans-serif;
}

.hud-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 6px 14px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
  border: none;
  font-family: inherit;
  color: var(--ink);
}

.height-pill { color: var(--popp-red); }

.coin-pill {
  background: linear-gradient(180deg, #fff7d6, #ffe48a);
  color: var(--gold-dark);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.coin-pill:active { transform: scale(0.95); }

.coin-icon {
  display: inline-block;
  color: var(--gold);
  font-size: 18px;
  line-height: 1;
  text-shadow: 0 1px 0 var(--gold-dark);
}

.coin-icon-sm {
  color: var(--gold);
  text-shadow: 0 1px 0 var(--gold-dark);
}

.hud-label {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
  font-weight: 500;
}

.hud-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hud-unit {
  font-size: 14px;
  opacity: 0.7;
  font-weight: 500;
}

/* ---------------- Tap hint ---------------- */

.tap-hint {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.92);
  color: var(--popp-red);
  font-family: "Yanone Kaffeesatz", Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: clamp(20px, 5.5vmin, 32px);
  padding: 0.4em 1.1em;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  opacity: 0;
  transition: opacity 300ms ease;
  z-index: 9;
  white-space: nowrap;
}

.tap-hint.visible {
  opacity: 1;
  animation: hint-pulse 1.4s ease-in-out infinite;
}

@keyframes hint-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -50%) scale(1.06); }
}

/* ---------------- Floating coins / milestones ---------------- */

.floaters {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  overflow: hidden;
}

.floater {
  position: absolute;
  font-family: "Yanone Kaffeesatz", Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 28px;
  color: var(--gold-dark);
  background: linear-gradient(180deg, #fff7d6, #ffe48a);
  border-radius: 999px;
  padding: 4px 14px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transform: translate(-50%, -50%);
  animation: floater-rise 1.5s ease-out forwards;
  white-space: nowrap;
}

@keyframes floater-rise {
  0%   { opacity: 0; transform: translate(-50%, -30%) scale(0.6); }
  20%  { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -160%) scale(0.95); }
}

/* ---------------- Modals ---------------- */

.modal {
  position: absolute;
  inset: 0;
  background: rgba(20, 10, 5, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
  z-index: 30;
}

.modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: linear-gradient(180deg, #fff 0%, #ffe9d9 100%);
  color: var(--ink);
  padding: 28px 26px 22px;
  border-radius: 22px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  width: 100%;
  max-width: 380px;
  animation: pop-in 420ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pop-in {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-title {
  font-family: "Yanone Kaffeesatz", Helvetica, Arial, sans-serif;
  font-size: 38px;
  font-weight: 700;
  color: var(--popp-red);
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}

.modal-stats {
  display: flex;
  justify-content: space-around;
  gap: 14px;
  margin-bottom: 14px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-num {
  font-family: "Yanone Kaffeesatz", Helvetica, Arial, sans-serif;
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}

.stat-lbl {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin-top: 4px;
}

.best-line {
  font-size: 14px;
  opacity: 0.7;
  margin-bottom: 18px;
}

.btn-primary, .btn-secondary {
  display: block;
  width: 100%;
  font-family: "Yanone Kaffeesatz", Helvetica, Arial, sans-serif;
  font-size: 22px;
  font-weight: 700;
  padding: 12px 20px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  transition: transform 120ms ease, background 120ms ease;
}

.btn-primary {
  background: var(--popp-red);
  color: #fff;
}
.btn-primary:hover { background: var(--popp-red-dark); }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  background: transparent;
  color: var(--popp-red);
  border: 2px solid var(--popp-red);
}
.btn-secondary:hover { background: rgba(200, 16, 46, 0.08); }
.btn-secondary:active { transform: scale(0.97); }

/* ---------------- Shop ---------------- */

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

.shop-sub {
  font-size: 14px;
  opacity: 0.7;
  margin-bottom: 14px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.shop-item {
  background: #fff;
  border: 2px solid #eadfd2;
  border-radius: 14px;
  padding: 12px 8px 10px;
  text-align: center;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
  font-family: inherit;
  color: var(--ink);
}
.shop-item:active { transform: scale(0.97); }
.shop-item.equipped { border-color: var(--popp-red); background: #fff5f0; }
.shop-item.locked { opacity: 0.85; }
.shop-item.affordable { border-color: var(--gold); }

.shop-thumb {
  width: 64px;
  height: 64px;
  margin: 0 auto 6px;
  display: block;
}

.shop-name {
  display: block;
  font-family: "Yanone Kaffeesatz", Helvetica, Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 4px;
}

.shop-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-dark);
}

.shop-price.equipped-tag { color: var(--popp-red); }
