/* Values taken from the layout and colors in brskofdp/secretservice-remake-roblox Source.lua */
:root {
  --page: #0a0a0a;
  --win: #181818;
  --win-stroke: #1f211f;
  --main: #111;
  --main-stroke: #1d1d1d;
  --shade: #141414;
  --section: #1c1c1c;
  --section-stroke: #252525;
  --element: #242424;
  --element-lo: #1b1b1b;
  --white: #fff;
  --tab: #89898b;
  --dim: #817f7f;
  --accent: #a89d9f;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 12px;
  background: var(--page);
  color: var(--white);
  font: 16px/1.3 "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Roblox TextStrokeTransparency = 0 look */
.window, .window a { text-shadow: 0 0 1px #000, 0 1px 1px #000; }

a, button, [role="checkbox"], [role="tab"] { cursor: pointer; }

/* Visually hidden, still read by screen readers. */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--win); padding: 4px 8px; z-index: 5; }

/* Photo: "Gartenzwerg 2015" from Wikimedia Commons, CC0. Sits centred behind the window,
   inset so the window covers it completely. Hiding the window reveals it. */
.gnome {
  position: fixed;
  inset: 0;
  z-index: 0;
  margin: auto;
  width: min(340px, 100vw - 48px);
  aspect-ratio: 1920 / 1384;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 0 0 2px var(--win-stroke), 0 30px 90px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

.window {
  position: relative;
  width: 100%;
  max-width: 600px;
  padding: 12px 15px 10px;
  background: var(--win);
  border: 2px solid var(--win-stroke);
  border-radius: 6px;
  box-shadow: 0 0 0 1px #000, 0 30px 90px rgba(0, 0, 0, 0.85);
}

.titlebar { display: flex; align-items: center; height: 20px; margin-bottom: 14px; }
.brand { font-size: 16px; white-space: nowrap; }
.brand b { font-weight: 400; color: var(--dim); }
.divider { flex: none; width: 1px; height: 16px; margin: 0 14px; background: var(--white); }
.tabs { display: flex; gap: 5px; }
.tabs a { padding: 0 3px; color: var(--tab); transition: color 0.15s; }
.tabs a:hover, .tabs a.on { color: var(--white); }

/* Fixed window height on every tab. Extra boxes scroll inside the panel. */
.panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  align-items: start;
  align-content: start;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #3a3a3a transparent;
}
.panel[hidden] { display: none; }

.tabs button {
  padding: 0 3px;
  background: none;
  border: 0;
  font: inherit;
  text-shadow: inherit;
  color: var(--tab);
  cursor: pointer;
  transition: color 0.15s;
}
.tabs button:hover, .tabs button[aria-selected="true"] { color: var(--white); }
.tabs button:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

.body {
  position: relative;
  height: 350px;
  padding: 10px 6px;
  background: var(--main);
  border: 1px solid var(--main-stroke);
  border-radius: 6px;
  overflow: hidden;
}
.body::before, .body::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 16px;
  pointer-events: none;
  z-index: 1;
}
.body::before { top: 0; background: linear-gradient(var(--shade), transparent); }
.body::after { bottom: 0; background: linear-gradient(transparent, var(--shade)); }

.col { display: flex; flex-direction: column; gap: 10px; align-content: start; }

.group {
  margin: 0;
  padding: 7px 9px 10px;
  background: var(--section);
  border: 1px solid var(--section-stroke);
  border-radius: 4px;
}
.group > h2 { margin: 0 0 8px; font-size: 14px; font-weight: 400; color: var(--white); }
.group p { margin: 0 0 6px; font-size: 14px; color: var(--tab); }
.group p:last-child { margin-bottom: 0; }
.group p.lead { color: var(--white); }

.opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 14px;
}
.check {
  flex: none;
  width: 12px;
  height: 12px;
  padding: 0;
  background: var(--element);
  border: 1px solid #000;
  border-radius: 2px;
  cursor: pointer;
}
.check[aria-checked="true"] { background: var(--accent); }
.check:hover { border-color: var(--accent); }
.todo .check[aria-checked="true"] + .main { color: var(--tab); text-decoration: line-through; }
.check:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.window.off { display: none; }
.logo { flex: none; width: 14px; height: 14px; margin-top: 3px; }
.opt .main { flex: 1; min-width: 0; }
.opt .main a:hover { color: var(--accent); }
.opt .sub { display: block; font-size: 12.5px; color: var(--tab); }
.opt .tag { font-size: 13px; color: var(--accent); }

.list { margin: 0; padding: 0; list-style: none; font-size: 14px; }
.list li { position: relative; padding: 3px 0 3px 16px; }
.list li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: calc(3px + 0.65em - 2.5px);
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 1px;
}

.slider { padding: 3px 0; font-size: 14px; }
.slider .row { display: flex; justify-content: space-between; margin-bottom: 3px; }
.slider .val { color: var(--accent); }
.track { height: 8px; background: var(--element); border: 1px solid #000; border-radius: 2px; overflow: hidden; }
.fill { height: 100%; background: var(--accent); }

/* Click to copy. Looks like plain text, still selectable by hand. */
.copy {
  display: block;
  margin: 0 0 4px;
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  font-size: 14px;
  text-align: left;
  text-shadow: inherit;
  color: var(--tab);
  cursor: pointer;
  user-select: text;
  transition: color 0.15s;
}
.copy:hover, .copy.done { color: var(--accent); }

/* Pressed states, so every control answers a click. */
.copy:active { color: var(--white); }
.tabs button:active { color: var(--accent); }
.check:active { transform: scale(0.88); }
.btn:active { transform: translateY(1px); background: #1f1f1f; }
.btn.primary:active { background: #968b8d; }
.copy:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

.btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  height: 22px;
  padding: 0 12px;
  background: var(--element);
  border: 1px solid #000;
  border-radius: 3px;
  font-size: 14px;
  color: var(--white);
  transition: background-color 0.15s;
}
.btn:hover { background: #2c2c2c; }
.btn.primary { background: var(--accent); color: #111; text-shadow: none; }
.btn.primary:hover { background: #bcb1b3; }

.status { margin-top: 8px; text-align: right; font-size: 14px; color: var(--tab); }

/* Tab switch: all boxes fade and rise in together. */
@media (prefers-reduced-motion: no-preference) {
  .panel:not([hidden]) .group { animation: rise 0.28s ease-out both; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } }

  /* Window hide and show, driven by egg.js. */
  .window.closing { animation: win-out 0.2s ease-in both; }
  .window.opening { animation: win-in 0.25s ease-out both; }
  @keyframes win-out { to { opacity: 0; transform: scale(0.96) translateY(8px); } }
  @keyframes win-in { from { opacity: 0; transform: scale(0.96) translateY(8px); } }

  .tabs button { position: relative; }
  .tabs button::after {
    content: "";
    position: absolute;
    left: 3px;
    right: 3px;
    bottom: -3px;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 0.2s ease-out;
  }
  .tabs button[aria-selected="true"]::after { transform: scaleX(1); }
}

@media (max-width: 560px) {
  .panel { grid-template-columns: 1fr; }
  .body { height: 60vh; }
  .titlebar { flex-wrap: wrap; height: auto; row-gap: 6px; }
  .divider { display: none; }
  .brand { width: 100%; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
