/* Black glass: the map fills the window, panels float above it as dark frosted sheets. Monochrome, one white accent. */
:root {
  --ink: #f5edef;
  --ink-2: #c9babf;
  --ink-3: #aa939c;
  --glass: linear-gradient(180deg, rgba(31, 23, 29, .87), rgba(16, 13, 17, .84));
  --glass-solid: #19161a;
  --edge: rgba(239, 163, 168, .17);
  --edge-hi: rgba(239, 163, 168, .36);
  --fill: rgba(239, 163, 168, .065);
  --fill-hi: rgba(239, 163, 168, .14);
  --blur: blur(26px) saturate(150%);
  --shadow: 0 24px 70px rgba(0, 0, 0, .6), 0 2px 8px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .09);
  --ok: #8fe0ae;
  --warn: #f0c878;
  --bad: #f1938a;
  --side-w: 344px;
  --gap: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: #0c0b0d; color: var(--ink); font: 13px/1.42 "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif; overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
code { background: var(--fill); padding: 0 5px; border-radius: 5px; font-size: 12px; }
::selection { background: rgba(255, 255, 255, .25); }

#app { position: relative; height: 100%; }
main { position: absolute; inset: 0; }
#map { position: absolute; inset: 0; background: #0c0b0d; }
/* soft vignette so the glass has depth to sit on */
main::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 450; background: radial-gradient(120% 90% at 55% 50%, transparent 55%, rgba(0, 0, 0, .55) 100%); }

/* ---------- shared glass ---------- */
#side, #panel, #coords, #toast, #tools > *, .leaflet-bar, .leaflet-popup-content-wrapper {
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--edge); box-shadow: var(--shadow);
}

/* ---------- sidebar ---------- */
#side { position: absolute; z-index: 800; left: var(--gap); top: var(--gap); bottom: var(--gap); width: var(--side-w); display: flex; flex-direction: column; min-height: 0; border-radius: 20px; overflow: hidden; }
#side header { padding: 18px 20px 12px; }
#side h1 { margin: 0; font: 600 17px/1.2 "Segoe UI Variable Display", "Segoe UI", sans-serif; letter-spacing: -.1px; }
#side header p { margin: 4px 0 0; color: var(--ink-3); font-size: 12px; }

.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin: 0 14px; padding: 3px; background: rgba(0, 0, 0, .35); border: 1px solid var(--edge); border-radius: 12px; }
.tabs button { background: none; border: 0; border-radius: 9px; padding: 7px 4px; cursor: pointer; color: var(--ink-3); transition: background .15s, color .15s; }
.tabs button:hover { color: var(--ink); }
.tabs button b { display: block; font-weight: 400; font-size: 10.5px; opacity: .7; font-variant-numeric: tabular-nums; }
.tabs button.on { background: var(--fill-hi); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 1px 2px rgba(0, 0, 0, .4); font-weight: 600; }

.search { display: flex; gap: 6px; padding: 12px 14px 10px; }
.search input, #opts input[type=number], #opts input[type=text], #opts select, .row select, #tools select, .pp input {
  background: rgba(0, 0, 0, .38); border: 1px solid var(--edge); border-radius: 10px; padding: 7px 10px; outline: none; transition: border-color .15s, background .15s;
}
.search input { flex: 1; min-width: 0; }
.search input::placeholder { color: var(--ink-3); }
.search input:focus, #opts input:focus, #opts select:focus, .row select:focus, .pp input:focus { border-color: var(--edge-hi); background: rgba(0, 0, 0, .5); }

.search button, .btn, #panel button, .pp button, .mini {
  background: var(--fill); border: 1px solid var(--edge); border-radius: 10px; padding: 7px 11px; cursor: pointer; white-space: nowrap; color: var(--ink-2); transition: background .15s, border-color .15s, color .15s;
}
.search button:hover, .btn:hover, #panel button:hover:not(:disabled), .pp button:hover { background: var(--fill-hi); border-color: var(--edge-hi); color: var(--ink); }

#userbar { padding: 0 14px 10px; display: flex; flex-wrap: wrap; gap: 6px; }
#userbar .hint { flex-basis: 100%; margin: 2px 0 0; color: var(--ink-3); font-size: 12px; }

