/* MidoFiles — "Living Gallery". The background is the collection's own art, blurred + reactive.
   Chrome stays near-monochrome glass so the game art is the only source of colour.
   Type: Syne (display) · Inter (body) · Space Mono (data). One warm accent, used with restraint. */
:root {
  --ink: #08080a;
  --paper: #f4f2ee;
  --muted: rgba(244, 242, 238, 0.6);
  --dim: rgba(244, 242, 238, 0.4);
  --line: rgba(255, 255, 255, 0.12);
  --line2: rgba(255, 255, 255, 0.24);
  --glass: rgba(18, 18, 22, 0.55);
  --glass2: rgba(26, 26, 32, 0.72);
  --accent: #f6c453;
  --accent-ink: #17120a;
  --shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
  --radius: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2 { font-family: "Syne", sans-serif; margin: 0; letter-spacing: -0.02em; }
a { color: inherit; }
img { display: block; }
.mono { font-family: "Space Mono", monospace; }

/* ---- signature: reactive art background --------------------------------- */
.stage { position: fixed; inset: 0; z-index: 0; background: var(--ink); overflow: hidden; }
.amb {
  position: absolute; inset: -6%; z-index: 0; opacity: 0;
  background-size: cover; background-position: center;
  filter: blur(64px) saturate(1.15) brightness(0.52);
  transform: scale(1.18);
  transition: opacity 1.1s ease;
  will-change: opacity;
}
.veil {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(120% 90% at 50% -10%, transparent 30%, rgba(8, 8, 10, 0.55) 100%),
    linear-gradient(180deg, rgba(8, 8, 10, 0.5) 0%, rgba(8, 8, 10, 0.72) 55%, rgba(8, 8, 10, 0.92) 100%);
}
.wrap { position: relative; z-index: 2; max-width: 1220px; margin: 0 auto; padding: 0 24px 100px; }

/* ---- top bar ------------------------------------------------------------ */
.bar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 16px 24px;
  background: linear-gradient(180deg, rgba(8, 8, 10, 0.7), rgba(8, 8, 10, 0));
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 30px; height: 30px; opacity: 0.95; }
.brand .wm { font-family: "Syne", sans-serif; font-weight: 800; font-size: 20px; }
.brand .tag { font-family: "Space Mono", monospace; font-size: 11px; color: var(--dim); letter-spacing: 0.5px; }
.bar .sp { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px; flex: 0 1 260px; min-width: 120px;
  background: var(--glass); backdrop-filter: blur(14px); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; transition: border-color 0.15s;
}
.search:focus-within { border-color: var(--line2); }
.search svg { opacity: 0.55; flex: none; }
.search input { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--paper); font-size: 13.5px; font-family: inherit; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  background: var(--glass); backdrop-filter: blur(14px); border: 1px solid var(--line);
  color: var(--paper); border-radius: 10px; padding: 9px 13px; font: 500 13px/1 "Inter", sans-serif;
  transition: border-color 0.15s, background 0.15s;
}
.pill:hover { border-color: var(--line2); }
.pill.on { border-color: var(--accent); color: var(--accent); }

