/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden;
             font-family: 'Segoe UI', system-ui, sans-serif; }

/* ─── Top bar ────────────────────────────────────────────────────────────── */
#top-bar {
  position: fixed; inset: 0 0 auto 0; height: 70px; z-index: 60;
  background: linear-gradient(90deg,#1a1a2e,#16213e);
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
  color: #fff; font-size: 1.2rem; font-weight: 700; letter-spacing: .07em;
  box-shadow: 0 2px 16px rgba(0,0,0,.45); user-select: none;
}
#map { width: 100%; height: calc(100vh - 70px); margin-top: 70px; }

/* ─── Side panel ─────────────────────────────────────────────────────────── */
#side-panel {
  display: none;
  position: fixed; bottom: 24px; left: 24px; z-index: 20;
  background: rgba(13,13,26,.9); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.1); border-radius: 14px;
  padding: 16px 18px; color: #fff; min-width: 164px;
}
.panel-label {
  font-size: .78rem; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; opacity: .65; white-space: nowrap; margin-bottom: 9px;
}
.round-links { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; }
.round-links a { display: block; padding: 6px 10px; border-radius: 8px;
                 color: rgba(255,255,255,.68); text-decoration: none;
                 font-size: .86rem; transition: background .15s, color .15s; }
.round-links a:hover { background: rgba(255,255,255,.12); color: #fff; }
.round-links a.current { background: rgba(255,255,255,.17); color: #fff; font-weight: 600; }

#instawin {
  width: 100%; padding: 8px 10px; border: none; border-radius: 9px; cursor: pointer;
  background: linear-gradient(135deg,#ff6b35,#ffb347);
  color: #fff; font-size: .83rem; font-weight: 700; letter-spacing: .03em;
  transition: opacity .15s, transform .1s;
}
#instawin:hover  { opacity: .85; transform: translateY(-1px); }
#instawin:active { opacity: 1;   transform: translateY(0);    }

/* ─── Pin label (float/fade) ─────────────────────────────────────────────── */
@keyframes labelFloat {
  0%   { opacity: 0; transform: translateX(-50%) translateY(6px);  }
  18%  { opacity: 1; transform: translateX(-50%) translateY(0);     }
  65%  { opacity: 1; transform: translateX(-50%) translateY(-14px); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-24px); }
}
.guess-label {
  position: fixed; pointer-events: none; z-index: 100; white-space: nowrap;
  font-size: 1.35rem; font-weight: 600; letter-spacing: .03em;
  background: rgba(255,255,255,.82); padding: 3px 10px; border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  animation: labelFloat 1.6s ease forwards;
}

/* ─── Counter widget ─────────────────────────────────────────────────────── */
.counter-widget { display: flex; align-items: center; gap: 10px; }
.counter-bar-wrapper { position: relative; }
.counter-bar-track {
  width: 330px; height: 30px;
  background: rgba(255,255,255,.18); border-radius: 15px; overflow: hidden;
}
.counter-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #4dd0e1, #26c6da);
  border-radius: 15px; transition: width .35s ease;
}
.counter-bar-fill.over-goal { background: #ef5350; animation: barBlink 1.8s ease-in-out infinite; }
@keyframes barBlink { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
#goal-label {
  display: none; position: absolute; inset: 0;
  align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 900; color: #fff; letter-spacing: .05em;
  text-transform: uppercase; pointer-events: none;
  animation: barBlink 1.8s ease-in-out infinite;
}
#goal-label.visible { display: flex; }
#counter-text  { font-size: .8rem; font-weight: 700; white-space: nowrap; }
.counter-label { font-size: .78rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; opacity: .65; white-space: nowrap; }

/* ─── Next-round button reveal ───────────────────────────────────────────── */
#next-round-btn.btn-reveal { animation: btnReveal .45s cubic-bezier(.34,1.56,.64,1) forwards; }
@keyframes btnReveal { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ─── Euro badge used in toasts ─────────────────────────────────────────── */
.toast-euro {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, #f9c923, #e6a817);
  color: #7a4800; font-size: 1rem; font-weight: 900;
  vertical-align: middle; flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}

/* ─── Toast notifications ────────────────────────────────────────────────── */
#toast-container {
  position: fixed; top: 80px; right: 16px; z-index: 200;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none;
}
.toast {
  background: rgba(20,28,46,.93); backdrop-filter: blur(6px);
  color: #fff; padding: 14px 28px; border-radius: 26px;
  font-size: 1.19rem; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.25);
  opacity: 0; transform: translateX(10px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.toast-in  { opacity: 1; transform: translateX(0); }
.toast.toast-out { opacity: 0; transform: translateX(10px); }

/* ─── Victory overlay & modal ────────────────────────────────────────────── */
#victory-overlay {
  display: none; position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.55); backdrop-filter: blur(5px);
  align-items: center; justify-content: center;
}
#victory-overlay.open { display: flex; }
.modal {
  background: #fff; border-radius: 22px; padding: 52px 58px;
  text-align: center; max-width: 460px; width: 90%;
  box-shadow: 0 36px 110px rgba(0,0,0,.48);
  animation: popIn .38s cubic-bezier(.34,1.56,.64,1) forwards;
}
@keyframes popIn { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-icon    { font-size: 4rem; line-height: 1; margin-bottom: 14px; }
.modal-heading { font-size: 1rem; color: #777; font-weight: 500; margin-bottom: 6px; }
.modal-name    { font-size: 2.5rem; font-weight: 900; color: #1a1a2e; margin-bottom: 20px; }
.modal-sub     { font-size: 1rem; color: #888; margin-bottom: 20px; }
.modal-btn {
  display: inline-block; padding: 14px 40px; border-radius: 50px;
  background: #1a1a2e; color: #fff; font-size: 1rem; font-weight: 700;
  text-decoration: none; transition: background .2s;
}
.modal-btn:hover { background: #e63946; }

/* ─── Goal-exceeded block inside victory modal ───────────────────────────── */
.goal-exceeded-msg {
  margin-bottom: 24px; border-radius: 12px; overflow: hidden;
  text-align: left; box-shadow: 0 2px 14px rgba(183,28,28,.18);
}
.goal-msg-header {
  background: #b71c1c; color: #fff; padding: 9px 16px;
  font-size: .78rem; font-weight: 700; letter-spacing: .06em;
  font-family: 'Courier New', monospace; text-transform: uppercase;
}
.goal-msg-body { background: #fff8f8; padding: 13px 18px; }
.goal-sub { display: block; font-size: 1.05rem; font-weight: 800; color: #1a1a2e; }

/* ─── Last-round green goal bar ──────────────────────────────────────────── */
.counter-bar-fill.goal-reached { background: #2e7d32; animation: barBlink 1.8s ease-in-out infinite; }
