  * { margin: 0; padding: 0; box-sizing: border-box; }
  body {
    background: #111;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    font-family: sans-serif;
    user-select: none;
  }

  #hint {
    color: #aaa;
    font-size: 14px;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
    transition: opacity 0.4s;
  }

  #frame {
    position: relative;
    display: inline-block;
    cursor: crosshair;
    line-height: 0;
  }

  #painting {
    display: block;
    max-height: 80vh;
    max-width: 90vw;
  }

  #overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    cursor: crosshair;
  }

  /* The selected area window */
  #cam-window {
    position: absolute;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.5);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.5), 0 4px 24px rgba(0,0,0,0.6);
    cursor: grab;
    display: none;
    border-radius: 2px;
  }
  #cam-window.active { cursor: grab; }
  #cam-window.dragging-cam { cursor: grabbing; }

  #cam-video {
    position: absolute;
    top: 50%; left: 50%;
    transform-origin: center center;
    /* transform set by JS */
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    pointer-events: none;
  }

  /* Controls bar */
  #controls {
    display: none;
    gap: 8px;
    margin-top: 14px;
    align-items: center;
  }
  #controls.visible { display: flex; }

  button {
    background: #222;
    color: #eee;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 7px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
  }
  button:hover { background: #333; }
  button:active { background: #444; }

  #zoom-label {
    color: #888;
    font-size: 13px;
    min-width: 52px;
    text-align: center;
  }

  #reset-btn {
    color: #f88;
    border-color: #633;
  }
  #reset-btn:hover { background: #311; }

  #skin-controls {
    display: none;
    gap: 10px;
    margin-top: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
  }
  #skin-controls.visible { display: flex; }

  .skin-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #999;
    font-size: 12px;
  }
  .skin-row label { min-width: 62px; text-align: right; }
  input[type=range] {
    -webkit-appearance: none;
    width: 120px;
    height: 4px;
    border-radius: 2px;
    background: #444;
    outline: none;
    cursor: pointer;
  }
  input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #aaa;
    cursor: pointer;
  }
  .skin-val { min-width: 34px; color: #777; font-size: 11px; }
