@charset "utf-8";

.mosaic-editor {
  display: flex;
  gap: 1em;
  background: var(--color_bg, #fff);
}

:host {
  display: block;
  position: relative;
  user-select: none;
}

.toolbar {
  flex-basis: min-content;
  position: relative;
  display: flex;
  gap: 1em;
  padding: .75em;
  background: rgba(255, 255, 255, 0.92);
  font-size: 16px;
  flex-direction: column;
}

.toolbar .sliders .ctl {
  display: block;
  background: #efefef;
  padding: .5em 1.1em;
  border-radius: 10px;

  +.ctl {
    margin-top: 1em;
  }
}

.toolbar .sliders .label__name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar .sliders .label__value {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar input[type="range"] {
  width: 180px;
}

.toolbar input[type="file"] {
  display: none;
}

.toolbar #open {
  display: none;
}

.toolbar #download {
  display: none;
}

.toolbar button {
  font-size: 1em;
  min-height: 40px;
  padding: 1em;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .1em;

  &:hover,
  &.active,
  &.temp {
    background: #222;
    color: #fff;
    border-color: #222;
  }
}

.toolbar .icon {
  font-size: 1.5em;
}

.toolbar kbd {
  margin-left: .4em;
  padding: .15em .5em;
  border-radius: .5em;
  border: 1px solid #ddd;
  border-bottom-color: #c8c8c8;
  background: #f3f3f3;
  color: #333;
  font: 11px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.canvas-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #111;
  color: #222;
}

canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#hud {
  pointer-events: none;
}

.canvas-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border: .5em dashed #66a3ff;
  background: rgba(102, 163, 255, 0.08);
  opacity: 0;
  transition: opacity .12s ease;
  pointer-events: none;
}

:host(.dragover) .canvas-wrap::after {
  opacity: 1;
}

.status {
  position: absolute;
  left: 0;
  bottom: 0;
  display: flex;
  gap: 16px;
  padding: 6px 10px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.45);
  font: 12px/1.4 system-ui, sans-serif;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s ease;
}

:host(.has-image) .status {
  opacity: 1;
}

.savebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  color: #222;
  font: 13px/1.5 system-ui, sans-serif;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e5e7eb;
  border-radius: 14px;
}

.savebar label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: .5em .9em;
  border-radius: 10px;
  background: #f7f7f7;
  cursor: pointer;
}

.savebar label input[type="checkbox"] {
  accent-color: #222;
  transform: scale(1.1);
  cursor: pointer;
}

.savebar button {
  font-size: 1.05em;
  font-weight: 600;
  min-height: 44px;
  padding: .9em 1.2em;
  border-radius: 12px;
  border: 1px solid transparent;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease, transform .02s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}

.savebar button:hover {
  background: #1d4ed8;
  color: #fff;
}

.savebar button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .35), 0 2px 6px rgba(0, 0, 0, .2);
}

.savebar button:active {
  transform: translateY(.5px);
}

.savebar button svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: currentColor;
  stroke: currentColor;
}

.pnginfo-card {
  display: none;
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.pnginfo-header {
  font-size: .8em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.pnginfo-title {
  color: #111827;
}

.pnginfo-actions {
  display: flex;
  gap: 8px;
}

.btn-ghost {
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-ghost:hover,
.btn-ghost.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

.btn-ghost svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
  stroke: currentColor;
}

.btn-ghost .icon-check {
  display: none;
}

.btn-ghost.success .icon-copy {
  display: none;
}

.btn-ghost.success .icon-check {
  display: block;
}

.pnginfo-actions .btn-ghost {
  padding: 0px 10px;
  min-height: unset;
}

.pnginfo-text {
  margin: 0;
  padding: 12px;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #0f172a;
  color: #e5e7eb;
  white-space: pre-wrap;
  overflow-y: scroll;
  max-height: 5lh;
  user-select: text;
  cursor: text;
}

.drop-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.5em;
  color: rgba(255, 255, 255, 0.9);
  opacity: .95;
  transition: opacity .15s ease;
  pointer-events: auto;
  padding: 1.2em;
  cursor: pointer;
}

.drop-hint:hover {
  color: #fff;
}

.drop-hint:focus {
  outline: 2px solid #66a3ff;
  outline-offset: 2px;
}

.clear-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 2em;
  height: 2em;
  font-size: 1.5em;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(100, 100, 100, 0.6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  z-index: 11;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, background .15s ease;
}

.clear-btn:hover {
  background: rgba(0, 0, 0, 0.75);
}

:host(.has-image) .clear-btn {
  opacity: 1;
  pointer-events: auto;
}

:host(:not(.has-image)) .savebar {
  display: none;
}

.clear-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.drop-hint small {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  margin-top: .2em;
}

/* Hide editing controls until an image is loaded */
:host(:not(.has-image)) .ctl {
  opacity: .5;
  pointer-events: none;
}

:host([aspect="16:9"]) .canvas-wrap {
  aspect-ratio: 16/9;
}

:host([aspect="4:3"]) .canvas-wrap {
  aspect-ratio: 4/3;
}

:host([aspect="1:1"]) .canvas-wrap {
  aspect-ratio: 1/1;
}