/* ---- buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  border: 1px solid transparent; border-radius: 10px; padding: 12px 20px;
  font: 600 14px/1 "Inter", sans-serif; text-decoration: none; transition: transform 0.12s, filter 0.15s, background 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.glass { background: var(--glass2); backdrop-filter: blur(14px); border-color: var(--line2); color: var(--paper); }
.btn.glass:hover { background: rgba(40, 40, 48, 0.8); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- featured spotlight ------------------------------------------------- */
.spotlight { display: grid; grid-template-columns: 240px 1fr; gap: 40px; align-items: center; padding: 48px 0 30px; animation: rise 0.6s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.poster {
  aspect-ratio: 2 / 3; border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--line2);
  transform: perspective(1000px) rotateY(6deg); transition: transform 0.35s ease;
}
.poster:hover { transform: perspective(1000px) rotateY(0deg) translateY(-4px); }
.poster img { width: 100%; height: 100%; object-fit: cover; }
.feat .eyebrow { font-family: "Space Mono", monospace; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.feat h1 { font-size: clamp(30px, 5vw, 58px); font-weight: 800; line-height: 1; margin-bottom: 16px; }
.feat p { color: var(--muted); font-size: 14.5px; line-height: 1.65; max-width: 620px; margin: 0 0 22px; max-height: 4.9em; overflow: hidden; }
.feat .cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* meta row (shared) */
.meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.meta .m { font-family: "Space Mono", monospace; font-size: 12px; color: var(--muted); background: var(--glass); border: 1px solid var(--line); border-radius: 7px; padding: 4px 9px; }
.meta .m.hot { color: var(--accent); border-color: rgba(246, 196, 83, 0.35); }
.meta .g { font-size: 12px; color: var(--paper); background: rgba(255, 255, 255, 0.08); border-radius: 7px; padding: 4px 10px; }

/* ---- the shelf ---------------------------------------------------------- */
.shelf { margin-top: 26px; }
.shelfhead { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.shelfhead h2 { font-size: 22px; font-weight: 700; }
.shelfhead .ct { font-family: "Space Mono", monospace; font-size: 12px; color: var(--dim); }
.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-left: auto; }
.chip { background: var(--glass); backdrop-filter: blur(10px); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 5px 13px; font: 500 12px/1 "Inter", sans-serif; cursor: pointer; transition: all 0.14s; }
.chip:hover { color: var(--paper); border-color: var(--line2); }
.chip.on { color: var(--accent); border-color: var(--accent); }

.rack { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 18px; }
.game {
  position: relative; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); background: #14141a;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45); transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
}
.game:hover { transform: translateY(-6px); box-shadow: 0 22px 46px rgba(0, 0, 0, 0.6); border-color: var(--line2); }
.game img { width: 100%; height: 100%; object-fit: cover; }
.game .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 14px; text-align: center; }
.game .ph span { font-family: "Syne", sans-serif; font-weight: 700; font-size: 16px; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); }
.game .cap-size { position: absolute; top: 8px; right: 8px; font-family: "Space Mono", monospace; font-size: 10.5px; background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(4px); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; }
.game .cap-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 11px 11px; font-family: "Syne", sans-serif; font-weight: 700; font-size: 13px; line-height: 1.2; background: linear-gradient(0deg, rgba(0, 0, 0, 0.9), transparent); opacity: 0; transition: opacity 0.18s; }
.game:hover .cap-name { opacity: 1; }
.game .pending-dot { position: absolute; top: 8px; left: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(246, 196, 83, 0.2); }

.empty { text-align: center; padding: 70px 20px; color: var(--dim); font-family: "Space Mono", monospace; }
.foot { margin-top: 56px; text-align: center; font-family: "Space Mono", monospace; font-size: 11.5px; color: var(--dim); }
.foot a { color: var(--muted); }

