/* WinterStorm.online v6.0
   Modern, fast, mobile-first UI. No external CSS frameworks required.
*/
:root{
  --bg0:#070a12;
  --bg1:#0b1224;
  --card:rgba(255,255,255,.06);
  --card2:rgba(255,255,255,.085);
  --stroke:rgba(255,255,255,.12);
  --stroke2:rgba(255,255,255,.18);
  --text:#eaf0ff;
  --muted:rgba(234,240,255,.72);
  --muted2:rgba(234,240,255,.56);
  --pink:#ff2ea6;
  --cyan:#45d7ff;
  --blue:#4f7cff;
  --warn:#ffb020;
  --bad:#ff4d6d;
  --ok:#47f58a;
  --shadow: 0 20px 60px rgba(0,0,0,.55);
  --shadow2: 0 12px 28px rgba(0,0,0,.45);
  --r:18px;
  --r2:14px;
  --max:1200px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--sans);
  color:var(--text);
  background:
    radial-gradient(900px 550px at 20% -10%, rgba(79,124,255,.22), transparent 55%),
    radial-gradient(800px 500px at 100% 20%, rgba(69,215,255,.14), transparent 56%),
    radial-gradient(700px 500px at 60% 110%, rgba(255,46,166,.14), transparent 58%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 55%, #050710);
  overflow-x:hidden;
}

a{color:inherit}
.container{max-width:var(--max); margin:0 auto; padding:0 18px}

.topbar{
  position:sticky; top:0; z-index:50;
  backdrop-filter: blur(12px);
  background: rgba(7,10,18,.62);
  border-bottom:1px solid rgba(255,255,255,.08);
}
.topbar-inner{
  display:flex; align-items:center; justify-content:space-between;
  gap:14px;
  padding:12px 0;
}
.brand{
  display:flex; align-items:center; gap:10px;
  text-decoration:none;
}
.brand-mark{
  width:36px; height:36px; border-radius:12px;
  background:
    radial-gradient(14px 14px at 30% 28%, rgba(255,255,255,.9), rgba(255,255,255,0) 70%),
    conic-gradient(from 180deg, rgba(79,124,255,.9), rgba(69,215,255,.85), rgba(255,46,166,.9), rgba(79,124,255,.9));
  box-shadow: 0 10px 22px rgba(0,0,0,.45);
  position:relative;
}
.brand-mark:after{
  content:"";
  position:absolute; inset:1px;
  border-radius:11px;
  background:linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.6));
}
.brand-text{display:flex; flex-direction:column; line-height:1.05}
.brand-text b{font-size:15px; letter-spacing:.2px}
.brand-text span{font-size:12px; color:var(--muted2)}
.nav{
  display:flex; gap:10px; align-items:center;
}
.pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:9px 12px; border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
  color:var(--muted);
  text-decoration:none;
  font-size:13px;
}
.pill:hover{border-color:rgba(255,255,255,.18); background:rgba(255,255,255,.06)}
.pill .dot{width:8px; height:8px; border-radius:999px; background:var(--ok); box-shadow:0 0 0 4px rgba(71,245,138,.15)}
.pill .dot.bad{background:var(--bad); box-shadow:0 0 0 4px rgba(255,77,109,.15)}
.pill .dot.warn{background:var(--warn); box-shadow:0 0 0 4px rgba(255,176,32,.15)}

.hero{
  padding:22px 0 12px;
}
.hero-grid{
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap:14px;
  align-items:stretch;
}
@media (max-width: 980px){
  .hero-grid{grid-template-columns:1fr; }
}
.card{
  border-radius:var(--r);
  border:1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  box-shadow: var(--shadow2);
}
.card-inner{padding:16px}
.h-title{
  display:flex; gap:10px; align-items:flex-start; justify-content:space-between; flex-wrap:wrap;
}
.h-title h1{
  margin:0; font-size:22px; letter-spacing:.2px;
}
.h-title p{margin:6px 0 0; color:var(--muted); font-size:13px; max-width:66ch}
.kpis{display:flex; gap:10px; flex-wrap:wrap; margin-top:12px}
.kpi{
  flex:1 1 130px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.09);
  background: rgba(0,0,0,.22);
  padding:10px 11px;
  min-width:130px;
}
.kpi b{display:block; font-size:12px; color:var(--muted2); font-weight:600}
.kpi span{display:block; margin-top:2px; font-size:18px; font-weight:800}
.kpi small{display:block; margin-top:2px; font-size:12px; color:var(--muted)}

