:root {
  --bg: #0e0d13;
  --bg-raised: #17151f;
  --line: #262336;
  --text: #ece9f5;
  --muted: #8d86a6;
  --accent: #a970ff;
  --accent-soft: rgba(169, 112, 255, 0.16);
  --radius: 10px;
  --column: 780px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(14, 13, 19, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: var(--column);
  margin: 0 auto;
  padding: 18px 20px 14px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.channel {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.channel:hover { color: var(--accent); border-bottom-color: var(--accent-soft); }

.controls {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.search {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

input[type="search"],
select {
  appearance: none;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="search"] {
  width: 100%;
  padding-left: 36px;
  padding-right: 34px;
}

input[type="search"]::-webkit-search-cancel-button { display: none; }

input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

select {
  padding-right: 30px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5 6 8.5 10 4.5' fill='none' stroke='%238d86a6' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 12px;
  max-width: 190px;
}

.clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

.clear:hover { color: var(--text); background: var(--line); }

.status {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

main {
  max-width: var(--column);
  margin: 0 auto;
  padding: 8px 20px 40px;
}

.quotes {
  list-style: none;
  margin: 0;
  padding: 0;
}

.quote {
  padding: 17px 0 15px 16px;
  border-left: 2px solid transparent;
  border-bottom: 1px solid var(--line);
  transition: border-left-color 0.15s, background 0.15s;
}

.quote:hover { border-left-color: var(--line); }

.quote:target {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  padding-right: 14px;
}

.quote p {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  font-size: 12.5px;
  color: var(--muted);
}

.game {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--line);
}

.game:hover { color: var(--accent); border-bottom-color: currentColor; }

.dot { opacity: 0.45; }

.num {
  margin-left: auto;
  color: #4f4a63;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

.num:hover { color: var(--accent); }

mark {
  background: var(--accent-soft);
  color: var(--text);
  border-radius: 3px;
  padding: 0 1px;
}

.empty {
  padding: 48px 0;
  text-align: center;
  color: var(--muted);
}

footer {
  max-width: var(--column);
  margin: 0 auto;
  padding: 0 20px 40px;
  font-size: 12px;
  color: #4f4a63;
}

@media (max-width: 620px) {
  .controls { flex-wrap: wrap; }
  .search { flex-basis: 100%; }
  select { flex: 1 1 0; max-width: none; }
  .quote p { font-size: 17px; }
}

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

/* Footer on the viewer */

footer { display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; }
.footer-link { color: #4f4a63; text-decoration: none; }
.footer-link:hover { color: var(--accent); }

/* Landing, upload and 404 pages */

.page main.panel {
  max-width: 620px;
  padding: 64px 20px 48px;
}

.panel h1 {
  margin: 0 0 16px;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.lead { color: var(--muted); font-size: 17px; margin: 0 0 24px; }
.fine { color: var(--muted); font-size: 13px; }

code {
  font-size: 0.92em;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}

.button {
  display: inline-block;
  appearance: none;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 10px 18px;
  text-decoration: none;
  cursor: pointer;
}

.button:hover { filter: brightness(1.1); }
.button:disabled { opacity: 0.5; cursor: default; filter: none; }

.link {
  appearance: none;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  padding: 0;
  cursor: pointer;
}

.link:hover { color: var(--accent); }

.account {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}

.account strong { color: var(--text); }
.account a { color: var(--accent); text-decoration: none; }
.account form { margin: 0 0 0 auto; }

.steps { padding-left: 20px; margin: 0 0 18px; }
.steps li { margin-bottom: 6px; }

.dropzone {
  display: block;
  position: relative;
  padding: 36px 20px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover, .dropzone.dragging, .dropzone:focus-within {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone u { color: var(--accent); text-decoration: none; }

#preview { margin-top: 24px; }

.summary { font-size: 15px; }

.notice {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 16px 0;
  font-size: 14.5px;
}

.notice p { margin: 0 0 10px; }
.notice.error { border-left-color: #ff6b81; }
.notice.success { border-left-color: #4ad295; }
.notice a { color: var(--accent); }

.field { display: block; margin: 20px 0; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

input[type="text"] {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  padding: 9px 12px;
  outline: none;
}

.quotes.compact { margin: 8px 0 24px; }
.quotes.compact .quote p { font-size: 16px; }
.quotes.compact .quote:hover { border-left-color: transparent; }

.danger {
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.danger summary { cursor: pointer; }
.danger-button { background: #c7374f; margin-top: 4px; }

/* Automatic updates guide */

.auto {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.auto h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.auto > p { color: var(--muted); }
.actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.guide li { margin-bottom: 14px; }

.copy-block {
  position: relative;
  margin-top: 8px;
}

.copy-block pre {
  margin: 0;
  padding: 12px 64px 12px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13.5px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}

.copy-block .copy {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 13px;
  color: var(--accent);
}
