/* Mobile-only first (works on desktop too) */
:root{
  --bg: #0a0a0f;
  --panel: rgba(10,10,15,.72);
  --stroke: rgba(255,255,255,.80);
  --stroke2: rgba(255,255,255,.35);
  --txt: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.65);
  --border: rgba(255,255,255,.12);
  --shadow: 0 12px 30px rgba(0,0,0,.40);
  --radius: 16px;
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-left: env(safe-area-inset-left);
  --safe-right: env(safe-area-inset-right);
  font-synthesis: none;
}

html, body{
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

#app{
  position: relative;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

#c{
  display:block;
  width:100%;
  height:100%;
  touch-action: none; /* prevent scroll while drawing */
  background: radial-gradient(1200px 900px at 50% 45%, rgba(255,255,255,.06), rgba(0,0,0,0) 55%),
              radial-gradient(900px 700px at 35% 60%, rgba(0,255,255,.04), rgba(0,0,0,0) 60%),
              radial-gradient(900px 700px at 65% 40%, rgba(255,0,255,.035), rgba(0,0,0,0) 60%),
              var(--bg);
}

/* UI panel */
.ui{
  position:absolute;
  left: calc(12px + var(--safe-left));
  right: calc(12px + var(--safe-right));
  bottom: calc(12px + var(--safe-bottom));
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ui.hidden{ display:none; }

.ui-row{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content: space-between;
}

.ui-row-2{ margin-top: 10px; flex-wrap: wrap; }
.ui-row-2 .btn.secondary{ flex: 1 1 100%; }

.ui-title{
  font-weight: 650;
  letter-spacing: .2px;
  font-size: 15px;
}

.label{
  display:block;
  margin-top: 10px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}

.input{
  flex: 1;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.25);
  color: var(--txt);
  padding: 0 12px;
  outline: none;
  font-size: 15px;
}

.input:focus{
  border-color: rgba(255,255,255,.28);
}

.btn{
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.10);
  color: var(--txt);
  padding: 0 12px;
  font-weight: 620;
  letter-spacing: .2px;
}

.btn:active{ transform: translateY(1px); }

.btn.secondary{
  flex: 1;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.88);
}

.icon-btn{
  height: 34px;
  width: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.90);
  display:grid;
  place-items:center;
}

.tiny{
  margin-top: 10px;
  justify-content:flex-start;
}

.hint{
  font-size: 12px;
  color: rgba(255,255,255,.70);
}

.hint code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  color: rgba(255,255,255,.85);
}

.fab{
  position:absolute;
  right: calc(12px + var(--safe-right));
  bottom: calc(12px + var(--safe-bottom));
  height: 48px;
  width: 48px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display:none; /* shown when panel hidden */
  font-size: 20px;
}

.fab.show{ display:grid; place-items:center; }

/* Desktop: keep it elegant and centered a bit */
@media (min-width: 900px){
  .ui{
    left: 50%;
    right: auto;
    width: 520px;
    transform: translateX(-50%);
  }
}


.ui-subtitle{
  margin-top: 2px;
  font-size: 11px;
  letter-spacing: .4px;
  opacity: .65;
}


.ui-footer{
  margin-top: 6px;
  font-size: 11px;
  opacity: .55;
}

.ui-footer a{
  color: inherit;
  text-decoration: none;
}

.ui-footer a:hover{
  opacity: .9;
  text-decoration: underline;
}


/* Discreet visit counter */
.counter{
  font-size: 11px;
  opacity: .55;
  margin-left: 6px;
  white-space: nowrap;
}