.search-row{
  display:flex; gap:10px; flex-wrap:wrap; margin-top:12px;
}
.input{
  flex:1 1 220px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.11);
  border-radius:14px;
  padding:12px 12px;
  color:var(--text);
  outline:none;
}
.input::placeholder{color:rgba(234,240,255,.46)}
.btn{
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color:var(--text);
  border-radius:14px;
  padding:12px 12px;
  font-weight:800;
  cursor:pointer;
  display:inline-flex; align-items:center; gap:8px;
}
.btn:hover{border-color:rgba(255,255,255,.20); background:rgba(255,255,255,.08)}
.btn.primary{
  background: linear-gradient(135deg, rgba(79,124,255,.95), rgba(69,215,255,.85));
  border-color:rgba(255,255,255,.16);
  color:#081022;
}
.btn.pink{
  background: linear-gradient(135deg, rgba(255,46,166,.95), rgba(79,124,255,.75));
  border-color:rgba(255,255,255,.16);
  color:#0a0710;
}
.btn.ghost{background:transparent}
.btn:disabled{opacity:.55; cursor:not-allowed}
.note{
  margin-top:10px;
  font-size:12px;
  color:var(--muted2);
  line-height:1.45;
}
.note a{color:rgba(234,240,255,.82)}
.badge{
  display:inline-flex; align-items:center; gap:7px;
  padding:7px 10px; border-radius:999px;
  background: rgba(0,0,0,.20);
  border:1px solid rgba(255,255,255,.10);
  font-size:12px;
  color:var(--muted);
}
.badge .spark{width:10px; height:10px; border-radius:999px; background:var(--pink); box-shadow:0 0 0 5px rgba(255,46,166,.15)}
.badge .spark.cyan{background:var(--cyan); box-shadow:0 0 0 5px rgba(69,215,255,.14)}
.badge .spark.blue{background:var(--blue); box-shadow:0 0 0 5px rgba(79,124,255,.14)}

.side-stack{display:grid; gap:14px}
.donate{
  display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap;
}
.donate .big{
  font-size:18px; font-weight:900; margin:0;
}
.donate .small{margin:6px 0 0; color:var(--muted); font-size:13px}
hr.sep{
  border:0; border-top:1px solid rgba(255,255,255,.08);
  margin:12px 0;
}
.list{display:grid; gap:10px}
.row{
  display:flex; justify-content:space-between; gap:12px; align-items:flex-start;
  padding:10px 10px;
  background: rgba(0,0,0,.18);
  border:1px solid rgba(255,255,255,.09);
  border-radius:14px;
}
.row b{font-size:13px}
.row span{color:var(--muted); font-size:12px; line-height:1.35}
.row .tag{
  font-family:var(--mono);
  font-size:11px;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color:rgba(234,240,255,.86);
  white-space:nowrap;
}

.main{
  padding:10px 0 24px;
}
.map-shell{
  position:relative;
  border-radius:22px;
  border:1px solid rgba(255,255,255,.10);
  overflow:hidden;
  box-shadow:var(--shadow);
  background: #000;
  min-height:560px;
}
@media (max-width: 680px){
  .map-shell{min-height: 610px;}
}

#map{width:100%; height:560px}
@media (max-width: 680px){ #map{height:610px} }

.map-overlay{
  position:absolute; inset:0;
  pointer-events:none;
}
.toast{
  position:absolute; left:calc(14px + env(safe-area-inset-left)); right:calc(14px + env(safe-area-inset-right)); top:calc(14px + env(safe-area-inset-top));
  z-index: 1300;
  display:none;
  pointer-events:auto;
}
.toast .inner{
  border-radius:16px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(12px);
  padding:12px 12px;
  display:flex; align-items:flex-start; justify-content:space-between; gap:12px;
}
.toast .inner p{margin:0; font-size:13px; color:var(--muted)}
.toast .inner b{color:var(--text)}
.toast.show{display:block}

.fab{
  position:absolute; right:calc(14px + env(safe-area-inset-right)); bottom:calc(14px + env(safe-area-inset-bottom));
  z-index: 1200;
  display:flex; flex-direction:column; gap:10px;
  pointer-events:auto;
}
.fab .fabbtn{
  width:46px; height:46px; border-radius:16px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.50);
  backdrop-filter: blur(12px);
  color:var(--text);
  display:grid; place-items:center;
  cursor:pointer;
  box-shadow: 0 14px 30px rgba(0,0,0,.45);
}
.fab .fabbtn:hover{background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.18)}
.fab .fabbtn svg{width:20px; height:20px; opacity:.92}

