/* MODZGPX Upscaler — dark UI. Everything is scoped under .mgu; doubled .mgu.mgu beats the theme's dark-mode input styles. */
.mgu {
  --bg: #0b0d12; --canvas: #0f1218; --panel: #12151c; --card: #181c25; --card-2: #1f2430;
  --line: #2a3040; --line-2: #363d50; --text: #e7e9ee; --muted: #8b93a7; --faint: #5d6579;
  --accent: #e11d48; --accent-2: #ff4d6d; --ok: #22c55e; --warn: #f43f5e; --radius: 10px;
  color-scheme: dark; display: flex; height: min(86vh, 920px); min-height: 560px; overflow: hidden;
  font: 13px/1.45 Inter, "Segoe UI", system-ui, sans-serif; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 14px; text-align: left;
}
.mgu * { box-sizing: border-box; }
/* edge to edge on the page: no rounded box, fill the screen under the header */
.mgu.alignfull { border-radius: 0; border-left: 0; border-right: 0; height: calc(100vh - 80px); max-height: none; } /* 78px header + 2px border */
.mgu .mgu-view { flex: 1; position: relative; min-width: 0; background: radial-gradient(circle at 1px 1px, #1a1f2a 1px, transparent 0) 0 0 / 22px 22px, var(--canvas); }
.mgu #drop { position: absolute; inset: 24px; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center;
  color: var(--muted); font-size: 15px; pointer-events: none; border: 2px dashed var(--line-2); border-radius: 18px; }
.mgu #drop svg { width: 46px; height: 46px; color: var(--faint); }
.mgu #drop small { color: var(--faint); }
.mgu .mgu-view.drag #drop { border-color: var(--accent); color: var(--text); background: rgba(225, 29, 72, .06); }
.mgu #hud { position: absolute; left: 14px; top: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(24, 28, 37, .85);
  border: 1px solid var(--line); color: var(--muted); font-size: 12px; backdrop-filter: blur(6px); }
.mgu #hud:empty { display: none; }
.mgu #zoomhint { position: absolute; right: 14px; bottom: 12px; color: var(--faint); font-size: 11px; }

.mgu aside { width: 330px; flex: none; overflow-y: auto; background: var(--panel); border-left: 1px solid var(--line); padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; }
.mgu header { display: flex; align-items: center; gap: 10px; padding: 0; margin: 0; background: none; border: 0; position: static; }
.mgu .logo { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), #7c3aed); display: grid; place-items: center; flex: none; }
.mgu .logo svg { width: 18px; height: 18px; color: #fff; }
.mgu.mgu h1 { font-size: 15px; line-height: 1.3; margin: 0; letter-spacing: .2px; color: var(--text); font-family: inherit; }
.mgu header p { margin: 0; color: var(--muted); font-size: 11.5px; }

.mgu .card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 0; }
.mgu.mgu h2 { margin: 0 0 8px; font-size: 11px; line-height: 1.4; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-family: inherit; }
.mgu label { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 7px 0; color: #c9cdd8; font-size: 13px; font-weight: 400; }
.mgu.mgu input[type=number], .mgu.mgu select { width: 128px; height: auto; padding: 6px 8px; margin: 0; background: var(--bg); color: var(--text); border: 1px solid var(--line-2);
  border-radius: 7px; font: inherit; outline: none; box-shadow: none; transition: border-color .15s, box-shadow .15s; }
.mgu.mgu input[type=number]:focus, .mgu.mgu select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(225, 29, 72, .2); }
.mgu input:disabled { opacity: .4; }
/* switch */
.mgu.mgu input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 34px; height: 19px; margin: 0; padding: 0; border: 0; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; transition: background .15s; flex: none; }
.mgu.mgu input[type=checkbox]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: transform .15s; }
.mgu.mgu input[type=checkbox]:checked { background: var(--accent); }
.mgu.mgu input[type=checkbox]:checked::after { transform: translateX(15px); }
.mgu input[type=checkbox]:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.mgu.mgu button, .mgu.mgu a.btn { font: inherit; font-size: 13px; line-height: 1.3; padding: 8px 12px; margin: 0; border: 1px solid var(--line-2); border-radius: 8px; background: var(--card-2); color: var(--text);
  cursor: pointer; transition: background .15s, border-color .15s, transform .05s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; text-transform: none; letter-spacing: 0; box-shadow: none; }