#tree { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 8px 14px 10px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .16) transparent; mask-image: linear-gradient(180deg, transparent 0, #000 10px, #000 calc(100% - 18px), transparent 100%); }
.grp > .kids { margin-left: 14px; border-left: 1px solid rgba(255, 255, 255, .07); padding-left: 4px; }
.grp.closed > .kids { display: none; }
.rowi { display: flex; align-items: center; gap: 8px; padding: 5px 8px 5px 4px; border-radius: 9px; cursor: pointer; user-select: none; color: var(--ink-2); transition: background .12s, color .12s; }
.rowi:hover { background: var(--fill); color: var(--ink); }
.rowi .caret { width: 12px; flex: none; color: var(--ink-3); font-size: 9px; text-align: center; transition: transform .14s; }
.grp.closed > .rowi .caret { transform: rotate(-90deg); }
.rowi .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowi.g { color: var(--ink); }
.rowi.g .nm { font-weight: 600; }
.rowi .ct { color: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; flex: none; }
.rowi .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px rgba(0, 0, 0, .45), 0 0 8px currentColor; }
.rowi img.ic { width: 20px; height: 20px; object-fit: contain; flex: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
.rowi .tag { font-size: 10px; color: var(--warn); border: 1px solid rgba(240, 200, 120, .4); border-radius: 6px; padding: 0 5px; flex: none; }
.rowi .go { visibility: hidden; border: 0; background: none; color: var(--ink-3); cursor: pointer; padding: 0 2px; flex: none; }
.rowi:hover .go { visibility: visible; }
.rowi .go:hover { color: var(--ink); }
.rowi.hide, .grp.hide { display: none; }
.empty { color: var(--ink-3); padding: 16px 12px; }

/* checkboxes: a small glass square that turns white when on */
input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin: 0; flex: none; cursor: pointer; border-radius: 5px; border: 1px solid rgba(255, 255, 255, .26); background: rgba(0, 0, 0, .35); display: inline-grid; place-content: center; transition: background .12s, border-color .12s; }
input[type=checkbox]:hover { border-color: rgba(255, 255, 255, .5); }
input[type=checkbox]::after { content: ""; width: 8px; height: 4px; border: solid #0b0b0d; border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg) scale(0); transition: transform .1s; }
input[type=checkbox]:checked { background: var(--ink); border-color: var(--ink); }
input[type=checkbox]:checked::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
input[type=checkbox]:indeterminate { background: rgba(255, 255, 255, .5); border-color: transparent; }
input[type=checkbox]:indeterminate::after { width: 8px; height: 0; border-width: 0 0 2px 0; transform: none; }

/* ---------- map chrome ---------- */
.leaflet-container { font: inherit; background: #0c0b0d; }
.gm-canvas { position: absolute; left: 0; top: 0; pointer-events: none; }
#map.tool-on { cursor: crosshair; }
#map.pt-hover { cursor: pointer; }
.leaflet-top.leaflet-left { left: calc(var(--side-w) + var(--gap) + 2px); top: 4px; }
.leaflet-bar { border-radius: 12px !important; overflow: hidden; }
.leaflet-bar a { background: transparent; color: var(--ink-2); border-bottom: 1px solid var(--edge); width: 32px; height: 32px; line-height: 32px; }
.leaflet-bar a:hover { background: var(--fill-hi); color: var(--ink); }
.leaflet-bar a.leaflet-disabled { background: transparent; color: var(--ink-3); opacity: .5; }

#tools { position: absolute; z-index: 800; top: var(--gap); left: calc(var(--side-w) + var(--gap) + 58px); right: 338px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
#tools > * { pointer-events: auto; border-radius: 12px; padding: 7px 12px; cursor: pointer; color: var(--ink-2); white-space: nowrap; transition: color .15s, border-color .15s; }
#tools > *:hover { color: var(--ink); border-color: var(--edge-hi); }
#tools select { padding: 7px 10px; }
#tools select option, .row select option, #opts select option { background: var(--glass-solid); color: var(--ink); }
#tools button.on { background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(225, 225, 230, .9)); color: #0b0b0d; border-color: transparent; font-weight: 600; }

#coords { position: absolute; z-index: 800; left: calc(var(--side-w) + var(--gap) * 2); bottom: var(--gap); border-radius: 12px; padding: 7px 12px; font-variant-numeric: tabular-nums; font-size: 12px; color: var(--ink-2); pointer-events: none; }
#coords:empty { display: none; }
#coords b { color: var(--ink); font-weight: 600; }
#coords i { font-style: normal; color: var(--ink-3); }

/* ---------- right panel ---------- */
#panel { position: absolute; z-index: 800; right: var(--gap); top: var(--gap); width: 312px; max-height: calc(100% - var(--gap) * 2); overflow-y: auto; border-radius: 20px; padding: 18px; scrollbar-width: none; }
.p-head strong { display: block; font: 600 20px/1.15 "Segoe UI Variable Display", "Segoe UI", sans-serif; letter-spacing: -.2px; font-variant-numeric: tabular-nums; }
.p-head span { color: var(--ink-3); font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0 2px; }
.chips span { border-radius: 999px; padding: 2px 9px; font-size: 11px; background: rgba(0, 0, 0, .35); border: 1px solid var(--edge); font-variant-numeric: tabular-nums; }
.chips .q0 { color: var(--ok); } .chips .q2 { color: var(--warn); } .chips .q3 { color: var(--bad); } .chips .q4 { color: var(--ink-3); }
.note { color: var(--ink-3); font-size: 12px; margin: 6px 0; }
.note:empty { display: none; }
.note b { color: var(--ink); font-weight: 600; }
.row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.row.two > * { flex: 1; }
.row .lbl { color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: .7px; min-width: 52px; }
.row .val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.row select { flex: 1; min-width: 0; }
#panel button.primary { flex: 1; padding: 10px; border-radius: 12px; border-color: transparent; font-weight: 600; color: #0b0b0d; background: linear-gradient(180deg, #ffffff, #dcdce2); box-shadow: 0 6px 20px rgba(255, 255, 255, .1), inset 0 1px 0 #fff; }
#panel button.primary:hover:not(:disabled) { background: linear-gradient(180deg, #ffffff, #ececf0); color: #000; border-color: transparent; }
#panel button:disabled { opacity: .35; cursor: default; }
#panel button.primary:disabled { background: var(--fill); color: var(--ink-3); box-shadow: none; opacity: 1; border-color: var(--edge); }
.mini { padding: 2px 8px !important; font-size: 11px; border-radius: 7px !important; }
#packRow button { flex: 1; }
#opts { margin-top: 14px; border-top: 1px solid var(--edge); padding-top: 10px; }
#opts summary { cursor: pointer; color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: .7px; list-style: none; }
#opts summary::-webkit-details-marker { display: none; }
#opts summary::after { content: "+"; float: right; font-size: 14px; line-height: 1; }
#opts[open] summary::after { content: "–"; }
#opts summary:hover { color: var(--ink); }
#opts label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--ink-2); }
#opts label.chk { justify-content: flex-start; }
#opts input[type=number], #opts input[type=text], #opts select { width: 96px; padding: 5px 8px; border-radius: 8px; }

#toast { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 900; border-radius: 999px; padding: 9px 18px; border-color: var(--edge-hi); }

/* ---------- popup ---------- */
.leaflet-popup-content-wrapper { color: var(--ink); border-radius: 16px; }
.leaflet-popup-tip { background: rgba(14, 14, 18, .82); box-shadow: none; }
.leaflet-popup-content { margin: 14px 16px; min-width: 214px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--ink-3); top: 6px; right: 6px; }
.leaflet-container a.leaflet-popup-close-button:hover { color: var(--ink); }
.pp h3 { margin: 0; font: 600 15px/1.2 "Segoe UI Variable Display", "Segoe UI", sans-serif; }
.pp .cat { color: var(--ink-3); font-size: 11px; margin: 2px 0 8px; }
.pp table { border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pp td { padding: 1px 12px 1px 0; }
.pp td:first-child { color: var(--ink-3); font-weight: 600; }
.pp .ysrc { font-size: 11px; margin: 6px 0 10px; }
.pp .ysrc.q0, .pp .ysrc.q1 { color: var(--ok); } .pp .ysrc.q2 { color: var(--warn); } .pp .ysrc.q3, .pp .ysrc.q4 { color: var(--bad); }
.pp .acts { display: flex; flex-wrap: wrap; gap: 5px; }
.pp button { padding: 4px 9px; font-size: 12px; border-radius: 8px; }
.pp input { width: 88px; padding: 2px 6px; border-radius: 6px; }

/* ---------- narrow windows ---------- */
@media (max-width: 1100px) {
  :root { --side-w: 292px; --gap: 10px; }
  #panel { width: 276px; padding: 14px; }
  #tools { right: 296px; }
}
@media (max-width: 820px) {
  :root { --side-w: 248px; }
  #panel { width: 232px; top: auto; bottom: var(--gap); max-height: 52%; }
  #tools { right: var(--gap); }
  #coords { display: none; }
}
.row.builds #bLang { flex: none; width: 62px; }

/* ADWIN Map Editor release skin: isolated inside its iframe. */
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; background:#0c0b0d; }
#app { background: #0c0b0d; }
#side h1 { color: #f5edef; letter-spacing: -.04em; font-size: 18px; }
#side header p { color: #aa939c; }
.tabs button.on { color:#f3c3c7; background:rgba(239,163,168,.14); box-shadow: none; }
#tools button.on { color:#25161b; background:#efa3a8; border-color:transparent; }
#panel button.primary { background:#efa3a8; color:#231317; box-shadow:none; }
#panel button.primary:hover:not(:disabled) { background:#df858d; color:#201117; }
#panel button.primary:disabled { background:var(--fill); color:var(--ink-3); }
.search input:focus, #opts input:focus, #opts select:focus, .row select:focus, .pp input:focus { border-color: #efa3a8; }
::selection { background:rgba(239,163,168,.3); }
@media (max-width: 700px) {
  :root { --gap: 10px; --side-w: auto; }
  html, body { height:100%; overflow:auto; }
  #app { position:relative; min-height:100%; height:auto; display:flex; flex-direction:column; gap:10px; padding:10px; }
  #side { position:relative; inset:auto; z-index:2; width:100%; height:275px; min-height:275px; flex:none; border-radius:16px; }
  #side header { padding:12px 15px 9px; }
  #tree { padding-bottom: 8px; }
  main { position:relative; inset:auto; display:flex; flex-direction:column; min-height:850px; height:auto; overflow:visible; gap:10px; }
  main::after { display:none; }
  #map { position:relative; inset:auto; width:100%; height:440px; min-height:440px; flex:none; border-radius:16px; overflow:hidden; }
  .leaflet-top.leaflet-left { left:12px; top:12px; }
  #tools { position:relative; inset:auto; left:auto; right:auto; top:auto; order:1; flex:none; display:flex; gap:6px; width:100%; }
  #tools > * { font-size:11px; padding:7px 9px; }
  #tools #tGo { flex:1; min-width:110px; }
  #coords { display:none; }
  #panel { position:relative; inset:auto; width:100%; max-height:none; padding:15px; overflow:visible; border-radius:16px; order:2; }
  #toast { position:fixed; bottom:15px; z-index:1100; max-width:calc(100vw - 32px); white-space:normal; }
}

/* Updated Map Editor language controls; retain the ADWIN skin and mobile layout. */
#side header .lang { position: absolute; right: 16px; top: 16px; display: flex; gap: 2px; padding: 2px; background: rgba(0, 0, 0, .35); border: 1px solid var(--edge); border-radius: 9px; }
#side header .lang button { background: none; border: 0; border-radius: 7px; padding: 3px 8px; cursor: pointer; color: var(--ink-3); font-size: 11px; font-weight: 600; letter-spacing: .04em; }
#side header .lang button:hover { color: var(--ink); }
#side header .lang button.on { background: var(--fill-hi); color: var(--ink); }
#side header { position:relative; padding-top:46px; }
#side header .lang { top:10px; right:14px; }
.tabs { grid-template-columns:repeat(2,minmax(0,1fr)); }
@media(max-width:700px) {
  #side header { padding-top:40px; }
  #tools { flex-wrap:wrap; }
  #tools #tGo { flex-basis:100%; }
}
