:root {
    --color:rgb(0, 0, 0);
    --border-radius:10px;
  }
  
  body {
    background:#000000;
    padding:0;
    margin:0;
    box-sizing:border-box;
    overflow: hidden;
    touch-action: none;
  }
  
  #puz, #puzz {
    position:absolute;
    border-radius:var(--border-radius) 0 var(--border-radius) 0;    
    user-select:none;
    touch-action: none;
  }
  #puz {
    width:300px;
    height:300px;
    position:absolute;
    top:50%;
    left:50%;
    transform:translate(-50%,-50%);
    border:3px dashed lightgray;
    overflow:hidden;
  }
  #puzz {
    left:0;
    top:0;
    border:0;
  }
  
  #puz i {
    float:left;
    width:100px;
    height:100px;
    outline:1px dashed lightgray;
  }
  
  #puzz i {
    position:absolute;
    width:100px;
    height:100px;
    background:var(--color);
    background-image:var(--image);
    background-size:300px 300px;
    background-repeat: no-repeat;
    cursor:move;
    box-shadow:0 0 10px rgba(0,0,0,.25);
    touch-action: none;
  }
  
  .first {
    border-top-left-radius:var(--border-radius);
    background-position:0 0 !important;
  }
  .secon {
    background-position:-100px 0 !important;
  }
  .third {
  /*   border-top-right-radius:var(--border-radius); */
    background-position:-200px 0 !important;
  }
  .fourt {
    background-position:0 -100px !important;
  }
  .fifth {
    background-position:-100px -100px !important;
  }
  .sixth {  
    background-position:-200px -100px !important;
  }
  .seven {
  /*   border-bottom-left-radius:var(--border-radius); */
    background-position:0 -200px !important;
  }
  .eight {
    background-position:-100px -200px !important;
  }
  .ninth {
    border-bottom-right-radius:var(--border-radius);
    background-position:-200px -200px !important;
  }
  
  .clicked {
    box-shadow:0 0 0 4px gray !important;
  }
  
  .dropped {
    background:var(--color);
    background-image:var(--image);
    background-size:300px 300px;
  }
  .done {
    opacity:0;
    pointer-events:none;
  }
  
  .allDone {
    animation:allDone 1s linear forwards;
    border:3px solid lightgray !important;
  }
  .allDone i {
    outline:0 !important;
  }

  #play-music {
    position: absolute;
    top: 10px; /* Adjust as needed */
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    font-size: 16px;
    background-color: #ff5733; /* Example color */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }

  #play-music:hover {
      background-color: #e04e2a; /* Darker shade on hover */
  }

  
  @keyframes allDone {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); }
  }
  
  #clicks {
    font-size:8px;
    font-family:monospace;
    position:absolute;
    bottom:5px;
    right:5px;
  }

  #win-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: #ff5733;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    opacity: 0;
    z-index: 1000;
    pointer-events: none;
  }

  #win-message.show {
    animation: showMessage 1s forwards;
  }

  @keyframes showMessage {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  }

  /* Mobile Styles */
  @media screen and (max-width: 768px) {
    #puz {
      width: 240px;
      height: 240px;
    }
    
    #puz i, #puzz i {
      width: 80px;
      height: 80px;
    }
    
    #puzz i {
      background-size: 240px 240px;
      background-position: center;
    }
    
    #win-message {
      font-size: 36px;
    }
    
    #play-music {
      font-size: 14px;
      padding: 8px 16px;
    }
  }

  /* Small Mobile Styles */
  @media screen and (max-width: 360px) {
    #puz {
      width: 180px;
      height: 180px;
    }
    
    #puz i, #puzz i {
      width: 60px;
      height: 60px;
    }
    
    #puzz i {
      background-size: 180px 180px;
      background-position: center;
    }
    
    #win-message {
      font-size: 28px;
    }
  }

  /* Mobile-specific background positions */
  @media screen and (max-width: 768px) {
    .first { background-position: 0 0 !important; }
    .secon { background-position: -80px 0 !important; }
    .third { background-position: -160px 0 !important; }
    .fourt { background-position: 0 -80px !important; }
    .fifth { background-position: -80px -80px !important; }
    .sixth { background-position: -160px -80px !important; }
    .seven { background-position: 0 -160px !important; }
    .eight { background-position: -80px -160px !important; }
    .ninth { background-position: -160px -160px !important; }
  }

  @media screen and (max-width: 360px) {
    .first { background-position: 0 0 !important; }
    .secon { background-position: -60px 0 !important; }
    .third { background-position: -120px 0 !important; }
    .fourt { background-position: 0 -60px !important; }
    .fifth { background-position: -60px -60px !important; }
    .sixth { background-position: -120px -60px !important; }
    .seven { background-position: 0 -120px !important; }
    .eight { background-position: -60px -120px !important; }
    .ninth { background-position: -120px -120px !important; }
  }