:root {
  --bg: #0a0a0a;
  --surface: #161616;
  --surface-2: #202020;
  --text: #f2f2f2;
  --muted: #9a9a9a;
  --accent: #6db3f2;
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
}

body { display: flex; flex-direction: column; height: 100dvh; }

header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; padding-top: max(14px, env(safe-area-inset-top));
  background: var(--surface); border-bottom: 1px solid #262626;
  flex: 0 0 auto;
}
header .title { font-weight: 600; letter-spacing: .5px; margin-right: auto; font-size: 18px; }

.icon-btn {
  background: none; border: none; color: var(--text);
  font-size: 22px; cursor: pointer; padding: 6px;
}

#main {
  flex: 1 1 auto; overflow-y: auto;
  padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 6px;
}
.tagline { font-size: 26px; font-weight: 700; margin: 8px 0 0; }
.sub { color: var(--muted); font-size: 15px; margin: 0 0 18px; line-height: 1.4; }

.launchers { display: flex; flex-direction: column; gap: 14px; }

.launch {
  display: grid;
  grid-template-columns: 56px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 14px;
  text-align: left; text-decoration: none;
  background: var(--surface); color: var(--text);
  border: 1px solid #2c2c2c; border-radius: var(--radius);
  padding: 18px 18px; cursor: pointer; user-select: none;
  transition: transform .06s, background .12s;
}
.launch:active { transform: scale(.98); background: var(--surface-2); }
.launch .emoji { grid-row: 1 / 3; font-size: 34px; text-align: center; }
.launch .label { font-size: 19px; font-weight: 600; }
.launch .desc { color: var(--muted); font-size: 13px; }
.launch.surprise { border-color: #3a4a5c; background: #14202b; }
.launch.loading { opacity: .55; }

.locstatus { color: var(--accent); font-size: 14px; min-height: 1.2em; margin-top: 18px; line-height: 1.4; }

.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: #e05252; color: #fff; padding: 12px 18px; border-radius: 10px;
  font-size: 15px; max-width: 90%; z-index: 20; box-shadow: 0 4px 20px rgba(0,0,0,.5);
}
.toast.hidden { display: none; }

dialog {
  background: var(--surface); color: var(--text);
  border: 1px solid #333; border-radius: var(--radius);
  padding: 20px; width: min(90vw, 380px);
}
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog h2 { margin: 0 0 16px; font-size: 18px; }
dialog label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
dialog select {
  background: var(--bg); border: 1px solid #333; border-radius: 8px;
  color: var(--text); padding: 12px; font-size: 16px;
}
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.dialog-actions button {
  background: var(--surface-2); color: var(--text); border: 1px solid #333;
  border-radius: 8px; padding: 10px 16px; font-size: 15px; cursor: pointer;
}
.dialog-actions button[value="save"] { background: var(--accent); color: #041018; border: none; }
