* { box-sizing: border-box; }
:root{
  --bg:#07131f;
  --panel:#0a1a28;
  --panel2:rgba(7,20,31,.9);
  --line:rgba(255,255,255,.12);
  --text:#f4f7fb;
  --muted:#9fb0bf;
  --accent:#3d9cff;
  --visited:#245b87;
  --new:#ff9a35;
  --country:#1b2b38;
}
html,body{
  width:100%;height:100%;margin:0;
  background:var(--bg);color:var(--text);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  overflow:hidden;
}
button,select,input{font:inherit}
button{
  border:1px solid rgba(255,255,255,.15);
  background:rgba(255,255,255,.055);
  color:var(--text);
  border-radius:8px;padding:10px 12px;cursor:pointer;
}
button:hover{background:rgba(255,255,255,.09)}
button.primary,button.active{
  background:#1677db;border-color:#2b8ff5;
}
#intro{
  position:fixed;inset:0;z-index:100;
  display:grid;place-items:center;
  background:radial-gradient(circle at center,#10283c 0%,#06111b 65%);
  transition:opacity 1s ease;
}
.intro-card{text-align:center}
.intro-kicker,.eyebrow{font-size:11px;letter-spacing:.18em;color:#6eb4ff}
.intro-card h1{font-size:clamp(34px,6vw,72px);margin:8px 0 4px}
.intro-card p{color:var(--muted);font-size:18px}
.app-shell{display:grid;grid-template-columns:280px 1fr;height:100vh;width:100vw}
.sidebar{
  position:relative;z-index:20;
  background:linear-gradient(180deg,#091826 0%,#07131f 100%);
  border-right:1px solid var(--line);
  padding:22px 18px;overflow:auto;
}
.brand-row{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.brand-row h1{font-size:24px;margin:4px 0 0}
.globe-icon{font-size:34px;opacity:.72}
.year-block{margin-top:28px}
.section-label{font-size:12px;color:var(--muted)}
#year-display{font-size:58px;font-weight:750;line-height:1;margin-top:4px}
#year-subtitle{font-size:13px;color:var(--muted);margin-top:8px;min-height:38px}
.controls{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:22px}
.speed-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:18px;color:var(--muted);font-size:13px}
.speed-row select{background:#102536;color:var(--text);border:1px solid var(--line);border-radius:7px;padding:7px}
.divider{border-top:1px solid var(--line);margin:22px 0}
.section-title{font-size:16px;font-weight:650;margin-bottom:12px}
.stats-grid{display:grid;grid-template-columns:1fr auto;gap:11px 16px;font-size:13px}
.stat-label{color:var(--muted)}
.stat-value{font-weight:700}
.legend-item{display:flex;align-items:center;gap:10px;font-size:13px;margin:10px 0;color:#dfe7ee}
.swatch{display:inline-block;width:30px;height:12px;border-radius:3px;border:1px solid rgba(255,255,255,.16)}
.swatch.visited{background:var(--visited)}
.swatch.new{background:var(--new)}
.swatch.future{background:var(--country)}
.map-wrap{position:relative;min-width:0;overflow:hidden}
#map{width:100%;height:100%;display:block;background:
  radial-gradient(circle at 65% 40%,rgba(41,84,112,.18),transparent 35%),
  linear-gradient(180deg,#061522,#081722);}
.country{
  stroke:#445462;stroke-width:.45;vector-effect:non-scaling-stroke;
  transition:fill .5s ease,opacity .5s ease;
}
.country.future{fill:var(--country);opacity:.9}
.country.visited{fill:var(--visited);opacity:1}
.country.new{fill:var(--new);opacity:1}
.country:hover{stroke:#dbefff;stroke-width:1}
.country-card{
  position:absolute;right:22px;top:20px;z-index:10;
  min-width:230px;padding:14px 16px;border-radius:12px;
  background:rgba(7,20,31,.92);border:1px solid var(--line);
  box-shadow:0 8px 35px rgba(0,0,0,.3);backdrop-filter:blur(8px);
}
.country-card.hidden{opacity:0;pointer-events:none}
.country-card-year{font-size:12px;color:#ffb668}
.country-card-title{font-size:24px;font-weight:720;margin-top:3px}
.country-card-text{font-size:12px;color:var(--muted);margin-top:3px}
.bottom-panel{
  position:absolute;left:18px;right:18px;bottom:18px;z-index:12;
  background:rgba(7,19,30,.90);border:1px solid var(--line);
  border-radius:12px;padding:13px 16px 12px;backdrop-filter:blur(8px);
}
.bottom-main{display:grid;grid-template-columns:180px 1fr 140px;gap:20px;align-items:center}
.bottom-year{font-size:24px;font-weight:760}
.bottom-year .muted{font-size:13px;font-weight:400;color:var(--muted)}
.bottom-event{font-size:16px;text-align:center}
.bottom-count{text-align:right;color:var(--muted)}
.bottom-count span{font-size:24px;color:#5eb0ff;font-weight:750}
#year-slider{width:100%;accent-color:#3d9cff;margin-top:11px}
.timeline-labels{display:flex;justify-content:space-between;color:var(--muted);font-size:11px;margin-top:-2px}

@media (max-width: 760px){
  html,body{overflow:auto}
  .app-shell{
    display:flex;
    flex-direction:column;
    height:auto;
    min-height:100vh;
  }
  .map-wrap{
    order:1;
  }
  .sidebar{
    order:2;
    position:relative;
    width:100%;
    height:auto;
    border-right:0;
    border-top:1px solid var(--line);
    border-bottom:0;
    padding:14px 12px 18px;
  }
  .brand-row h1{font-size:20px}
  .globe-icon{font-size:26px}
  .year-block{margin-top:12px}
  #year-display{font-size:42px}
  #year-subtitle{min-height:auto}
  .controls{margin-top:12px}
  button{min-height:44px}
  .speed-row{margin-top:12px}
  .divider{margin:14px 0}
  .sidebar section:last-child{padding-bottom:max(8px, env(safe-area-inset-bottom))}
  .stats-grid{gap:8px 12px}
  .map-wrap{height:72vh;min-height:500px}
  .country-card{top:8px;right:8px;min-width:0;max-width:52vw;padding:9px 11px}
  .country-card-title{font-size:17px}
  .bottom-panel{left:8px;right:8px;bottom:8px;padding:10px}
  .bottom-main{grid-template-columns:1fr auto;gap:6px 10px}
  .bottom-year{font-size:19px}
  .bottom-event{grid-column:1/-1;grid-row:2;text-align:left;font-size:13px}
  .bottom-count{font-size:12px}
  .bottom-count span{font-size:19px}
}