/* ---- modal -------------------------------------------------------------- */
.modal-wrap { position: fixed; inset: 0; z-index: 90; display: none; align-items: flex-start; justify-content: center; padding: 40px 20px; overflow-y: auto; }
.modal-wrap.show { display: flex; }
.modal-wrap .backdrop { position: fixed; inset: 0; background: rgba(4, 4, 6, 0.7); backdrop-filter: blur(8px); }
.modal { position: relative; z-index: 1; width: min(820px, 100%); background: var(--glass2); backdrop-filter: blur(24px); border: 1px solid var(--line2); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); animation: pop 0.2s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(0.985); } to { opacity: 1; transform: none; } }
.modal .close { position: absolute; top: 14px; right: 14px; z-index: 3; width: 34px; height: 34px; border-radius: 9px; background: rgba(0, 0, 0, 0.5); border: 1px solid var(--line2); color: #fff; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.mhero { position: relative; aspect-ratio: 16 / 6; background-size: cover; background-position: center; display: flex; align-items: flex-end; }
.mhero .mscrim { position: absolute; inset: 0; background: linear-gradient(0deg, var(--glass2) 4%, transparent 70%); }
.mhero h2 { position: relative; z-index: 1; padding: 22px 26px; font-size: clamp(24px, 4vw, 38px); font-weight: 800; }
.mbody { padding: 20px 26px 26px; }
.mdesc { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 4px 0 20px; white-space: pre-line; max-height: 210px; overflow-y: auto; }
.shots { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; margin-bottom: 20px; }
.shots img { height: 150px; border-radius: 9px; scroll-snap-align: start; border: 1px solid var(--line); cursor: zoom-in; flex: none; }
.shots:empty { display: none; }
.mactions { display: flex; gap: 12px; align-items: center; }
.madmin { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }

/* lightbox for a screenshot */
.light { position: fixed; inset: 0; z-index: 130; background: rgba(0, 0, 0, 0.9); display: none; align-items: center; justify-content: center; padding: 30px; cursor: zoom-out; }
.light.show { display: flex; }
.light img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* ---- librarian drawer --------------------------------------------------- */
.drawer-wrap { position: fixed; inset: 0; z-index: 80; display: none; }
.drawer-wrap.show { display: block; }
.drawer-wrap .backdrop { position: absolute; inset: 0; background: rgba(4, 4, 6, 0.55); }
.drawer { position: absolute; top: 0; right: 0; height: 100%; width: min(430px, 100%); background: var(--glass2); backdrop-filter: blur(24px); border-left: 1px solid var(--line2); display: flex; flex-direction: column; animation: slide 0.22s ease-out; }
@keyframes slide { from { transform: translateX(100%); } to { transform: none; } }
.dhead { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.dhead b { font-family: "Syne", sans-serif; font-weight: 700; font-size: 16px; }
.dhead .sp { flex: 1; }
.dbody { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: "Space Mono", monospace; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--dim); }
.field input { background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; color: var(--paper); font-size: 13.5px; font-family: inherit; outline: none; transition: border-color 0.15s; }
.field input:focus { border-color: var(--accent); }
.note { font-size: 12px; color: var(--dim); line-height: 1.5; }
.note.warn { color: var(--accent); }

.jobcard { background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line); border-radius: 11px; padding: 12px 13px; display: flex; flex-direction: column; gap: 8px; }
.jobcard .top { display: flex; align-items: center; gap: 8px; }
.jobcard .fn { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.jobcard .st { font-family: "Space Mono", monospace; font-size: 10px; letter-spacing: 0.5px; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; }
.st.downloading, .st.queued { color: var(--accent); background: rgba(246, 196, 83, 0.14); }
.st.scanning, .st.matching { color: #7fd7ff; background: rgba(127, 215, 255, 0.12); }
.st.done { color: #74e0a3; background: rgba(116, 224, 163, 0.14); }
.st.error { color: #ff8095; background: rgba(255, 128, 149, 0.14); }
.bar-p { height: 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.bar-p > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.4s; }
.jobcard .sub { font-family: "Space Mono", monospace; font-size: 10.5px; color: var(--dim); display: flex; justify-content: space-between; }

.fixrow { background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; display: flex; flex-direction: column; gap: 9px; }
.fixrow .q { font-size: 12.5px; }
.fixrow .q b { font-family: "Space Mono", monospace; font-weight: 700; }
.cands { display: flex; flex-direction: column; gap: 6px; }
.cand { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; cursor: pointer; font-size: 12px; transition: border-color 0.14s; }
.cand:hover { border-color: var(--accent); }
.cand .yr { color: var(--dim); margin-left: auto; font-family: "Space Mono", monospace; font-size: 11px; }
.mini { display: flex; gap: 7px; }
.minibtn { font: 500 11.5px/1 "Inter", sans-serif; padding: 6px 10px; border-radius: 7px; border: 1px solid var(--line2); background: rgba(255, 255, 255, 0.05); color: var(--muted); cursor: pointer; }
.minibtn:hover { color: var(--paper); }
.minibtn.danger:hover { color: #ff8095; border-color: #ff8095; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); z-index: 140; background: var(--glass2); backdrop-filter: blur(16px); border: 1px solid var(--line2); border-radius: 11px; padding: 12px 18px; font-size: 13px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: all 0.25s; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: #ff8095; }
.toast.ok { border-color: #74e0a3; }

@media (max-width: 720px) {
  .spotlight { grid-template-columns: 150px 1fr; gap: 22px; padding: 30px 0 20px; }
  .poster { transform: none; }
  .brand .tag { display: none; }
  .rack { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .amb { transition: none; }
  .spotlight { animation: none; }
  .poster, .game { transition: none; }
  .poster { transform: none; }
}
