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

html,body{
  height:100%;
}

body{
  margin:0;
  font-family:var(--font-base);
  font-size:var(--text-md);
  line-height:1.6;
  background:var(--page-bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  -webkit-tap-highlight-color:transparent;
  min-height:100vh;
}

@supports(height:100dvh){
  body{min-height:100dvh;}
}

h1,h2,h3{
  margin:0;
  font-weight:var(--font-weight-bold);
  letter-spacing:-0.02em;
}

p{
  margin:0;
}

a{
  color:var(--accent);
  text-decoration:none;
  font-weight:var(--font-weight-medium);
}

a:hover{
  text-decoration:underline;
}

:root{
  --font-base:'Manrope','Inter','Segoe UI',system-ui,-apple-system,Roboto,'Helvetica Neue',Arial,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Noto Color Emoji';
  --font-card:var(--font-base);
  --font-ui:var(--font-base);
  --font-weight-regular:400;
  --font-weight-medium:600;
  --font-weight-bold:700;
  --text-xs:12px;
  --text-sm:14px;
  --text-md:16px;
  --text-lg:18px;
  --text-xl:22px;
  --text-2xl:28px;
  --page-bg:radial-gradient(circle at top left,#fdf4ec 0%,#f5f8ff 40%,#eef1f8 100%);
  --surface:rgba(255,255,255,0.72);
  --surface-strong:rgba(255,255,255,0.85);
  --surface-border:rgba(15,23,42,0.08);
  --surface-shadow:0 22px 60px -28px rgba(15,23,42,0.55);
  --map-border:rgba(15,23,42,0.12);
  --map-shadow:0 30px 70px -40px rgba(15,23,42,0.6);
  --text:#1f2933;
  --muted:#6b7280;
  --accent:#c26d43;
  --accent-soft:rgba(194,109,67,0.16);
  --pill-bg:rgba(23,32,44,0.08);
  --pill-border:rgba(23,32,44,0.16);
  --ach-badge-size:44px;
  --popup-cover-height:184px;
}

body[data-theme="dark"]{
  --page-bg:radial-gradient(circle at top left,#101725 0%,#0b1220 45%,#151c2a 100%);
  --surface:rgba(17,24,39,0.78);
  --surface-strong:rgba(17,24,39,0.88);
  --surface-border:rgba(255,255,255,0.08);
  --surface-shadow:0 24px 64px -32px rgba(0,0,0,0.75);
  --map-border:rgba(255,255,255,0.08);
  --map-shadow:0 30px 70px -40px rgba(0,0,0,0.75);
  --text:#f1f5f9;
  --muted:#a5b4cc;
  --accent:#f59e0b;
  --accent-soft:rgba(245,158,11,0.16);
  --pill-bg:rgba(148,163,184,0.16);
  --pill-border:rgba(148,163,184,0.32);
}

.glass-card{
  background:var(--surface);
  backdrop-filter:blur(18px);
  border-radius:24px;
  border:1px solid var(--surface-border);
  box-shadow:var(--surface-shadow);
  padding:24px;
  font-family:var(--font-card);
  font-weight:var(--font-weight-regular);
}

.map-stage{
  position:relative;
  width:100%;
  height:100vh;
  min-height:100vh;
  background:var(--page-bg);
  overflow:visible;
}

.map-loading{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  background:rgba(245,248,255,0.72);
  color:var(--text);
  font-family:var(--font-ui);
  font-weight:var(--font-weight-medium);
  z-index:4;
  pointer-events:none;
}

body[data-theme="dark"] .map-loading{
  background:rgba(11,18,32,0.66);
}

.map-loading[hidden]{
  display:none !important;
}

.map-loading-spinner{
  width:18px;
  height:18px;
  border-radius:999px;
  border:2px solid var(--accent);
  border-right-color:transparent;
  animation:achievements-spin 0.8s linear infinite;
}

@supports(height:100dvh){
  .map-stage{
    height:100dvh;
    min-height:100dvh;
  }
}

.map-ui{
  position:absolute;
  top:24px;
  left:24px;
  right:24px;
  display:flex;
  flex-direction:column;
  gap:12px;
  align-items:flex-start;
  pointer-events:none;
  z-index:2;
}

.map-banner{
  grid-area:banner;
  background:var(--surface);
  border-radius:20px;
  border:1px solid var(--surface-border);
  box-shadow:var(--surface-shadow);
  backdrop-filter:blur(18px);
  padding:10px 16px;
  font-family:var(--font-card);
  display:flex;
  flex-direction:column;
  gap:4px;
  max-width:440px;
  width:min(440px,100%);
  pointer-events:auto;
}

@media (max-width:720px){
  .map-ui{
    left:16px;
    right:16px;
  }
  .map-reset{
    left:16px;
    bottom:16px;
  }
}

.map-stats{
  position:absolute;
  top:24px;
  right:24px;
  display:flex;
  align-items:stretch;
  gap:10px;
  flex-wrap:wrap;
  row-gap:8px;
  padding:10px 14px;
  border-radius:16px;
  background:var(--surface);
  border:1px solid var(--surface-border);
  box-shadow:var(--surface-shadow);
  backdrop-filter:blur(18px);
  font-family:var(--font-ui);
  pointer-events:auto;
  z-index:3;
}

.map-reset{
  position:absolute;
  left:24px;
  bottom:24px;
  pointer-events:none;
  z-index:3;
}

.map-reset-button{
  pointer-events:auto;
  display:inline-flex;
  align-items:center;
  min-height:44px;
  gap:10px;
  padding:10px 14px;
  border-radius:14px;
  border:1px solid var(--surface-border);
  background:var(--surface);
  color:var(--text);
  font-family:var(--font-ui);
  font-weight:var(--font-weight-bold);
  font-size:var(--text-sm);
  letter-spacing:0.01em;
  box-shadow:var(--surface-shadow);
  backdrop-filter:blur(18px);
  cursor:pointer;
  transition:transform 0.15s ease,box-shadow 0.2s ease,border-color 0.2s ease;
}

.map-reset-button:hover,
.map-reset-button:focus-visible{
  transform:translateY(-1px);
  box-shadow:0 24px 50px -30px rgba(15,23,42,0.55);
  border-color:var(--accent-soft);
  outline:none;
}

.map-reset-button:focus:not(:focus-visible){
  outline:none;
}

.map-reset-button:active{
  transform:translateY(0);
}

.map-reset-button [aria-hidden="true"]{
  color:var(--accent);
  font-size:var(--text-lg);
  line-height:1;
}

.map-stat{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:108px;
  position:relative;
}

.map-stat[data-country-stat]{
  position:relative;
}

.map-stat[data-consumed-stat]{
  min-width:max-content;
}

.map-stat-label{
  font-size:var(--text-xs);
  white-space:nowrap;
  letter-spacing:0.08em;
  text-transform:uppercase;
  color:var(--muted);
}

.map-stat-value{
  font-size:var(--text-xl);
  font-weight:var(--font-weight-bold);
  letter-spacing:-0.01em;
  color:var(--text);
  font-variant-numeric:tabular-nums;
  font-feature-settings:"tnum" 1;
}

.map-stat-value-button{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-width:44px;
  min-height:44px;
  padding:8px 6px;
  border:0;
  background:none;
  color:inherit;
  cursor:pointer;
  text-align:left;
  font:inherit;
  letter-spacing:inherit;
}

.map-stat-value-button:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:4px;
  border-radius:8px;
}

.map-stat-value-button[aria-expanded="true"]{
  color:var(--accent);
}

.map-stat-value-button:disabled{
  color:var(--muted);
  cursor:default;
}

.map-stat-dropdown{
  min-width:0;
  width:max-content;
  max-width:min(280px,calc(100vw - 32px));
  max-height:calc(100vh - 160px);
  overflow-y:auto;
  overflow-x:hidden;
  margin-top:2px;
  padding:10px 0 2px;
  border-top:1px solid var(--surface-border);
}

.map-stat-dropdown-list{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.map-stat-dropdown-item{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  font-size:var(--text-sm);
  color:var(--text);
  white-space:nowrap;
}

.map-stat-dropdown-item > span:not(.map-stat-dropdown-flag):not(.sr-only){
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
}

.map-stat-dropdown-flag{
  width:26px;
  height:18px;
  flex:0 0 26px;
  border-radius:4px;
  overflow:hidden;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:var(--pill-bg);
  border:1px solid var(--surface-border);
  font-size:var(--text-md);
}

.map-stat-dropdown-flag img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.map-stat-divider{
  width:1px;
  align-self:stretch;
  background:var(--surface-border);
}

@media (max-width:720px){
  .map-stats{
    top:auto;
    bottom:16px;
    right:16px;
    left:16px;
    justify-content:space-between;
    gap:12px 14px;
  }

  .map-banner,
  .map-stats,
  .map-reset-button,
  .map-error{
    backdrop-filter:none;
    box-shadow:0 8px 18px -14px rgba(15,23,42,0.45);
  }

  .map-stat{
    min-width:0;
  }

  .map-stat-divider{
    display:none;
  }
}

@media (max-width:480px){
  .achievements-panel,
  .ach-badge{
    backdrop-filter:none;
    box-shadow:none;
  }
}

.map-title-row{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:8px;
  flex-wrap:nowrap;
}

.map-banner .map-title{
  font-size:clamp(var(--text-lg), 4vw, var(--text-2xl));
  font-weight:var(--font-weight-bold);
  letter-spacing:-0.02em;
  color:var(--text);
  flex:1;
  text-align:left;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.map-info-toggle{
  border:0;
  min-width:44px;
  min-height:44px;
  padding:10px;
  border-radius:50%;
  background:var(--accent-soft);
  color:var(--accent);
  font-size:var(--text-md);
  line-height:1;
  cursor:pointer;
  transition:background-color 0.2s ease,color 0.2s ease;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
}

.map-info-toggle:hover,
.map-info-toggle:focus-visible{
  background:var(--accent);
  color:#fff;
  outline:none;
}

.map-info-toggle:focus:not(:focus-visible){
  outline:none;
}

.map-info-toggle[aria-expanded="true"]{
  background:var(--accent);
  color:#fff;
}

.map-banner .map-subtitle{
  margin:6px 0 0;
  color:var(--muted);
  font-size:var(--text-sm);
  line-height:1.6;
}

.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

.map-achievements{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:6px;
  width:100%;
  max-width:440px;
  justify-self:start;
  position:relative;
  z-index:3;
  pointer-events:auto;
}


.map-achievements[hidden]{
  display:none;
}

.achievements-toggle{
  font-family:var(--font-ui);
  font-size:15px;
  font-weight:600;
  border-radius:999px;
  border:1px solid var(--surface-border);
  background:var(--surface);
  color:var(--text);
  min-height:44px;
  padding:8px 18px;
  cursor:pointer;
  transition:background-color 0.2s ease,border-color 0.2s ease,transform 0.2s ease;
}

.achievements-toggle:hover,
.achievements-toggle:focus-visible{
  background:var(--pill-bg);
  border-color:var(--pill-border);
  outline:none;
}

.achievements-toggle:focus:not(:focus-visible){
  outline:none;
}

.achievements-toggle[aria-expanded="true"]{
  background:var(--accent-soft);
  border-color:var(--accent);
  color:var(--accent);
}

.map-secondary-link{
  pointer-events:auto;
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:8px 14px;
  border-radius:999px;
  border:1px solid var(--surface-border);
  background:var(--surface);
  color:var(--text);
  font-family:var(--font-ui);
  font-size:var(--text-sm);
  font-weight:var(--font-weight-medium);
  box-shadow:var(--surface-shadow);
}

.map-secondary-link:hover,
.map-secondary-link:focus-visible{
  color:var(--accent);
  border-color:var(--accent-soft);
  text-decoration:none;
}

.map-secondary-link--inline{
  min-height:36px;
  box-shadow:none;
}

.stats-page{
  min-height:100vh;
  background:var(--page-bg);
  color:var(--text);
  padding:24px;
}

@supports(height:100dvh){
  .stats-page{
    min-height:100dvh;
  }
}

.stats-shell{
  max-width:1080px;
  margin:0 auto;
  display:grid;
  gap:14px;
}

.stats-header{
  padding:16px 18px;
  display:grid;
  gap:8px;
}

.stats-header-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.stats-title{
  font-size:clamp(22px,3.5vw,32px);
}

.stats-subtitle{
  font-size:var(--text-sm);
  color:var(--muted);
}

.stats-kpis{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
}

.stats-kpi{
  padding:12px 14px;
  border-radius:16px;
  gap:4px;
  display:grid;
}

.stats-kpi-label{
  font-size:var(--text-xs);
  letter-spacing:0.08em;
  text-transform:uppercase;
  color:var(--muted);
}

.stats-kpi-value{
  font-size:clamp(22px,3.3vw,30px);
  line-height:1.1;
  font-weight:var(--font-weight-bold);
  letter-spacing:-0.01em;
  font-variant-numeric:tabular-nums;
}

.stats-kpi-meta{
  font-size:var(--text-xs);
  color:var(--muted);
}

.stats-layout{
  display:grid;
  grid-template-columns:1.15fr 0.85fr;
  gap:10px;
}

.stats-panel{
  padding:14px;
  border-radius:18px;
}

.stats-panel-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:10px;
}

.stats-panel-head h2{
  font-size:var(--text-md);
  font-weight:var(--font-weight-bold);
}

.stats-chip{
  border-radius:999px;
  padding:4px 10px;
  font-size:var(--text-xs);
  font-weight:var(--font-weight-medium);
  background:var(--accent-soft);
  color:var(--accent);
}

.stats-layout--single{
  grid-template-columns:1fr;
}

.stats-panel-meta{
  margin:0 0 10px;
  color:var(--muted);
  font-size:var(--text-sm);
}

.stats-status{
  margin:0 0 10px;
  color:var(--muted);
  font-size:var(--text-sm);
  min-height:20px;
}

.stats-achievements-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  align-items:stretch;
}

.stats-achievements-grid .ach-badge{
  min-height:92px;
}

.stats-achievements-actions{
  margin-top:12px;
  display:flex;
  justify-content:flex-start;
}

@media (max-width:900px){
  .stats-kpis{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .stats-layout{
    grid-template-columns:1fr;
  }
}

@media (max-width:560px){
  .stats-page{
    padding:14px;
  }

  .stats-kpis{
    gap:8px;
  }

  .stats-achievements-grid{
    grid-template-columns:1fr;
  }

  .achievements--detailed{
    grid-template-columns:1fr;
    gap:10px;
  }

  .ach-badge{
    align-items:flex-start;
  }

  .ach-header{
    flex-wrap:wrap;
    row-gap:4px;
  }

  .ach-status{
    white-space:nowrap;
  }

}

.achievements-panel{
  width:100%;
}

.achievements{
  --ach-grid-size:var(--ach-badge-size,48px);
  display:grid;
  grid-template-columns:repeat(2, minmax(0,var(--ach-grid-size)));
  gap:4px;
  justify-content:flex-start;
  align-content:flex-start;
  justify-items:start;
  align-items:start;
  width:100%;
  pointer-events:auto;
}

.achievements--compact{
  grid-template-columns:repeat(2, minmax(0,var(--ach-grid-size)));
  gap:6px;
}

.achievements--detailed{
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.achievements-message{
  display:flex;
  align-items:center;
  gap:8px;
  width:100%;
  padding:12px 14px;
  border-radius:14px;
  border:1px dashed var(--surface-border);
  background:var(--surface);
  color:var(--muted);
  font-family:var(--font-ui);
  font-size:var(--text-sm);
  line-height:1.5;
}

.achievements-message--loading .achievements-spinner{
  width:16px;
  height:16px;
  border-radius:999px;
  border:2px solid var(--accent);
  border-right-color:transparent;
  animation:achievements-spin 0.8s linear infinite;
}

.achievements-spinner{
  display:inline-flex;
  flex-shrink:0;
}

.achievements-message--error{
  color:#b91c1c;
  background:rgba(254,226,226,0.65);
  border-color:rgba(185,28,28,0.45);
}

body[data-theme="dark"] .achievements-message--error{
  color:#fecaca;
  background:rgba(127,29,29,0.45);
  border-color:rgba(248,113,113,0.45);
}

@keyframes achievements-spin{
  to{transform:rotate(360deg);}
}


.ach-badge{
  --ach-progress:1;
  position:relative;
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  min-height:68px;
  padding:8px 10px;
  border-radius:14px;
  border:1px solid var(--ach-border,var(--surface-border));
  background:var(--ach-bg,var(--surface));
  color:var(--text);
  box-shadow:var(--surface-shadow);
  transition:transform 0.2s ease,border-color 0.2s ease;
  pointer-events:auto;
}

.ach-badge:hover,
.ach-badge:focus-visible{
  transform:translateY(-1px);
  border-color:var(--accent);
  outline:none;
}

.ach-badge--compact{
  width:var(--ach-grid-size);
  min-height:var(--ach-grid-size);
  padding:0;
  align-items:center;
  justify-content:center;
}

.ach-badge--compact .ach-icon{
  width:100%;
  height:100%;
  border-radius:12px;
}

.ach-icon{
  width:44px;
  height:44px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:22px;
  overflow:hidden;
  background:rgba(255,255,255,0.55);
  flex:0 0 auto;
}

.ach-icon-emoji{
  position:relative;
  z-index:2;
}

.ach-icon-image{
  width:100%;
  height:100%;
  border-radius:10px;
  object-fit:contain;
  display:block;
}

.ach-content{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
  width:100%;
}

.ach-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}

.ach-title{
  font-size:var(--text-sm);
  font-weight:var(--font-weight-bold);
  color:var(--text);
}

.ach-status{
  font-size:var(--text-xs);
  color:var(--muted);
}

.ach-bar{
  width:100%;
  height:8px;
  border-radius:999px;
  background:rgba(15,23,42,0.12);
  overflow:hidden;
}

.ach-bar-fill{
  display:block;
  height:100%;
  width:calc(var(--ach-progress) * 100%);
  background:linear-gradient(90deg,#2e7d32,#66bb6a);
}

.ach-requirement{
  margin:0;
  font-size:var(--text-xs);
  color:var(--muted);
  line-height:1.4;
}

.ach-tooltip{
  position:absolute;
  left:50%;
  bottom:calc(100% + 8px);
  transform:translateX(calc(-50% + var(--ach-tooltip-shift,0px)));
  max-width:min(280px, calc(100vw - 32px));
  width:max-content;
  padding:8px 10px;
  border-radius:10px;
  background:rgba(17,24,39,0.92);
  color:#f8fafc;
  font-size:12px;
  line-height:1.35;
  box-shadow:0 16px 30px -20px rgba(15,23,42,0.8);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity 0.15s ease, visibility 0.15s ease;
  z-index:12;
}

.ach-badge.is-tooltip-active .ach-tooltip{
  opacity:1;
  visibility:visible;
}

@media (max-width:560px){
  .stats-achievements-grid.achievements--detailed{
    grid-template-columns:1fr;
  }

  .stats-achievements-grid .ach-badge{
    min-width:0;
    align-items:flex-start;
  }

  .stats-achievements-grid .ach-header{
    flex-direction:column;
    align-items:flex-start;
    gap:2px;
  }

  .stats-achievements-grid .ach-title,
  .stats-achievements-grid .ach-requirement{
    overflow-wrap:anywhere;
  }

  .stats-achievements-grid .ach-status{
    white-space:normal;
  }
}


#map{
  position:absolute;
  top:0;
  right:0;
  bottom:0;
  left:0;
}

.map-error{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  text-align:center;
  font-family:var(--font-ui);
  font-size:var(--text-md);
  line-height:1.5;
  color:var(--muted);
  background:linear-gradient(180deg,rgba(255,255,255,0.82),rgba(255,255,255,0.94));
  backdrop-filter:blur(18px);
}

body[data-theme="dark"] .map-error{
  color:var(--text);
  background:rgba(17,24,39,0.88);
}

.mapboxgl-popup-content{
  background:transparent;
  padding:0;
  border-radius:24px;
  box-shadow:none;
}

.mapboxgl-popup-tip{
  display:none;
}

.popup-card{
  position:relative;
  width:320px;
  max-width:92vw;
  border-radius:20px;
  overflow:hidden;
  background:var(--surface-strong);
  border:1px solid var(--surface-border);
  font:var(--text-sm)/1.5 var(--font-card);
  color:var(--text);
}

.popup-cover-box{
  width:100%;
  height:var(--popup-cover-height);
  background:linear-gradient(180deg,rgba(244,246,249,0.8),rgba(235,239,245,0.9));
}

.popup-cover{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.popup-body{
  padding:18px 20px 20px;
}

.popup-title{
  font-weight:var(--font-weight-bold);
  font-size:var(--text-lg);
  margin:2px 0 6px;
  color:var(--text);
}

.row{
  margin:4px 0;
  display:flex;
  align-items:baseline;
  gap:10px;
  color:var(--text);
}

.popup-fields{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  column-gap:10px;
  row-gap:2px;
}

.popup-card--compact-fields .popup-fields{
  max-width:252px;
  margin-inline:auto;
}

.popup-field{
  margin:2px 0;
  display:flex;
  align-items:flex-start;
  gap:8px;
  min-width:0;
  color:var(--text);
}

.popup-field--no-icon{
  gap:0;
}

.popup-field span:last-child{
  min-width:0;
  word-break:break-word;
}

.popup-subtext{
  color:var(--muted);
  font-size:var(--text-xs);
}

.row-emoji{
  width:1.4em;
  text-align:center;
}

.meta{
  margin-bottom:10px;
  color:var(--muted);
}

.process-badge{
  position:absolute;
  top:14px;
  right:14px;
  z-index:2;
  font-size:var(--text-xs);
  padding:6px 12px;
  border-radius:999px;
  border:1px solid transparent;
  background:rgba(255,255,255,0.85);
  backdrop-filter:blur(4px);
}

.popup-nav button{
  font-family:inherit;
  font-weight:var(--font-weight-medium);
  color:var(--text);
  background:var(--surface-strong);
  border-radius:12px;
  border:1px solid var(--surface-border);
  padding:8px 12px;
  cursor:pointer;
}

.popup-nav button:hover{
  background:var(--pill-bg);
}

@media (max-width:1024px){
  .map-ui{
    top:20px;
    left:20px;
    right:20px;
  }

  .map-banner{
    max-width:320px;
  }
}

@media (max-width:720px){
  .glass-card,
  .map-banner,
  .map-stats,
  .map-reset-button,
  .map-error{
    backdrop-filter:none;
  }

  .map-ui{
    top:16px;
    left:16px;
    right:16px;
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:12px;
  }

  .map-banner{
    max-width:none;
  }

  .map-achievements{
    align-items:flex-start;
    max-width:none;
  }

  .achievements{
    grid-template-columns:repeat(2, minmax(0,var(--ach-grid-size)));
    justify-content:flex-start;
  }
}

@media (max-width:560px){
  :root{
    --ach-badge-size:40px;
    --popup-cover-height:160px;
  }

  .map-ui{
    top:14px;
    left:14px;
    right:14px;
  }

  .map-banner{
    padding:16px 18px;
  }

}

@media (max-width:420px){
  .map-ui{
    top:max(10px,env(safe-area-inset-top));
    left:max(10px,env(safe-area-inset-left));
    right:max(10px,env(safe-area-inset-right));
    gap:10px;
  }

  .popup-card{
    width:280px;
  }

  :root{
    --ach-badge-size:36px;
    --popup-cover-height:144px;
  }

  .map-banner{
    padding:14px 16px;
    border-radius:18px;
    gap:8px;
  }

  .map-title-row{
    flex-wrap:wrap;
    justify-content:space-between;
    gap:8px;
  }

  .map-banner .map-title{
    text-align:left;
    white-space:normal;
  }
  .map-info-toggle{
    width:44px;
    height:44px;
    padding:10px;
  }

}

@media (max-width:360px){
  .map-banner{
    padding:12px 14px;
  }

  .popup-card{
    width:260px;
  }

  :root{
    --ach-badge-size:34px;
    --popup-cover-height:128px;
  }
}

/* add-cup page */
.cup-page {
  margin: 0;
  background: #0f1115;
  color: #f4f5f7;
  font-family: 'Manrope', sans-serif;
}

.cup-layout {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.cup-header h1 { margin-bottom: 8px; }
.cup-header p { opacity: 0.85; }
.cup-back-link { color: #99d1ff; text-decoration: none; }

.cup-card {
  background: #171b22;
  border: 1px solid #2a303a;
  border-radius: 16px;
  padding: 18px;
  margin-top: 16px;
}

.cup-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 12px; }
.cup-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.cup-field input, .cup-field select, .cup-field textarea {
  background: #0f1115;
  color: #f4f5f7;
  border: 1px solid #343b46;
  border-radius: 10px;
  padding: 10px;
}

.cup-fieldset { border: 1px solid #343b46; border-radius: 12px; margin: 14px 0; }
.cup-chip-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
.cup-chip { background: #232a35; border-radius: 999px; padding: 6px 10px; font-size: 13px; }
.cup-chip input { margin-right: 6px; }

.cup-actions { display: flex; gap: 10px; margin-top: 10px; }
.cup-primary, .cup-secondary {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
}
.cup-primary { background: #85db9f; color: #0e1713; }
.cup-secondary { background: #2b3340; color: #f4f5f7; }
.cup-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

.cup-output {
  overflow-x: auto;
  white-space: pre-wrap;
  background: #0f1115;
  border: 1px solid #343b46;
  border-radius: 10px;
  padding: 10px;
}
.cup-hint { min-height: 20px; color: #9ad9aa; }
