@property --inv { syntax: '<number>'; inherits: true; initial-value: 1; }
@property --tilt { syntax: '<angle>'; inherits: true; initial-value: 0deg; }
@property --rot { syntax: '<angle>'; inherits: true; initial-value: 0deg; }
@property --dz { syntax: '<length>'; inherits: true; initial-value: 110px; }
@property --edgew { syntax: '<number>'; inherits: true; initial-value: 2.2; }
:root {
  --sky1: #050a1f; --sky2: #16224d; --land: #1b2849; --land2: #0c1430; --land3: #060918; --edge: #5f86e0;
  --night: 1; --ink: #eef3ff; --muted: #b8c4e6; --panel: rgba(10, 16, 38, .86); --accent: #ffcf6b;
  --tilt: 50deg; --rot: -4deg; --inv: 1;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #050a1f; color: var(--ink);
  font: 15px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; -webkit-tap-highlight-color: transparent; }
html { height: 100vh; height: 100dvh; height: 100svh; }
body { height: 100%; }
a { color: #bcd3ff; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#sky { position: fixed; inset: 0; background: radial-gradient(120% 80% at 50% 0%, var(--sky2), var(--sky1) 70%); }
#flash { position: fixed; inset: 0; background: #e8eeff; opacity: 0; pointer-events: none; z-index: 3; }

#app { position: fixed; inset: 0; z-index: 1; display: flex; flex-direction: column;
  height: 100%; height: 100dvh; height: 100svh; width: 100%;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
  min-height: 0; }

.top { flex: 0 0 auto; z-index: 10; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px 6px; }
.brand { color: #fff; font-weight: 800; font-size: 20px; text-decoration: none; letter-spacing: -.02em; white-space: nowrap; }
.brand span { color: var(--accent); }
.badge { font-size: 11px; padding: 3px 8px; border-radius: 99px; background: rgba(255,207,107,.16); color: var(--accent); border: 1px solid rgba(255,207,107,.35); white-space: nowrap; }
.grow { flex: 1; min-width: 4px; }
select, .ghost { font: inherit; font-size: 13px; color: var(--ink); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px; padding: 7px 10px; }
select option { color: #111; }
.ghost { cursor: pointer; white-space: nowrap; }
.ghost[aria-pressed="true"] { background: rgba(255,207,107,.2); border-color: rgba(255,207,107,.5); }
#liteBtn .short { display: none; }

#nowbar { flex: 0 0 auto; z-index: 6; align-self: center; font-size: 13px; color: var(--muted);
  background: rgba(8,14,36,.55); padding: 4px 12px; border-radius: 99px; white-space: nowrap; pointer-events: none; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; margin: 0 8px 4px; }
#nowbar b { color: #fff; }

#mapcol { flex: 1 1 auto; height: 0; min-height: 0; position: relative; display: flex; flex-direction: column; }
#stage { flex: 1 1 auto; height: 0; min-height: 0; position: relative; perspective: 1100px; perspective-origin: 50% 22%; overflow: hidden; z-index: 1; }
#plane { position: absolute; left: 50%; top: 50%; width: 1000px; height: 740px; margin: -370px 0 0 -500px;
  transform-style: preserve-3d; will-change: transform;
  transition: none; }
