:root {
  --header-bg: #303c54;
  --page-bg: #e3e4db;
  --map-fill: #268146;
  --map-stroke: #4ba56a;
  --map-hover: #2fa355;
  --map-found: #1a5c34;
  --accent-yellow: #ffd700;
  --text: #fff;
  --hint-bg: #fff;
  /* miejsce pod nagłówek (jedna–dwie linie) + margines mapy */
  --map-vspace: clamp(5.5rem, 14vmin, 8.5rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  height: 100dvh;
}

body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--page-bg);
  color: #222;
}

.top-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.65rem;
  padding: 0.35rem 0.6rem;
  background: var(--header-bg);
  color: var(--text);
  flex-wrap: wrap;
}

.top-bar__left,
.top-bar__center,
.top-bar__right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.top-bar__center {
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}

.score {
  font-weight: 700;
  font-size: 1rem;
}

.percent {
  opacity: 0.9;
  font-size: 0.85rem;
}

.prompt {
  font-size: 0.9rem;
}

.target-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.target-pill {
  display: inline-block;
  padding: 0.28rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  font-weight: 600;
  min-width: 7.5rem;
  max-width: 42vw;
  font-size: clamp(0.8rem, 2.5vw, 0.95rem);
  text-align: center;
}

.btn-skip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.btn-skip:hover {
  background: rgba(255, 255, 255, 0.22);
}

.chevrons {
  letter-spacing: -0.15em;
  font-weight: 700;
}

.coa-box {
  width: 40px;
  height: 40px;
  background: var(--accent-yellow);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.coa-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.timer {
  font-variant-numeric: tabular-nums;
  padding: 0.4rem 0.85rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  font-weight: 600;
  min-width: 4.5rem;
  text-align: center;
}

.btn-close {
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.map-stage {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem 0.5rem;
  overflow: hidden;
}

.map-shell {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  max-width: min(88vw, 620px);
  max-height: calc(100dvh - var(--map-vspace));
  max-height: calc(100svh - var(--map-vspace));
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-root {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #555;
  text-align: center;
  padding: 0.25rem;
}

.map-root > svg {
  display: block;
  flex-shrink: 1;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  vertical-align: top;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
}

.hint-float {
  position: absolute;
  right: 1%;
  top: 50%;
  transform: translateY(-50%);
  background: var(--hint-bg);
  border-radius: 12px;
  padding: 0.45rem 0.65rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  max-width: min(220px, 38vw);
  font-size: clamp(0.75rem, 2vw, 0.9rem);
  font-weight: 500;
  pointer-events: none;
}

.hint-coa {
  flex-shrink: 0;
  border-radius: 6px;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(48, 60, 84, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.overlay.hidden {
  display: none;
}

.overlay__card {
  background: var(--page-bg);
  padding: 2rem;
  border-radius: 16px;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.overlay__card h2 {
  margin: 0 0 0.75rem;
  color: var(--header-bg);
}

.overlay__card p {
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

.btn-primary {
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: 10px;
  background: var(--header-bg);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
}

.btn-primary:hover {
  filter: brightness(1.08);
}
