: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; }

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; }
}
