/* ROM§EARCH: dark terminal look. Amber + coral on near-black, monospace, scanlines. */
:root {
  --bg: #07080a; --panel: #0d0f12; --line: #23262b; --line2: #353a41;
  --text: #d9d5c9; --dim: #858479; --faint: #55554e;
  --acc: #ffc23d; --acc2: #ff6b57; --ok: #6fd6a0; --bad: #ff6b57;
  --glow: rgba(255, 194, 61, .35); --scan: rgba(255, 255, 255, .025);
  --mono: "Cascadia Mono", "JetBrains Mono", "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
}
:root[data-theme="light"] {
  --bg: #f2efe5; --panel: #fbf9f2; --line: #d8d3c2; --line2: #bdb7a3;
  --text: #1d1d19; --dim: #6f6c60; --faint: #9c988a;
  --acc: #b36b00; --acc2: #d1432f; --ok: #1f8a57; --bad: #d1432f;
  --glow: rgba(179, 107, 0, .3); --scan: rgba(0, 0, 0, .02);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--mono); min-height: 100vh; transition: background .3s, color .3s; }
::selection { background: var(--acc); color: #000; }
a { color: inherit; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 1px solid var(--acc); outline-offset: 2px; }

#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.scan { position: fixed; inset: 0; z-index: 50; pointer-events: none; background: repeating-linear-gradient(0deg, var(--scan) 0 1px, transparent 1px 3px); }
.scan::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .35)); }
:root[data-theme="light"] .scan::after { background: none; }

main { position: relative; z-index: 1; max-width: 880px; margin: 0 auto; padding: 56px 18px 48px; }

.corner { position: fixed; top: 14px; right: 14px; z-index: 60; display: flex; gap: 8px; }
.corner button { width: 38px; height: 38px; border: 1px solid var(--line2); background: var(--panel); color: var(--dim); font-size: 17px; line-height: 1; transition: color .15s, border-color .15s, box-shadow .15s, transform .15s; }
.corner button:hover, .corner button.on { color: var(--acc); border-color: var(--acc); box-shadow: 0 0 14px var(--glow); }
.corner button:active { transform: scale(.94); }