.drawer{
  position:absolute; left:calc(14px + env(safe-area-inset-left)); bottom:calc(14px + env(safe-area-inset-bottom));
  z-index: 1100;
  width:min(440px, calc(100% - 28px));
  pointer-events:auto;
}
.drawer .panel{
  border-radius:22px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.56);
  backdrop-filter: blur(14px);
  box-shadow: 0 22px 60px rgba(0,0,0,.56);
  overflow:hidden;
}
.drawer .head{
  padding:12px 12px;
  display:flex; justify-content:space-between; gap:10px; align-items:center;
  border-bottom:1px solid rgba(255,255,255,.10);
}
.drawer .head .ttl{display:flex; align-items:center; gap:10px}
.drawer .head .ttl b{font-size:13px}
.drawer .head .ttl span{font-size:12px; color:var(--muted)}
.drawer .body{
  padding:12px;
  display:grid; gap:12px;
  max-height: 62vh;
  overflow:auto;
}
.chips{display:flex; flex-wrap:wrap; gap:8px}
.chip{
  display:inline-flex; align-items:center; gap:8px;
  padding:9px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  font-size:12px;
  color:rgba(234,240,255,.88);
  cursor:pointer;
  user-select:none;
}
.chip input{accent-color: var(--pink)}
.chip:hover{border-color:rgba(255,255,255,.18); background:rgba(255,255,255,.07)}
.mini{
  padding:10px 10px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
}
.mini h3{margin:0 0 6px; font-size:13px}
.mini p{margin:0; color:var(--muted); font-size:12px; line-height:1.45}
.slider{
  display:grid; gap:8px;
}
.slider input[type="range"]{width:100%}
.row2{
  display:flex; justify-content:space-between; align-items:center; gap:10px;
  flex-wrap:wrap;
}
.smallbtn{
  padding:10px 10px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  cursor:pointer;
  font-weight:800;
  font-size:12px;
  color:rgba(234,240,255,.94);
  display:inline-flex; align-items:center; gap:8px;
}
.smallbtn:hover{border-color:rgba(255,255,255,.20); background:rgba(255,255,255,.08)}
.smallbtn.primary{
  background: linear-gradient(135deg, rgba(255,46,166,.95), rgba(79,124,255,.65));
  color:#0a0710;
}
.smallbtn.danger{
  background: rgba(255,77,109,.18);
  border-color: rgba(255,77,109,.28);
}
kbd{
  font-family:var(--mono);
  font-size:11px;
  padding:3px 6px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.25);
  color:rgba(234,240,255,.88);
}

.section{
  padding:18px 0 30px;
}
.grid3{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap:14px;
}
@media (max-width: 980px){ .grid3{grid-template-columns:1fr 1fr} }
@media (max-width: 650px){ .grid3{grid-template-columns:1fr} }
.mcard{border-radius:22px; border:1px solid rgba(255,255,255,.10); background: rgba(0,0,0,.18); overflow:hidden}
.mcard .pad{padding:14px}
.mcard h3{margin:0 0 8px; font-size:14px}
.mcard p{margin:0; font-size:12px; color:var(--muted); line-height:1.5}
.mcard .actions{display:flex; gap:10px; flex-wrap:wrap; margin-top:12px}
.mcard .actions .smallbtn{flex:1}

.footer{
  border-top:1px solid rgba(255,255,255,.08);
  padding:18px 0 26px;
  color:var(--muted);
  font-size:12px;
}
.footer a{color:rgba(234,240,255,.82); text-decoration:none}
.footer a:hover{text-decoration:underline}
.footer .cols{
  display:grid; grid-template-columns:1.2fr .8fr; gap:14px;
}
@media (max-width: 820px){ .footer .cols{grid-template-columns:1fr} }

