:root { color-scheme: dark; }
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, system-ui, sans-serif;
  background: #1a1a1a;
  color: #e8e8e8;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

header {
  padding: 12px 16px;
  background: #242424;
  border-bottom: 1px solid #333;
  flex-shrink: 0;
}

h1 { font-size: 15px; margin: 0 0 10px; font-weight: 600; color: #bbb; }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.controls { margin-top: 10px; }

input[type="text"] {
  flex: 1;
  min-width: 280px;
  padding: 8px 10px;
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 6px;
  color: #e8e8e8;
  font-size: 13px;
  font-family: ui-monospace, Menlo, monospace;
}

button {
  padding: 8px 14px;
  background: #333;
  border: 1px solid #555;
  border-radius: 6px;
  color: #e8e8e8;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
button:hover { background: #3d3d3d; }
button:active { background: #2a2a2a; }
button.primary { background: #2d5a8c; border-color: #3a6ea5; }
button.primary:hover { background: #356aa3; }

#copyBtn { margin-left: auto; }

.step { font-size: 18px; font-weight: 700; min-width: 46px; text-align: center; }

.url-bar {
  margin-top: 10px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12px;
  color: #888;
  word-break: break-all;
}
.url-bar b { color: #6cb6ff; }

main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 16px;
  position: relative;
}

#image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: none;
  border-radius: 4px;
  cursor: zoom-in;
  transition: transform 0.12s ease-out;
  transform: scale(1);
}
#image.zoomed {
  cursor: zoom-out;
  transition: transform 0.12s ease-out;
}

#zoomBtn {
  position: absolute;
  top: 24px;
  right: 24px;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(20, 20, 20, 0.78);
  border: 1px solid #555;
  border-radius: 8px;
  color: #e8e8e8;
  font-size: 13px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 5;
  backdrop-filter: blur(4px);
}
#zoomBtn:hover { background: rgba(40, 40, 40, 0.9); }
main.has-image:hover #zoomBtn,
main.has-image #zoomBtn.active { display: inline-flex; opacity: 1; }

/* On touch devices the JS pan (mousemove) doesn't work — hide the zoom button
   and let users tap "Open in new tab" for native pinch-to-zoom instead. */
@media (hover: none), (pointer: coarse) {
  #zoomBtn { display: none !important; }
  #image { cursor: default; }
}

#status {
  text-align: center;
  color: #777;
  font-size: 15px;
  line-height: 1.6;
}
#status .num { color: #ff8a8a; font-weight: 700; }

.hint { color: #666; font-size: 12px; margin-top: 14px; }

kbd {
  background: #333; border: 1px solid #555; border-radius: 4px;
  padding: 1px 6px; font-size: 11px; font-family: ui-monospace, monospace;
}