.hero { text-align: center; margin-bottom: 26px; animation: rise .6s both; }
/* logo: the original look (two stacked S, yellow over coral) */
h1 { margin:0; display:flex; justify-content:center; align-items:center; font:800 clamp(44px,11vw,84px)/1.15 'Bricolage Grotesque',Inter,sans-serif; letter-spacing:-.035em; color:#fff; }
:root[data-theme="light"] h1 { color:#14202b; }
h1 b { font-weight:800; }
h1 .sec { display:inline-flex; flex-direction:column; align-items:center; margin:0 .07em 0 .05em; font-size:.72em; line-height:.5; font-weight:800; position:relative; top:-.02em; transition:transform .25s cubic-bezier(.3,1.6,.5,1); }
h1 .sec i { font-style:normal; display:block; text-shadow:.04em .04em 0 #07141f; }
h1 .sec i:first-child { color:#ffe14d; transform:translateX(.07em); }
h1 .sec i:last-child { color:#ff6b57; transform:translateX(-.07em); }
h1:hover .sec { transform:scale(1.12) rotate(-6deg); }
.tag { margin: 10px 0 14px; color: var(--dim); }
.cursor { display: inline-block; width: .6em; height: 1em; margin-left: 4px; vertical-align: -2px; background: var(--acc); animation: blink 1.1s steps(1) infinite; }
.stats { margin: 2px 0; font-size: 12px; color: var(--faint); letter-spacing: .04em; }
.stats button { background: none; border: 0; padding: 0; color: var(--acc); text-decoration: underline; text-underline-offset: 3px; }

#form { position: relative; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--panel); border: 1px solid var(--line2); transition: border-color .2s, box-shadow .2s; animation: rise .6s .08s both; }
#form::before { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--acc), transparent); opacity: .55; transition: opacity .2s; }
#form:focus-within { border-color: var(--acc); box-shadow: 0 0 26px var(--glow); }
#form:focus-within::before { opacity: 1; animation: sweep 2.4s ease-in-out infinite; }
.prompt { color: var(--acc); font-weight: 700; }
#q { flex: 1; min-width: 0; border: 0; background: none; padding: 15px 0; font-size: 16px; outline: 0; caret-color: var(--acc); -webkit-appearance: none; appearance: none; }
#q::placeholder { color: var(--faint); }
#q::-webkit-search-cancel-button { display: none; }
kbd { display: inline-block; min-width: 1.6em; padding: 0 5px; border: 1px solid var(--line2); color: var(--dim); font: inherit; font-size: 11px; text-align: center; }
.go, .ctrls button, #more, .seg button, .switch { background: none; border: 1px solid var(--line2); color: var(--text); padding: 7px 14px; letter-spacing: .04em; transition: color .15s, border-color .15s, background .15s, box-shadow .15s, transform .1s; }
.go { padding: 7px 12px; }
.go:hover, .ctrls button:hover, #more:hover, .seg button:hover, .switch:hover { color: var(--acc); border-color: var(--acc); box-shadow: 0 0 12px var(--glow); }
.go:active, .ctrls button:active, #more:active { transform: translateY(1px); }
.ctrls button.on, .seg button.on { color: #000; background: var(--acc); border-color: var(--acc); }

.panel { margin-top: 12px; padding: 14px 16px; border: 1px solid var(--line); background: var(--panel); display: flex; flex-wrap: wrap; gap: 14px 28px; animation: drop .25s both; }
.grp { display: flex; flex-direction: column; gap: 6px; }
.lbl { font-size: 11px; color: var(--dim); letter-spacing: .08em; }
.lbl::before { content: "[ "; color: var(--faint); } .lbl::after { content: " ]"; color: var(--faint); }
.seg { display: flex; }
.seg button { padding: 5px 12px; }
.seg button + button { margin-left: -1px; }
.switch { display: inline-flex; align-items: center; gap: 10px; padding: 5px 12px 5px 6px; }
.switch .knob { width: 28px; height: 14px; border: 1px solid var(--line2); position: relative; }
.switch .knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 8px; height: 8px; background: var(--faint); transition: transform .2s, background .2s; }
.switch.on .knob { border-color: var(--acc); }
.switch.on .knob::after { transform: translateX(14px); background: var(--acc); }

.strip { margin-top: 18px; position: relative; animation: rise .6s .16s both; }
.strip::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 34px; pointer-events: none; background: linear-gradient(90deg, transparent, var(--bg)); }
.consoles { display: flex; gap: 6px; overflow-x: auto; padding: 4px 30px 8px 1px; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.cc { flex: none; display: flex; flex-direction: column; align-items: center; gap: 3px; width: 62px; padding: 8px 2px 6px; background: none; border: 1px solid transparent; color: var(--dim); font-size: 10px; transition: border-color .15s, color .15s, background .15s; }
.cc img { width: 30px; height: 30px; object-fit: contain; filter: grayscale(.85) brightness(.9); transition: filter .2s, transform .2s; }
.cc span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc:hover { border-color: var(--line2); color: var(--text); } .cc:hover img { filter: none; transform: translateY(-2px); }
.cc.on { border-color: var(--acc); color: var(--acc); background: rgba(255, 194, 61, .07); box-shadow: 0 0 14px var(--glow); }
.cc.on img { filter: none; }
.cc .ab { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--line2); font-size: 10px; }
.cdiv { flex: none; align-self: center; height: 34px; border-left: 1px dashed var(--line2); margin: 0 4px; position: relative; }
.cdiv::after { content: "retro"; position: absolute; top: -12px; left: 5px; font-size: 9px; color: var(--faint); letter-spacing: .1em; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { background: none; border: 1px solid var(--line2); padding: 4px 11px; font-size: 12px; color: var(--dim); display: inline-flex; align-items: center; gap: 7px; transition: all .15s; }
.chip i { width: 7px; height: 7px; background: hsl(var(--h) 80% 60%); box-shadow: 0 0 8px hsl(var(--h) 80% 60% / .7); }
.chip small { color: var(--faint); }
.chip:hover { color: var(--text); border-color: var(--dim); }
.chip.on { color: var(--text); border-color: hsl(var(--h) 80% 60%); background: hsl(var(--h) 80% 60% / .1); }
.chip .bad { color: var(--bad); }

.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 8px; padding-top: 12px; border-top: 1px dashed var(--line); }
#status { margin: 0; color: var(--dim); font-size: 12px; }
#status::before { content: "> "; color: var(--acc); }
.ctrls { display: flex; flex-wrap: wrap; gap: 8px; }
.ctrls select { background: var(--panel); border: 1px solid var(--line2); padding: 6px 10px; font-size: 13px; }
.ctrls select:hover { border-color: var(--acc); }

#results { list-style: none; margin: 0; padding: 0; }
#results li { position: relative; border-left: 2px solid var(--line); margin: 0 0 4px; opacity: 0; animation: rise .35s calc(var(--i, 0) * 28ms) forwards; transition: border-color .15s; }
#results li > a, #results li .card { display: flex; align-items: center; gap: 12px; padding: 11px 14px; text-decoration: none; background: var(--panel); border: 1px solid transparent; border-left: 0; transition: background .15s, transform .15s, border-color .15s; }
#results li:hover, #results li.sel { border-left-color: var(--acc); }
#results li:hover > a, #results li.sel > a, #results li:hover .card, #results li.sel .card { background: rgba(255, 194, 61, .06); border-color: var(--line2); transform: translateX(3px); }
#results li.sel::before { content: "▸"; position: absolute; left: -17px; top: 11px; color: var(--acc); }
.body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.t { font-size: 15px; color: var(--text); overflow-wrap: anywhere; }
li:hover .t, li.sel .t { color: var(--acc); }
.m { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 11px; color: var(--dim); }
.src { color: hsl(var(--h) 80% 65%); }
.tagc { display: inline-flex; align-items: center; gap: 5px; }
.ci { width: 18px; height: 18px; object-fit: contain; }
.found { color: var(--ok); }
.badge { font-size: 10px; padding: 0 5px; border: 1px solid; letter-spacing: .08em; text-transform: uppercase; }
.badge.new { color: var(--ok); border-color: var(--ok); animation: pulse 2s infinite; }
.badge.dead { color: var(--bad); border-color: var(--bad); }
li.isdead .t { text-decoration: line-through; text-decoration-color: var(--bad); opacity: .7; }
.arrow { flex: none; color: var(--faint); transition: color .15s, transform .15s; }
li:hover .arrow, li.sel .arrow { color: var(--acc); transform: translate(2px, -2px); }
.links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.lnk { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid hsl(var(--h) 60% 45%); color: hsl(var(--h) 80% 70%); text-decoration: none; font-size: 12px; transition: all .15s; }
.lnk small { color: var(--dim); }
.lnk:hover { background: hsl(var(--h) 80% 60% / .14); box-shadow: 0 0 12px hsl(var(--h) 80% 60% / .35); }
.lnk.isdead { opacity: .55; text-decoration: line-through; }
:root[data-theme="light"] .src, :root[data-theme="light"] .lnk { color: hsl(var(--h) 70% 30%); }

#empty { color: var(--dim); padding: 18px 4px; }
#more { display: block; margin: 18px auto 0; }
footer { margin-top: 38px; padding-top: 14px; border-top: 1px dashed var(--line); text-align: center; font-size: 11px; color: var(--faint); }
footer a { color: var(--dim); }
footer .keys { display: inline-block; margin-top: 6px; }
footer kbd { margin: 0 2px; font-size: 10px; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes sweep { 50% { opacity: .8; } }
@keyframes flick { 0%, 92%, 96%, 100% { opacity: 1; } 93%, 95% { opacity: .55; } }
@keyframes pulse { 50% { box-shadow: 0 0 10px var(--ok); } }

@media (max-width: 560px) { main { padding-top: 62px; } #kbd { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  #results li { opacity: 1; }
}

.lead { flex: none; width: 32px; height: 32px; object-fit: contain; }

.links ul, #link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
#link-list a { color: var(--acc); text-decoration: none; border-bottom: 1px dashed var(--acc); }
#link-list a:hover { text-shadow: 0 0 10px var(--glow); }
#link-list a::after { content: " ↗"; }
#link-list small { color: var(--dim); margin-left: 6px; }

.m .fmt { color: var(--accent2, #ff6b57); }
.m > span + span:not(.badge)::before { content: "·"; margin-right: 8px; opacity: .6; }