.modal{
  position:fixed; inset:0; z-index:99999;
  display:none;
  background: rgba(0,0,0,.68);
  backdrop-filter: blur(8px);
}
.modal.show{display:flex; align-items:center; justify-content:center;}
.modal .box{
  width:min(940px, calc(100% - 28px));
  border-radius:22px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.62);
  box-shadow: var(--shadow);
  overflow:hidden;
  max-height: 92vh;
  display:flex;
  flex-direction:column;
}
.modal .bar{display:flex; justify-content:space-between; align-items:center; gap:10px; padding:12px 12px; border-bottom:1px solid rgba(255,255,255,.10)}
.modal .bar b{font-size:13px}
.modal .bar button{all:unset; cursor:pointer; padding:8px 10px; border-radius:12px; border:1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06)}
.modal .bar button:hover{background: rgba(255,255,255,.08)}
.modal .content{padding:14px; overflow:auto; flex:1}
.card-preview{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
}
@media (max-width: 900px){ .card-preview{grid-template-columns:1fr} }
.canvaswrap{
  border-radius:18px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  padding:10px;
}
.canvaswrap canvas{width:100%; height:auto; display:block; border-radius:14px}

.tiny{font-size:11px; color:var(--muted2); line-height:1.45}
.success{color:var(--ok)}
.warning{color:var(--warn)}
.danger{color:var(--bad)}

.leaflet-control-attribution, .leaflet-control-scale{
  filter: drop-shadow(0 8px 12px rgba(0,0,0,.55));
}
.leaflet-container{
  background:#071024;
  outline:none;
}


/* Quick layer bar */
.mapbar{
  position:absolute;
  left:calc(14px + env(safe-area-inset-left));
  top:calc(14px + env(safe-area-inset-top));
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  z-index: 1150;
  pointer-events:auto;
}
.mapbar .pill{
  padding:10px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(12px);
  color: var(--text);
  font-weight: 800;
  letter-spacing: .02em;
  font-size: 12px;
  cursor:pointer;
}
.mapbar .pill.on{ box-shadow: inset 0 0 0 1px rgba(79,124,255,.35); }
.mapbar .pill.off{ opacity:.6; }
.mapbar .pill.ghost{ background: rgba(255,255,255,.06); }
@media (max-width: 640px){
  .mapbar{ left:calc(10px + env(safe-area-inset-left)); top:calc(10px + env(safe-area-inset-top)); gap:8px; }
  .mapbar .pill{ padding:9px 11px; font-size: 12px; }
}


/* Alert severity accents */
.tag.sevExtreme{ border-color: rgba(255,69,120,.55); background: rgba(255,69,120,.16); }
.tag.sevSevere{ border-color: rgba(255,120,70,.55); background: rgba(255,120,70,.14); }
.tag.sevModerate{ border-color: rgba(255,200,66,.55); background: rgba(255,200,66,.12); }
.tag.sevMinor{ border-color: rgba(79,124,255,.55); background: rgba(79,124,255,.12); }
.row.alertRow{ position:relative; overflow:hidden; }
.row.alertRow::before{
  content:"";
  position:absolute; left:0; top:0; bottom:0;
  width:3px;
  background: rgba(255,255,255,.12);
}
.row.alertRow.extreme::before{ background: rgba(255,69,120,.8); }
.row.alertRow.severe::before{ background: rgba(255,120,70,.8); }
.row.alertRow.moderate::before{ background: rgba(255,200,66,.8); }
.row.alertRow.minor::before{ background: rgba(79,124,255,.8); }


.linkgrid{ display:grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap:10px; margin-top:10px; }
.alink{
  display:flex; align-items:center; justify-content:center;
  padding:10px 12px; border-radius:14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(234,240,255,.92);
  text-decoration:none;
  font-weight:800;
  font-size:12px;
}
.alink:hover{ border-color: rgba(79,124,255,.45); background: rgba(79,124,255,.10); }


/* mapbar (always-visible overlay controls) */
.mapbar{
  position:absolute;
  top:14px;
  right:14px;
  z-index:1200;
  display:flex;
  gap:10px;
  align-items:center;
  padding:10px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.52);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.mapbar .mbbtn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  color: rgba(234,240,255,.92);
  font-weight: 650;
  font-size: 12px;
  cursor:pointer;
}
.mapbar .mbbtn svg{width:16px;height:16px}
.mapbar .mbbtn.active{
  border-color: rgba(255,46,166,.55);
  background: rgba(255,46,166,.12);
}
@media (max-width: 680px){
  .mapbar{
    left:14px;
    right:14px;
    top: calc(14px + env(safe-area-inset-top));
    justify-content:space-between;
    gap:8px;
  }
  .mapbar .mbbtn{flex:1; justify-content:center; padding:10px 8px}
  .mapbar .mbbtn span{display:none}
}
