body{margin:0;font-family:Arial,sans-serif;background:#111;color:#fff}
header{position:sticky;top:0;background:#1a1a1a;border-bottom:1px solid #333;padding:12px;z-index:10}
.toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:8px}
.toolbar input,.toolbar button{padding:8px 10px;border:1px solid #444;border-radius:6px;background:#222;color:#fff}
.toolbar button{cursor:pointer}
main{padding:18px;overflow:auto}

#grid{display:grid;grid-template-columns:repeat(100,10px);grid-template-rows: repeat(100, 10px);background:#222;user-select:none}
.cell{width:10px;height:10px;box-sizing:border-box;border:1px solid #2a2a2a;background:#fafafa;cursor:pointer}

.cell img{width:100%;height:100%;object-fit:cover;display:block;pointer-events:none}
#selectionRect{position:absolute;border:1px dashed #00d0ff;background:rgba(0,208,255,.15);display:none;pointer-events:none}
a{color:#00d0ff}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #111;
  padding: 20px;
  width: 400px;
  border-radius: 12px;
  color: white;
}

.modal-content img {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 10px;
}

textarea {
  width: 100%;
  height: 80px;
  margin-top: 10px;
}

#gridWrap {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  cursor: grab;
  touch-action: none;

}

#grid {
  transform-origin: 0 0;
  image-rendering: pixelated;
}

.cell.selected {
  outline: 2px solid blue;
  background: rgba(60, 179, 113, 1);
}

