:root{
  --bg:#000;
  --green:#00ff41;
  --head:#baffc9;
  --ui-glow:rgba(0,255,65,.65);
}

*{ box-sizing:border-box; }
html,body{ margin:0; height:100%; background:var(--bg); overflow:hidden; }

/* Canvas layer */
#gl{
  position:fixed; inset:0; z-index:0;
  display:block; width:100vw; height:100vh;
}

/* Honor [hidden] everywhere */
[hidden]{ display:none !important; }

/* UI bar */
#ui{
  position:fixed; left:12px; right:12px; bottom:12px; z-index:10;
  display:flex; justify-content:flex-start; gap:10px;
  pointer-events:none;
}

#ui .ui-left { display:flex; gap:10px; }


/* Pills */
.pill{
  pointer-events:auto;
  font:12px "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing:.12em; color:#1f3;
  text-shadow:0 0 8px var(--ui-glow);
  border:1px solid rgba(0,255,65,.35);
  background:linear-gradient(180deg, rgba(0,0,0,.6), rgba(0,0,0,.2));
  padding:6px 10px; border-radius:8px; opacity:.85;
  box-shadow:0 0 12px rgba(0,255,65,.15), inset 0 0 10px rgba(0,255,65,.08);
  transition:transform .08s ease, opacity .2s ease, box-shadow .2s ease;
}
.pill:hover{ transform:translateY(-1px); opacity:1; box-shadow:0 0 18px rgba(0,255,65,.25), inset 0 0 12px rgba(0,255,65,.12); }
.pill.ghost{ border-color:rgba(0,255,65,.15); opacity:.7; }

/* Legacy helper (optional) */
.pill-left{ position:fixed; left:14px; bottom:10px; }

/* Modals (both #modal and generic .modal share the same base) */
#modal, .modal{
  position:fixed; inset:0; z-index:20;
  display:flex; align-items:center; justify-content:center;
  background:radial-gradient(ellipse at center, rgba(0,0,0,.35), rgba(0,0,0,.85));
  backdrop-filter:blur(2px);
}

/* Window shells (about uses .window, tune uses .modal-window) */
.window, .modal-window{
  position:relative;
  width:min(820px, 92vw);
  border-radius:12px;
  background:rgba(0,0,0,.6);
  border:1px solid rgba(0,255,65,.25);
  box-shadow:0 0 24px rgba(0,255,65,.2), 0 0 80px rgba(0,255,65,.08), inset 0 0 24px rgba(0,255,65,.12);
  color:#cfe; font:14px/1.6 "IBM Plex Mono", ui-monospace, monospace;
}
.window::before, .modal-window::before{
  content:""; position:absolute; inset:-2px; border-radius:14px;
  box-shadow:0 0 60px rgba(0,255,65,.18), 0 0 160px rgba(0,255,65,.12);
  pointer-events:none;
}

/* Window headers */
.window-head, .modal-window > header{
  position:relative; display:flex; align-items:center; gap:10px;
  padding:10px 14px; border-bottom:1px solid rgba(0,255,65,.18);
  background:linear-gradient(180deg, rgba(0,0,0,.7), rgba(0,0,0,.35));
  border-top-left-radius:12px; border-top-right-radius:12px;
}
.window-head .dot{
  width:8px; height:8px; border-radius:999px !important;
  box-shadow:0 0 10px rgba(0,255,65,.75), inset 0 0 8px rgba(0,255,65,.35);
  background:var(--green);
}
.window-head .title{
  margin-left:6px; color:#9f9; letter-spacing:.12em;
  text-shadow:0 0 8px rgba(0,255,65,.55); flex:1;
}
#modal-close{
  color:#9f9; background:transparent; border:none; font-size:20px; line-height:1;
  text-shadow:0 0 10px rgba(0,255,65,.6);
  padding:4px 8px; cursor:pointer;
}

/* Window bodies */
.window-body, .modal-body{
  padding:16px; display:grid; gap:12px;
}
.window-body section{
  padding:12px; margin-bottom:12px; border-radius:10px;
  border:1px solid rgba(0,255,65,.18);
  box-shadow:inset 0 0 18px rgba(0,255,65,.08);
}
.window-body h3{
  margin:0 0 8px; color:#bfffbf; font-weight:600; letter-spacing:.1em;
  text-shadow:0 0 10px rgba(0,255,65,.5);
}
.window-body p, .window-body li{ color:#cfe; }
.window-body .links{ display:flex; gap:16px; justify-content:flex-end; }
.window-body .links a{
  color:#caffd5; text-decoration:none; border-bottom:1px dashed rgba(0,255,65,.35);
}
.window-body .links a:hover{ color:#fff; text-shadow:0 0 10px rgba(0,255,65,.7); }

/* Tune modal form pieces */
.modal-body textarea{
  width:100%; resize:vertical;
  background:#020; color:#bfffcf;
  border:1px solid rgba(0,255,65,.2); border-radius:8px; padding:10px;
}
.modal-body .row{ display:flex; gap:8px; justify-content:flex-end; }
.hint{ opacity:.65; font-size:12px; }

/* Shortcuts table */
.shortcuts{ margin-top:16px; }
.shortcuts .keys{ border-collapse:collapse; width:100%; max-width:520px; }
.shortcuts .keys td{ padding:3px 0; vertical-align:top; color:#1f3; letter-spacing:.04em; }
.shortcuts .keys td:first-child{ width:170px; opacity:.85; }
.shortcuts kbd{
  display:inline-block; padding:0 6px;
  border:1px solid rgba(0,255,65,.35); border-radius:6px;
  background:rgba(0,0,0,.25); color:#1f3;
  font:12px "IBM Plex Mono", ui-monospace, monospace;
}
