body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #121212;
    color: #eee;
    display: flex;
    flex-direction: column;
    height: 100vh;
  }
  
  header {
    padding: 10px;
    background: #1e1e1e;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }
  
  header input {
    flex: 1;
    min-width: 200px;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #333;
    background: #222;
    color: #eee;
  }
  
  header button {
    padding: 6px 12px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    background: #333;
    color: #eee;
    transition: background 0.2s, color 0.2s;
  }
  
  header button:hover {
    background: #555;
  }
  
  header button.copied {
    background: #28a745;
    color: #fff;
    font-weight: bold;
  }
  
  #imageInfo {
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin: 10px;
    align-self: flex-start;
    z-index: 500;
  }
  
  #viewer {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #000;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
  }
  
  #viewer h2 {
    margin: 10px;
    font-size: 1.2rem;
    font-weight: normal;
    color: #aaa;
  }
  
  .image-layer {
    position: absolute;
    top: 0; left: 0;
    transform-origin: 0 0;
    display: none;
    user-select: none;
    pointer-events: none;
    max-width: none;
    max-height: none;
  }
  
  .image-layer.active {
    display: block;
  }
  
  #controls {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(20,20,20,0.8);
    padding: 8px;
    border-radius: 8px;
    z-index: 1000;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }
  
  #controls button {
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid #444;
    background: #222;
    color: #eee;
    transition: all 0.2s;
  }
  
  #controls button:hover {
    background: #333;
  }
  
  #controls button.active {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
    font-weight: bold;
  }
  
  #history {
    background: #1e1e1e;
    padding: 10px;
    border-top: 1px solid #333;
  }
  
  #history h3 {
    margin-top: 0;
    font-size: 1rem;
    color: #aaa;
  }
  
  #historyList {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .history-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border: 1px solid #444;
    border-radius: 6px;
    background: #222;
    color: #eee;
    cursor: pointer;
    transition: background 0.2s;
    min-width: 120px;
    position: relative;
  }
  
  .history-btn:hover {
    background: #333;
  }
  
  .history-btn img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #444;
  }
  
  .delete-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    transition: background 0.2s;
  }
  
  .delete-btn:hover {
    background: #e74c3c;
  }
  