:root{
  --panel: rgba(11,21,38,0.9);
  --panel-2: rgba(16,31,56,0.95);
  --panel-3: #142a4a;
  --line: #1c3a5e;
  --sky: #7dd3fc;
  --sky-soft: #4fb3e8;
  --sky-dim: #a9dffb;
  --sky-faint: #26558a;
  --accent: #7dd3fc;
}
*{ box-sizing:border-box; }
html, body{ margin:0; padding:0; height:100%; overflow:hidden; }
body{
  font-family: var(--ui-font, 'Lexend'), sans-serif;
  color:var(--sky-dim);
}

#bgLayer{
  position:fixed; inset:0; z-index:-2;
  background: linear-gradient(120deg, #030711, #071229, #0a1128, #050a16, #0c1c38);
  background-size:400% 400%;
  animation:drift 24s ease-in-out infinite;
  background-position:center;
  background-size:cover;
}
@keyframes drift{
  0%   { background-position:0% 50%; }
  50%  { background-position:100% 50%; }
  100% { background-position:0% 50%; }
}
#bgShadow{
  position:fixed; inset:0; z-index:-1;
  background:#000;
  opacity:0.3;
}

#widgets{
  position:fixed; top:20px; right:24px; z-index:5;
  display:flex; flex-direction:column; align-items:flex-end; gap:4px;
}
.widget{
  font-size:0.85rem; color:var(--sky-dim);
  background:var(--panel); border:1px solid var(--line);
  padding:6px 12px; border-radius:8px;
}
.widget:empty{ display:none; }

#content{
  position:relative; z-index:2;
  height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:28px; padding:20px;
}

#title{
  font-size:clamp(1.6rem, 4vw, 2.6rem);
  font-weight:600;
  color:var(--sky);
  text-align:center;
  text-shadow:0 2px 20px rgba(0,0,0,0.5);
  font-family: var(--title-font, 'Lexend'), sans-serif;
  transition:opacity 0.3s ease;
}

#searchForm{
  display:flex; align-items:center; gap:8px;
  background:var(--panel); border:1px solid var(--line);
  border-radius:50px; padding:6px 6px 6px 8px;
  width:min(560px, 90vw);
  box-shadow:0 10px 40px rgba(0,0,0,0.35);
}
#engineBtn{
  background:var(--panel-3); color:var(--sky);
  border:1px solid var(--sky-faint); border-radius:50px;
  padding:10px 14px; font-size:0.8rem; cursor:pointer; white-space:nowrap;
  font-family:inherit;
}
#engineBtn:hover{ background:var(--sky-faint); }
#searchInput{
  flex:1; background:none; border:none; outline:none;
  color:var(--sky-dim); font-size:1rem; font-family:inherit; padding:10px 4px;
}
#searchInput::placeholder{ color:rgba(169,223,251,0.45); }
#goBtn{
  background:var(--accent); color:#04121f; border:none; border-radius:50px;
  padding:10px 18px; font-weight:600; cursor:pointer; font-family:inherit;
}

#settingsToggle{
  position:fixed; bottom:20px; right:24px; z-index:10;
  background:var(--panel); color:var(--sky); border:1px solid var(--line);
  width:42px; height:42px; border-radius:50%; font-size:1.1rem; cursor:pointer;
}
#settingsToggle:hover{ background:var(--sky-faint); }

.menu{
  position:fixed; z-index:20;
  background:var(--panel-2); border:1px solid var(--line); border-radius:10px;
  padding:8px; display:flex; flex-direction:column; gap:4px;
  box-shadow:0 10px 30px rgba(0,0,0,0.4);
}
.menu button{
  background:none; border:none; color:var(--sky-dim); text-align:left;
  padding:8px 10px; border-radius:6px; cursor:pointer; font-family:inherit; font-size:0.85rem;
}
.menu button:hover{ background:var(--sky-faint); color:var(--sky); }
.hidden{ display:none !important; }

#settingsPanel{
  position:fixed; top:0; right:0; bottom:0; width:340px; max-width:92vw; z-index:30;
  background:var(--panel-2); border-left:1px solid var(--line);
  display:flex; flex-direction:column;
  box-shadow:-10px 0 40px rgba(0,0,0,0.4);
}
.panelHeader{
  display:flex; justify-content:space-between; align-items:center;
  padding:16px 18px; border-bottom:1px solid var(--line); color:var(--sky); font-weight:600;
}
#closeSettings{ background:none; border:none; color:var(--sky-dim); font-size:1.3rem; cursor:pointer; }
.panelBody{ flex:1; overflow-y:auto; padding:18px; display:flex; flex-direction:column; gap:22px; }
.panelBody section h3{
  font-size:0.72rem; text-transform:uppercase; letter-spacing:0.08em;
  color:var(--sky-soft); margin:0 0 10px;
}
.panelBody label{
  display:block; font-size:0.75rem; color:var(--sky-soft); margin:10px 0 4px;
}
.panelBody input[type="text"],
.panelBody input[type="number"],
.panelBody textarea,
.panelBody select{
  width:100%; background:#0b1526; color:var(--sky-dim); border:1px solid var(--line);
  border-radius:6px; padding:8px 10px; font-family:inherit; outline:none; font-size:0.85rem;
}
.panelBody textarea{ resize:vertical; }
.panelBody input[type="color"]{
  width:100%; height:34px; padding:2px; background:#0b1526; border:1px solid var(--line); border-radius:6px;
}
.panelBody input[type="range"]{ width:100%; accent-color:var(--sky); }

.chipRow{ display:flex; flex-wrap:wrap; gap:6px; }
.chip{
  background:var(--panel-3); color:var(--sky-dim); border:1px solid var(--sky-faint);
  border-radius:20px; padding:6px 12px; font-size:0.75rem; cursor:pointer; font-family:inherit;
}
.chip:hover{ border-color:var(--sky-soft); }
.chip.active{ background:var(--sky-soft); color:#04121f; border-color:var(--sky-soft); }
.fileChip{ display:inline-flex; align-items:center; }

.toggleRow{
  display:flex; align-items:center; gap:8px; font-size:0.85rem; color:var(--sky-dim);
  margin-bottom:6px; cursor:pointer;
}
.toggleRow input{ accent-color:var(--sky); width:16px; height:16px; }

#exportSettings, #resetSettings{
  background:var(--panel-3); color:var(--sky); border:1px solid var(--sky-faint);
  border-radius:20px; padding:6px 12px; font-size:0.75rem; cursor:pointer; font-family:inherit;
}
#resetSettings{ border-color:#fca5a5; color:#fca5a5; }