.mgu.mgu button:hover:not(:disabled), .mgu.mgu a.btn:hover { background: #283041; border-color: #47506a; color: var(--text); }
.mgu button:active:not(:disabled) { transform: translateY(1px); }
.mgu button:focus-visible, .mgu a.btn:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.mgu.mgu .primary { background: linear-gradient(135deg, var(--accent), #be123c); border-color: transparent; font-weight: 600; color: #fff; }
.mgu.mgu .primary:hover:not(:disabled) { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; }
.mgu.mgu button:disabled { opacity: .4; cursor: default; }
.mgu .row { display: flex; gap: 8px; flex-wrap: wrap; }
.mgu .row.grow > * { flex: 1; }

.mgu progress { width: 100%; height: 6px; appearance: none; border: 0; border-radius: 999px; overflow: hidden; background: var(--line); }
.mgu progress::-webkit-progress-bar { background: var(--line); }
.mgu progress::-webkit-progress-value { background: linear-gradient(90deg, var(--accent), #7c3aed); }
.mgu progress::-moz-progress-bar { background: var(--accent); }
.mgu #status { color: var(--muted); white-space: pre-line; font-variant-numeric: tabular-nums; }
.mgu #status:empty { display: none; }
.mgu #warn { color: #fecdd3; background: rgba(244, 63, 94, .1); border: 1px solid rgba(244, 63, 94, .45); border-radius: 8px; padding: 9px 11px; white-space: pre-line; font-weight: 500; }
.mgu #warn:empty { display: none; }
/* plan / paywall */
.mgu #plan { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.mgu #plan:empty { display: none; }
.mgu .plan-state { display: flex; align-items: center; gap: 8px; color: #c9cdd8; }
.mgu .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.mgu .dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.mgu .plan-note { color: var(--muted); font-size: 12px; }
.mgu .plan-buy { display: flex; flex-direction: column; gap: 6px; }
.mgu .plan-buy .btn { justify-content: space-between; }
.mgu .plan-buy .btn b { font-weight: 600; }
.mgu .plan-buy .btn span { color: #fda4af; font-weight: 600; }
.mgu .plan-buy .primary span { color: #fff; }
.mgu .card.locked { border-color: rgba(225, 29, 72, .55); box-shadow: 0 0 0 3px rgba(225, 29, 72, .15); }

.mgu aside::-webkit-scrollbar { width: 8px; } .mgu aside::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }
@media (max-width: 760px) {
  .mgu, .mgu.alignfull { flex-direction: column; height: auto; }
  .mgu .mgu-view { height: 60vh; flex: none; }
  .mgu aside { width: 100%; border-left: 0; border-top: 1px solid var(--line); }
}

/* upscaler view */
.mgu .mgu-view { overflow: hidden; touch-action: none; cursor: grab; }
.mgu .mgu-view:active { cursor: grabbing; }
.mgu .mgu-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: repeating-conic-gradient(#20242e 0 25%, #171a22 0 50%) 0 0 / 16px 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.mgu .mgu-stage img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; user-select: none; -webkit-user-drag: none; }
.mgu .mgu-stage img[hidden], .mgu .mgu-stage img:not([src]), .mgu .mgu-stage img[src=""] { display: none; }
.mgu #divider { position: absolute; top: 0; bottom: 0; width: 0; border-left: calc(2px / var(--z, 1)) solid #fff; cursor: ew-resize; z-index: 2; }
.mgu #divider span { position: absolute; top: 50%; left: -14px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.5); transform: translateY(-50%) scale(calc(1 / var(--z, 1))); }
.mgu #divider::before { content: ""; position: absolute; inset: 0 -12px; }
.mgu #drop[hidden] { display: none; }
.mgu .mgu-tabs, .mgu .mgu-zoom { position: absolute; top: 12px; display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(24, 28, 37, .9); border: 1px solid var(--line); backdrop-filter: blur(6px); }
.mgu .mgu-tabs { left: 50%; transform: translateX(-50%); }
.mgu .mgu-zoom { right: 12px; }
.mgu.mgu .mgu-tabs button, .mgu.mgu .mgu-zoom button { border: 0; background: none; padding: 5px 11px; border-radius: 7px; color: var(--muted); font-size: 12.5px; }
.mgu.mgu .mgu-tabs button.on { background: var(--card-2); color: var(--text); }
.mgu #hud { left: 14px; top: auto; bottom: 12px; }
.mgu .muted { color: var(--muted); word-break: break-word; }
.mgu label.slider input { width: 128px; accent-color: var(--accent); }
@media (max-width: 760px) {
  .mgu .mgu-tabs { left: 8px; transform: none; }
  .mgu .mgu-zoom { top: auto; bottom: 10px; right: 8px; }
  .mgu.mgu .mgu-tabs button { padding: 5px 9px; }
}
/* result canvas (on top of the original; the compare view clips it) */
.mgu .mgu-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.mgu .mgu-stage canvas[hidden] { display: none; }
.mgu.zoomed .mgu-stage canvas, .mgu.zoomed #origImg { image-rendering: pixelated; }
/* queue */
.mgu .mgu-queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; }
.mgu .mgu-queue:empty::before { content: "No images yet"; color: var(--muted); }
.mgu .mgu-queue li { display: flex; align-items: center; gap: 8px; padding: 5px 6px; margin: 0; border: 1px solid transparent; border-radius: 8px; cursor: pointer; }
.mgu .mgu-queue li:hover { background: var(--card-2); }
.mgu .mgu-queue li.on { border-color: var(--accent); background: rgba(225, 29, 72, .08); }
.mgu .mgu-queue img { width: 38px; height: 38px; object-fit: cover; border-radius: 6px; flex: none; background: var(--bg); }
.mgu .mgu-queue .q-text { flex: 1; min-width: 0; }
.mgu .mgu-queue .q-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.mgu .mgu-queue .q-info { display: block; color: var(--muted); font-size: 11.5px; }
.mgu .mgu-queue .q-info.done { color: var(--ok); }
.mgu .mgu-queue .q-info.err { color: var(--warn); }
.mgu.mgu .mgu-queue .q-x { padding: 2px 7px; border: 0; background: none; color: var(--faint); font-size: 15px; }
.mgu.mgu .mgu-queue .q-x:hover:not(:disabled) { background: var(--card-2); color: var(--text); }
.mgu .mgu-credit { font-size: 11px; color: var(--faint); }
/* site logo header */
.mgu header.has-logo { flex-direction: column; align-items: flex-start; gap: 6px; }
.mgu .mgu-brand { display: inline-flex; }
.mgu .mgu-brand img { display: block; height: 34px; width: auto; max-width: 100%; }