body.allow-motion #plane { transition: transform 1.1s cubic-bezier(.3,.75,.2,1), --inv 1.1s cubic-bezier(.3,.75,.2,1), --tilt 1.1s ease, --dz 1.1s cubic-bezier(.3,.75,.2,1), --edgew 1.1s ease; }
.layer { position: absolute; left: 0; top: 0; width: 1000px; height: 740px; pointer-events: none; }
svg.layer { overflow: visible; }
.side path { fill: var(--land2); stroke: var(--land2); stroke-width: 1.5; }
.side.bottom path { fill: var(--land3); }
.shadow path { fill: #000; }
.top-land .land { fill: var(--land); stroke: color-mix(in srgb, var(--edge) 30%, #fff); stroke-width: var(--edgew, 2.2); stroke-linejoin: round;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--edge) 55%, transparent)); }
.lights { opacity: var(--night); }
.lights circle.dot { fill: #ffe7a8; }
.sea-label { fill: color-mix(in srgb, var(--ink) 45%, transparent); font: italic 22px Georgia, serif; letter-spacing: .3em; }
canvas.layer { width: 1000px; height: 740px; }
#fx { transform: translateZ(2px); }
#clouds { left: -220px; top: -200px; width: 1440px; height: 1140px; transform: translateZ(40px);
  -webkit-mask-image: radial-gradient(ellipse 62% 64% at 50% 48%, #000 42%, transparent 78%);
  mask-image: radial-gradient(ellipse 62% 64% at 50% 48%, #000 42%, transparent 78%); }
#labels { transform: translateZ(40px); transform-style: preserve-3d; pointer-events: none; z-index: 2; }

.city { position: absolute; width: 0; height: 0; transform-style: preserve-3d;
  transform: rotateZ(calc(-1 * var(--rot))) rotateX(calc(-1 * var(--tilt))) scale(var(--inv)); transform-origin: 0 0; }
.city button { position: absolute; left: 0; bottom: 0; transform: translate(-50%, 0); transform-origin: 50% 100%; pointer-events: auto; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 0 0 2px; border: 0; background: none; color: var(--ink); font: inherit; }
.chip { display: flex; align-items: center; gap: 3px; padding: 3px 8px 3px 4px; border-radius: 99px;
  background: rgba(8, 14, 36, .9); border: 1px solid rgba(255,255,255,.4); box-shadow: 0 4px 14px rgba(0,0,0,.5);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); white-space: nowrap; }
.chip .t { font-weight: 750; font-size: 15px; font-variant-numeric: tabular-nums; }
.chip svg { width: 26px; height: 26px; }
.city .nm { font-size: 11.5px; font-weight: 650; color: #fff; letter-spacing: .01em;
  text-shadow: 0 1px 2px #000, 0 0 6px #000, 0 0 10px rgba(0,0,0,.85);
  background: rgba(8,14,36,.5); padding: 0 6px; border-radius: 6px; white-space: nowrap; }
.city .pt { width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px 3px rgba(255,220,140,.8); margin-top: 1px; }
.city.small .chip { padding: 2px 6px 2px 3px; }
.city.small .chip svg { width: 21px; height: 21px; }
.city.small .t { font-size: 13px; }
.city.sel .chip { background: rgba(255,207,107,.92); color: #1b1300; border-color: #fff; }
.city.sel .nm { color: var(--accent); background: rgba(20,14,0,.45); }
.city button:focus-visible .chip { outline: 2px solid var(--accent); outline-offset: 2px; }

.ic .rays { transform-origin: 16px 16px; animation: spin 18s linear infinite; }
.ic .drop { animation: drop 1.1s linear infinite; }
.ic .drop:nth-of-type(2) { animation-delay: -.35s; } .ic .drop:nth-of-type(3) { animation-delay: -.7s; }
.ic .flake { animation: flake 2.4s ease-in-out infinite; }
.ic .flake:nth-of-type(2) { animation-delay: -.8s; } .ic .flake:nth-of-type(3) { animation-delay: -1.6s; }
.ic .bolt { animation: bolt 3s steps(1) infinite; }
.ic .fogl { animation: fog 4s ease-in-out infinite alternate; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drop { 0% { transform: translateY(-3px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(5px); opacity: 0; } }
@keyframes flake { 0%, 100% { transform: translate(0, -1px); } 50% { transform: translate(1.5px, 2px); } }
@keyframes bolt { 0%, 88% { opacity: .25; } 90%, 94% { opacity: 1; } 92% { opacity: .3; } }
@keyframes fog { to { transform: translateX(2px); } }
.lite .ic *, .reduce-motion .ic * { animation: none !important; }

#summary { display: none; }
.controls { flex: 0 0 auto; z-index: 8; padding: 8px 12px 6px;
  background: linear-gradient(rgba(5,10,31,0), rgba(5,10,31,.45) 28%); }
#days { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; justify-content: center; }
#days::-webkit-scrollbar { display: none; }
#days button { flex: 0 0 auto; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; padding: 6px 11px; border-radius: 12px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
#days button small { font-size: 10.5px; color: var(--muted); }
#days button svg { width: 22px; height: 22px; }
#days button[aria-selected="true"] { background: rgba(255,207,107,.2); border-color: var(--accent); }
.hourrow { display: flex; align-items: center; gap: 10px; max-width: 720px; margin: 0 auto; }
.round { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.1); color: #fff; font-size: 15px; cursor: pointer; }
#hour { flex: 1; accent-color: var(--accent); height: 30px; }
#hourOut { width: 52px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.attr { text-align: center; font-size: 10px; color: rgba(220,230,255,.6); padding: 4px 8px 0; }
.attr a { color: inherit; }

#card { position: absolute; z-index: 9; right: 16px; top: 12px; width: 330px; padding: 16px 16px 14px; border-radius: 18px;
  background: var(--panel); border: 1px solid rgba(255,255,255,.14); box-shadow: 0 18px 50px rgba(0,0,0,.45);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: up .35s ease; }
#card[hidden] { display: none !important; }
@keyframes up { from { transform: translateY(16px); } }
#card h2 { margin: 0; font-size: 22px; padding-right: 28px; }
#card .sub { color: var(--muted); font-size: 13px; }
#card .x { position: absolute; right: 10px; top: 8px; border: 0; background: none; color: var(--muted); font-size: 26px; cursor: pointer; line-height: 1; }
#card .big { display: flex; align-items: center; gap: 10px; margin: 8px 0 6px; }
#card .big svg { width: 54px; height: 54px; }
#card .big .t { font-size: 40px; font-weight: 800; letter-spacing: -.03em; }
#card .big .c { color: var(--muted); font-size: 13px; }
#card .facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin: 6px 0 10px; }
#card .facts > div { min-width: 0; }
#card .facts dt { color: var(--muted); font-size: 11px; font-weight: 500; }
#card .facts dd { margin: 0; font-weight: 650; font-size: 13px; }
#card .go { display: block; text-align: center; padding: 10px; border-radius: 12px; background: var(--accent); color: #1b1300; font-weight: 750; text-decoration: none; }

#loading { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; color: var(--muted); background: #050a1f; transition: opacity .5s; }
#loading.done { opacity: 0; pointer-events: none; }
#toast { position: fixed; z-index: 21; left: 50%; top: 100px; transform: translateX(-50%); background: rgba(8,14,36,.9); border: 1px solid rgba(255,255,255,.2); padding: 8px 14px; border-radius: 12px; font-size: 13px; }

@media (max-width: 700px) {
  .badge { display: none; }
  .top { gap: 6px; padding: 8px 8px 4px; }
  .brand { font-size: 16px; }
  select { font-size: 12px; padding: 6px 6px; max-width: 42vw; }
  #liteBtn { font-size: 12px; padding: 6px 8px; }
  #liteBtn .full { display: none; }
  #liteBtn .short { display: inline; }
  #nowbar { font-size: 12px; padding: 3px 10px; margin-bottom: 2px; }
  #summary { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; margin: 4px 10px 6px;
    padding: 8px 12px; border-radius: 16px; background: var(--panel); border: 1px solid rgba(255,255,255,.16); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,.35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
  #summary svg { width: 36px; height: 36px; flex: 0 0 36px; }
  #summary .st { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
  #summary b { font-size: 14px; line-height: 1.25; } #summary small { font-size: 11.5px; color: var(--muted); }
  body.zoomed #summary { display: none; }
  #card { position: relative; left: auto; right: auto; top: auto; bottom: auto; width: auto;
    display: flex; flex-direction: column;
    flex: 0 1 auto; margin: 0 10px 8px; padding: 8px 10px 8px; max-height: 48%;
    overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
  #card h2 { font-size: 15px; line-height: 1.2; padding-right: 24px; }
  #card .sub { font-size: 11px; }
  #card .x { top: 2px; right: 4px; font-size: 22px; }
  #card .big { margin: 1px 0 2px; gap: 6px; }
  #card .big .t { font-size: 22px; }
  #card .big svg { width: 30px; height: 30px; }
  #card .big .c { font-size: 11px; }
  #card .facts { margin: 2px 0 6px; gap: 2px 10px; flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  #card .facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
  #card .facts dt { font-size: 10px; }
  #card .facts dd { font-size: 11.5px; white-space: nowrap; }
  #card .go { flex: 0 0 auto; padding: 7px; font-size: 13px; border-radius: 10px; }
  #days { justify-content: flex-start; }
  .controls { padding: 4px 10px 4px; }
  .city button { gap: 0; }
  .chip { padding: 1px 5px 1px 2px; } .chip .t { font-size: 12px; } .chip svg { width: 16px; height: 16px; }
  .city.small .chip { padding: 1px 4px 1px 1px; } .city.small .chip svg { width: 15px; height: 15px; } .city.small .t { font-size: 11px; }
  .city .nm { font-size: 9.5px; padding: 0 4px; } .city .pt { width: 5px; height: 5px; margin-top: 0; }
}
body:not(.zoomed) .city.minor, .city.crowded { display: none; }
body.zoomed .city.crowded:not(.sel) { display: none; }
body.allow-motion.lite #plane { transition: transform .35s ease; }
.lite .side, .lite .shadow { display: none; }
.mk { position: absolute; width: 1px; height: 1px; pointer-events: none; }

#dbg { position:fixed; left:0; bottom:0; z-index:40; max-height:30%; overflow:auto; font:10px/1.2 monospace; background:#000c; color:#9f9; display:none; }
body[data-ready] #dbg { display:block; }

/* Embedded on krituliai.lt home (iframe): the site header already carries the brand. */
.embed .brand, .embed .badge { display: none; }
@media (max-width: 700px) {
  .embed .top { padding: 4px 8px 0; }
  .embed #nowbar { margin: 0 8px 0; padding: 2px 10px; }
  .embed #summary { margin: 2px 8px 4px; }
  .embed .controls { padding: 2px 8px 2px; }
}
.nojs { position: fixed; left: 0; right: 0; top: 45%; z-index: 30; text-align: center; color: #fff; font-size: 15px; }
.nojs a { color: var(--accent); }
